/* =========================================================
   Mct License - hệ giao diện
   ========================================================= */
:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border: #e5e8ef;
    --border-strong: #d4d9e3;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-ring: rgba(79, 70, 229, .18);

    --green: #059669;   --green-soft: #ecfdf5;
    --amber: #d97706;   --amber-soft: #fffbeb;
    --red: #dc2626;     --red-soft: #fef2f2;
    --violet: #7c3aed;  --violet-soft: #f5f3ff;
    --sky: #0284c7;     --sky-soft: #f0f9ff;
    --slate: #475569;   --slate-soft: #f1f5f9;

    --sidebar: #0f172a;
    --sidebar-2: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 10px 30px -10px rgba(15, 23, 42, .18);
    --sidebar-w: 252px;
    --topbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1020;
        --surface: #131a2c;
        --surface-2: #172036;
        --surface-3: #1c2640;
        --border: #232d45;
        --border-strong: #2e3a57;
        --text: #e8ecf5;
        --text-2: #c3cad9;
        --muted: #8b95ab;
        --faint: #5f6b85;
        --primary: #818cf8;
        --primary-hover: #a5b4fc;
        --primary-soft: #1f2450;
        --primary-ring: rgba(129, 140, 248, .25);
        --green: #34d399;  --green-soft: #0f2a24;
        --amber: #fbbf24;  --amber-soft: #2d2412;
        --red: #f87171;    --red-soft: #2d1719;
        --violet: #a78bfa; --violet-soft: #231a3d;
        --sky: #38bdf8;    --sky-soft: #0f2536;
        --slate: #a3adc2;  --slate-soft: #1c2640;
        --sidebar: #080c18;
        --sidebar-2: #131a2c;
        --shadow-sm: none;
        --shadow: none;
        --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, .6);
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }

code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: .92em; }
pre { white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.strong { font-weight: 600; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- icon ---------- */
.i { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: -4px; }
.i-sm { width: 15px; height: 15px; vertical-align: -3px; }
.i-lg { width: 22px; height: 22px; }

/* ô icon căn giữa, tô màu theo tông */
.ico-box {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--primary);
}
.ico-box.sm { width: 32px; height: 32px; border-radius: 8px; }
.ico-box.sm .i { width: 16px; height: 16px; }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-red { background: var(--red-soft); color: var(--red); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-sky { background: var(--sky-soft); color: var(--sky); }
.tone-slate { background: var(--slate-soft); color: var(--slate); }

/* icon gói (emoji theo bảng giá) trong ô tròn căn giữa */
.plan-ico {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--surface-3);
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}
.plan-ico.lg { width: 40px; height: 40px; font-size: 20px; }
.plan-name { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500; }

/* =========================================================
   Khung trang
   ========================================================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

.brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.logo {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 4px 14px -4px rgba(99, 102, 241, .7);
}
.logo .i { width: 18px; height: 18px; }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--sidebar-text); }

.nav { flex: 1; overflow-y: auto; padding: 16px 12px; }

.nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    padding: 14px 12px 8px;
}
.nav-label:first-child { padding-top: 0; }

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-weight: 500;
    position: relative;
    transition: background .15s, color .15s;
}
.nav a .nav-ico { width: 20px; height: 20px; display: grid; place-items: center; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.nav a.active { background: rgba(99, 102, 241, .16); color: var(--sidebar-active); }
.nav a.active::before {
    content: "";
    position: absolute;
    left: -12px; top: 9px; bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #818cf8;
}
.nav a.active .nav-ico { color: #a5b4fc; }

.side-user {
    margin: 12px;
    padding: 12px;
    border-radius: 10px;
    background: var(--sidebar-2);
    display: flex;
    align-items: center;
    gap: 10px;
}
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; color: #e2e8f0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 12px; }
.side-user .icon-btn { color: var(--sidebar-text); }
.side-user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    flex-shrink: 0;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.top-search { position: relative; width: 340px; max-width: 100%; }
.top-search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.top-search input[type=search] { padding-left: 36px; background: var(--surface-2); }
.spacer { flex: 1; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 500;
    white-space: nowrap;
}
.pill b { font-weight: 700; }

.topbar .menu-btn { display: none; }

.content { padding: 28px; width: 100%; max-width: 1360px; margin: 0 auto; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }

/* =========================================================
   Thẻ
   ========================================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    min-height: 60px;
}
.card-head .title { display: flex; align-items: center; gap: 12px; }
.card-head .desc { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.card-body { padding: 20px; }
.card-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.grid { display: grid; gap: 20px; }
.grid > *, .stack > * { min-width: 0; } /* cho phép cột co lại - bảng rộng tự cuộn trong thẻ */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.side-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.sticky-card { position: sticky; top: calc(var(--topbar-h) + 20px); }

/* thẻ số liệu */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* danh sách nhãn - giá trị */
dl.info { display: grid; grid-template-columns: 150px minmax(0, 1fr); margin: 0; }
dl.info dt, dl.info dd { padding: 11px 0; border-bottom: 1px dashed var(--border); margin: 0; }
dl.info dt { color: var(--muted); display: flex; align-items: center; gap: 8px; }
dl.info dd { font-weight: 500; overflow-wrap: anywhere; }
dl.info dt:nth-last-child(2), dl.info dd:last-child { border-bottom: 0; }

/* =========================================================
   Bảng
   ========================================================= */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    background: var(--surface-2);
    white-space: nowrap;
}
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sub { color: var(--muted); font-size: 12.5px; }
.table.compact td, .table.compact th { padding-top: 9px; padding-bottom: 9px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .ico-box { margin-bottom: 10px; }
.empty-state b { display: block; color: var(--text-2); margin-bottom: 2px; }

.cell-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.table-wrap .table { min-width: 620px; } /* hẹp thì cuộn ngang trong thẻ, không bóp chữ */
.table-wrap .table.compact { min-width: 0; }
.cell-user .avatar { width: 30px; height: 30px; font-size: 12px; }

/* key */
.key {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .02em;
    white-space: nowrap;
    color: var(--text);
}
a.key:hover { color: var(--primary); }
.key-cell { display: inline-flex; align-items: center; gap: 4px; }

.amount-pos { color: var(--green); font-weight: 600; }
.amount-neg { color: var(--red); font-weight: 600; }

/* =========================================================
   Badge
   ========================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-orange, .badge-yellow { background: var(--amber-soft); color: var(--amber); }
.badge-gray { background: var(--slate-soft); color: var(--slate); }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }

/* =========================================================
   Form
   ========================================================= */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field .hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; font-weight: 400; }
