/* =========================================================
   MovieTicket Admin — giao diện quản trị dùng chung
   ========================================================= */
:root {
    --bg: #f4f5f9;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --ink: #161925;
    --ink-2: #474d61;
    --muted: #8a90a3;
    --line: #e7e9f0;
    --line-2: #eff1f6;

    --sidebar: #12141c;
    --sidebar-2: #1a1d28;
    --sidebar-ink: #a6abbd;
    --sidebar-ink-strong: #f3f4f8;

    --accent: #f2a22c;         /* vàng đèn rạp — điểm nhấn thương hiệu */
    --accent-strong: #d98a12;
    --accent-soft: #fff5e3;

    --primary: #3b5bdb;
    --primary-soft: #edf1ff;
    --success: #1f9d6b;
    --success-soft: #e6f6ef;
    --warning: #c27c0e;
    --warning-soft: #fdf3e1;
    --danger: #d63f4b;
    --danger-soft: #fdebed;
    --info: #1c7fa6;
    --info-soft: #e5f4fa;
    --neutral-soft: #eef0f4;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(22, 25, 37, .04), 0 1px 3px rgba(22, 25, 37, .06);
    --shadow: 0 4px 24px rgba(22, 25, 37, .06);
    --sidebar-w: 264px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.admin-body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: #2f4ac0; }

/* ---------------- Shell ---------------- */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--sidebar);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    color: var(--sidebar-ink-strong);
}
.sidebar-brand:hover { color: var(--sidebar-ink-strong); }

.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--accent) 0%, #e8641c 100%);
    color: #1b1406;
    font-size: 18px;
    flex-shrink: 0;
}
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.brand-text small { font-size: 11.5px; color: var(--sidebar-ink); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 20px;
    scrollbar-width: thin;
    scrollbar-color: #2b2f3d transparent;
}

.nav-group-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: #646a7e;
    padding: 16px 12px 6px;
}

.nav-link-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 9px;
    color: var(--sidebar-ink);
    font-weight: 500;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.nav-link-item i { font-size: 17px; width: 20px; text-align: center; opacity: .9; }
.nav-link-item:hover { background: rgba(255, 255, 255, .05); color: var(--sidebar-ink-strong); }
.nav-link-item.active {
    background: rgba(242, 162, 44, .12);
    color: var(--sidebar-ink-strong);
}
.nav-link-item.active i { color: var(--accent); opacity: 1; }
.nav-link-item.active::before {
    content: "";
    position: absolute;
    left: -12px; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    border-radius: 10px;
    background: var(--sidebar-2);
}
.sidebar-user .avatar { width: 34px; height: 34px; font-size: 13px; }
.sidebar-user .who { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-user .who strong { display: block; color: var(--sidebar-ink-strong); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who small { font-size: 11.5px; color: var(--sidebar-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidebar-user .logout {
    width: 32px; height: 32px; border-radius: 8px;
    display: grid; place-items: center;
    color: var(--sidebar-ink);
}
.sidebar-user .logout:hover { background: rgba(214, 63, 75, .18); color: #ff8f98; }

.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700;
    font-size: 14px;
    color: #1b1406;
    background: var(--accent);
    flex-shrink: 0;
    text-transform: uppercase;
}

.admin-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

/* ---------------- Topbar ---------------- */
.topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-toggle {
    display: none;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 20px;
    align-items: center; justify-content: center;
}
.breadcrumb-lite {
    display: flex; align-items: center; gap: 8px;
    font-size: 13.5px;
    color: var(--muted);
    min-width: 0;
}
.breadcrumb-lite a { color: var(--muted); }
.breadcrumb-lite a:hover { color: var(--ink); }
.breadcrumb-lite .current { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-lite i.sep { font-size: 11px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 13px; color: var(--muted); }
.topbar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 6px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}
.topbar-user:hover, .topbar-user:focus { color: var(--ink); background: var(--surface-2); }
.topbar-user .avatar { width: 32px; height: 32px; font-size: 12.5px; }
.topbar-user .name { font-weight: 600; font-size: 13.5px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user::after { margin-left: 2px; color: var(--muted); }

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(22, 25, 37, .12);
    padding: 6px;
    font-size: 14px;
}
.dropdown-item { border-radius: 8px; padding: 8px 12px; }
.dropdown-item i { width: 20px; }
.dropdown-header { font-size: 12px; }

/* ---------------- Content ---------------- */
.admin-content {
    padding: 28px;
    width: 100%;
    max-width: 1440px;
}

.page-head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.page-head h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.3px;
    margin: 0;
    color: var(--ink);
}
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 20px; }
.panel-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-2);
}
.panel-title { font-size: 15.5px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--muted); }
.panel-sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.panel-body { padding: 20px; }
.panel-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--line-2);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}

