/* =========================================================
   InvestBoard — giao diện báo cáo nhà đầu tư
   ========================================================= */
:root {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #14171c;
  --ink-2: #3b404b;
  --muted: #747985;
  --line: #e6e1d7;
  --line-2: #efebe3;

  --side: #0f1318;
  --side-2: #1a1f27;
  --side-ink: #c6ccd6;
  --side-muted: #6f7787;

  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #dff2ee;

  --live: #059669;
  --step1: #4f46e5;
  --pending: #d97706;
  --withdraw: #0284c7;
  --dead: #dc2626;
  --fund: #0f172a;
  --share: #7c3aed;
  --kycteam: #db2777;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 19, 24, .04), 0 10px 30px -18px rgba(15, 19, 24, .18);
  --shadow-lg: 0 2px 4px rgba(15, 19, 24, .05), 0 24px 50px -24px rgba(15, 19, 24, .28);
  --font: "Be Vietnam Pro", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
p { margin: 4px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 20px; }
.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 28px 36px 56px; width: 100%; max-width: 1480px; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 268px; flex: none;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(20, 184, 166, .10), transparent 60%),
    var(--side);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 22px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 18px; color: #fff; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #2dd4bf, #0f766e 70%);
  box-shadow: 0 6px 18px -6px rgba(20, 184, 166, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 18px; }
.side-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--side-muted); padding: 18px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0; border-radius: 10px;
  color: var(--side-ink); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 3px 0 0 var(--accent-2); }
