* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.container-admin {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    padding: 30px 0;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

header p {
    opacity: 0.85;
    margin-top: 6px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.card-link {
    cursor: pointer;
}

.card-link:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #1a73e8;
}

.card p {
    color: #666;
    margin-bottom: 12px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-secondary {
    background: #e8eaed;
    color: #333;
}

.btn-secondary:hover {
    background: #dadce0;
}

.btn-danger {
    background: #ea4335;
    color: #fff;
}

.btn-danger:hover {
    background: #c5221f;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.satisfaction-group {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.satisfaction-option {
    flex: 1;
    min-width: 140px;
    position: relative;
}

.satisfaction-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.satisfaction-option input:focus-visible + label {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.satisfaction-option label {
    display: block;
    text-align: center;
    padding: 16px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.satisfaction-option input:checked + label {
    border-color: #1a73e8;
    background: #e8f0fe;
    color: #1a73e8;
}

.satisfaction-option label:hover {
    border-color: #1a73e8;
}

.emoji {
    font-size: 32px;
    display: block;
    margin-bottom: 6px;
}

.extra-fields {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    animation: fadeIn 0.3s;
}

.extra-fields.visible {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

a:focus-visible,
.btn:focus-visible,
.tab:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: #1a73e8;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #999;
    margin: 0 8px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    table-layout: fixed;
    overflow-wrap: break-word;
    word-break: break-word;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    overflow-wrap: break-word;
    word-break: break-word;
}

th {
    font-weight: 600;
    color: #555;
    background: #fafafa;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.badge-unsatisfied {
    background: #fce8e6;
    color: #c5221f;
}

.badge-neutral {
    background: #fef7e0;
    color: #e37400;
}

.badge-satisfied {
    background: #e6f4ea;
    color: #137333;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    font-weight: 500;
}

.tab:hover {
    color: #1a73e8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.inline-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.alert-error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #f5c6cb;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-info {
    color: #666;
    font-size: 14px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bar-label {
    width: 80px;
    flex-shrink: 0;
    font-size: 14px;
    color: #555;
}

.bar-track {
    flex: 1;
    height: 14px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
}

.bar-count {
    width: 110px;
    flex-shrink: 0;
    text-align: right;
    font-size: 13px;
    color: #666;
}

.response-card {
    position: relative;
    border: 1px solid #eee;
    border-left: 4px solid #d0d0d0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
}

.response-card.satisfied {
    border-left-color: #137333;
}

.response-card.neutral {
    border-left-color: #e37400;
}

.response-card.unsatisfied {
    border-left-color: #c5221f;
}

.response-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.response-meta {
    color: #999;
    margin-left: 12px;
    font-size: 13px;
}

.response-suggestion {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
    margin-bottom: 0;
}

.response-note {
    background: #f0f7f0;
    padding: 10px;
    border-radius: 6px;
    margin-top: 4px;
    font-size: 14px;
}

.badge-status-pending {
    background: #fff3e0;
    color: #e65100;
    margin-left: 6px;
}

.badge-status-processed {
    background: #e6f4ea;
    color: #137333;
    margin-left: 6px;
}

.sort-links {
    font-size: 13px;
    color: #666;
}

.sort-links a {
    color: #1a73e8;
    text-decoration: none;
    margin-left: 4px;
}

.sort-links a.active {
    font-weight: 600;
    text-decoration: underline;
}

/* ===== Mobile / Tablet ===== */
@media (max-width: 768px) {
    .container,
    .container-admin {
        padding: 12px;
    }

    header {
        padding: 20px 12px;
        margin-bottom: 16px;
    }

    header h1 {
        font-size: 20px;
    }

    header p {
        font-size: 14px;
    }

    .card {
        padding: 16px;
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .card h3 {
        font-size: 17px;
    }

    /* Buttons - larger tap targets */
    .btn {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 36px;
    }

    /* Satisfaction radio cards - stack vertically */
    .satisfaction-group {
        flex-direction: column;
        gap: 10px;
    }

    .satisfaction-option {
        min-width: 0;
    }

    .satisfaction-option label {
        padding: 14px 10px;
        font-size: 15px;
    }

    .emoji {
        font-size: 28px;
    }

    /* Form inputs - prevent iOS auto-zoom */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 12px 14px;
    }

    .form-group textarea {
        min-height: 80px;
    }

    /* Tables - horizontal scroll on wrapper */
    .table-wrap {
        overflow-x: auto;
    }

    .table-wrap table {
        table-layout: auto;
        min-width: 600px;
    }

    th, td {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Tabs - compact */
    .tabs {
        gap: 2px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab {
        padding: 10px 14px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Action row - wrap */
    .action-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Stats cards - stack */
    .container > div[style*="display:flex"] {
        flex-direction: column !important;
    }

    .container > div[style*="display:flex"] > .card[style*="flex:1"] {
        min-width: 0 !important;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 13px;
        margin-bottom: 14px;
    }

    /* Inline form - stack */
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form .form-group {
        min-width: 0;
    }

    .inline-form .btn {
        align-self: flex-start;
    }

    /* Badges */
    .badge {
        padding: 3px 10px;
        font-size: 12px;
    }

    /* Alerts */
    .alert {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* Small phones */
@media (max-width: 400px) {
    header h1 {
        font-size: 18px;
    }

    .card {
        padding: 12px;
    }

    .btn {
        width: 100%;
    }

    .btn-sm {
        width: auto;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 10px;
    }
}