/* ---------------- Toolbar / filters ---------------- */
.toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 11px;
    background: var(--neutral-soft);
    gap: 2px;
}
.seg > a, .seg > button {
    border: 0;
    background: transparent;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-2);
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.seg > a:hover, .seg > button:hover { color: var(--ink); }
.seg > .active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.search-box { position: relative; }
.search-box i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--muted); pointer-events: none;
}
.search-box input { padding-left: 36px; min-width: 240px; }

/* ---------------- Buttons ---------------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }

.btn-primary, .btn-dark {
    --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink);
    --bs-btn-hover-bg: #2a2f40; --bs-btn-hover-border-color: #2a2f40;
    --bs-btn-active-bg: #0b0d14; --bs-btn-active-border-color: #0b0d14;
    --bs-btn-disabled-bg: var(--ink); --bs-btn-disabled-border-color: var(--ink);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
}
.btn-accent {
    --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: #1b1406;
    --bs-btn-hover-bg: var(--accent-strong); --bs-btn-hover-border-color: var(--accent-strong); --bs-btn-hover-color: #1b1406;
    --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong); --bs-btn-active-color: #1b1406;
    font-weight: 600;
}
.btn-light, .btn-outline-secondary, .btn-secondary {
    --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink-2);
    --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #d6d9e3; --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: var(--neutral-soft); --bs-btn-active-border-color: #d6d9e3; --bs-btn-active-color: var(--ink);
}
.btn-soft-danger {
    --bs-btn-bg: var(--danger-soft); --bs-btn-border-color: transparent; --bs-btn-color: var(--danger);
    --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #b8323d; --bs-btn-active-color: #fff;
}
.btn-soft-warning {
    --bs-btn-bg: var(--warning-soft); --bs-btn-border-color: transparent; --bs-btn-color: var(--warning);
    --bs-btn-hover-bg: #f6e2bd; --bs-btn-hover-border-color: transparent; --bs-btn-hover-color: #8f5a06;
    --bs-btn-active-bg: #f1d59f; --bs-btn-active-color: #8f5a06;
}
.btn-soft-success {
    --bs-btn-bg: var(--success-soft); --bs-btn-border-color: transparent; --bs-btn-color: var(--success);
    --bs-btn-hover-bg: #cdeedf; --bs-btn-hover-border-color: transparent; --bs-btn-hover-color: #167a53;
    --bs-btn-active-bg: #b9e6d1; --bs-btn-active-color: #167a53;
}
.btn-soft-primary {
    --bs-btn-bg: var(--primary-soft); --bs-btn-border-color: transparent; --bs-btn-color: var(--primary);
    --bs-btn-hover-bg: #dbe3ff; --bs-btn-hover-border-color: transparent; --bs-btn-hover-color: #2f4ac0;
    --bs-btn-active-bg: #cbd6ff; --bs-btn-active-color: #2f4ac0;
}

.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: 9px;
    font-size: 15px;
}
.btn-icon.btn-sm { width: 30px; height: 30px; font-size: 14px; }

.row-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.row-actions form { display: inline; margin: 0; }

.btn:focus-visible, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 4px rgba(242, 162, 44, .22);
    border-color: var(--accent);
    outline: none;
}

/* ---------------- Forms ---------------- */
.form-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--line);
    padding: 9px 13px;
    font-size: 14.5px;
    color: var(--ink);
    background-color: var(--surface);
}
.form-control::placeholder { color: #a9aebd; }
.form-control[readonly] { background: var(--surface-2); color: var(--ink-2); }
.form-text { color: var(--muted); font-size: 12.5px; }
.form-section-title {
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .9px;
    color: var(--muted);
    margin: 4px 0 14px;
}
.form-narrow { max-width: 880px; }
.input-icon { position: relative; }
.input-icon > i {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--muted); pointer-events: none; font-size: 15px;
}
.input-icon > .form-control, .input-icon > .form-select { padding-left: 38px; }

