@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #D4A843;
    --primary-light: #E8C96A;
    --primary-dark: #B8922F;
    --secondary: #2D6A4F;
    --secondary-light: #40916C;
    --bg-dark: #0F0F1A;
    --bg-darker: #0A0A14;
    --bg-card: rgba(255,255,255,0.04);
    --bg-sidebar: #111122;
    --bg-input: rgba(255,255,255,0.06);
    --text: #F0F0F0;
    --text-secondary: #9A9AB0;
    --border: rgba(255,255,255,0.08);
    --glass: rgba(255,255,255,0.05);
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    --success: #4CAF50; --warning: #FF9800; --danger: #F44336; --info: #2196F3;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== LOGIN ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-darker) 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
}
.login-container::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(212,168,67,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(45,106,79,0.08) 0%, transparent 50%);
}
.login-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
    position: relative; z-index: 1;
    animation: fadeUp 0.6s ease;
}
.login-brand { text-align: center; margin-bottom: 36px; }
.login-brand h1 {
    font-size: 2rem; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 6px; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-control {
    width: 100%; padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text); font-family: inherit; font-size: 0.95rem;
    transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212,168,67,0.15); }
.form-control::placeholder { color: var(--text-secondary); opacity: 0.6; }
select.form-control { cursor: pointer; }
select option, select optgroup { background: #1a1a2e; color: var(--text); }
textarea.form-control { resize: vertical; min-height: 80px; }

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

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #1a1a2e;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(212,168,67,0.3); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: rgba(244,67,54,0.15); color: var(--danger); border: 1px solid rgba(244,67,54,0.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: 8px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: var(--transition); display:inline-flex;align-items:center;justify-content:center; }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== DASHBOARD LAYOUT ========== */
.dashboard { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px; background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    transition: var(--transition);
}
.sidebar-brand {
    padding: 24px 20px; border-bottom: 1px solid var(--border);
    text-align: center;
}
.sidebar-brand h2 {
    font-size: 1.3rem; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-brand small { color: var(--text-secondary); font-size: 0.75rem; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.9rem; font-weight: 400;
    transition: var(--transition); margin-bottom: 4px;
}
.sidebar-nav a:hover { background: var(--bg-input); color: var(--text); }
.sidebar-nav a.active { background: rgba(212,168,67,0.1); color: var(--primary); font-weight: 500; }
.sidebar-nav a .nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.sidebar-footer {
    padding: 16px 12px; border-top: 1px solid var(--border);
}
.sidebar-footer .user-info {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-input);
}
.sidebar-footer .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem; color: #fff;
}
.sidebar-footer .user-name { font-size: 0.85rem; font-weight: 500; }
.sidebar-footer .user-role { font-size: 0.72rem; color: var(--text-secondary); }

/* Main Content */
.main-content { flex: 1; margin-left: 260px; display: flex; flex-direction: column; }
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.header-left h1 { font-size: 1.4rem; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }

.notification-bell {
    position: relative; cursor: pointer;
    padding: 8px; border-radius: 8px;
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text); transition: var(--transition);
}
.notification-bell:hover { border-color: var(--primary); color: var(--primary); }
.notification-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: #fff;
    font-size: 0.65rem; font-weight: 600;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.notification-badge:empty { display: none; }

.content { flex: 1; padding: 32px; }

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.stat-icon.gold { background: rgba(212,168,67,0.15); color: var(--primary); }
.stat-icon.green { background: rgba(45,106,79,0.15); color: var(--secondary-light); }
.stat-icon.blue { background: rgba(33,150,243,0.15); color: var(--info); }
.stat-icon.orange { background: rgba(255,152,0,0.15); color: var(--warning); }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }

/* ========== TABLES ========== */
.table-container {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.table-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    flex-wrap: wrap; gap: 12px;
}
.table-header h3 { font-size: 1.1rem; font-weight: 600; }
.table-actions { display: flex; gap: 10px; align-items: center; }
.search-input {
    padding: 8px 14px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-family: inherit; font-size: 0.85rem;
    outline: none; transition: var(--transition); min-width: 200px;
}
.search-input:focus { border-color: var(--primary); }

table { width: 100%; border-collapse: collapse; }
thead th {
    padding: 14px 20px; text-align: left;
    font-size: 0.78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
}
tbody td {
    padding: 14px 20px; font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(212,168,67,0.03); }
