/* SaktiSeva Platform - Amazon-Style Mobile-First UI */
:root {
    --primary: #e8590c;
    --primary-dark: #c94a0a;
    --primary-light: #ff8c42;
    --primary-gradient: linear-gradient(135deg, #e8590c 0%, #ff8c42 100%);
    --header-bg: linear-gradient(180deg, #f7c78e 0%, #f5deb8 100%);
    --secondary: #495057;
    --success: #2f9e44;
    --danger: #e03131;
    --warning: #f08c00;
    --info: #1971c2;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --border: #e9ecef;
    --shadow: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.1);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --sidebar-width: 240px;
    --bottom-nav-height: 60px;
    --topbar-height: 56px;
    --search-bar-height: 56px;
}

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

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--dark);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ==================== AUTH PAGES ==================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--header-bg);
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 35px 30px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo h1 {
    font-size: 30px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo .brand-img {
    display: inline-block;
    padding: 14px 22px;
    border-radius: var(--radius-lg);
    background: var(--primary-gradient);
    margin-bottom: 6px;
}

.auth-logo .brand-img img {
    display: block;
    height: 56px;
    width: auto;
    max-width: 240px;
}

.auth-logo p {
    color: var(--gray-600);
    font-size: 13px;
    margin-top: 4px;
}

/* ==================== APP LAYOUT ==================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ==================== TOP HEADER / SEARCH BAR ==================== */
.app-header {
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 80;
    padding: 0;
}

.app-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

.app-header-top .brand {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -.3px;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 10px;
    background: var(--primary-gradient);
    text-decoration: none;
    line-height: 0;
}

.app-header-top .brand img {
    display: block;
    height: 28px;
    width: auto;
}

.app-header-top .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 60%;
}

.app-header-top .header-actions::-webkit-scrollbar { display: none; }

.app-header-top .header-actions a {
    color: var(--dark);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.6);
    transition: background .15s;
}

.app-header-top .header-actions a:hover {
    background: rgba(255,255,255,.9);
}

.search-bar {
    padding: 0 12px 10px;
}

.search-bar .search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 0 14px;
    height: 44px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,.06);
}

.search-bar .search-input-wrap svg {
    width: 20px;
    height: 20px;
    color: var(--gray-500);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 0 10px;
    background: transparent;
    font-family: var(--font);
    color: var(--dark);
}

.search-bar input::placeholder { color: var(--gray-500); }

/* Search Auto-Suggest Results */
.search-results {
    display: none;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-top: none;
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
}

.search-results.active { display: block; }

.search-results .search-group-label {
    padding: 8px 14px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--gray-500);
    font-weight: 700;
    background: var(--gray-50);
}

.search-results a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--dark);
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    transition: background .1s;
    text-decoration: none;
}

.search-results a:hover { background: var(--gray-50); }

.search-results a .sr-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.search-results a .sr-text { flex: 1; }
.search-results a .sr-text small { display: block; font-size: 11px; color: var(--gray-500); }

.search-results .search-no-results {
    padding: 20px 14px;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}

/* ==================== SIDEBAR (DESKTOP + MOBILE DRAWER) ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 200;
    border-right: 1px solid var(--border);
    transition: transform .3s ease;
}

.sidebar-header {
    padding: 18px 16px;
    background: var(--header-bg);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 16px;
}

.sidebar-header-info h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.sidebar-header small {
    font-size: 11px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.sidebar-nav { padding: 8px 0; }

.sidebar-nav .nav-section {
    padding: 12px 16px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gray-500);
    font-weight: 700;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a .nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: #fff5f0;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav a.active .nav-icon {
    background: var(--primary);
    color: var(--white);
}

.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 190;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    min-height: 100vh;
    padding-bottom: 70px;
}

.topbar { display: none; }

.content {
    padding: 0;
}

/* ==================== QUICK ACTIONS BAR ==================== */
.quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.quick-actions::-webkit-scrollbar { display: none; }

.quick-action-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    font-family: var(--font);
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
}

.quick-action-btn:hover,
.quick-action-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ==================== SECTION HEADERS ==================== */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 8px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        var(--primary-light),
        var(--primary-light) 4px,
        transparent 4px,
        transparent 8px
    );
    opacity: .5;
}