/* Upload */
.upload-drop {
    position: relative;
    display: flex; align-items: center; gap: 16px;
    padding: 16px;
    border: 1.5px dashed #d3d7e2;
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.upload-drop:hover, .upload-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-thumb {
    width: 84px; height: 84px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    display: grid; place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    color: var(--muted);
    font-size: 26px;
}
.upload-thumb.tall { width: 72px; height: 104px; }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-meta strong { display: block; font-weight: 600; font-size: 14px; color: var(--ink); word-break: break-all; }
.upload-meta small { color: var(--muted); }

/* ---------------- Tables ---------------- */
.table-modern { margin: 0; --bs-table-bg: transparent; --bs-table-hover-bg: var(--surface-2); }
.table-modern > thead > tr > th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table-modern > tbody > tr > td {
    padding: 13px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink);
}
.table-modern > tbody > tr:last-child > td { border-bottom: 0; }
.table-modern .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-modern .id-col { color: var(--muted); font-variant-numeric: tabular-nums; width: 70px; }
.table-modern .actions-col { text-align: right; width: 1%; white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
.panel > .table-wrap:first-child { border-radius: var(--radius); }

.cell-media { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-media .title { font-weight: 600; color: var(--ink); line-height: 1.3; }
.cell-media .sub { font-size: 12.5px; color: var(--muted); }
.thumb {
    width: 48px; height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--neutral-soft);
    flex-shrink: 0;
    display: grid; place-items: center;
    color: var(--muted);
}
.thumb.poster { width: 44px; height: 62px; border-radius: 7px; }
.thumb.wide { width: 120px; height: 52px; }
.thumb.logo { object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 4px; }
.truncate { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------- Pills / status ---------------- */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}
.pill::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}
.pill.no-dot::before { display: none; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-primary { background: var(--primary-soft); color: var(--primary); }
.pill-neutral { background: var(--neutral-soft); color: var(--ink-2); }
.pill-accent { background: var(--accent-soft); color: #9a5c00; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--neutral-soft);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    margin: 1px 2px 1px 0;
    font-variant-numeric: tabular-nums;
}

/* ---------------- Card grids ---------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.card-grid.lg { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.item-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.item-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.item-card .cover {
    position: relative;
    aspect-ratio: 2 / 3;
    background: var(--neutral-soft);
    display: grid; place-items: center;
    color: var(--muted);
    font-size: 40px;
    overflow: hidden;
}
.item-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item-card .cover.short { aspect-ratio: 16 / 9; }
.item-card .cover.logo img { object-fit: contain; padding: 22px; background: #fff; }
.item-card .cover .pill { position: absolute; top: 10px; right: 10px; box-shadow: var(--shadow-sm); }
.item-card .body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item-card .title { font-weight: 600; font-size: 15px; line-height: 1.35; margin: 0; }
.item-card .meta, .tile-card .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.item-card .meta i, .tile-card .meta i { margin-right: 4px; }
.item-card .desc { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card .foot {
    padding: 10px 16px;
    border-top: 1px solid var(--line-2);
    display: flex; gap: 6px; align-items: center; justify-content: space-between;
}

.tile-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
    box-shadow: var(--shadow-sm);
}
.tile-card .tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center;
    font-size: 20px;
    background: var(--accent-soft); color: var(--accent-strong);
}
.tile-card .tile-title { font-weight: 600; font-size: 15.5px; margin: 0; }
.tile-card .tile-sub { color: var(--muted); font-size: 12.5px; }
.tile-card .tile-foot { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }

/* ---------------- Stats (dashboard) ---------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 6px;
}
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-label i {
    width: 30px; height: 30px; border-radius: 9px;
    display: grid; place-items: center; font-size: 15px;
    background: var(--neutral-soft); color: var(--ink-2);
}
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat-foot { font-size: 12.5px; color: var(--muted); }
.stat.hero { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.stat.hero .stat-label { color: #a6abbd; }
.stat.hero .stat-label i { background: rgba(242, 162, 44, .16); color: var(--accent); }
.stat.hero .stat-value small, .stat.hero .stat-foot { color: #a6abbd; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.dash-grid .panel + .panel { margin-top: 0; }

/* Bar chart (CSS) */
.bar-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    height: 220px;
    padding: 8px 4px 0;
    position: relative;
    background-image: linear-gradient(to top, var(--line-2) 1px, transparent 1px);
    background-size: 100% 25%;
}
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar {
    width: 100%; max-width: 38px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: filter .15s;
    position: relative;
}
.bar-col:hover .bar { filter: brightness(.92); }
.bar-col .bar-tip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%; transform: translateX(-50%);
    background: var(--ink); color: #fff;
    font-size: 12px; font-weight: 600;
    padding: 5px 9px; border-radius: 7px;
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .12s;
    z-index: 2;
}
.bar-col:hover .bar-tip { opacity: 1; }
.bar-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; padding: 8px 4px 0; }
.bar-labels span { text-align: center; font-size: 12px; color: var(--muted); }
.bar-labels span.today { color: var(--ink); font-weight: 600; }

