/* ==========================================
   THƯƠNG CHÂU - ADMIN PANEL
   Shared Stylesheet v5.0
   ========================================== */

:root {
    --sidebar-width: 252px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active-bg: rgba(99,102,241,.14);
    --sidebar-active-border: #6366f1;
    --sidebar-active-color: #a5b4fc;
    --sidebar-text: #94a3b8;
    --sidebar-heading: #475569;
    --sidebar-border: rgba(255,255,255,.06);

    --topbar-height: 60px;
    --topbar-bg: #ffffff;
    --topbar-border: #e2e8f0;

    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99,102,241,.1);

    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-table-head: #f8fafc;
    --bg-row-hover: rgba(99,102,241,.03);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --success: #10b981;
    --success-bg: rgba(16,185,129,.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,.08);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,.08);
    --info: #3b82f6;
    --info-bg: rgba(59,130,246,.08);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07),0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08),0 4px 6px -2px rgba(0,0,0,.04);
    --transition: .15s ease;
}

*,*::before,*::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    scrollbar-width: none;
    border-right: 1px solid var(--sidebar-border);
    transition: transform var(--transition);
}
.admin-sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
    padding: 0 18px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14.5px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-brand:hover { color: #fff; }

.brand-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,.4);
}

.brand-text .brand-name { display: block; font-size: 13.5px; font-weight: 700; color: #f1f5f9; letter-spacing: -.2px; }
.brand-text .brand-ver  { display: block; font-size: 10px; color: var(--sidebar-heading); font-weight: 400; }

.sidebar-nav { flex: 1; padding: 8px 0 14px; }

.nav-section {
    padding: 14px 14px 4px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sidebar-heading);
}
.nav-section:first-child { padding-top: 8px; }

/* Collapsible nav groups */
.nav-section-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 14px 4px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sidebar-heading);
    display: flex;
    align-items: center;
    cursor: pointer;
    text-align: left;
    line-height: 1.6;
    transition: color .15s;
}
.nav-section-toggle:hover { color: #64748b; }
.nav-section-toggle:first-child { padding-top: 8px; }
.nav-section-toggle .nav-chevron {
    margin-left: auto;
    font-size: 8px;
    opacity: .5;
    transition: transform .2s ease;
}
.nav-section-toggle[aria-expanded="false"] .nav-chevron { transform: rotate(-90deg); }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
    margin: 1px 0;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    border-left-color: var(--sidebar-active-border);
}
.sidebar-link .nav-icon { width: 20px; text-align: center; font-size: 14px; flex-shrink: 0; opacity: .85; }
.sidebar-link.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 11px;
    color: var(--sidebar-heading);
    line-height: 1.8;
}

/* ===== MAIN LAYOUT ===== */
.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== TOPBAR ===== */
.admin-topbar {
    position: sticky;
    top: 0; z-index: 1030;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}
.topbar-title { font-weight: 600; font-size: 15.5px; color: var(--text-primary); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.admin-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--accent-light); color: var(--accent);
    font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 20px; letter-spacing: .3px;
}
.topbar-logout {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 13px; font-weight: 500;
    padding: 6px 12px; border-radius: var(--radius-sm);
    border: none; background: transparent; cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.topbar-logout:hover { background: var(--danger-bg); color: var(--danger); }
.hamburger-btn {
    display: none; border: none; background: transparent;
    color: var(--text-secondary); font-size: 20px;
    cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm);
}