tbody tr:last-child td { border-bottom: none; }

/* ========== BADGES ========== */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 500;
}
.badge-iniciado { background: rgba(33,150,243,0.15); color: #64B5F6; }
.badge-en_proceso { background: rgba(255,152,0,0.15); color: #FFB74D; }
.badge-terminado { background: rgba(156,39,176,0.15); color: #CE93D8; }
.badge-enviado { background: rgba(0,188,212,0.15); color: #4DD0E1; }
.badge-recolectado { background: rgba(0,188,212,0.15); color: #4DD0E1; }
.badge-finalizado { background: rgba(76,175,80,0.15); color: #81C784; }
.badge-paid { background: rgba(76,175,80,0.15); color: #81C784; }
.badge-pending { background: rgba(255,152,0,0.15); color: #FFB74D; }
.badge-admin { background: rgba(212,168,67,0.15); color: var(--primary); }
.badge-employee { background: rgba(45,106,79,0.15); color: var(--secondary-light); }
.badge-active { background: rgba(76,175,80,0.15); color: #81C784; }
.badge-inactive { background: rgba(244,67,54,0.15); color: #E57373; }

/* ========== MODALS ========== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: #1a1a2e; border: 1px solid var(--border);
    border-radius: 16px; padding: 32px;
    width: 90%; max-width: 600px; max-height: 85vh; overflow-y: auto;
    transform: translateY(20px); transition: var(--transition);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-lg { max-width: 800px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.2rem; font-weight: 600; }
.modal-close {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.4rem; cursor: pointer; transition: var(--transition);
    padding: 4px;
}
.modal-close:hover { color: var(--danger); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ========== NOTIFICATION DROPDOWN ========== */
.notification-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 360px; background: #1a1a2e;
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    display: none; z-index: 200;
}
.notification-dropdown.show { display: block; animation: fadeUp 0.2s ease; }
.notification-dropdown-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.notification-dropdown-header h4 { font-size: 0.95rem; }
.notification-list { max-height: 320px; overflow-y: auto; }
.notification-item {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
}
.notification-item:hover { background: var(--bg-input); }
.notification-item.unread { border-left: 3px solid var(--primary); }
.notification-item .notif-msg { font-size: 0.85rem; margin-bottom: 4px; }
.notification-item .notif-time { font-size: 0.72rem; color: var(--text-secondary); }
.notification-empty { padding: 32px; text-align: center; color: var(--text-secondary); font-size: 0.85rem; }

/* ========== ALERTS / TOASTS ========== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 14px 20px; border-radius: var(--radius-sm);
    font-size: 0.88rem; font-weight: 500;
    animation: slideIn 0.3s ease; min-width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast-success { background: rgba(76,175,80,0.9); color: #fff; }
.toast-error { background: rgba(244,67,54,0.9); color: #fff; }
.toast-warning { background: rgba(255,152,0,0.9); color: #fff; }
.toast-info { background: rgba(33,150,243,0.9); color: #fff; }

/* ========== IMAGE UPLOAD ========== */
.img-upload-area {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 24px; text-align: center; cursor: pointer;
    transition: var(--transition);
}
.img-upload-area:hover { border-color: var(--primary); }
.img-upload-area img { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); object-fit: cover; }
.img-upload-area p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 8px; }
.img-thumbnail { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; }

/* ========== ORDER DETAIL ========== */
.order-status-flow {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 16px 0;
}
.status-step {
    padding: 6px 14px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 500;
    background: var(--bg-input); color: var(--text-secondary);
    border: 1px solid var(--border); transition: var(--transition);
}
.status-step.active { background: rgba(212,168,67,0.15); color: var(--primary); border-color: var(--primary); }
.status-step.completed { background: rgba(76,175,80,0.15); color: #81C784; border-color: rgba(76,175,80,0.3); }
.status-arrow { color: var(--text-secondary); font-size: 0.8rem; }

.payment-summary {
    background: var(--bg-input); border-radius: var(--radius);
    padding: 16px 20px; margin-top: 12px;
}
.payment-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; }
.payment-row:last-child { margin-bottom: 0; font-weight: 600; }
.payment-row.remaining { color: var(--warning); }
.payment-row.paid { color: var(--success); }

/* ========== CHECKBOX GRID (permissions) ========== */
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
}
.checkbox-item:hover { border-color: var(--primary); }
.checkbox-item input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }
.checkbox-item label { cursor: pointer; font-size: 0.88rem; }

/* ========== FILTERS ========== */
.filters-bar {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-group label { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; }
.filter-group select, .filter-group input {
    padding: 8px 12px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-family: inherit; font-size: 0.85rem;
    outline: none;
}

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; }

/* ========== LOADING ========== */
.loading-spinner {
    display: flex; align-items: center; justify-content: center; padding: 40px;
}
.spinner {
    width: 36px; height: 36px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeUp 0.4s ease; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

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

/* Sidebar overlay backdrop */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); z-index: 99;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-backdrop.active { display: block; }

/* ---- TABLET (max 1024px) ---- */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px; transform: translateX(-100%);
        z-index: 100; box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .main-content { margin-left: 0; }
    .content { padding: 20px; }
    .header { padding: 14px 20px; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
}

/* ---- MOBILE (max 768px) ---- */
@media (max-width: 768px) {
    body { font-size: 16px; }

    .header { padding: 14px 16px; gap: 10px; }
    .header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .header-left h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-right { gap: 10px; }

    .content { padding: 16px; }

    /* Forms - legible */
    .form-row, .form-row-3, .checkbox-grid { grid-template-columns: 1fr; gap: 14px; }
    .form-group { margin-bottom: 16px; }
    .form-group label { font-size: 0.92rem; margin-bottom: 8px; }
    .form-control { padding: 14px 16px; font-size: 16px; border-radius: 10px; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
    .stat-card { padding: 14px; gap: 12px; }
    .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 10px; }
    .stat-value { font-size: 1.35rem; }
    .stat-label { font-size: 0.85rem; }

    /* Tables → Cards on mobile */
    .table-container { border-radius: 10px; }
    .table-header {
        flex-direction: column; align-items: stretch; gap: 12px;
        padding: 16px;
    }
    .table-header h3 { font-size: 1.05rem; }
    .table-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }
    .table-actions .btn { width: 100%; justify-content: center; padding: 12px; font-size: 0.95rem; }
    .search-input { width: 100%; min-width: unset; padding: 12px 14px; font-size: 16px; }

    /* Hide table header, convert rows to cards */
    thead { display: none; }
    tbody tr {
        display: block;
        padding: 14px 16px;
        margin-bottom: 2px;
        border-bottom: 1px solid var(--border);
        position: relative;
    }
    tbody tr:last-child { margin-bottom: 0; }
    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        font-size: 0.92rem;
        border: none;
        text-align: right;
        white-space: normal;
        word-break: break-word;
    }
    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.82rem;
        color: var(--text-secondary);
        text-align: left;
        margin-right: 12px;
        flex-shrink: 0;
    }
    /* Actions column centered */
    tbody td:last-child {
        justify-content: flex-end;
        padding-top: 8px;
        gap: 8px;
    }

    /* Modals - bottom sheet */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal {
        width: 100%; max-width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 24px 18px;
        max-height: 92vh;
        margin: 0;
    }
    .modal-lg { max-width: 100%; }
    .modal-header { margin-bottom: 18px; padding-bottom: 14px; }
    .modal-header h2 { font-size: 1.12rem; }
    .modal-close { font-size: 1.8rem; padding: 8px; }
    .modal-footer {
        flex-wrap: wrap; gap: 10px;
        margin-top: 18px; padding-top: 14px;
    }
    .modal-footer .btn {
        flex: 1 1 auto; min-width: 0;
        justify-content: center; padding: 13px 16px;
        font-size: 0.95rem;
    }

    /* Notifications */
    .notification-dropdown {
        position: fixed; top: 58px; left: 8px; right: 8px;
        width: auto; border-radius: 12px;
    }
    .notification-list { max-height: 50vh; }
    .notification-item .notif-msg { font-size: 0.92rem; }
    .notification-item .notif-time { font-size: 0.82rem; }

    /* Toasts */
    .toast-container { left: 10px; right: 10px; top: 10px; }
    .toast { min-width: unset; width: 100%; font-size: 0.95rem; padding: 14px 16px; }

    /* Filters */
    .filters-bar {
        flex-direction: column; align-items: stretch;
        gap: 10px; margin-bottom: 16px;
    }
    .filter-group {
        width: 100%; display: flex; align-items: center; gap: 10px;
    }
    .filter-group label { min-width: 55px; font-size: 0.9rem; }
    .filter-group select, .filter-group input {
        flex: 1; width: 100%;
        padding: 12px 14px; font-size: 16px;
    }

    /* Order status flow */
    .order-status-flow { gap: 6px; justify-content: center; }
    .status-step { padding: 6px 12px; font-size: 0.82rem; }
    .status-arrow { font-size: 0.78rem; }

    /* Payment */
    .payment-summary { padding: 14px 16px; }
    .payment-row { font-size: 0.95rem; }

    /* Login */
    .login-card {
        padding: 36px 28px; margin: 16px;
        max-width: calc(100% - 32px);
        border-radius: 16px;
    }
    .login-brand h1 { font-size: 1.7rem; }
    .login-brand p { font-size: 0.95rem; }

    /* Buttons - BIG touch targets */
    .btn { padding: 12px 18px; font-size: 0.95rem; }
    .btn-sm { padding: 10px 16px; font-size: 0.88rem; }
    .btn-icon { padding: 10px; min-width: 44px; min-height: 44px; font-size: 1rem; }

    /* Sidebar */
    .sidebar-brand { padding: 22px 18px; }
    .sidebar-brand h2 { font-size: 1.25rem; }
    .sidebar-nav a { padding: 16px 18px; font-size: 1.02rem; }

    /* Badges */
    .badge { font-size: 0.82rem; padding: 5px 10px; }

    /* Empty state */
    .empty-state { padding: 40px 16px; }
    .empty-state .empty-icon { font-size: 2.5rem; }
    .empty-state p { font-size: 1rem; }

    /* Image upload */
    .img-upload-area { padding: 20px; }
    .img-upload-area p { font-size: 0.95rem; }
    .img-thumbnail { width: 48px; height: 48px; }

    /* Checkbox */
    .checkbox-item { padding: 13px 14px; }
    .checkbox-item label { font-size: 0.95rem; }
    .checkbox-item input[type="checkbox"] { width: 20px; height: 20px; }
}

/* ---- SMALL PHONES (max 480px) ---- */
@media (max-width: 480px) {
    .content { padding: 12px; }

    .stats-grid { grid-template-columns: 1fr; gap: 10px; }

    .header-left h1 { font-size: 1.05rem; }

    thead th { padding: 10px 8px; font-size: 0.75rem; }
    tbody td { padding: 10px 8px; font-size: 0.85rem; }

    .login-card { padding: 30px 22px; margin: 12px; }
    .login-brand h1 { font-size: 1.5rem; }

    .modal { padding: 20px 14px; max-height: 95vh; }

    /* Order detail grid to single column */
    .modal [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .hide-mobile { display: none; }
    .status-arrow { display: none; }
}

/* ---- VERY SMALL (max 360px) ---- */
@media (max-width: 360px) {
    .content { padding: 10px; }
    .header { padding: 10px 12px; }
    .header-left h1 { font-size: 1rem; }
    .form-control { padding: 12px; font-size: 16px; }
    .btn { padding: 11px 14px; font-size: 0.9rem; }
}

/* ---- LARGE SCREENS (min 1400px) ---- */
@media (min-width: 1400px) {
    .sidebar { width: 280px; }
    .main-content { margin-left: 280px; }
    .content { padding: 40px 48px; }
    .header { padding: 18px 48px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .modal { max-width: 650px; }
    .modal-lg { max-width: 900px; }
    thead th { padding: 16px 24px; }
    tbody td { padding: 16px 24px; }
}

/* ---- ULTRA WIDE (min 1800px) ---- */
@media (min-width: 1800px) {
    .content { max-width: 1600px; margin: 0 auto; padding: 48px 60px; }
    .header { padding: 20px 60px; }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .btn-icon { min-width: 44px; min-height: 44px; }
    .sidebar-nav a { padding: 16px 18px; }
    tbody tr:hover { background: none; }
    .stat-card:hover { transform: none; }
    .btn-primary:hover { transform: none; }
}
