/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #C8381A;
    --primary-dark: #9E2A12;
    --primary-light: #FDECEA;
    --sidebar-bg: #1A1A2E;
    --sidebar-hover: #16213E;
    --sidebar-active: #C8381A;
    --gold: #D4900A;
    --surface: #ffffff;
    --bg: #F4F6F9;
    --text: #1C1C28;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
}

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
}

/* ===== LAYOUT ===== */
.cms-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

.cms-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.cms-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.sidebar-name {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.95rem;
}

.sidebar-sub {
    color: rgba(255,255,255,0.35);
    font-size: 0.72rem;
}

.sidebar-nav {
    padding: 0.8rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.2rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

    .nav-item:hover {
        background: var(--sidebar-hover);
        color: #fff;
        border-left-color: rgba(255,255,255,0.2);
    }

    .nav-item.active {
        background: rgba(200,56,26,0.15);
        color: #fff;
        border-left-color: var(--primary);
    }

    .nav-item i {
        width: 18px;
        text-align: center;
        font-size: 1rem;
    }

.nav-logout {
    color: rgba(239,68,68,0.7);
    margin-top: auto;
}

    .nav-logout:hover {
        color: #EF4444;
        background: rgba(239,68,68,0.1);
    }

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0.5rem 0;
}

/* Backdrop shown behind the off-canvas sidebar on mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s;
}

    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }

/* ===== TOPBAR ===== */
.cms-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
}

    .sidebar-toggle:hover {
        background: var(--bg);
    }

.topbar-title {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

/* ===== ALERTS ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    font-size: 0.88rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-wa {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-wa-send {
    background: #25D366;
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== STATS CARDS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

    .stat-icon.blue {
        background: #EFF6FF;
        color: #3B82F6;
    }

    .stat-icon.orange {
        background: #FFF7ED;
        color: #F97316;
    }

    .stat-icon.green {
        background: #ECFDF5;
        color: #10B981;
    }

    .stat-icon.red {
        background: #FEF2F2;
        color: #EF4444;
    }

.stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.stat-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ===== DASHBOARD GRID ===== */
.dash-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1.5rem;
}

