/* Admin Console · Demo by Microads */
:root {
  --bg: #f7f5f1; --card: #fff; --line: #ebe5da; --line-2: #f1ece4; --ink: #22180f; --ink-2: #4b3d30; --muted: #8a7b6b;
  --side: #1d140d; --side-2: #2a1d13; --side-ink: #e7dac3; --side-muted: #a8957a;
  --gold: #c98a2e; --gold-2: #e2b96f; --gold-soft: #f8edd9; --gold-deep: #9a6526; --gold-grad: linear-gradient(135deg, #f0cd8d, #d9a456 55%, #b98538);
  --jade: #177a55; --jade-soft: #e3f1ea; --blue: #4b86d6; --blue-soft: #e5eefa; --rust: #a84e2a; --rust-soft: #f8e6de;
  --amber: #b7791f; --amber-soft: #fbf0d9; --red: #b42318; --red-soft: #fde8e6; --gray-soft: #f1eee9;
  --serif: 'Playfair Display', Georgia, serif; --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 10px; --sw: 264px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.8; flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

/* ---------- Bố cục ---------- */
.app { display: grid; grid-template-columns: var(--sw) 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--side) 0%, #241810 100%); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40; }
.side .brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px; color: var(--gold-2); }
.side .brand svg.lotus { width: 48px; height: 34px; filter: drop-shadow(0 0 8px rgba(226, 185, 111, .35)); }
.side .brand b { display: block; font-family: var(--serif); font-size: 23px; letter-spacing: .06em; color: #f3e5c8; font-weight: 600; line-height: 1; }
.side .brand small { display: block; font-size: 9.5px; letter-spacing: .16em; white-space: nowrap; color: var(--gold-2); margin-top: 5px; }
.scope { margin: 4px 16px 10px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(226, 185, 111, .25); border-radius: 8px; background: rgba(255, 255, 255, .03); font-size: 13px; }
.scope svg { color: var(--gold-2); }
.scope span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: #4a3726 transparent; }
.nav h6 { font-size: 11px; letter-spacing: .14em; color: var(--gold-2); margin: 16px 10px 6px; font-weight: 600; text-transform: uppercase; opacity: .9; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 7px; color: var(--side-ink); font-size: 13.5px; position: relative; transition: background .2s, color .2s; }
.nav a svg { color: #cdb894; width: 17px; height: 17px; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.on { background: linear-gradient(90deg, #6b4a26, #533a1f); color: #fff; box-shadow: inset 3px 0 0 var(--gold-2); }
.nav a.on svg { color: var(--gold-2); }
.nav a .cnt { margin-left: auto; background: var(--gold-grad); color: #2a1a0c; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid rgba(226, 185, 111, .15); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: #2a1a0c; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.side .me b { display: block; font-size: 13px; color: #f3e5c8; font-weight: 600; }
.side .me small { color: var(--side-muted); font-size: 11.5px; }
.side .me .icon-btn { margin-left: auto; color: var(--side-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 26px; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb svg { width: 15px; height: 15px; }
.gsearch { margin-left: auto; position: relative; width: min(420px, 38vw); }
.gsearch input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px 0 38px; background: #faf8f5; outline: none; }
.gsearch input:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(201, 138, 46, .14); }
.gsearch > svg { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.gsearch .res { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .3); max-height: 420px; overflow: auto; padding: 6px; }
.gsearch .res h5 { margin: 8px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.gsearch .res a { display: flex; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 6px; font-size: 13px; }
.gsearch .res a:hover { background: var(--gray-soft); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--gray-soft); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px #fff; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 8px; font-size: 13.5px; }
.user-btn:hover { background: var(--gray-soft); }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .35); min-width: 240px; padding: 6px; z-index: 50; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; background: none; border: 0; cursor: pointer; text-align: left; font-size: 13.5px; }
.dropdown a:hover, .dropdown button:hover { background: var(--gray-soft); }
.dropdown .hd { padding: 8px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.burger { display: none; }

.content { padding: 26px 26px 40px; max-width: 1640px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .t { flex: 1; min-width: 260px; }
.page-head h1 { font-family: var(--serif); font-size: 32px; letter-spacing: -.01em; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.demo-badge { font-family: var(--sans); font-size: 10.5px; letter-spacing: .12em; font-weight: 600; color: var(--gold-deep); background: var(--gold-soft); border: 1px solid #ecd3a7; padding: 4px 10px; border-radius: 4px; }
.page-head .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Thành phần ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: #d8ccb8; background: #fcfaf7; }
.btn.primary { background: var(--gold-grad); border-color: #d19d4f; color: #2a1a0c; box-shadow: 0 6px 16px -8px rgba(201, 138, 46, .8); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.dark { background: var(--side-2); color: #f3e5c8; border-color: var(--side-2); }
.btn.green { background: var(--jade); color: #fff; border-color: var(--jade); }
.btn.danger { color: var(--red); border-color: #f1c4bf; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn.outline-gold { border-color: var(--gold-deep); color: var(--gold-deep); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link { color: var(--gold-deep); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; background: none; border: 0; padding: 0; border-bottom: 1px solid transparent; }
.link:hover { border-bottom-color: currentColor; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card > .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card > .hd h3 { font-family: var(--serif); font-size: 19px; display: flex; align-items: center; gap: 10px; }
.card > .hd h3 small { font-family: var(--sans); font-size: 12.5px; color: var(--muted); font-weight: 400; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g5 { grid-template-columns: repeat(5, 1fr); }
.g-main { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
.mt { margin-top: 18px; }

.kpi { display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.kpi .ic { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.kpi .ic svg { width: 23px; height: 23px; }
.kpi > div:last-child { min-width: 0; }
.ic.green { background: var(--jade-soft); color: var(--jade); } .ic.gold { background: var(--gold-soft); color: var(--gold-deep); } .ic.blue { background: var(--blue-soft); color: var(--blue); } .ic.rust { background: var(--rust-soft); color: var(--rust); } .ic.gray { background: var(--gray-soft); color: var(--ink-2); }
.kpi .lb { font-size: 13.5px; color: var(--ink-2); }
.kpi .val { font-size: 26px; white-space: nowrap; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; margin-top: 4px; }
.delta svg { width: 13px; height: 13px; stroke-width: 2.4; }
.delta.up { background: var(--jade-soft); color: var(--jade); } .delta.down { background: var(--red-soft); color: var(--red); } .delta.flat { background: var(--gray-soft); color: var(--muted); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 14px; cursor: pointer; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--side-2); color: #f3e5c8; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 11px 18px; border: 0; background: none; cursor: pointer; color: var(--ink-2); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs .on { color: var(--ink); font-weight: 600; border-color: var(--gold); }
.tabs .n { font-size: 11px; background: var(--gray-soft); border-radius: 99px; padding: 1px 7px; font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.input, .select, textarea.input { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; outline: none; min-width: 0; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; width: 100%; }
.input:focus, .select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 138, 46, .14); }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search-box .input { padding-left: 36px; width: 260px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 500; color: var(--ink-2); background: #f8f5f0; padding: 10px 12px; white-space: nowrap; font-size: 13px; }
.t td { padding: 11px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.t tbody tr { transition: background .15s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr:hover { background: #fcfaf6; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t .thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--gray-soft); }
.t .sub { font-size: 12px; color: var(--muted); }
.t input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold-deep); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: #d4c4a8; margin-bottom: 8px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.green { background: var(--jade-soft); color: var(--jade); } .pill.amber { background: var(--amber-soft); color: var(--amber); } .pill.gold { background: var(--gold-soft); color: var(--gold-deep); }
.pill.blue { background: var(--blue-soft); color: #2f63ad; } .pill.red { background: var(--red-soft); color: var(--red); } .pill.gray { background: var(--gray-soft); color: var(--ink-2); } .pill.rust { background: var(--rust-soft); color: var(--rust); }
.pill.dotted::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.bar { height: 8px; border-radius: 99px; background: #eee8de; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--jade); }
.bar.gold i { background: var(--gold); } .bar.red i { background: var(--rust); }

.todo a { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; transition: .15s; }
.todo a:hover { border-color: var(--gold); background: #fffaf2; }
.todo a b { font-size: 18px; }
.todo a svg.lucide:first-child { color: var(--gold-deep); width: 22px; height: 22px; }
.todo a .chev { margin-left: auto; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.quick a { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-right: 1px solid var(--line); }
.quick a:last-child { border-right: 0; }
.quick a:hover { background: #fcfaf6; }
.quick a > svg:first-child { width: 30px; height: 30px; color: var(--ink-2); stroke-width: 1.4; }
.quick b { display: block; font-size: 13.5px; font-weight: 600; }
.quick small { color: var(--muted); font-size: 12px; }
.quick .chev { margin-left: auto; color: var(--muted); }

.legend-list { display: grid; gap: 12px; }
.legend-list div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend-list i { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.legend-list b { margin-left: auto; font-variant-numeric: tabular-nums; }
.chart-box { position: relative; min-height: 260px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager .pg { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 0 8px; }
.pager button.on { background: var(--side-2); color: #f3e5c8; border-color: var(--side-2); }
.pager button[disabled] { opacity: .4; cursor: default; }

/* ---------- Form ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.f label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.f label .req { color: var(--red); }
.f .input, .f .select { width: 100%; }
.f .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--gold-deep); }
.switch { position: relative; width: 38px; height: 22px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d9d0c2; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--jade); }
.switch input:checked + span::before { transform: translateX(16px); }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-deep); font-weight: 600; margin: 6px 0 -4px; }
.img-slot { border: 1.5px dashed #d9ccb6; border-radius: 10px; min-height: 140px; display: grid; place-items: center; cursor: pointer; background: #fcfaf6; position: relative; overflow: hidden; color: var(--muted); text-align: center; font-size: 13px; transition: .2s; }
.img-slot:hover { border-color: var(--gold); color: var(--gold-deep); }
.img-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-slot .x { position: absolute; top: 6px; right: 6px; z-index: 2; }
.gallery-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gallery-edit .it { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--gray-soft); cursor: grab; }
.gallery-edit .it img { width: 100%; height: 100%; object-fit: cover; }
.gallery-edit .it .x { position: absolute; top: 4px; right: 4px; }
.gallery-edit .it:first-child::after { content: 'Ảnh chính'; position: absolute; left: 4px; bottom: 4px; background: var(--gold-grad); color: #2a1a0c; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.gallery-edit .add { aspect-ratio: 1; min-height: 0; }
.mini-x { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mini-x svg { width: 14px; height: 14px; }

/* Quill */
.editor-wrap { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.editor-wrap .ql-toolbar { border: 0; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; background: #faf8f4; position: sticky; top: 0; z-index: 2; }
.editor-wrap .ql-container { border: 0; font-family: var(--sans); font-size: 15px; }
.editor-wrap .ql-editor { min-height: 360px; line-height: 1.75; }
.editor-wrap .ql-editor h2 { font-family: var(--serif); font-size: 24px; margin: 1em 0 .4em; }
.editor-wrap .ql-editor h3 { font-family: var(--serif); font-size: 19px; }
.editor-wrap .ql-editor img { max-width: 100%; border-radius: 6px; }
.editor-wrap .ql-editor blockquote { border-left: 3px solid var(--gold); background: #fff8ec; padding: 10px 14px; }
.ql-snow .ql-picker.ql-header { width: 110px; }
.ql-toolbar .ql-library { width: auto !important; padding: 0 6px !important; font-size: 12px; color: var(--gold-deep); font-weight: 600; }

/* ---------- Modal & drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(29, 20, 13, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); animation: pop .25s cubic-bezier(.2, 1.2, .4, 1); }
.modal.lg { max-width: 900px; } .modal.xl { max-width: 1180px; } .modal.sm { max-width: 420px; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal .mh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { font-family: var(--serif); font-size: 20px; }
.modal .mb { padding: 20px; overflow-y: auto; flex: 1; }
.modal .mf { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbf9f6; border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.overlay.drawer { justify-content: flex-end; padding: 0; }
.overlay.drawer .modal { max-width: 760px; height: 100vh; max-height: 100vh; border-radius: 0; animation: slideIn .3s cubic-bezier(.2, .8, .2, 1); }
.overlay.drawer .modal .mf { border-radius: 0; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--side-2); color: #f3e5c8; padding: 12px 16px; border-radius: 10px; display: flex; gap: 10px; align-items: center; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); font-size: 13.5px; max-width: 420px; animation: pop .3s; }
.toast svg { color: var(--gold-2); }
.toast.err { background: #5b1c16; }
.toast.err svg { color: #ffb4a8; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.timeline li::after { content: ''; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.steps-mini { display: flex; gap: 4px; margin: 10px 0 16px; }
.steps-mini span { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.steps-mini span.done { border-color: var(--jade); color: var(--ink); font-weight: 600; }
.steps-mini span.cur { border-color: var(--gold); color: var(--gold-deep); font-weight: 700; }
.box-soft { background: #faf7f2; border: 1px solid var(--line-2); border-radius: 8px; padding: 14px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-it { position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--gray-soft); cursor: pointer; aspect-ratio: 1; }
.media-it img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.media-it:hover img { transform: scale(1.05); }
.media-it.sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 138, 46, .25); }
.media-it.sel::after { content: '✓'; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold-grad); color: #2a1a0c; display: grid; place-items: center; font-weight: 700; }
.media-it .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop { border: 2px dashed #d9ccb6; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); background: #fcfaf6; transition: .2s; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--gold); background: #fff8ec; color: var(--gold-deep); }
.drop svg { width: 30px; height: 30px; color: var(--gold); }
.progress { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold-grad); transition: width .2s; }

.tree { font-size: 13.5px; }
.tree .node { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 8px; }
.tree .node .lv { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.tree .children { margin-left: 28px; padding-left: 18px; border-left: 1.5px dashed #ddcfb8; }
.lv.agency { background: var(--side-2); color: var(--gold-2); } .lv.F1 { background: var(--jade-soft); color: var(--jade); } .lv.F2 { background: var(--blue-soft); color: #2f63ad; } .lv.CTV { background: var(--gold-soft); color: var(--gold-deep); }

.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; font-size: 10.5px; color: var(--muted); }
.heat div { aspect-ratio: 1; border-radius: 3px; }
.heat .lb { aspect-ratio: auto; display: flex; align-items: center; }
.heat .hh { aspect-ratio: auto; text-align: center; }

/* Đăng nhập */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--side); }
.login .art { position: relative; overflow: hidden; color: #f3e5c8; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.login .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.login .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(29, 20, 13, .95), rgba(29, 20, 13, .2)); }
.login .art > * { position: relative; z-index: 1; }
.login .art h2 { font-family: var(--serif); font-size: 40px; line-height: 1.15; }
.login .art h2 span { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .panel { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 30px; }
.login form { width: 100%; max-width: 400px; }
.login .brand { display: flex; align-items: center; gap: 12px; color: var(--gold-deep); margin-bottom: 26px; }
.login .brand b { font-family: var(--serif); font-size: 26px; letter-spacing: .05em; color: var(--ink); display: block; line-height: 1; }
.login .brand small { font-size: 10px; letter-spacing: .2em; color: var(--gold-deep); }
.demo-accts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.demo-accts button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 11px; cursor: pointer; font-size: 12.5px; transition: .15s; }
.demo-accts button:hover { border-color: var(--gold); background: #fffaf2; }
.demo-accts b { display: block; font-size: 13px; }
.demo-accts small { color: var(--muted); }

.skeleton { background: linear-gradient(90deg, #f1ece4 25%, #f8f5f0 50%, #f1ece4 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.apexcharts-tooltip { box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .3) !important; border: 1px solid var(--line) !important; font-family: var(--sans) !important; }
.apexcharts-legend-text { font-family: var(--sans) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .g5 { grid-template-columns: repeat(3, 1fr); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sw); transform: translateX(-100%); transition: transform .3s; visibility: hidden; }
  body.nav-open .side { visibility: visible; box-shadow: 20px 0 40px rgba(0, 0, 0, .3); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .burger { display: grid; }
  .g4 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: 1fr 1fr; }
  .quick { grid-template-columns: 1fr; } .quick a { border-right: 0; border-bottom: 1px solid var(--line); }
  .login { grid-template-columns: 1fr; } .login .art { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .crumb span.full, .user-btn .nm { display: none; }
  .gsearch { width: auto; flex: 1; }
  .content { padding: 16px 12px 40px; }
  .page-head h1 { font-size: 25px; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
  .g5.kpis, .g4.kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 14px; gap: 10px; flex-direction: column; }
  .kpi .ic { width: 40px; height: 40px; } .kpi .ic svg { width: 20px; height: 20px; }
  .kpi .val { font-size: 21px; }
  .form { grid-template-columns: 1fr; }
  .search-box .input { width: 100%; }
  .search-box { flex: 1; }
  .card { padding: 14px; }
  .kv { grid-template-columns: 110px 1fr; }
  .modal .mb { padding: 14px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 14px 14px 0 0; }
  .demo-accts { grid-template-columns: 1fr; }
}