.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-link {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font-weight: 500;
    font-size: 13.5px;
    transition: border-color .15s, background .15s;
}
.quick-link i {
    width: 32px; height: 32px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--neutral-soft); color: var(--ink-2);
    font-size: 15px;
    flex-shrink: 0;
}
.quick-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.quick-link:hover i { background: var(--accent); color: #1b1406; }

/* ---------------- Detail lists ---------------- */
.dl-grid { display: grid; grid-template-columns: 200px 1fr; margin: 0; }
.dl-grid dt, .dl-grid dd { padding: 11px 0; border-bottom: 1px solid var(--line-2); margin: 0; }
.dl-grid dt { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.dl-grid dd { color: var(--ink); }
.dl-grid dt:last-of-type, .dl-grid dd:last-of-type { border-bottom: 0; }

/* ---------------- Alerts / empty ---------------- */
.alert { border-radius: 12px; border: 1px solid transparent; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: var(--success-soft); color: #136b49; border-color: #c6ebdb; }
.alert-danger { background: var(--danger-soft); color: #a52c37; border-color: #f6cdd1; }
.alert-warning { background: var(--warning-soft); color: #8f5a06; border-color: #f3dfb8; }
.alert-info { background: var(--info-soft); color: #145d79; border-color: #c4e5f2; }
.alert .btn-close { margin-left: auto; padding: .6rem; font-size: 12px; position: static; }

.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--muted);
}
.empty-state .icon {
    width: 64px; height: 64px; border-radius: 18px;
    display: grid; place-items: center;
    margin: 0 auto 14px;
    background: var(--neutral-soft);
    color: var(--muted);
    font-size: 28px;
}
.empty-state h5 { color: var(--ink); font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.empty-state p { margin-bottom: 16px; }

.text-muted { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }
.hidden-by-search { display: none !important; }
[data-view-panel][hidden] { display: none !important; }

/* ---------------- Backdrop / responsive ---------------- */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(10, 12, 18, .45);
    z-index: 1035;
}

@media (max-width: 1199.98px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .admin-main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .topbar-toggle { display: inline-flex; }
    .topbar-date { display: none; }
    .admin-content { padding: 20px 16px; }
}

@media (max-width: 575.98px) {
    .stat-grid { grid-template-columns: 1fr; }
    .topbar-user .name { display: none; }
    .page-head h1 { font-size: 21px; }
    .search-box input { min-width: 0; width: 100%; }
    .search-box, .toolbar-left, .toolbar-right { width: 100%; }
    .dl-grid { grid-template-columns: 1fr; }
    .dl-grid dt { border-bottom: 0; padding-bottom: 0; }
    .quick-links { grid-template-columns: 1fr; }
    .bar-chart, .bar-labels { gap: 6px; }
}

.hidden-by-filter { display: none !important; }

/* Xếp hạng doanh thu (thanh ngang) */
.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.rank-name { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.rank-bar { height: 100%; border-radius: 4px; background: var(--accent); min-width: 2px; }
.dash-grid > .d-flex > .stat { flex: 1; }
.chart-empty {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: var(--muted); font-size: 13.5px;
    pointer-events: none;
}