.dash-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

    .panel-header h2 {
        font-size: 0.95rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .panel-header h2 i {
            color: var(--primary);
        }

.count-badge {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-sm {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-sm:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.qa-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid transparent;
}

    .qa-card i {
        font-size: 1.5rem;
    }

    .qa-card.orange {
        background: #FFF7ED;
        color: #C2410C;
        border-color: #FED7AA;
    }

    .qa-card.blue {
        background: #EFF6FF;
        color: #1D4ED8;
        border-color: #BFDBFE;
    }

    .qa-card.green {
        background: #ECFDF5;
        color: #065F46;
        border-color: #A7F3D0;
    }

    .qa-card.red {
        background: #FEF2F2;
        color: #991B1B;
        border-color: #FECACA;
    }

    .qa-card.purple {
        background: #F5F3FF;
        color: #5B21B6;
        border-color: #DDD6FE;
    }

    .qa-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

/* ===== TABLE ===== */
.table-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
/* Horizontal scroll container so wide tables never break the layout */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .cms-table thead {
        background: var(--bg);
    }

    .cms-table th {
        padding: 0.75rem 1rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    .cms-table td {
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .cms-table tr:last-child td {
        border-bottom: none;
    }

    .cms-table tr:hover td {
        background: #FAFAFA;
    }

.empty-row {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem !important;
}

.no-img {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-lg {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge-accepted {
    background: #D1FAE5;
    color: #065F46;
}

.badge-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-completed {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-noshow {
    background: #F3F4F6;
    color: #374151;
}

.badge-preparing {
    background: #FFEDD5;
    color: #9A3412;
}

.badge-ready {
    background: #E0E7FF;
    color: #3730A3;
}

.badge-outfordelivery {
    background: #CFFAFE;
    color: #155E75;
}

/* ===== BUTTONS ===== */
.btn-primary-sm {
    background: var(--primary);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    font-size: 0.85rem;
}

    .btn-primary-sm:hover {
        background: var(--primary-dark);
    }

.btn-cancel {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

    .btn-cancel:hover {
        background: var(--bg);
    }

.btn-icon {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

    .btn-icon:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

    .btn-icon.green:hover {
        background: var(--success);
        border-color: var(--success);
    }

    .btn-icon.red:hover {
        background: var(--danger);
        border-color: var(--danger);
    }

.btn-accept {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

    .btn-accept:hover {
        background: var(--success);
        color: #fff;
    }

.btn-reject {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

    .btn-reject:hover {
        background: var(--danger);
        color: #fff;
    }

.btn-complete {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

    .btn-complete:hover {
        background: var(--info);
        color: #fff;
    }

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 1.5rem;
    padding: 0.5rem 0;
}

/* ===== TOOLBAR ===== */
.page-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.filter-form {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

    .filter-form input, .filter-form select {
        padding: 0.5rem 0.8rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 0.85rem;
        background: var(--surface);
        color: var(--text);
        outline: none;
    }

        .filter-form input:focus, .filter-form select:focus {
            border-color: var(--primary);
        }

/* ===== FORM CARD ===== */
.form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

    .form-card h2, .form-card h3 {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .form-card h2 i, .form-card h3 i {
            color: var(--primary);
        }

.cms-form .form-group {
    margin-bottom: 1rem;
}

.cms-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cms-form label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.cms-form input[type=text], .cms-form input[type=email], .cms-form input[type=number], .cms-form input[type=url], .cms-form input[type=tel], .cms-form select, .cms-form textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

    .cms-form input:focus, .cms-form select:focus, .cms-form textarea:focus {
        border-color: var(--primary);
        background: var(--surface);
    }

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

.checkboxes {
    margin-top: 0.5rem;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}

    .check-label input {
        width: auto;
    }

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

/* ===== LOGO UPLOAD ===== */
.logo-upload-group {
    display: flex;
    flex-direction: column;
}

.logo-preview-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.logo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
}

/* ===== TOGGLE SWITCH ===== */
.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

    .toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #D1D5DB;
    border-radius: 22px;
    transition: 0.2s;
}

    .toggle-slider::before {
        content: '';
        position: absolute;
        width: 16px;
        height: 16px;
        left: 3px;
        top: 3px;
        background: #fff;
        border-radius: 50%;
        transition: 0.2s;
    }

.toggle input:checked + .toggle-slider {
    background: var(--success);
}

    .toggle input:checked + .toggle-slider::before {
        transform: translateX(18px);
    }

/* ===== DETAIL LAYOUT ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}

.detail-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    flex-wrap: wrap;
}

    .detail-header h2 {
        font-size: 1.4rem;
        font-weight: 700;
    }

.detail-rows {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.dr {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

    .dr:last-child {
        border-bottom: none;
    }

    .dr i {
        color: var(--primary);
        width: 18px;
        text-align: center;
        flex-shrink: 0;
    }

    .dr span {
        color: var(--text-muted);
        width: 80px;
        flex-shrink: 0;
    }

    .dr strong {
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }

.action-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

    .action-card h3 {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 1rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

.action-btns {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* ===== QR PANEL ===== */
.qr-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
    margin-bottom: 1rem;
}

    .qr-panel h3 {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        color: var(--text-muted);
    }

.qr-img {
    width: 180px;
    height: 180px;
    border: 3px solid var(--gold);
    border-radius: 8px;
    margin: 0 auto 0.8rem;
    max-width: 100%;
}

.qr-token {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    background: var(--bg);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
}

.qr-empty {
    color: var(--text-muted);
    padding: 1rem;
}

    .qr-empty i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

.wa-panel {
    background: #DCFCE7;
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    text-align: center;
    border: 1px solid #BBF7D0;
}

    .wa-panel h3 {
        color: #166534;
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
    }

.btn-wa-panel {
    background: #25D366;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

    .btn-wa-panel:hover {
        background: #1da851;
    }

/* ===== SCANNER ===== */
.scanner-wrap {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.scanner-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    text-align: center;
}

.scanner-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
}

.scanner-card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
}

.scanner-card > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.qr-reader {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    min-height: 200px;
}

.scanner-manual h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.manual-input {
    display: flex;
    gap: 0.5rem;
}

    .manual-input input {
        flex: 1;
        min-width: 0;
        padding: 0.65rem 0.9rem;
        border: 2px solid var(--border);
        border-radius: 8px;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        outline: none;
    }

        .manual-input input:focus {
            border-color: var(--primary);
        }

.btn-check {
    background: var(--primary);
    color: #fff;
    padding: 0.65rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.scan-result {
    margin-top: 1.5rem;
    border-radius: var(--radius);
    padding: 1.5rem;
    font-size: 0.9rem;
}

    .scan-result.loading {
        background: var(--bg);
        color: var(--text-muted);
    }

    .scan-result.success {
        background: #D1FAE5;
        color: #065F46;
    }

        .scan-result.success i {
            font-size: 2rem;
            display: block;
            margin-bottom: 0.5rem;
        }

        .scan-result.success h3 {
            font-size: 1.3rem;
            margin-bottom: 0.4rem;
        }

    .scan-result.error {
        background: #FEE2E2;
        color: #991B1B;
    }

        .scan-result.error i {
            font-size: 2rem;
            display: block;
            margin-bottom: 0.5rem;
        }

        .scan-result.error h3 {
            font-size: 1.1rem;
            margin-bottom: 0.4rem;
        }

/* ===== REVIEWS ===== */
.reviews-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.rtab {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .rtab.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

.review-cms-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

    .review-cms-card.featured {
        border-color: var(--gold);
    }

.rcms-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.rcms-author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.rcms-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.rcms-stars {
    color: var(--gold);
    font-size: 0.9rem;
}

.rcms-text {
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.rcms-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-approve {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

    .btn-approve:hover {
        background: var(--success);
        color: #fff;
    }

.btn-delete-sm {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

    .btn-delete-sm:hover {
        background: var(--danger);
        color: #fff;
    }

.btn-feature {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

    .btn-feature.active {
        background: var(--gold);
        color: #fff;
        border-color: var(--gold);
    }

.featured-badge {
    background: #FEF3C7;
    color: #92400E;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

    .empty-state i {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
        color: var(--success);
    }

/* ===== SETTINGS TABS ===== */
.settings-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stab {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .stab.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* ===== LOGIN PAGE ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
}

.login-container {
    padding: 1rem;
    width: 100%;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
    margin: 0 auto 0.8rem;
}

.login-brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field {
    position: relative;
}

    .login-field i {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
    }

    .login-field input {
        width: 100%;
        padding: 0.85rem 1rem 0.85rem 2.5rem;
        border: 2px solid var(--border);
        border-radius: 10px;
        font-size: 0.95rem;
        outline: none;
        transition: border-color 0.2s;
    }

        .login-field input:focus {
            border-color: var(--primary);
        }

.login-btn {
    background: var(--primary);
    color: #fff;
    padding: 0.9rem;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

    .login-btn:hover {
        background: var(--primary-dark);
    }

.login-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* --- Laptops / large tablets (≤1100px) --- */
@media (max-width: 1100px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .cms-content {
        padding: 1.5rem;
    }
}

/* --- Tablets (≤900px) --- */
@media (max-width: 900px) {
    .cms-topbar {
        padding: 0 1.25rem;
    }

    .detail-card, .form-card {
        padding: 1.5rem;
    }

    .scanner-card {
        padding: 2rem;
    }
}

/* --- Wide tables: scroll instead of overflow (≤860px) --- */
@media (max-width: 860px) {
    /* Any plain .cms-table that isn't already inside a .table-scroll wrapper */
    .table-card, .dash-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .table-card .cms-table, .dash-panel .cms-table {
            min-width: 620px;
        }

    .table-scroll .cms-table {
        min-width: 620px;
    }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    /* Off-canvas sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        width: 260px;
        z-index: 200;
        transition: left 0.3s ease;
        box-shadow: 2px 0 18px rgba(0,0,0,0.35);
    }

        .sidebar.open {
            left: 0;
        }

    .cms-content {
        padding: 1rem;
    }

    .cms-topbar {
        height: 52px;
        padding: 0 1rem;
        gap: 0.75rem;
    }

    .topbar-title {
        font-size: 0.95rem;
    }

    .topbar-user {
        font-size: 0.8rem;
    }

    /* Stack form / action layouts */
    .cms-form .form-row {
        grid-template-columns: 1fr;
    }

    .action-btns {
        flex-direction: column;
    }

        .action-btns form, .action-btns button {
            width: 100%;
        }

        .action-btns .btn-accept, .action-btns .btn-reject, .action-btns .btn-complete {
            width: 100%;
            justify-content: center;
        }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

        .form-actions .btn-primary-sm, .form-actions .btn-cancel {
            width: 100%;
            justify-content: center;
            text-align: center;
        }

    /* Toolbar + filters go full width and reflow */
    .page-toolbar {
        justify-content: stretch;
    }

        .page-toolbar .btn-primary-sm {
            width: 100%;
            justify-content: center;
        }

    .filter-form {
        width: 100%;
    }

        .filter-form input, .filter-form select {
            flex: 1 1 140px;
            min-width: 0;
        }

        .filter-form .btn-primary-sm {
            flex: 1 1 100%;
            justify-content: center;
        }

    /* Tab strips scroll sideways rather than wrapping awkwardly */
    .reviews-tabs, .settings-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

        .detail-header h2 {
            font-size: 1.2rem;
        }
}

/* --- Small phones (≤520px) --- */
@media (max-width: 520px) {
    html, body {
        font-size: 13px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-num {
        font-size: 1.5rem;
    }

    .detail-card, .form-card, .review-cms-card {
        padding: 1.25rem;
    }

    .scanner-card {
        padding: 1.5rem;
    }

    /* Manual QR input stacks */
    .manual-input {
        flex-direction: column;
    }

        .manual-input .btn-check {
            width: 100%;
        }

    .qr-img {
        width: 150px;
        height: 150px;
    }

    .rcms-actions .btn-approve, .rcms-actions .btn-feature, .rcms-actions .btn-delete-sm {
        flex: 1 1 auto;
        justify-content: center;
    }

    .alert {
        font-size: 0.82rem;
    }
}