.nav-folder .folder-dot { color: var(--c); display: grid; }
.nav-folder .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-folder.is-active { box-shadow: inset 3px 0 0 var(--c); }
.nav-empty { padding: 6px 12px; color: var(--side-muted); }
.side-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 14px; }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; }
.me:hover, .me.is-active { background: var(--side-2); }
.me-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.me-text strong { color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--side-muted); font-size: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(140deg, #334155, #1e293b);
  border: 1px solid rgba(255, 255, 255, .08);
}
.avatar.light { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.avatar.xl { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; background: linear-gradient(140deg, #2dd4bf, #0f766e); }
.scrim { display: none; }

/* folder management in sidebar */
.nav-label-row { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.nav-add, .nav-edit {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none;
  border: 0; background: transparent; color: var(--side-muted); cursor: pointer; transition: background .15s, color .15s, opacity .15s;
}
.nav-add .ic, .nav-edit .ic { width: 15px; height: 15px; }
.nav-add:hover, .nav-edit:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-folder-row { position: relative; display: flex; align-items: center; }
.nav-folder-row .nav-item { flex: 1; min-width: 0; padding-right: 36px; }
.nav-folder-row .nav-edit { position: absolute; right: 6px; opacity: 0; }
.nav-folder-row:hover .nav-edit, .nav-folder-row .nav-edit:focus-visible, .nav-folder-row.is-active .nav-edit { opacity: 1; }
@media (hover: none) { .nav-folder-row .nav-edit { opacity: 1; } }
.nav-new { width: 100%; border: 1px dashed rgba(255, 255, 255, .14); background: transparent; font: inherit; color: var(--side-muted); cursor: pointer; margin-top: 6px; text-align: left; }
.nav-new:hover { border-color: rgba(255, 255, 255, .3); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 62px; display: flex; align-items: center; gap: 12px;
  padding: 0 36px; border-bottom: 1px solid var(--line);
  background: rgba(244, 242, 237, .82); backdrop-filter: saturate(1.4) blur(10px);
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; min-width: 0; }
.crumbs .ic { width: 14px; height: 14px; }
.crumbs span { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar .menu-btn { display: none; }

.lang-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.lang-switch .ic { width: 15px; height: 15px; margin-right: 4px; }
.lang-switch a { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lang-switch a.on { background: var(--ink); color: #fff; }
.lang-switch a:not(.on):hover { color: var(--ink); }
.lang-switch.big { padding: 4px; }
.lang-switch.big a { padding: 8px 16px; font-size: 13.5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: transform .08s, background .15s, box-shadow .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 6px 16px -8px rgba(15, 19, 24, .6); }
.btn-primary:hover { background: #262b33; }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: #cdebe5; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #cfc8ba; }
.btn-danger { background: #fff5f5; border-color: #f5c2c2; color: #b42318; }
.btn-danger:hover { background: #fdecec; }
.btn-ok { background: #047857; color: #fff; }
.btn-ok:hover { background: #036649; }
.btn-block { width: 100%; height: 46px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { border-color: #cfc8ba; color: var(--ink); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--dead); border-color: #f5c2c2; background: #fff5f5; }
.icon-btn.ghost-dark { background: transparent; border-color: transparent; color: var(--side-muted); }
.icon-btn.ghost-dark:hover { background: var(--side-2); color: #fff; }

/* ---------- Page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-actions { display: flex; gap: 10px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .ic { width: 14px; height: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 14px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--ink); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.chip .ic { width: 15px; height: 15px; color: var(--muted); }
.chip.sm { padding: 3px 10px; font-size: 12px; }

/* ---------- Flash ---------- */
.flash {
  margin: 18px 36px 0; padding: 12px 16px; border-radius: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; transition: opacity .4s, transform .4s;
}
.flash.inline { margin: 0 0 16px; }
.flash-success { background: #e3f6ee; color: #05603f; border: 1px solid #bfe8d6; }
.flash-error { background: #fdecec; color: #a11b1b; border: 1px solid #f7c9c9; }
.flash.hide { opacity: 0; transform: translateY(-6px); }
.flash-warn { background: #fff6e0; color: #8a5300; border: 1px solid #f5d999; }
.dev-banner { text-decoration: none; font-weight: 600; }
.dev-banner span { flex: 1; }
.dev-banner:hover { background: #ffefc7; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f59e0b; color: #1f1300; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Thiết bị & bảo mật ---------- */
.dev-list { display: grid; gap: 10px; }
.dev-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line, #e5e7eb); border-radius: 14px; background: #fff; }
.dev-card.is-pending { border-color: #f5d999; background: #fffbf0; }
.dev-ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #eef2f7; color: #334155; }
.dev-card.is-pending .dev-ico { background: #fff1c9; color: #8a5300; }
.dev-main { flex: 1; min-width: 0; }
.dev-main strong { display: block; font-size: 14.5px; }
.dev-meta { color: #64748b; font-size: 12.5px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dev-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .08em; background: #0f172a; color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; }
.dev-actions { display: flex; gap: 8px; flex: none; }
.dev-actions form { margin: 0; }
.dev-empty { padding: 18px; text-align: center; color: #64748b; border: 1px dashed #cbd5e1; border-radius: 14px; }
.dev-section { margin-bottom: 26px; }
.dev-section h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.st-approved { background: #d9f5ea; color: #047857; }
.st-pending { background: #fff1c9; color: #8a5300; }
.st-rejected, .st-revoked { background: #fdecec; color: #a11b1b; }
.log-table td { font-size: 13px; }
.log-ev { font-weight: 600; }
.ev-bad { color: #a11b1b; }
.ev-good { color: #047857; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
@media (max-width: 600px) {
  .dev-card { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .dev-actions { width: 100%; }
  .dev-actions form, .dev-actions .btn { flex: 1; }
  .dev-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  --tone: var(--accent);
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px; box-shadow: var(--shadow);
}
.kpi::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: var(--tone); opacity: .06;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, white);
}
.kpi-icon .ic { width: 16px; height: 16px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 2px; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--live); }
.delta.down { color: var(--dead); }
.delta.flat { color: var(--muted); }

.tone-live { --tone: var(--live); }
.tone-step1 { --tone: var(--step1); }
.tone-pending { --tone: var(--pending); }
.tone-withdraw { --tone: var(--withdraw); }
.tone-dead { --tone: var(--dead); }
.tone-fund { --tone: var(--fund); }
.tone-share { --tone: var(--share); }
.tone-kycteam { --tone: var(--kycteam); }
.tone-accent { --tone: var(--accent); }
.tone-neutral { --tone: #64748b; }

/* ---------- Folder cards (dashboard) ---------- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.folder-card { position: relative; padding-top: 14px; }
.folder-tab {
  position: absolute; top: 0; left: 0; width: 46%; height: 20px;
  background: var(--c); border-radius: 12px 6px 0 0;
  clip-path: polygon(0 0, 82% 0, 100% 100%, 0 100%);
}
.folder-body {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--c);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 18px 18px 14px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.folder-card:hover .folder-body { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.folder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.folder-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.folder-title strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.folder-title small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, white);
}
.folder-icon .ic { width: 22px; height: 22px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }

.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 12px; }
.mini {
  --tone: var(--accent);
  padding: 9px 10px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.mini span { font-size: 11px; color: var(--muted); line-height: 1.25; min-height: 2.5em; }
.mini strong { font-size: 19px; font-weight: 800; color: var(--tone); font-variant-numeric: tabular-nums; }

.folder-money {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--side); color: #fff;
  background-image: radial-gradient(100% 140% at 100% 0%, color-mix(in srgb, var(--c) 45%, transparent), transparent 60%);
}
.folder-money .lbl { display: block; font-size: 11.5px; color: #9aa3b2; }
.folder-money .big { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.folder-money .right { text-align: right; }
.folder-money .pos { color: #5eead4; font-variant-numeric: tabular-nums; }

.folder-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.folder-links a {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line-2);
  transition: background .15s, border-color .15s, color .15s;
}
.folder-links a .ic { width: 15px; height: 15px; color: var(--c); }
.folder-links a:hover { background: color-mix(in srgb, var(--c) 7%, white); border-color: color-mix(in srgb, var(--c) 30%, white); color: var(--ink); }
.folder-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.status .ic { width: 14px; height: 14px; }
.status.ok { background: #e3f6ee; color: #05603f; }
.status.warn { background: #fff4e0; color: #9a5a00; }
.status.off { background: #f1f1f1; color: #6b6b6b; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 .ic { color: var(--muted); }
.card-body { padding: 16px 20px 18px; }
.chart-box { position: relative; height: 320px; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.chart-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.chart-row.with-pie { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); }

/* ---------- Folder page ---------- */
.folder-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.hero-main { display: flex; align-items: center; gap: 16px; }
.hero-icon {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 70%, white), var(--c));
  box-shadow: 0 12px 24px -12px var(--c);
}
.hero-icon .ic { width: 30px; height: 30px; }
.hero-main .eyebrow { margin-bottom: 2px; }
.hero-side { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-side form { margin: 0; }
.kpi-hint { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.kpi-hint .ic { width: 14px; height: 14px; color: var(--accent); }
.kpi-edit { cursor: pointer; border-radius: var(--radius); outline: none; }
.kpi-edit .kpi { transition: border-color .15s, transform .15s, box-shadow .15s; }
.kpi-edit:hover .kpi, .kpi-edit:focus-visible .kpi { border-color: color-mix(in srgb, var(--tone) 45%, white); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hint.hint-edit { background: #e6f4f1; color: #0b5d56; }

.subfolders { display: flex; gap: 4px; border-bottom: 2px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subfolder {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 12px 18px 12px 12px; min-width: max-content;
  border-radius: 14px 14px 0 0; color: var(--muted); border: 1px solid transparent; border-bottom: 0; margin-bottom: -2px;
  transition: background .15s, color .15s;
}
.subfolder:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.subfolder.is-active { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: inset 0 3px 0 var(--c); }
.subfolder.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--surface); }
.sf-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); color: var(--muted); }
.subfolder.is-active .sf-icon { background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); }
.sf-text strong { display: block; font-size: 14px; line-height: 1.25; }
.sf-text small { display: block; font-size: 12px; color: var(--muted); }

.pills { display: flex; gap: 8px; padding: 14px 0 0; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
}
.pill .ic { width: 15px; height: 15px; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.on.danger { background: var(--dead); border-color: var(--dead); }

.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 18px 0 18px; }
.range { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.range label { display: flex; flex-direction: column; gap: 4px; }
.range label span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.range input { height: 40px; padding: 0 10px; width: auto; background: var(--surface); }
.presets { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); align-self: flex-end; flex-wrap: wrap; }
.preset { padding: 7px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.preset:hover { color: var(--ink); background: var(--surface-2); }
.preset.on { background: var(--ink); color: #fff; }
.week-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 12px; }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-title { display: flex; flex-direction: column; align-items: center; min-width: 170px; padding: 4px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.week-title strong { font-size: 15px; }
.week-title span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.preset-link { font-size: 13px; font-weight: 600; color: var(--accent); padding: 8px 10px; border-radius: 10px; }
.preset-link:hover { background: var(--accent-soft); }
.week-pick label { display: flex; flex-direction: column; gap: 4px; }
.week-pick label span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.week-pick input { height: 40px; padding: 0 10px; background: var(--surface); width: auto; }
.auto-note { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: #0b5d56; font-size: 13px; }
.auto-note .ic { width: 16px; height: 16px; flex: none; }
.week-table td.wd { font-weight: 700; color: var(--ink-2); }
.week-table tr.is-weekend td.wd { color: var(--pending); }
.week-table tr.is-today td { background: #f0faf7; }
.week-table tr.is-today td.wd { box-shadow: inset 3px 0 0 var(--accent); }
.week-table tr.is-empty td { color: var(--muted); }
.table td.strong { font-weight: 700; }
.empty-cell { text-align: left; }
tr.row-link { cursor: pointer; }
tr.row-link td.date a { color: var(--ink); }
tr.row-link:hover td.date a { color: var(--accent); text-decoration: underline; }
tr.is-current td { background: #f0faf7; font-weight: 600; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 700; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #fbfaf6; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.date { font-weight: 700; font-variant-numeric: tabular-nums; }
.table td.pos { color: var(--live); font-weight: 600; }
.table td.neg { color: #be123c; }
.table td.wrap { white-space: normal; }
.table tfoot td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--line); border-bottom: 0; }
.table .actions-col { width: 1%; text-align: right; }
.note { display: inline-block; max-width: 280px; white-space: normal; color: var(--ink-2); }
.empty-row { text-align: center !important; color: var(--muted); padding: 40px 14px !important; }
.empty-row .ic { display: block; margin: 0 auto 8px; width: 28px; height: 28px; opacity: .5; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-live { background: #d9f5ea; color: #047857; }
.badge-step1 { background: #e5e7ff; color: #4338ca; }
.badge-admin { background: #ffe4e0; color: #b42318; }
.badge-reporter { background: #fff1d6; color: #9a5a00; }
.badge-viewer { background: #e7eef7; color: #335a85; }
.folder-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; margin: 2px 4px 2px 0; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: color-mix(in srgb, var(--c) 9%, white); border: 1px solid color-mix(in srgb, var(--c) 22%, white);
}
.folder-chip .ic { width: 14px; height: 14px; color: var(--c); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Forms ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=number] { font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 20px 22px; }
.form-grid.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field > span em { font-weight: 400; color: var(--muted); font-style: normal; }
.field.full, .full { grid-column: 1 / -1; }
.hint { display: flex; align-items: center; gap: 8px; margin: 0 22px; padding: 10px 12px; border-radius: 10px; background: #fff8ea; color: #8a5a00; font-size: 12.5px; }
.hint .ic { width: 15px; height: 15px; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.input-icon input { padding-left: 40px; height: 46px; }

.seg { display: flex; gap: 6px; }
.seg-opt { flex: 1; position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  display: block; text-align: center; padding: 9px 10px; border-radius: 10px; font-weight: 700; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); transition: all .15s;
}
.seg-opt.badge-live, .seg-opt.badge-step1 { background: none; padding: 0; border-radius: 0; }
.seg-opt.badge-live input:checked + span { background: #d9f5ea; color: #047857; border-color: #8fdcbc; }
.seg-opt.badge-step1 input:checked + span { background: #e5e7ff; color: #4338ca; border-color: #b4b9fb; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 9px; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); transition: transform .12s; }
.swatch input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); transform: scale(1.05); }

.role-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-opt { position: relative; cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; }
.role-opt-body {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); transition: all .15s;
}
.role-opt-body small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.role-opt input:checked + .role-opt-body { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 1px var(--ink); }
.badge-admin, .badge-reporter, .badge-viewer { align-self: flex-start; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check { position: relative; cursor: pointer; }
.check input { position: absolute; opacity: 0; }
.check span {
  display: flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: 10px; font-weight: 600; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); transition: all .15s;
}
.check span .ic { width: 16px; height: 16px; color: var(--c); }
.check input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); box-shadow: 0 0 0 1px var(--c); color: var(--ink); }
.check input:focus-visible + span, .role-opt input:focus-visible + .role-opt-body, .seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.toggle input { position: absolute; opacity: 0; }
.track { width: 42px; height: 24px; border-radius: 999px; background: #d6d1c6; position: relative; transition: background .15s; flex: none; }
.thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track .thumb { transform: translateX(18px); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 19, 24, .45); backdrop-filter: blur(4px); animation: fade .18s ease; }
.modal-card {
  position: relative; width: min(680px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: 20px; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .5);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-card.narrow { width: min(480px, 100%); }
.modal-card.wide { width: min(860px, 100%); }
.import-help { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: #0b5d56; font-size: 13px; line-height: 1.55; }
.import-stats { font-style: normal; font-weight: 600; color: var(--accent); }
[data-import-text] { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; white-space: pre; overflow-x: auto; tab-size: 18; }
.import-preview { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.import-preview:empty { display: none; }
.import-preview .table td { padding: 7px 12px; font-size: 13px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.modal-head h3 { font-size: 20px; }
.modal-head .eyebrow { color: var(--c, var(--muted)); margin-bottom: 2px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; border-top: 1px solid var(--line-2); margin-top: 16px; }
body.modal-open { overflow: hidden; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Users page ---------- */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.role-top { display: flex; justify-content: space-between; align-items: center; }
.role-top strong { font-size: 26px; font-weight: 800; }
.role-card p { color: var(--muted); font-size: 13px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell strong, .user-cell small { display: block; line-height: 1.3; }

/* ---------- Profile ---------- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { padding: 22px; }
.profile-top { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.profile-top h2 { font-size: 20px; }
.profile-top .badge { margin-top: 6px; }
.divider { height: 1px; background: var(--line-2); margin: 18px 0; }

/* ---------- Login ---------- */
.auth-page {
  min-height: 100vh; margin: 0; color: #e8ecf2; background: #0b0f14;
  display: flex; flex-direction: column; position: relative; overflow-x: hidden;
}
.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 85%);
}
.orb { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .55; z-index: 0; pointer-events: none; }
.orb-1 { width: 520px; height: 520px; background: #0f766e; top: -160px; left: -120px; animation: drift 18s ease-in-out infinite alternate; }
.orb-2 { width: 460px; height: 460px; background: #4338ca; bottom: -180px; right: -120px; opacity: .45; animation: drift 22s ease-in-out infinite alternate-reverse; }
.orb-3 { width: 280px; height: 280px; background: #14b8a6; top: 40%; left: 58%; opacity: .18; animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

.auth-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 24px 32px; }
.auth-top .brand { padding: 0; }
.auth-lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: #8b94a5; backdrop-filter: blur(8px); }
.auth-lang .ic { width: 15px; height: 15px; margin-right: 4px; }
.auth-lang a { padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #a7b0bf; }
.auth-lang a.on { background: #fff; color: #0b0f14; }
.auth-lang a:not(.on):hover { color: #fff; }

.auth-main { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 16px 40px; }
.auth-card {
  width: min(420px, 100%); padding: 36px 32px 30px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(23, 29, 38, .88), rgba(15, 19, 25, .9));
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.3);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 18px;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.1);
}
.auth-head { text-align: center; margin-bottom: 4px; }
.auth-logo {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 17px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #2dd4bf, #0f766e 70%);
  box-shadow: 0 12px 30px -8px rgba(20,184,166,.6), inset 0 1px 0 rgba(255,255,255,.3);
}
.auth-logo .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.auth-head h1 { font-size: 28px; color: #fff; }
.auth-head p { color: #8b94a5; font-size: 14px; margin-top: 8px; }

.auth-error { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.auth-error .ic { width: 17px; height: 17px; }

.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field > span { font-size: 12.5px; font-weight: 600; color: #b4bcc9; }
.auth-input { position: relative; }
.auth-input > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #6b7486; pointer-events: none; transition: color .15s; }
.auth-input input {
  height: 50px; padding: 0 46px 0 44px; border-radius: 13px; font-size: 15px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); color: #fff;
}
.auth-input input::placeholder { color: #5d6575; }
.auth-input input:focus { background: rgba(255,255,255,.06); border-color: #2dd4bf; box-shadow: 0 0 0 4px rgba(45,212,191,.15); }
.auth-input:focus-within > .ic { color: #5eead4; }
.auth-input input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px #18202a inset; caret-color: #fff; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: #6b7486; cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { color: #fff; background: rgba(255,255,255,.06); }
.pw-toggle .eye-off { display: none; }
.pw-toggle.on .eye-open { display: none; }
.pw-toggle.on .eye-off { display: block; color: #5eead4; }

.auth-submit {
  margin-top: 6px; height: 52px; border: 0; border-radius: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15.5px; font-weight: 700; color: #04201d;
  background: linear-gradient(180deg, #5eead4, #2dd4bf);
  box-shadow: 0 12px 28px -10px rgba(45,212,191,.7), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .1s, filter .15s, box-shadow .15s;
}
.auth-submit .ic { width: 18px; height: 18px; stroke-width: 2.4; transition: transform .15s; }
.auth-submit:hover { filter: brightness(1.05); box-shadow: 0 16px 34px -10px rgba(45,212,191,.85), inset 0 1px 0 rgba(255,255,255,.5); }
.auth-submit:hover .ic { transform: translateX(3px); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.auth-card.busy .auth-submit { opacity: .7; pointer-events: none; }

.auth-note { display: flex; align-items: center; gap: 7px; margin-top: 22px; font-size: 12.5px; color: #6b7486; }
.auth-note .ic { width: 14px; height: 14px; }

@media (max-width: 520px) {
  .auth-top { padding: 16px; }
  .auth-top .brand-name { display: none; }
  .auth-card { padding: 28px 20px 24px; border-radius: 20px; }
  .auth-head h1 { font-size: 24px; }
}

/* ---------- Error ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.error-box { padding: 40px; text-align: center; width: min(420px, 100%); }
.error-code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: var(--accent); }
.error-box p { margin: 6px 0 22px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .chart-row.with-pie { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 80; transform: translateX(-100%); transition: transform .25s ease; }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  body.sidebar-open .scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(15, 19, 24, .4); }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 48px; }
  .flash { margin: 14px 16px 0; }
  .role-cards, .profile-grid { grid-template-columns: 1fr; }
  .mobile-only { display: grid; }
}
@media (max-width: 600px) {
  h1 { font-size: 23px; }
  .folder-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .mini span { min-height: 0; }
  .form-grid { grid-template-columns: 1fr; padding: 18px 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .hint { margin: 0 16px; }
  .role-pick { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 20px; }
  .crumbs a { display: none; }
  .crumbs > .ic:first-of-type { display: none; }
  .lang-switch > .ic { display: none; }
  .lang-switch { padding-left: 3px; }
  .toolbar, .range { width: 100%; }
  .range label { flex: 1; min-width: 130px; }
  .range input { width: 100%; }
  .chart-box { height: 260px; }
  .subfolder { padding: 10px 12px 10px 10px; }
  .sf-text small { display: none; }
}
.folder-links a:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Sổ vốn & lợi nhuận ---------- */
.badge-capital_in { background: #d9f5ea; color: #047857; }
.badge-capital_out { background: #ffe4e0; color: #b42318; }
.badge-kyc { background: #fff1d6; color: #9a5a00; }
.badge-vps { background: #e7eef7; color: #335a85; }
.badge-other_cost { background: #f1f1f1; color: #555; }
.badge-adjust_capital, .badge-adjust_profit { background: #ede9fe; color: #6d28d9; }
.table th.sep, .table td.sep { border-left: 2px solid var(--line); }
.table td.warn { color: #b45309; font-weight: 600; }
.notice { margin: 0 0 14px; }

.folder-money { flex-wrap: wrap; }
.folder-money .split { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.folder-money .split > span { display: flex; flex-direction: column; }
.folder-money .split > span:last-child { text-align: right; }
a.folder-money { color: #fff; transition: filter .15s; }
a.folder-money:hover { filter: brightness(1.15); }
.folder-money .split strong { font-size: 15px; font-variant-numeric: tabular-nums; color: #fff; }
.folder-money .split strong.pro { color: #c4b5fd; }
.folder-money .split strong.neg { color: #fca5a5; }

.ledger-table th, .ledger-table td { padding-left: 10px; padding-right: 10px; }
.ledger-table th { white-space: normal; min-width: 72px; line-height: 1.3; }
@media (max-width: 1500px) {
  .subfolder { padding: 10px 14px 10px 10px; gap: 9px; }
  .subfolder .sf-icon { width: 32px; height: 32px; }
  .sf-text small { display: none; }
}

/* =====================================================================
   GIAO DIỆN ĐIỆN THOẠI GỌN (≤ 600px)
   ===================================================================== */
.range-custom { display: flex; align-items: flex-end; gap: 8px; }
.fab, .l-short, .m-only, tr.m-hidden { display: none; }
.show-more { display: block; width: 100%; border: 0; border-top: 1px solid var(--line-2); background: var(--surface-2); padding: 12px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--accent); cursor: pointer; border-radius: 0 0 var(--radius) var(--radius); }
.show-more:hover { background: var(--accent-soft); }

@media (max-width: 600px) {
  body { font-size: 14px; }
  .content { padding: 12px 12px 96px; }
  .topbar { height: 52px; padding: 0 12px; gap: 8px; }
  .crumbs { font-size: 13px; }
  .lang-switch a { padding: 5px 10px; }
  .l-full { display: none; }
  .l-short { display: inline; }
  .btn-label, .hide-mobile { display: none !important; }
  .btn { height: 38px; padding: 0 12px; font-size: 13.5px; }
  .flash { margin: 10px 12px 0; padding: 10px 12px; font-size: 13px; }

  /* Đầu trang tổng quan */
  .page-head { margin-bottom: 14px; gap: 10px; align-items: center; }
  .page-head h1 { font-size: 21px; }
  .page-head p.muted { display: none; }
  .page-head .eyebrow { font-size: 11px; margin-bottom: 2px; }
  .section-head { margin: 20px 0 10px; }
  .section-head h2 { font-size: 16px; }

  /* Đầu trang nhóm: 1 hàng gọn */
  .folder-hero { flex-wrap: nowrap; gap: 10px; margin-bottom: 12px; align-items: center; }
  .hero-main { gap: 10px; min-width: 0; }
  .hero-icon { width: 40px; height: 40px; border-radius: 12px; flex: none; }
  .hero-icon .ic { width: 20px; height: 20px; }
  .hero-main .eyebrow, .hero-main p.muted { display: none; }
  .hero-main h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero-side { flex-wrap: nowrap; gap: 6px; margin-left: auto; }
  .hero-side .chip { padding: 5px 9px; font-size: 12px; }
  .hero-side .chip .ic { display: none; }
  .hero-side .btn, .hero-side .icon-btn { width: 36px; height: 36px; padding: 0; }

  /* Thẻ thư mục con: hàng cuộn ngang, dạng viên thuốc */
  .subfolders { gap: 6px; border-bottom: 0; margin: 0 -12px; padding: 2px 12px 4px; overflow-x: auto; scroll-snap-type: x proximity; }
  .subfolder { padding: 7px 12px 7px 8px; gap: 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); margin: 0; scroll-snap-align: center; }
  .subfolder.is-active { box-shadow: none; background: var(--c); border-color: var(--c); color: #fff; }
  .subfolder.is-active::after { display: none; }
  .sf-icon { width: 24px; height: 24px; border-radius: 999px; background: transparent; }
  .sf-icon .ic { width: 16px; height: 16px; }
  .subfolder.is-active .sf-icon { background: rgba(255, 255, 255, .2); color: #fff; }
  .sf-text strong { font-size: 13px; }
  .pills { padding-top: 8px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
  .pill { padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }

  /* Thanh công cụ: chọn nhanh (cuộn ngang) + ngày tuỳ chọn trên 1 hàng */
  .toolbar { margin: 10px 0 12px; gap: 8px; flex-wrap: nowrap; align-items: flex-start; }
  .range { flex-direction: column; align-items: stretch; gap: 8px; flex: 1; min-width: 0; width: auto; }
  .presets { order: -1; flex-wrap: nowrap; overflow-x: auto; align-self: stretch; scrollbar-width: none; }
  .presets::-webkit-scrollbar, .subfolders::-webkit-scrollbar, .pills::-webkit-scrollbar { display: none; }
  .preset { padding: 6px 10px; font-size: 12.5px; }
  .range > * { min-width: 0; max-width: 100%; }
  .range-custom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; }
  .range-custom label { min-width: 0; }
  .range-custom label span { display: none; }
  .range-custom input { height: 36px; padding: 0 8px; font-size: 13px; width: 100%; min-width: 0; }
  .range-custom .btn { width: 40px; height: 36px; padding: 0; }
  .toolbar-actions { flex-direction: column; gap: 6px; flex-wrap: nowrap; }
  .toolbar-actions .btn { width: 40px; height: 36px; padding: 0; }

  /* Nút + nổi để nhập báo cáo */
  .fab span { display: none; }
  .fab {
    display: inline-grid; place-items: center; position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 50; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--ink); color: #fff; font: inherit; font-weight: 700; font-size: 14px;
    box-shadow: 0 12px 28px -8px rgba(15, 19, 24, .55);
  }
  .fab .ic { width: 26px; height: 26px; stroke-width: 2.4; }
  .fab:active { transform: scale(.94); }
  body.modal-open .fab { display: none; }

  /* Ghi chú / gợi ý */
  .kpi-hint { display: none; }
  .auto-note { font-size: 12px; padding: 8px 10px; margin-bottom: 10px; line-height: 1.45; }
  .notice { margin-bottom: 10px; }

  /* Ô số liệu: 2 cột gọn */
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .kpi { padding: 10px 12px; border-radius: 12px; box-shadow: none; }
  .kpi::after { display: none; }
  .kpi-top { align-items: center; }
  .kpi-label { font-size: 11.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .kpi-icon { width: 22px; height: 22px; border-radius: 7px; }
  .kpi-icon .ic { width: 13px; height: 13px; }
  .kpi-value { font-size: 18px; margin-top: 4px; }
  .kpi-sub { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .kpi-sub > span { display: inline; }

  /* Thẻ, biểu đồ */
  .card { border-radius: 14px; box-shadow: none; }
  .card-head { padding: 11px 14px; }
  .card-head h3 { font-size: 14px; }
  .card-body { padding: 10px 12px 12px; }
  .chart-box { height: 220px; }
  .chart-row { gap: 12px; }
  .mt { margin-top: 12px; }

  /* Bảng -> danh sách thẻ */
  .table-wrap { overflow: visible; }
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tfoot { display: block; width: 100%; }
  .table.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); position: relative; }
  .table.cards tbody tr:hover td { background: none; }
  .table.cards td { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 0; border: 0; white-space: normal; text-align: left !important; font-size: 13.5px; min-width: 0; background: none !important; box-shadow: none !important; }
  .table.cards td::before { content: attr(data-label); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .table.cards td.cell-head { font-size: 14.5px; font-weight: 800; flex-direction: row; align-items: center; }
  .table.cards td.cell-head::before, .table.cards td.cell-wide::before, .table.cards td.cell-actions::before { content: none; }
  .table.cards td.cell-wide { grid-column: 1 / -1; }
  .table.cards td.cell-blank:not(.cell-head):not(.cell-wide) { display: none; }
  .table.cards td.cell-actions { position: absolute; top: 8px; right: 10px; width: auto; }
  .table.cards td.cell-actions .row-actions { gap: 4px; }
  .table.cards tr:has(.cell-actions) td.cell-head { padding-right: 76px; }
  .table.cards .note { max-width: none; }
  .table.cards td.cell-meta { display: none; }
  .table.cards.cols-3 tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; }
  .table.cards.cols-3 td { font-size: 13px; }
  .table.cards tr.m-hidden { display: none; }
  .show-more { display: block; width: 100%; border: 0; border-top: 1px solid var(--line-2); background: var(--surface-2); padding: 12px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--accent); cursor: pointer; border-radius: 0 0 14px 14px; }
  .table.cards td.empty-row { grid-column: 1 / -1; padding: 24px 0 !important; align-items: center; }
  .table.cards td.empty-row::before { content: none; }
  .table.cards tfoot tr { background: var(--surface-2); border-top: 2px solid var(--line); }
  .table.cards tfoot td { font-weight: 800; }
  .table.cards tr.is-today { background: #f0faf7; box-shadow: inset 3px 0 0 var(--accent); }
  .table.cards tr.is-current { background: #f0faf7; }
  .table.cards td.m-dup { display: none; }
  .m-only { display: inline; }
  .head-extra { font-weight: 600; color: var(--ink-2); }
  .week-table.cards tr.is-empty { grid-template-columns: 1fr auto; align-items: center; padding-right: 56px; }
  .week-table.cards tr.is-empty td.cell-wide:not(.cell-head) { grid-column: auto; }
  .week-table.cards tr.is-empty td.cell-head { grid-column: auto; }
  .user-cell { gap: 8px; }

  /* Tổng quan: thẻ nhóm gọn */
  .folder-grid { gap: 14px; grid-template-columns: minmax(0, 1fr); }
  .folder-card, .folder-body, .card, .kpi, .main, .content > * { min-width: 0; }
  .table.cards td.cell-head { white-space: nowrap; }
  .folder-body { padding: 14px 14px 12px; box-shadow: none; }
  .folder-card:hover .folder-body { transform: none; }
  .folder-icon { width: 36px; height: 36px; border-radius: 10px; }
  .folder-title strong { font-size: 16px; }
  .mini-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 0 10px; }
  .mini { padding: 7px 8px; border-radius: 9px; }
  .mini span { font-size: 10px; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .mini strong { font-size: 16px; }
  .folder-money { padding: 10px 12px; }
  .folder-money .big { font-size: 19px; }
  .folder-links { display: flex; overflow-x: auto; gap: 6px; margin: 10px -14px; padding: 0 14px; scrollbar-width: none; }
  .folder-links::-webkit-scrollbar { display: none; }
  .folder-links a { flex: none; white-space: nowrap; padding: 7px 11px; border-radius: 999px; }
  .folder-links a:last-child:nth-child(odd) { grid-column: auto; }
  .folder-foot { padding-top: 8px; }

  /* Trang tuần */
  .week-bar { margin: 10px 0; gap: 8px; flex-wrap: nowrap; align-items: center; }
  .week-nav { flex: 1; min-width: 0; gap: 6px; flex-wrap: wrap; }
  .week-nav .icon-btn { width: 36px; height: 36px; }
  .week-title { min-width: 0; flex: 1; padding: 3px 8px; }
  .week-title strong { font-size: 14px; }
  .week-title span { font-size: 11px; }
  .week-pick { display: none; }
  .week-bar .toolbar-actions { flex-direction: row; }
  .preset-link { padding: 6px 8px; font-size: 12.5px; }

  /* Người dùng */
  .role-cards { display: flex; overflow-x: auto; gap: 8px; margin: 0 -12px 12px; padding: 0 12px; scrollbar-width: none; }
  .role-card { flex: 0 0 72%; padding: 12px 14px; box-shadow: none; }
  .role-top strong { font-size: 20px; }

  /* Hộp thoại: dạng tấm trượt từ dưới lên */
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { width: 100% !important; max-height: 92vh; border-radius: 20px 20px 0 0; animation: sheet .22s ease; }
  .modal-head { padding: 16px 16px 0; position: sticky; top: 0; background: var(--surface); z-index: 2; }
  .modal-head h3 { font-size: 18px; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); margin-top: 8px; }
  .modal-foot .btn { flex: 1; height: 44px; }
  .form-grid { gap: 12px; padding: 14px 16px; }
  .form-grid input, .form-grid select, .form-grid textarea { font-size: 16px; } /* tránh iPhone tự phóng to */
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ===================== Sổ thu chi ===================== */
.how .card-body { display: flex; flex-direction: column; gap: 12px; }
.formula { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.f-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); min-width: 0; }
.f-item span { font-size: 12px; color: var(--muted); font-weight: 600; }
.f-item strong { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.f-item strong.pos { color: var(--live); }
.f-item strong.neg { color: #be123c; }
.f-total { background: var(--ink); border-color: var(--ink); }
.f-total span { color: #9aa3b2; }
.f-total strong { color: #fff; }
.f-op { align-self: center; font-size: 20px; font-weight: 800; color: var(--muted); }
.split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.sb-cap { background: #0f766e; }
.sb-inc { background: #8b5cf6; }
.split-legend { display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: 13.5px; }
.split-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dot.cap { background: #0f766e; }
.dot.inc { background: #8b5cf6; }
.how-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.type-filter { display: flex; gap: 6px; padding: 12px 20px 4px; overflow-x: auto; scrollbar-width: none; }
.type-filter::-webkit-scrollbar { display: none; }
.type-filter .pill { white-space: nowrap; }
.txb { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.txb-cap { background: #dff2ee; color: #0b5d56; }
.txb-inc { background: #d9f5ea; color: #047857; }
.txb-buy { background: #ffe4e8; color: #be123c; }
.txb-rst { background: #fff1d6; color: #9a5a00; }
.txb-cost { background: #e7e9ff; color: #4338ca; }
.txb-share { background: #efe5ff; color: #6d28d9; }
.cb-table td.acc strong { display: block; font-weight: 600; }
.cb-table td.acc small { display: block; color: var(--muted); font-size: 12px; }
.cb-table tr.tx-cap td, .cb-table tr.tx-inc td { background: #f6fbf9; }
.day-table td.cap { color: var(--accent); font-weight: 700; }
.day-table td.date a, .cb-table td.date { color: var(--ink); }
.radio-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 0; cursor: pointer; }
.radio-line input { width: auto; }
.radio-line.danger { color: #a11b1b; }
.import-check { padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.import-check.ok { background: #e3f6ee; color: #05603f; }
.import-check.bad { background: #fff4e0; color: #9a5a00; }
@media (max-width: 600px) {
  .formula { gap: 6px; }
  .f-item { padding: 8px 10px; flex: 1 1 40%; }
  .f-item strong { font-size: 15px; }
  .f-op { display: none; }
  .f-total { flex-basis: 100%; }
  .type-filter { padding: 10px 14px 2px; }
  .how-list { font-size: 12.5px; }
}

/* Số tiền có 2 số lẻ: cỡ chữ ô số liệu tự co theo màn hình; bảng nhiều cột gọn hơn */
.kpi-value { font-size: clamp(19px, 1.45vw, 26px); }
.day-table th, .day-table td, .cb-table th, .cb-table td, .week-table th, .week-table td { padding-left: 10px; padding-right: 10px; }
.day-table th, .week-table th { font-size: 10.5px; letter-spacing: .03em; }
.day-table td, .week-table td { font-size: 13px; }
@media (max-width: 600px) { .kpi-value { font-size: 17px; } }

/* ---------- Trang chờ duyệt thiết bị ---------- */
.dp-card { text-align: center; }
.dp-icon { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 20px; display: grid; place-items: center;
  background: rgba(245,158,11,.14); color: #fbbf24; border: 1px solid rgba(245,158,11,.35); }
.dp-icon .ic { width: 30px; height: 30px; }
.dp-icon.bad { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.35); }
.dp-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 34px; font-weight: 800; letter-spacing: .28em;
  color: #fff; padding: 14px 10px 14px 18px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.22); }
.dp-info { display: grid; gap: 6px; text-align: left; font-size: 13.5px; color: #b4bcc9; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.dp-info b { color: #fff; font-weight: 600; }
.dp-steps { text-align: left; color: #8b94a5; font-size: 13px; line-height: 1.6; padding-left: 18px; margin: 0; }
.dp-wait { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #8b94a5; font-size: 12.5px; }
.dp-dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; animation: dpPulse 1.4s ease-in-out infinite; }
@keyframes dpPulse { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.dp-actions { display: grid; gap: 10px; }
.dp-actions form { margin: 0; }
.dp-link { background: none; border: 0; color: #8b94a5; font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; width: 100%; }
.dp-link:hover { color: #fff; }
.auth-submit.as-link { text-decoration: none; }

/* ---------- Đổi / đặt lại mật khẩu ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pw-eye:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.pw-eye.on { color: var(--ink); background: rgba(0,0,0,.06); }
.pw-eye .ic { width: 16px; height: 16px; }
.pw-rule { margin-top: -6px; }
.pw-msg { color: #a11b1b; font-size: 12.5px; margin-top: -6px; }
.pw-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: -4px; }
.check-line { display: flex !important; flex-direction: row !important; gap: 8px; align-items: flex-start; justify-content: flex-start; text-align: left; font-size: 13.5px; cursor: pointer; grid-column: 1 / -1; }
.check-line input { width: 16px !important; height: 16px; flex: 0 0 auto; margin: 2px 0 0; padding: 0; }
.check-line span { flex: 1; }
.small-note { font-size: 12.5px; margin: 0; }
input.readonly { background: rgba(0,0,0,.03); color: var(--ink-2); }
.badge-pw { background: #fff6e0; color: #8a5300; border: 1px solid #f5d999; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.badge-pw .ic { width: 12px; height: 12px; }
.card-attn { box-shadow: 0 0 0 2px #f5d999, var(--shadow, 0 1px 2px rgba(0,0,0,.05)); }
.topbar-pw .ic { width: 15px; height: 15px; }
@media (max-width: 640px) { .topbar-pw span { display: none; } }

/* ===================== ĐỐI SOÁT VÍ ===================== */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; background: var(--c, var(--muted)); }
.block { display: block; }
.mt-s { margin-top: 10px; }
.wbadge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.wbadge.lg { font-size: 13px; padding: 4px 12px; margin-left: 8px; }
.w-open { background: #fdecec; color: #b42318; }
.w-ok { background: #d9f5ea; color: #047857; }
.w-exp { background: #fff1d6; color: #9a5a00; }
.wallet-fchip { text-decoration: none; color: var(--ink-2); margin: 2px 0; }
.flink { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; font-weight: 600; }
a.flink:hover { text-decoration: underline; }

.wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.wallet-card { display: block; text-decoration: none; color: inherit; padding: 18px 20px; transition: transform .12s, box-shadow .12s; }
.wallet-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(15, 19, 24, .35); }
.wc-head { display: flex; align-items: center; gap: 12px; }
.wc-head > div { flex: 1; min-width: 0; }
.wc-head strong { display: block; font-size: 16px; }
.wc-head small { color: var(--muted); font-size: 12.5px; }
.wc-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.wc-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.wc-body span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.wc-body strong { font-variant-numeric: tabular-nums; }

.wallet-entry { padding: 0; overflow: hidden; }
.we-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); }
.we-main { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px 16px; padding: 20px 22px; align-items: end; }
.we-amount { grid-column: 1 / -1; }
.we-amount input { font-size: 26px; font-weight: 800; height: 58px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.we-note { grid-column: 1 / -1; }
.we-btn { grid-column: 1 / -1; justify-self: start; min-width: 160px; }
.we-preview { background: var(--surface-2); border-left: 1px solid var(--line-2); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.we-preview span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.we-preview strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.we-preview strong.ok { color: var(--live); }
.we-preview strong.bad { color: #be123c; }

.wallet-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.f-bad { background: #b42318; border-color: #b42318; }
.f-bad span { color: #fecaca; }
.w-verdict, .w-resolution, .w-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-top: 14px; font-size: 13.5px; line-height: 1.55; }
.w-verdict .ic, .w-resolution .ic, .w-note .ic { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }
.w-verdict.ok { background: #e3f6ee; color: #05603f; }
.w-verdict.bad { background: #fdecec; color: #7a1414; }
.w-resolution { background: #fff6e0; color: #6b4100; }
.w-note { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); }
.w-adjs { margin-top: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.scope-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.scope-grid > div { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.scope-grid span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.scope-grid strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.scope-grid small { display: block; color: var(--muted); font-size: 12px; }
.scope-grid .bad { background: #fdecec; border-color: #f7c9c9; }
.scope-grid .bad strong { color: #b42318; }
.cause { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.cause.exact { border-color: #f5c2c2; background: linear-gradient(0deg, #fff, #fffafa); }
.cause-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cause p { margin: 4px 0 8px; }
.table.compact td { padding: 8px 10px; }
.table tr.pair-2 td { border-top: 0; }
.w-checklist { margin-top: 6px; font-size: 13px; }
.w-checklist ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; color: var(--ink-2); }
.resolve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.resolve { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.resolve h4 { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.resolve p { margin: 0; }
.resolve .form-grid.tight { padding: 0; gap: 10px; width: 100%; }
.wallet-folders { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 6px 0 0 24px; }
.wallet-folders.off { opacity: .45; pointer-events: none; }

@media (max-width: 1100px) {
  .resolve-grid { grid-template-columns: 1fr; }
  .wallet-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .we-form { grid-template-columns: 1fr; }
  .we-main { grid-template-columns: 1fr; padding: 16px; }
  .we-preview { border-left: 0; border-top: 1px solid var(--line-2); padding: 16px; flex-direction: row; flex-wrap: wrap; }
  .we-preview > div { flex: 1 1 45%; }
  .we-preview strong { font-size: 18px; }
  .we-btn { width: 100%; }
  .scope-grid { grid-template-columns: 1fr; }
  .wc-body { grid-template-columns: 1fr 1fr; }
  .wbadge.lg { display: flex; width: max-content; margin: 6px 0 0; }
}
@media (max-width: 760px) {
  .cause { padding: 12px; }
  .cause .table-wrap { overflow: visible; }
  .table.compact, .table.compact tbody { display: block; }
  .table.compact tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
  .table.compact td { display: inline-block; border: 0 !important; padding: 2px 0 !important; white-space: normal; }
  .table.compact td::before { display: none !important; }
  .table.compact td.wrap { flex: 1 1 100%; }
  .table.compact td.actions-col { width: auto; margin-left: auto; }
}