.section-header .section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* ==================== CATEGORY GRID (Amazon-style) ==================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 4px;
    padding: 6px 14px 14px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
    text-decoration: none;
    color: var(--dark);
    padding: 6px 2px;
    transition: transform .15s;
    border-radius: var(--radius-sm);
}

.category-card:hover {
    transform: translateY(-2px);
    color: var(--primary);
    background: var(--gray-50);
}

.category-card .cat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 1px solid var(--border);
}

.category-card .cat-icon.orange { background: #fff5f0; }
.category-card .cat-icon.blue { background: #e7f5ff; }
.category-card .cat-icon.green { background: #d3f9d8; }
.category-card .cat-icon.purple { background: #f3d9fa; }
.category-card .cat-icon.yellow { background: #fff9db; }
.category-card .cat-icon.red { background: #ffe3e3; }
.category-card .cat-icon.teal { background: #c3fae8; }

.category-card .cat-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-700);
}

/* ==================== STAT CARDS (Mobile Optimized) ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 14px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }
.stat-card.danger::before { background: var(--danger); }

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 11px;
    color: var(--gray-600);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 500;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 0 14px 16px;
}

.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.card-body { padding: 16px; }
.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ==================== ORDER CARDS (Mobile-Friendly) ==================== */
.order-list { padding: 0 14px; }

.order-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    padding: 14px;
    display: block;
    text-decoration: none;
    color: var(--dark);
    transition: box-shadow .15s;
}

.order-card:hover {
    box-shadow: var(--shadow-md);
    color: var(--dark);
}

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.order-card-top .order-id {
    font-weight: 700;
    font-size: 14px;
}

.order-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--gray-600);
}

.order-card-info strong {
    color: var(--dark);
    font-weight: 600;
}

/* ==================== TABLES ==================== */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

table th {
    background: var(--gray-50);
    font-weight: 700;
    color: var(--gray-700);
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

table tr:hover { background: var(--gray-50); }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    transition: all .2s;
    background: var(--white);
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,89,12,.08);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-hint { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    font-family: var(--font);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(232,89,12,.25);
}
.btn-primary:hover { opacity: .9; color: var(--white); }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #27862e; color: var(--white); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c82222; color: var(--white); }

.btn-warning { background: var(--warning); color: var(--white); }

.btn-outline {
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-primary { background: #e7f5ff; color: var(--info); }
.badge-success { background: #d3f9d8; color: var(--success); }
.badge-warning { background: #fff3bf; color: #e67700; }
.badge-danger { background: #ffe3e3; color: var(--danger); }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }
.badge-info { background: #d0ebff; color: #1864ab; }

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 10px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: #d3f9d8; color: #1b5e20; border: 1px solid #a5d6a7; }
.alert-danger { background: #ffe3e3; color: #c62828; border: 1px solid #ef9a9a; }
.alert-warning { background: #fff3bf; color: #e65100; border: 1px solid #ffe082; }
.alert-info { background: #d0ebff; color: #0d47a1; border: 1px solid #90caf9; }

/* ==================== BOTTOM NAV (OLX-style mobile tab bar) ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    color: var(--gray-600);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
    position: relative;
    min-width: 0;
}

.bottom-nav a .nav-icon-wrap {
    font-size: 22px;
    line-height: 1;
    filter: grayscale(.15);
}

.bottom-nav a.active {
    color: var(--primary);
}

.bottom-nav a.active .nav-icon-wrap {
    filter: none;
    transform: scale(1.05);
}

/* OLX-style floating centre action button */
.bottom-nav a.center {
    color: var(--primary);
    font-weight: 700;
}

.bottom-nav a.center .center-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-top: -28px;          /* lift above the bar */
    margin-bottom: 2px;
    box-shadow:
        0 0 0 4px var(--white),                /* white ring punched out of the bar */
        0 0 0 7px #ffe2cf,                     /* soft outer ring (OLX teal/yellow vibe) */
        0 6px 14px rgba(232,89,12,.35);
    position: relative;
    z-index: 1;
}

.bottom-nav a.center:active .center-fab {
    transform: scale(0.94);
}

@media (max-width: 360px) {
    .bottom-nav a { font-size: 9px; }
    .bottom-nav a.center .center-fab { width: 50px; height: 50px; font-size: 24px; margin-top: -24px; }
}

/* ==================== SIDEBAR DRAWER POLISH ==================== */
.sidebar-nav a {
    justify-content: flex-start;
    position: relative;
    padding: 14px 18px;
    font-size: 14px;
}

.sidebar-nav a .nav-chev {
    margin-left: auto;
    color: var(--gray-400);
    font-size: 18px;
    line-height: 1;
    font-weight: 400;
}

.sidebar-nav a.active .nav-chev { color: var(--primary); }

/* OLX-style close arrow inside the drawer (mobile only) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.85);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 20px;
    color: var(--dark);
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    line-height: 1;
}
@media (max-width: 768px) {
    .sidebar-close { display: inline-flex; }
    .sidebar-header { padding-left: 56px; } /* make room for the close arrow */
}

/* ==================== TIMELINE ==================== */
.timeline { position: relative; padding-left: 30px; }

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    margin-bottom: 18px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 2px solid var(--white);
}

.timeline-item.active::before { background: var(--primary); box-shadow: 0 0 0 3px rgba(232,89,12,.15); }
.timeline-item.completed::before { background: var(--success); }

.timeline-item .time { font-size: 11px; color: var(--gray-500); }
.timeline-item .desc { font-size: 13px; font-weight: 500; }

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-600);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state h3 { font-size: 16px; color: var(--gray-700); margin-bottom: 6px; font-weight: 700; }
.empty-state p { font-size: 13px; max-width: 300px; margin: 0 auto; }

/* ==================== MODAL ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body { padding: 16px; }
.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 16px;
    justify-content: center;
    padding: 0 14px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid var(--border);
    color: var(--gray-700);
}

.pagination a:hover { background: var(--gray-50); }
.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ==================== UTILITY ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-600); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 12px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.gap-10 { gap: 10px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

.mobile-toggle {
    background: var(--white);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--dark);
    padding: 6px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.desktop-only { display: none; }
.mobile-only { display: block; }

/* ==================== DESKTOP RESPONSIVE (768px+) ==================== */
@media (min-width: 769px) {
    .app-layout { display: flex; }

    .sidebar {
        position: fixed;
        transform: none !important;
    }

    .sidebar-overlay { display: none !important; }

    .main-content {
        margin-left: var(--sidebar-width);
        padding-bottom: 0;
    }

    .app-header {
        position: sticky;
        top: 0;
    }

    .bottom-nav { display: none; }
    .desktop-only { display: block; }
    .mobile-only { display: none; }
    .mobile-toggle { display: none; }

    .content { padding: 0; }

    .card { margin: 0 20px 20px; }
    .stats-grid { padding: 0 20px; gap: 16px; }
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        padding: 8px 20px 20px;
        gap: 10px 8px;
    }
    .section-header { padding: 20px 20px 8px; }
    .quick-actions { padding: 12px 20px; }
    .order-list { padding: 0 20px; }
    .alert { margin: 10px 20px; }

    .category-card .cat-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

    .app-header-top .header-actions { max-width: 70%; }

    .stat-card { padding: 18px; }
    .stat-card .stat-value { font-size: 28px; }

    .stats-grid { grid-template-columns: repeat(4, 1fr); }

    .modal-overlay { align-items: center; }
    .modal { border-radius: var(--radius-lg); }
}

/* ==================== MOBILE (max 768px) ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.open + .sidebar-overlay {
        display: block;
    }

    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .auth-card { padding: 25px 20px; }
    .category-grid { grid-template-columns: repeat(3, 1fr); gap: 4px 2px; padding: 6px 14px 12px; }
    .category-card .cat-icon { width: 46px; height: 46px; font-size: 20px; }
    .category-card .cat-label { font-size: 10px; }
    .app-header-top .header-actions a { font-size: 11px; padding: 4px 8px; }
    .stats-grid { padding: 0 10px; gap: 8px; }
    .card { margin: 0 10px 12px; }
    .section-header { padding: 14px 10px 6px; }
    .quick-actions { padding: 10px; }
    .alert { margin: 8px 10px; }
}