.req { color: var(--red); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 78px; padding: 9px 12px; resize: vertical; }
select { padding-right: 30px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }

.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon input[type], .input-icon select { padding-left: 36px; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-suffix input[type] { padding-right: 44px; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text-2); cursor: pointer; margin: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.toolbar .input-icon { flex: 1 1 280px; max-width: 360px; }
.toolbar select { width: auto; min-width: 150px; max-width: 100%; }

/* =========================================================
   Nút
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    font: inherit;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background .15s, border-color .15s, color .15s;
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--faint); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.icon-btn {
    width: 32px; height: 32px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
}
.icon-btn .i { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.copied { color: var(--green); }

.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { color: var(--primary-hover); }

.tabs-head { min-height: 0; padding-top: 10px; padding-bottom: 10px; overflow-x: auto; }
.tabs { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-3); border-radius: 9px; }
.tabs a { padding: 6px 14px; border-radius: 7px; color: var(--muted); font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* =========================================================
   Thông báo, phân trang
   ========================================================= */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-weight: 500;
}
.alert .i { margin-top: 1px; }
.alert-ok { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-err { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-info { background: var(--sky-soft); color: var(--sky); border-color: color-mix(in srgb, var(--sky) 25%, transparent); }

.pager { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); }

/* =========================================================
   Tạo key
   ========================================================= */
.step { display: flex; align-items: center; gap: 12px; }
.step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.plan-opt { margin: 0; font-weight: 400; color: inherit; position: relative; }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.plan-card:hover { border-color: var(--border-strong); }
.plan-card .top { display: flex; align-items: center; gap: 10px; }
.plan-card .top b { font-size: 15px; }
.plan-card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); }
.plan-card .price { font-weight: 700; color: var(--text); font-size: 13px; }
.plan-card .tick { margin-left: auto; color: var(--primary); opacity: 0; transition: opacity .15s; }
.plan-opt input:checked + .plan-card { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.plan-opt input:checked + .plan-card .tick { opacity: 1; }
.plan-opt input:focus-visible + .plan-card { box-shadow: 0 0 0 3px var(--primary-ring); }

.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-3); border-radius: 9px; }
.seg label { margin: 0; font-weight: 600; color: var(--muted); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 18px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.summary-row:last-child { border-bottom: 0; }
.summary-row span:first-child { color: var(--muted); }
.summary-row span:last-child { font-weight: 600; text-align: right; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--border); }
.summary-total .big { font-size: 26px; font-weight: 750; color: var(--primary); letter-spacing: -.02em; }

