:root {
  --navy: #1d1150;
  --navy-2: #2b1a74;
  --navy-3: #5b4cf0;
  --orange: #6d3cf5;
  --orange-2: #8b5cf6;
  --orange-soft: #f1ecff;
  --bg: #f6f5fc;
  --card: #ffffff;
  --line: #e9e7f5;
  --line-2: #f1eff9;
  --text: #1b1838;
  --muted: #706c8f;
  --green: #16a34a; --green-soft: #e8f7ee;
  --red: #dc2626; --red-soft: #fdecec;
  --amber: #d97706; --amber-soft: #fef5e6;
  --blue: #2563eb; --blue-soft: #eaf1ff;
  --violet: #7c3aed; --violet-soft: #f2ecff;
  --gray-soft: #eff1f6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60, 40, 160, .04), 0 8px 24px rgba(60, 40, 160, .06);
  --grad: linear-gradient(135deg, #7c3aed 0%, #5b4cf0 60%, #4f46e5 100%);
  --grad-dark: linear-gradient(120deg, #170a4d 0%, #2d1890 50%, #5b2be0 100%);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); } .neg { color: var(--red); }
.hidden { display: none !important; }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(circle at 20% 20%, rgba(255,106,19,.35), transparent 45%), radial-gradient(circle at 80% 70%, rgba(37,99,235,.3), transparent 50%), var(--navy); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 40px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -.02em; }
.login-art p { color: #c6cde0; max-width: 420px; line-height: 1.6; }
.login-art .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.login-art .chips span { border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: #e3e8f5; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { margin: 0 0 6px; font-size: 24px; }
.login-form .field { margin-top: 16px; }
.login-form .btn { width: 100%; justify-content: center; margin-top: 22px; height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--orange); display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; }
.brand small { display: block; font-weight: 500; letter-spacing: 0; font-size: 11px; opacity: .7; }

/* ---------- Bố cục ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d1e6; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { color: #fff; padding: 20px 20px 14px; }
.side nav { padding: 4px 12px 20px; flex: 1; }
.side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7d89ab; margin: 18px 10px 6px; }
.side a.item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #c9d1e6; margin: 1px 0; font-size: 13.5px; }
.side a.item:hover { background: var(--navy-2); color: #fff; }
.side a.item.active { background: linear-gradient(90deg, rgba(255,106,19,.22), rgba(255,106,19,.06)); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.side a.item.active svg { color: var(--orange-2); }
.side .badge-n { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.side-foot { padding: 14px 20px; font-size: 12px; color: #7d89ab; border-top: 1px solid rgba(255,255,255,.06); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(244,246,251,.88); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); }
.top .search { position: relative; flex: 1; max-width: 460px; }
.top .search input { width: 100%; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 0 12px 0 36px; outline: none; }
.top .search input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(109,60,245,.14); }
.top .search svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search-res { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 380px; overflow: auto; z-index: 30; }
.search-res a { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.search-res a:hover { background: var(--bg); }
.top .sp { flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; position: relative; }
.icon-btn:hover { border-color: #cfd5e4; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
.me { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 10px; }
.me:hover { background: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-3); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.me b { display: block; font-size: 13px; } .me small { color: var(--muted); font-size: 12px; }
.dropdown { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(13,27,62,.14); z-index: 50; min-width: 220px; padding: 6px; }
.dropdown a, .dropdown button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; background: none; border: 0; text-align: left; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }
.notif { width: 360px; max-height: 440px; overflow: auto; }
.notif .n { padding: 10px; border-radius: 8px; display: flex; gap: 10px; cursor: pointer; font-size: 13px; line-height: 1.45; }
.notif .n:hover { background: var(--bg); }
.notif .n i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--blue); }
.notif .n.danger i { background: var(--red); } .notif .n.warn i { background: var(--amber); }
.content { padding: 24px 28px 48px; min-width: 0; }
.menu-btn { display: none; }

/* ---------- Thành phần ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.page-head .count { color: var(--muted); font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.btn:hover { border-color: #c9d0e2; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: #f25e08; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 15px; }
.card-h .r { margin-left: auto; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: 2fr 1fr; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .lbl .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); }
.kpi .val { font-size: 24px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpi.dark .lbl, .kpi.dark .sub { color: #aab4cf; }
.kpi.dark .lbl .ic { background: rgba(255,106,19,.18); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 10px; outline: none; min-width: 140px; }
.filters input[type=search] { min-width: 240px; }
.filters input:focus, .filters select:focus { border-color: var(--orange); }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 11px 12px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; position: sticky; top: 0; cursor: default; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #fafbff; }
.tbl tfoot td { font-weight: 700; background: #fafbfd; padding: 11px 12px; }
.tbl td.act { text-align: right; white-space: nowrap; width: 1%; }
.tbl .strong { font-weight: 600; }
.tbl.compact td, .tbl.compact th { padding: 8px 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: #c3c9d9; margin-bottom: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--muted); font-size: 13px; }
.pager .btns { display: flex; gap: 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: #4b5675; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--gray-soft); font-size: 12px; color: #4b5675; }
.progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-2)); border-radius: 99px; }
.pbar { display: flex; align-items: center; gap: 8px; } .pbar span { font-size: 12px; color: var(--muted); width: 34px; }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol { flex: 0 0 280px; background: #eceff6; border-radius: 12px; padding: 10px; min-height: 120px; }
.kcol.over { background: var(--orange-soft); outline: 2px dashed var(--orange); }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-weight: 700; font-size: 13px; }
.kcol-h .n { color: var(--muted); font-weight: 500; }
.kcol-h .s { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(13,27,62,.04); }
.kcard:hover { border-color: #cfd5e4; }
.kcard.dragging { opacity: .5; }
.kcard b { display: block; font-size: 13.5px; margin-bottom: 6px; }
.kcard .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); gap: 6px; }

/* Lịch */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dh { padding: 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfd; }
.cal .d { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; background: #fff; }
.cal .d.out { background: #fafbfd; color: #b5bccd; }
.cal .d.today .dn { background: var(--orange); color: #fff; }
.cal .dn { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.cal .ev { font-size: 11.5px; padding: 3px 6px; border-radius: 5px; margin-bottom: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--blue-soft); color: var(--blue); }
.cal .ev.green { background: var(--green-soft); color: var(--green); } .cal .ev.amber { background: var(--amber-soft); color: var(--amber); } .cal .ev.red { background: var(--red-soft); color: var(--red); } .cal .ev.violet { background: var(--violet-soft); color: var(--violet); }
.cal-att .d { min-height: 78px; }
.cal-att .att { font-size: 11.5px; line-height: 1.5; }

/* Modal & form */
.overlay { position: fixed; inset: 0; background: rgba(13, 27, 62, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 720px; box-shadow: 0 24px 80px rgba(13,27,62,.3); animation: pop .18s ease-out; }
.modal.lg { max-width: 980px; } .modal.sm { max-width: 460px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 20px 22px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fafbfd; border-radius: 0 0 16px 16px; }
.modal-f .l { margin-right: auto; display: flex; gap: 8px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: #3d4763; }
.field label .req { color: var(--red); }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; outline: none; background: #fff; width: 100%; }
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(109,60,245,.14); }
.field input[readonly] { background: #f7f8fb; color: var(--muted); }
.field .check { display: flex; align-items: center; gap: 8px; height: 40px; }
.field .check input { width: 18px; height: 18px; accent-color: var(--orange); }
.items-ed { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.items-ed table { width: 100%; border-collapse: collapse; }
.items-ed th { font-size: 12px; color: var(--muted); text-align: left; padding: 8px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.items-ed td { padding: 6px; border-bottom: 1px solid var(--line-2); }
.items-ed input, .items-ed select { height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; width: 100%; outline: none; }
.items-ed input:focus, .items-ed select:focus { border-color: var(--orange); }
.items-ed .foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: #fafbfd; }
.totals { margin-left: auto; width: 300px; font-size: 13.5px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-weight: 800; font-size: 16px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; color: var(--orange); }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 380px; animation: pop .2s; font-size: 13.5px; }
.toast.err { background: var(--red); }
.toast.ok { background: #0f7a3a; }

/* Chi tiết */
.detail-head { display: flex; gap: 16px; align-items: center; }
.detail-head .avatar { width: 56px; height: 56px; font-size: 20px; background: var(--orange); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--orange); border-bottom-color: var(--orange); }
.timeline .t { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.timeline .t:last-child { border-bottom: 0; }
.timeline .t .when { font-size: 12px; color: var(--muted); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain li .r { margin-left: auto; text-align: right; }

.clock-card { display: flex; align-items: center; gap: 24px; padding: 22px; background: linear-gradient(135deg, var(--navy), var(--navy-3)); color: #fff; border-radius: var(--radius); }
.clock-card .time { font-size: 42px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock-card .muted { color: #aab4cf; }
.clock-card .btn { height: 46px; padding: 0 22px; font-size: 15px; }
.clock-card .stat { display: flex; gap: 22px; margin-left: auto; }
.clock-card .stat div b { display: block; font-size: 20px; }
.clock-card .stat div span { font-size: 12px; color: #aab4cf; }

.chart-box { position: relative; height: 280px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g21 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 90; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(13,27,62,.4); }
  .menu-btn { display: grid; }
  .top { padding: 10px 14px; }
  .content { padding: 16px 14px 40px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .me b, .me small { display: none; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .clock-card { flex-wrap: wrap; } .clock-card .stat { margin-left: 0; }
  .filters input[type=search] { min-width: 0; flex: 1; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi .val { font-size: 19px; } }

/* In ấn */
.print-only { display: none; }
@media print {
  body { background: #fff; }
}
.filters input[type=checkbox] { min-width: 0; width: 16px; height: 16px; }
.tbl td.pname { min-width: 240px; }
.tbl td.wide { min-width: 220px; }
.tbl th.num { text-align: right; }

/* =================== Giao diện tím (Galaxy style) =================== */
.brand-mark { background: var(--grad); box-shadow: 0 6px 16px rgba(109,60,245,.35); border-radius: 10px; }
.btn { border-radius: 10px; }
.btn.primary { background: var(--grad); border-color: transparent; box-shadow: 0 6px 16px rgba(109,60,245,.28); }
.btn.primary:hover { filter: brightness(1.06); background: var(--grad); }
.btn.navy { background: var(--navy); }
.card { border-color: #eeecf8; }
.tbl th { background: #faf9ff; }
.tbl tbody tr:hover td { background: #faf8ff; }
.seg button.on { background: var(--grad); }
.progress i { background: var(--grad); }
.kcol { background: #f0eefb; }
.avatar { background: var(--grad); }

/* Sidebar trắng */
.app { grid-template-columns: 264px 1fr; }
.side { background: transparent; color: var(--text); padding: 14px 0 14px 14px; height: 100vh; }
.side-inner { background: #fff; border: 1px solid #eeecf8; border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 100%; }
.side .brand { color: var(--text); padding: 18px 18px 8px; }
.side .brand small { color: var(--muted); opacity: 1; }
.side nav { padding: 4px 10px 8px; }
.side .grp { color: #a19dbd; font-weight: 600; margin: 16px 10px 6px; }
.side a.item { color: #3b3760; font-weight: 500; padding: 8px 10px; border-radius: 10px; }
.side a.item svg { color: #7c6cf0; }
.side a.item:hover { background: #f4f1ff; color: var(--text); }
.side a.item.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(109,60,245,.3); }
.side a.item.active svg { color: #fff; }
.side .new-tag { margin-left: auto; background: #fff; color: #6d3cf5; font-size: 10px; font-weight: 800; border-radius: 99px; padding: 1px 7px; }
.side a.item:not(.active) .new-tag { background: #f1ecff; }
.side-foot { border-top: 1px solid var(--line-2); color: var(--muted); padding: 12px 18px; }
.quick { margin: 10px; padding: 8px 6px; border-top: 1px solid var(--line-2); }
.quick .grp { margin-top: 8px; }
.quick button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 7px 10px; border: 0; background: none; cursor: pointer; border-radius: 10px; font-size: 13px; color: #3b3760; text-align: left; }
.quick button:hover { background: #f4f1ff; }
.quick .qi { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.quick .qi svg { width: 15px; height: 15px; }
.promo { margin: 10px; border-radius: 16px; padding: 18px 16px; color: #fff; background: radial-gradient(circle at 80% 10%, rgba(255,255,255,.18), transparent 40%), var(--grad); box-shadow: 0 10px 26px rgba(109,60,245,.35); position: relative; overflow: hidden; }
.promo h4 { margin: 0 0 4px; font-size: 15px; }
.promo p { margin: 0 0 12px; font-size: 12.5px; color: #e4dcff; line-height: 1.5; }
.promo .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.promo .btn { width: 100%; justify-content: center; background: #fff; color: #5b2be0; border: 0; }
.promo .glow { position: absolute; right: -20px; bottom: -20px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.12); }

/* Thanh trên */
.top { background: rgba(246,245,252,.85); border-bottom: 0; padding: 14px 28px 6px; }
.top .search input { height: 42px; border-radius: 12px; border-color: #ebe8f7; box-shadow: var(--shadow); }
.top .search svg { top: 12px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border-color: #ebe8f7; box-shadow: var(--shadow); }
.content { padding: 14px 28px 48px; }

/* Màu icon theo thứ tự */
.c-violet { background: #f1ecff; color: #6d3cf5; } .c-blue { background: #e8f0ff; color: #2563eb; } .c-green { background: #e6f8ee; color: #16a34a; }
.c-pink { background: #fde8f1; color: #db2777; } .c-orange { background: #fff1e5; color: #ea6a0c; } .c-cyan { background: #e2f7fb; color: #0891b2; } .c-red { background: #fdecec; color: #dc2626; }
.kpi .lbl .ic { background: #f1ecff; color: #6d3cf5; border-radius: 10px; }
.grid > .kpi:nth-child(5n+2) .lbl .ic { background: #e8f0ff; color: #2563eb; }
.grid > .kpi:nth-child(5n+3) .lbl .ic { background: #e6f8ee; color: #16a34a; }
.grid > .kpi:nth-child(5n+4) .lbl .ic { background: #fde8f1; color: #db2777; }
.grid > .kpi:nth-child(5n+5) .lbl .ic { background: #fff1e5; color: #ea6a0c; }
.kpi.dark { background: var(--grad-dark); border: 0; box-shadow: 0 10px 26px rgba(45,24,144,.3); }
.kpi.dark .lbl .ic { background: rgba(255,255,255,.14) !important; color: #fff !important; }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 30px 32px 0; color: #fff; background: radial-gradient(circle at 62% 30%, rgba(167,139,250,.55), transparent 32%), radial-gradient(circle at 10% 110%, rgba(99,102,241,.5), transparent 40%), var(--grad-dark); box-shadow: 0 16px 40px rgba(45,24,144,.28); }
.hero-row { display: grid; grid-template-columns: 1.3fr .9fr; gap: 24px; align-items: start; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 6px 0 10px; letter-spacing: -.02em; }
.hero h1 span { background: linear-gradient(90deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #d9d2ff; margin: 0 0 18px; max-width: 460px; line-height: 1.6; }
.hero .eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); padding: 4px 10px; border-radius: 99px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .cta .btn.primary { background: linear-gradient(135deg, #8b5cf6, #6d3cf5); }
.hero .cta .btn.light { background: #fff; color: #4c1fd6; border: 0; }
.hero-art { position: absolute; left: 47%; top: 18px; width: 210px; height: 210px; opacity: .95; pointer-events: none; }
.hero-panel { position: relative; z-index: 1; background: #fff; color: var(--text); border-radius: 16px; padding: 8px 16px; box-shadow: 0 12px 30px rgba(20,10,80,.25); }
.hero-panel .row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.hero-panel .row:last-child { border-bottom: 0; }
.hero-panel .row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.hero-panel .row b { font-size: 13px; display: block; } .hero-panel .row small { color: var(--muted); font-size: 11.5px; }
.hero-panel .row .v { margin-left: auto; text-align: right; font-weight: 700; font-size: 13px; }
.ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; font-size: 11px; font-weight: 800; color: #16a34a; }
.hero-stats { position: relative; z-index: 1; margin: 22px -14px 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: rgba(255,255,255,.95); border-radius: 16px; padding: 12px 16px; color: var(--text); }
.hero-stats > div { display: flex; gap: 10px; align-items: center; padding: 4px 8px; border-right: 1px solid var(--line-2); min-width: 0; }
.hero-stats > div:last-child { border-right: 0; }
.hero-stats .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.hero-stats small { color: var(--muted); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stats b { font-size: 15.5px; white-space: nowrap; }

/* Thẻ tính năng */
.feat { border-radius: 18px; padding: 18px; position: relative; overflow: hidden; min-height: 132px; border: 1px solid transparent; display: block; transition: transform .15s, box-shadow .15s; }
.feat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feat h4 { margin: 0 0 6px; font-size: 14.5px; }
.feat p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); max-width: 62%; line-height: 1.5; }
.feat .go { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 700; }
.feat .art { position: absolute; right: 14px; bottom: 14px; width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; transform: rotate(-8deg); }
.feat .art svg { width: 38px; height: 38px; stroke-width: 1.6; color: #fff; }
.feat.f1 { background: linear-gradient(135deg, #f5f0ff, #ece4ff); } .feat.f1 h4 { color: #5b2be0; } .feat.f1 .go, .feat.f1 .art { background: linear-gradient(135deg,#8b5cf6,#6d3cf5); }
.feat.f2 { background: linear-gradient(135deg, #eef4ff, #e1ebff); } .feat.f2 h4 { color: #1d4ed8; } .feat.f2 .go, .feat.f2 .art { background: linear-gradient(135deg,#60a5fa,#2563eb); }
.feat.f3 { background: linear-gradient(135deg, #fff3ec, #ffe6d6); } .feat.f3 h4 { color: #c2410c; } .feat.f3 .go, .feat.f3 .art { background: linear-gradient(135deg,#fb923c,#ea580c); }
.feat.f4 { background: linear-gradient(135deg, #ecfbf6, #dcf6ec); } .feat.f4 h4 { color: #047857; } .feat.f4 .go, .feat.f4 .art { background: linear-gradient(135deg,#34d399,#059669); }
.feat .art { box-shadow: 0 12px 24px rgba(0,0,0,.12); }

/* Thẻ phân tích có sparkline */
.spark-card { padding: 14px 16px 6px; border: 1px solid #eeecf8; border-radius: 14px; background: #fff; }
.spark-card .t { font-size: 12.5px; color: var(--muted); }
.spark-card .v { font-size: 20px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.spark-card .d { font-size: 11.5px; color: var(--muted); }
.spark-card canvas { width: 100% !important; height: 58px !important; margin-top: 6px; }

/* Lưới công cụ */
.tools { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.tools a, .tools button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; border-radius: 12px; font-size: 12px; text-align: center; color: #3b3760; background: none; border: 0; cursor: pointer; line-height: 1.3; }
.tools a:hover, .tools button:hover { background: #f6f3ff; }
.tools .ti { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; }
.tools .ti svg { width: 22px; height: 22px; }

/* Danh sách có icon màu */
.ilist { list-style: none; margin: 0; padding: 0; }
.ilist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.ilist li:last-child { border-bottom: 0; }
.ilist .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.ilist b { font-size: 13px; display: block; } .ilist small { color: var(--muted); font-size: 12px; }
.ilist .r { margin-left: auto; text-align: right; font-size: 12px; white-space: nowrap; }
.ilist a.row-link { display: contents; }
.view-all { margin-left: auto; color: #6d3cf5; font-size: 12.5px; font-weight: 600; }
.card-h h3 { font-size: 15px; }

/* Banner AI/tạo nhanh */
.create-band { border-radius: 20px; padding: 20px 22px; background: linear-gradient(120deg, #f3efff, #ece8ff 50%, #e8f0ff); border: 1px solid #e6e0ff; display: grid; grid-template-columns: 1.1fr 3fr; gap: 18px; align-items: center; }
.create-band h3 { margin: 0 0 6px; font-size: 17px; }
.create-band p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.create-band .items { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.create-band .items a { background: #fff; border-radius: 16px; padding: 16px 8px 12px; text-align: center; box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; transition: transform .15s; }
.create-band .items a:hover { transform: translateY(-2px); }
.create-band .items .big { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 10px; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.create-band .items .big svg { width: 26px; height: 26px; }

/* Đăng nhập tím */
.login-art { background: radial-gradient(circle at 70% 30%, rgba(167,139,250,.55), transparent 35%), radial-gradient(circle at 15% 85%, rgba(99,102,241,.5), transparent 40%), var(--grad-dark); }
.login-art p { color: #d9d2ff; }
.clock-card { background: var(--grad-dark); border-radius: 20px; }
.tabs button.on { color: #6d3cf5; border-bottom-color: #6d3cf5; }
.toast { background: #2b1a74; }
.badge-hot { background: var(--grad); color: #fff; }

@media (max-width: 1200px) { .sparks { grid-template-columns: repeat(3, minmax(0,1fr)) !important; } .hero-row { grid-template-columns: 1fr; } .hero-art { display: none; } .hero-stats { grid-template-columns: repeat(3, 1fr); } .create-band { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { padding: 0; background: #fff; position: fixed; width: 272px; height: 100vh; overflow-y: auto; } .side-inner { border-radius: 0; border: 0; box-shadow: none; }
  .sparks { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .feat p { max-width: 70%; }
  .top { padding: 10px 14px 6px; }
  .hero { padding: 22px 18px 0; } .hero h1 { font-size: 23px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); margin: 18px -6px 10px; } .hero-stats > div { border-right: 0; }
  .tools { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .create-band .items { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 560px) { .feat .art { width: 50px; height: 50px; border-radius: 15px; right: 10px; bottom: 10px; } .feat .art svg { width: 24px; height: 24px; } .feat p { max-width: 100%; margin-bottom: 44px; } .feat { min-height: 150px; } }