/* ===== PAGE BODY ===== */
.admin-page-body { flex: 1; padding: 24px; }

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.blue::before  { background: linear-gradient(90deg, var(--accent), #818cf8); }
.stat-card.green::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.amber::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.cyan::before  { background: linear-gradient(90deg, var(--info), #60a5fa); }
.stat-card.red::before   { background: linear-gradient(90deg, var(--danger), #f87171); }

.stat-icon-wrap {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 14px;
}
.stat-icon-wrap.blue  { background: var(--accent-light); color: var(--accent); }
.stat-icon-wrap.green { background: var(--success-bg);   color: var(--success); }
.stat-icon-wrap.amber { background: var(--warning-bg);   color: var(--warning); }
.stat-icon-wrap.cyan  { background: var(--info-bg);      color: var(--info); }
.stat-icon-wrap.red   { background: var(--danger-bg);    color: var(--danger); }

.stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; letter-spacing: -.5px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; font-weight: 500; }
.stat-sub   { font-size: 12px; margin-top: 8px; color: var(--text-muted); }

/* ===== STAT CHIPS ===== */
.stat-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-chip {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow-sm); flex: 1; min-width: 150px;
}
.chip-icon { font-size: 18px; }
.chip-value { font-weight: 800; font-size: 20px; line-height: 1; }
.chip-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== FILTER BAR ===== */
.filter-bar {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 16px 20px;
    margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filter-bar .form-label {
    font-size: 11.5px; font-weight: 700; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 5px;
}

/* ===== TABLE CARD ===== */
.admin-table-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm);
}
.card-header-custom {
    padding: 15px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px;
}
.card-header-custom h6 {
    margin: 0; font-weight: 700; font-size: 14px;
    color: var(--text-primary); display: flex; align-items: center; gap: 8px;
}
.header-count {
    font-size: 11.5px; font-weight: 500; color: var(--text-muted);
    background: var(--bg-page); padding: 2px 8px;
    border-radius: 10px; border: 1px solid var(--border);
}

/* ===== TABLE ===== */
.table { margin-bottom: 0; }
.table thead th {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: var(--text-muted);
    background: var(--bg-table-head); border-bottom: 2px solid var(--border);
    padding: 10px 16px; white-space: nowrap;
}
.table tbody td {
    padding: 11px 16px; vertical-align: middle;
    font-size: 13.5px; border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-row-hover); }
.table-responsive { overflow-x: auto; }

/* ===== BADGES ===== */
.badge-status {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
}
.badge-status.success  { background: var(--success-bg); color: #059669; }
.badge-status.warning  { background: var(--warning-bg); color: #d97706; }
.badge-status.danger   { background: var(--danger-bg);  color: #dc2626; }
.badge-status.info     { background: var(--info-bg);    color: #2563eb; }
.badge-status.secondary{ background: #f1f5f9;           color: #64748b; }
.badge-status.dark     { background: #1e293b;           color: #94a3b8; }
.badge-status.primary  { background: var(--accent-light); color: var(--accent); }

.badge-role {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: var(--radius-sm);
    background: #f1f5f9; color: var(--text-secondary);
    border: 1px solid var(--border);
}
.badge-role.ADMIN     { background: rgba(99,102,241,.1); color: var(--accent); border-color: rgba(99,102,241,.2); }
.badge-role.SUB_ADMIN { background: rgba(139,92,246,.1); color: #7c3aed; border-color: rgba(139,92,246,.2); }
.badge-role.SELLER    { background: rgba(16,185,129,.1); color: #059669; border-color: rgba(16,185,129,.2); }
.badge-role.BUYER,
.badge-role.USER      { background: rgba(59,130,246,.1); color: #2563eb; border-color: rgba(59,130,246,.2); }
.badge-role.MODERATOR { background: rgba(245,158,11,.1); color: #d97706; border-color: rgba(245,158,11,.2); }
.badge-role.SUPPORT   { background: rgba(20,184,166,.1); color: #0d9488; border-color: rgba(20,184,166,.2); }
.badge-role.GUEST     { background: #f8fafc; color: var(--text-muted); border-color: var(--border); }

/* ===== USER AVATAR ===== */
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 600; font-size: 13.5px; }
.user-handle { font-size: 11.5px; color: var(--text-muted); }

/* ===== ACTION BUTTONS ===== */
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-action {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 600; padding: 4px 9px;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: all var(--transition);
}
.btn-action.danger    { color: #dc2626;     border-color: rgba(239,68,68,.3);     background: var(--danger-bg); }
.btn-action.success   { color: #059669;     border-color: rgba(16,185,129,.3);    background: var(--success-bg); }
.btn-action.primary   { color: var(--accent); border-color: rgba(99,102,241,.3);  background: var(--accent-light); }
.btn-action.secondary { color: var(--text-secondary); border-color: var(--border); background: #f8fafc; }
.btn-action.warning   { color: #d97706;     border-color: rgba(245,158,11,.3);    background: var(--warning-bg); }
.btn-action.info      { color: #2563eb;     border-color: rgba(59,130,246,.3);    background: var(--info-bg); }

.btn-action.danger:hover    { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-action.success:hover   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-action.primary:hover   { background: var(--accent);  color: #fff; border-color: var(--accent); }
.btn-action.secondary:hover { background: #e2e8f0; color: var(--text-primary); }
.btn-action.warning:hover   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-action.info:hover      { background: var(--info);    color: #fff; border-color: var(--info); }
.btn-action:disabled { opacity: .55; cursor: not-allowed; }

/* ===== PAGINATION BAR ===== */
.pagination-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 20px; border-top: 1px solid var(--border-light);
    background: var(--bg-table-head); flex-wrap: wrap; gap: 8px;
}
.pagination-info { font-size: 12.5px; color: var(--text-muted); }

/* ===== FORM LABELS ===== */
.edit-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 5px;
}

/* ===== SETTINGS ===== */
.settings-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border); overflow: hidden;
    margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.settings-body { padding: 20px; }

.rate-row {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 0; border-bottom: 1px solid var(--border-light); flex-wrap: wrap;
}
.rate-row:last-child { border-bottom: none; }
.rate-pair { font-weight: 700; font-size: 14px; min-width: 90px; color: var(--text-secondary); }
.rate-value { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -.5px; flex: 1; }
.rate-meta { font-size: 12px; color: var(--text-muted); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.info-item { background: var(--bg-table-head); border-radius: var(--radius); padding: 14px; border: 1px solid var(--border-light); }
.info-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 4px; }
.info-value { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* ===== TOAST ===== */
#toastContainer {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999; display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.admin-toast {
    background: #fff; border-radius: 14px;
    padding: 14px 16px 16px; box-shadow: 0 8px 32px rgba(0,0,0,.13);
    display: flex; align-items: flex-start; gap: 12px;
    min-width: 300px; max-width: 400px; position: relative; overflow: hidden;
    pointer-events: all; border-left: 4px solid #d1d5db;
    opacity: 0; transform: translateX(110%) scale(.96);
    transition: opacity .3s ease, transform .35s cubic-bezier(.22,1,.36,1);
}
.admin-toast.show { opacity: 1; transform: translateX(0) scale(1); }
.admin-toast.hide { opacity: 0; transform: translateX(110%) scale(.96); }
.admin-toast.success { border-left-color: #10b981; }
.admin-toast.danger  { border-left-color: #ef4444; }
.admin-toast.warning { border-left-color: #f59e0b; }
.admin-toast.info    { border-left-color: #3b82f6; }
.toast-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.admin-toast.success .toast-icon { background: #d1fae5; color: #059669; }
.admin-toast.danger  .toast-icon { background: #fee2e2; color: #dc2626; }
.admin-toast.warning .toast-icon { background: #fef3c7; color: #d97706; }
.admin-toast.info    .toast-icon { background: #dbeafe; color: #2563eb; }
.toast-body { flex: 1; min-width: 0; padding-top: 1px; }
.toast-title { font-size: 13.5px; font-weight: 700; color: #111827; margin-bottom: 3px; }
.toast-message { font-size: 12.5px; color: #6b7280; line-height: 1.45; }
.toast-close {
    border: none; background: none; cursor: pointer;
    color: #9ca3af; font-size: 20px; line-height: 1;
    padding: 0 0 0 4px; flex-shrink: 0; margin-top: -1px;
    transition: color .15s;
}
.toast-close:hover { color: #374151; }
.toast-progress {
    position: absolute; bottom: 0; left: 0; height: 3px; width: 100%;
    transform-origin: left;
    animation: adm-toast-shrink linear forwards;
}
.admin-toast.success .toast-progress { background: #10b981; }
.admin-toast.danger  .toast-progress { background: #ef4444; }
.admin-toast.warning .toast-progress { background: #f59e0b; }
.admin-toast.info    .toast-progress { background: #3b82f6; }
@keyframes adm-toast-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ===== ADMIN CONFIRM DIALOG ===== */
.adm-confirm-overlay {
    position: fixed; inset: 0; z-index: 10500;
    background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; transition: opacity .2s ease;
}
.adm-confirm-overlay.adm-confirm-show { opacity: 1; }
.adm-confirm-box {
    background: #fff; border-radius: 18px; padding: 32px 28px 24px;
    max-width: 420px; width: 100%; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    transform: scale(.92) translateY(12px);
    transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.adm-confirm-overlay.adm-confirm-show .adm-confirm-box { transform: scale(1) translateY(0); }
.adm-confirm-icon {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin: 0 auto 16px;
}
.adm-confirm-icon.danger  { background: #fee2e2; color: #dc2626; }
.adm-confirm-icon.warning { background: #fef3c7; color: #d97706; }
.adm-confirm-icon.info    { background: #dbeafe; color: #2563eb; }
.adm-confirm-icon.success { background: #d1fae5; color: #059669; }
.adm-confirm-title {
    font-size: 17px; font-weight: 700; color: #111827; margin-bottom: 8px;
}
.adm-confirm-msg {
    font-size: 14px; color: #6b7280; line-height: 1.55; margin-bottom: 24px;
}
.adm-confirm-actions {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.adm-confirm-actions .btn { min-width: 110px; }
@media (max-width: 480px) {
    .adm-confirm-actions { flex-direction: column-reverse; }
    .adm-confirm-actions .btn { width: 100%; }
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { font-size: 38px; color: var(--text-muted); margin-bottom: 12px; opacity: .4; }
.empty-state-title { font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; font-size: 15px; }
.empty-state-sub { font-size: 13px; color: var(--text-muted); }

/* ===== ADMIN LANGUAGE SELECTOR ===== */
.admin-lang-bar {
    padding: 8px 14px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    justify-content: flex-end;
    background: var(--sidebar-bg);
}
.admin-lang-sel {
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 6px;
    font-size: .75rem;
    background: rgba(255,255,255,.08);
    color: var(--sidebar-text);
    cursor: pointer;
    outline: none;
    transition: border-color .15s, background .15s;
}
.admin-lang-sel:hover,
.admin-lang-sel:focus {
    border-color: var(--accent);
    background: rgba(99,102,241,.15);
    color: #e2e8f0;
}
.admin-lang-sel option {
    background: #1e293b;
    color: #e2e8f0;
}

/* ===== TOPBAR LANGUAGE SELECTOR (inline variant) ===== */
.topbar-lang-sel {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .78rem;
    background: var(--bg-page);
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}
.topbar-lang-sel:hover,
.topbar-lang-sel:focus { border-color: var(--accent); color: var(--accent); }

/* ===== OVERLAY & MOBILE ===== */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 1039;
}
.sidebar-overlay.open { display: block; }

/* ===== RESPONSIVE — TABLET (max 1024px) ===== */
@media (max-width: 1024px) {
    :root { --sidebar-width: 220px; }
    .admin-page-body { padding: 18px; }
    .stat-chips .stat-chip { min-width: 120px; }
}

/* ===== RESPONSIVE — MOBILE (max 768px) ===== */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .hamburger-btn { display: flex; }
    .admin-page-body { padding: 14px; }
    .stat-chips { gap: 8px; }
    .stat-chips .stat-chip { min-width: 130px; flex: 1 1 calc(50% - 4px); }
    .admin-topbar { padding: 0 14px; gap: 8px; }
    .topbar-title { font-size: 14px; }
    .admin-badge { display: none; }
    .topbar-logout span.d-none { display: none !important; }
    .admin-table-card { border-radius: var(--radius); }
    .filter-bar { padding: 12px; }
    .card-header-custom { padding: 12px 14px; }
    .table thead th,
    .table tbody td { padding: 8px 10px; font-size: .78rem; }
    .kpi-value { font-size: 1.4rem; }
    .admin-lang-bar { padding: 6px 14px; }
}

/* ===== RESPONSIVE — SMALL MOBILE (max 480px) ===== */
@media (max-width: 480px) {
    .admin-page-body { padding: 10px; }
    .stat-chips .stat-chip { min-width: 100%; flex: 1 1 100%; }
    .row.g-3 > [class*='col-6'] { flex: 0 0 100%; max-width: 100%; }
    .pagination-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
    .action-btns { flex-wrap: wrap; }
    .btn-action { font-size: .7rem; padding: 3px 7px; }
}

/* ===== COMPAT: alternate layout classes used by warehouse portal templates ===== */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    z-index: 1040; overflow-y: auto; scrollbar-width: none;
    border-right: 1px solid var(--sidebar-border);
    transition: transform var(--transition);
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-header {
    padding: 0 18px; height: var(--topbar-height);
    display: flex; align-items: center; gap: 10px;
    color: #fff; border-bottom: 1px solid var(--sidebar-border); flex-shrink: 0;
}
.sidebar-logo { font-size: 20px; }
.sidebar .sidebar-brand { color: #f1f5f9; font-weight: 700; font-size: 14px; }

/* Warehouse portal nav-item (scoped to avoid conflict with Bootstrap .nav-item) */
.sidebar .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; color: #94a3b8;
    text-decoration: none; font-size: 13.5px;
    transition: background .12s, color .12s;
    border-radius: 0 6px 6px 0; margin-right: 8px;
}
.sidebar .nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar .nav-item.active {
    background: linear-gradient(90deg, rgba(99,102,241,.18), rgba(99,102,241,.08));
    color: #a5b4fc; font-weight: 600;
}

.main-content {
    margin-left: var(--sidebar-width); min-height: 100vh;
    display: flex; flex-direction: column; flex: 1;
}

.topbar {
    height: var(--topbar-height); background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; padding: 0 20px; gap: 12px;
    position: sticky; top: 0; z-index: 100;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