/* =========================================================
   Chi tiết key
   ========================================================= */
.key-hero { padding: 22px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.key-hero .ico-box { width: 52px; height: 52px; border-radius: 14px; }
.key-hero .ico-box .i { width: 24px; height: 24px; }
.key-hero .main-info { flex: 1; min-width: 240px; }
.key-hero .big-key { font-family: "Cascadia Mono", Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .04em; overflow-wrap: anywhere; }
.key-hero .who { color: var(--muted); margin-top: 2px; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.fact { padding: 16px 24px; display: flex; gap: 12px; align-items: center; border-right: 1px solid var(--border); min-width: 0; }
.fact:last-child { border-right: 0; }
.fact .label { color: var(--muted); font-size: 12.5px; }
.fact .value { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; border-radius: 99px; background: var(--primary); }

.option-tile {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.option-tile .price { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 42px; bottom: -2px; width: 1px; background: var(--border); }
.timeline .what { font-weight: 600; }
.timeline .detail { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.timeline .when { color: var(--muted); font-size: 12px; }

.danger-zone { border-color: color-mix(in srgb, var(--red) 30%, var(--border)); }
.danger-zone .card-head { border-bottom-color: color-mix(in srgb, var(--red) 20%, var(--border)); }

/* =========================================================
   Đăng nhập
   ========================================================= */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.login-art {
    background: radial-gradient(1200px 500px at -10% -20%, #6366f1 0%, transparent 60%), radial-gradient(900px 500px at 120% 120%, #a855f7 0%, transparent 55%), #0f172a;
    color: #e2e8f0;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
}
.login-art .brand { padding: 0; border: 0; height: auto; }
.login-art h2 { color: #fff; font-size: 30px; line-height: 1.25; max-width: 440px; margin-bottom: 14px; }
.login-art p { color: #cbd5e1; max-width: 420px; }
.login-feats { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.login-feats li { display: flex; align-items: center; gap: 12px; }
.login-feats .ico-box { background: rgba(255, 255, 255, .08); color: #c7d2fe; width: 36px; height: 36px; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-form form { width: 100%; max-width: 380px; }
.login-form h1 { font-size: 26px; margin-bottom: 6px; }

/* =========================================================
   Màn hình nhỏ
   ========================================================= */
.backdrop { display: none; }

@media (max-width: 1280px) {
    .side-grid.lg-stack { grid-template-columns: 1fr; }
    .side-grid.lg-stack .sticky-card { position: static; }
}

@media (max-width: 1100px) {
    .grid-main, .side-grid { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fact:nth-child(2) { border-right: 0; }
    .fact:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: calc(-1 * var(--sidebar-w)); transition: left .2s; }
    .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
    .sidebar.open ~ .backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 25; }
    .topbar .menu-btn { display: inline-grid; }
    .content { padding: 16px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .top-search { display: none; }
    .top-create span, .pill .pill-label { display: none; }
    .top-create { padding: 0 11px; }
    .page-head { margin-bottom: 16px; }
    .stats { gap: 12px; }
    .table-wrap .table:not(.compact) { min-width: 680px; }
    .toolbar .input-icon { max-width: none; }
    dl.info { grid-template-columns: 120px minmax(0, 1fr); }
    .login { grid-template-columns: 1fr; }
    .login-art { display: none; }
}

@media (max-width: 520px) {
    .facts { grid-template-columns: 1fr; }
    .fact { border-right: 0; border-bottom: 1px solid var(--border); }
    .fact:last-child { border-bottom: 0; }
    .key-hero .big-key { font-size: 17px; }
}
