@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b0f1a;
  --card: #141a28;
  --card-2: #1a2030;
  --ink: #f2f5fc;
  --ink-soft: #c3ccdc;
  --muted: #8b96ab;
  --line: #222a3b;
  --line-2: #2b3448;
  --lime: #c6f135;
  --lime-2: #a6e626;
  --lime-ink: #0b0f1a;
  --lime-soft: rgba(198,241,53,.14);
  --green: #34d399;
  --green-bg: rgba(52,211,153,.14);
  --red: #f87171;
  --red-bg: rgba(248,113,113,.14);
  --amber: #fbbf24;
  --amber-bg: rgba(251,191,36,.14);
  --blue: #60a5fa;
  --blue-bg: rgba(96,165,250,.14);
  --violet: #a78bfa;
  --violet-bg: rgba(167,139,250,.14);
  --grad: linear-gradient(135deg, #d4f34e, #a6e626);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  display: flex;
  min-height: 100vh;
}

/* ---------- Material Symbols ---------- */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
  font-size: 20px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 230px;
  flex: none;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.sidebar h1 {
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--lime);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar h1 .material-symbols-rounded { font-size: 26px; }
.sidebar h1#brandRefresh { cursor: pointer; user-select: none; transition: opacity .15s; }
.sidebar h1#brandRefresh:hover { opacity: .8; }
.sidebar h1#brandRefresh:active { opacity: .6; }
.sidebar .sub { font-size: 11px; color: var(--muted); margin-bottom: 18px; padding-left: 2px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar nav a .material-symbols-rounded { font-size: 21px; }
.sidebar nav a:hover { background: var(--card-2); }
.sidebar nav a.active { background: var(--lime-soft); color: var(--lime); }
.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.back-link:hover { background: var(--card-2); color: var(--ink); }
.back-link .material-symbols-rounded { font-size: 18px; }
.side-note { margin-top: 16px; font-size: 11px; color: var(--muted); line-height: 1.5; }

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 60;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: 12px;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.main { flex: 1; padding: 28px 32px; max-width: 100%; width: 100%; min-width: 0; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h2 { margin-top: 0; display: flex; align-items: center; gap: 9px; font-size: 22px; }
h2 .material-symbols-rounded { font-size: 26px; color: var(--lime); }
h3 { display: flex; align-items: center; gap: 8px; }
.section-desc { color: var(--muted); font-size: 13px; margin: -4px 0 18px; line-height: 1.5; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--ink-soft); }
.card + .card, .card.mt { margin-top: 16px; }

/* ---------- KPI stat cards ---------- */
.kpi {
  position: relative;
  overflow: hidden;
}
.kpi .kpi-ic {
  position: absolute;
  right: 14px; top: 14px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
}
.kpi .kpi-ic .material-symbols-rounded { font-size: 24px; }
.kpi-ic.lime { background: var(--lime-soft); color: var(--lime); }
.kpi-ic.green { background: var(--green-bg); color: var(--green); }
.kpi-ic.red { background: var(--red-bg); color: var(--red); }
.kpi-ic.blue { background: var(--blue-bg); color: var(--blue); }
.kpi-ic.amber { background: var(--amber-bg); color: var(--amber); }
.kpi-ic.violet { background: var(--violet-bg); color: var(--violet); }
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.lime { color: var(--lime); }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.upload-card h3 .ic-meta { color: var(--blue); }
.upload-card h3 .ic-shopee { color: var(--amber); }
.upload-card h3 .ic-order { color: var(--green); }
.hint { font-size: 12px; color: var(--muted); margin: -4px 0 10px; }

.upload-box {
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--card-2);
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.upload-box .material-symbols-rounded { font-size: 30px; color: var(--lime); }
.upload-box:hover { border-color: var(--lime); background: rgba(198,241,53,.05); }
.upload-box input { display: none; }
.files { margin-top: 10px; font-size: 12px; color: var(--green); text-align: left; line-height: 1.6; }
.file-reject { color: var(--red); font-weight: 600; }

/* ---------- online pull card ---------- */
.online-card { margin-bottom: 20px; border: 1px solid rgba(198,241,53,.25); background: radial-gradient(120% 120% at 0% 0%, rgba(198,241,53,.06), transparent 55%), var(--card); }
.online-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.online-head h3 { margin: 0; font-size: 16px; color: var(--ink); }
.online-head h3 .material-symbols-rounded { color: var(--lime); }
.ext-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2); }
.ext-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.ext-status.ok { color: var(--green); } .ext-status.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.ext-status.off { color: var(--red); } .ext-status.off .dot { background: var(--red); }
.online-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.online-controls label { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.online-controls input[type=date] { background: var(--bg); border: 1px solid var(--line-2); color: var(--ink); border-radius: 10px; padding: 8px 10px; font-family: inherit; font-size: 13px; }
.online-status { margin-top: 12px; font-size: 12.5px; display: none; align-items: center; gap: 7px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; }
.online-status.loading, .online-status.ok, .online-status.warn, .online-status.error { display: flex; }
.online-status.loading { background: var(--card-2); color: var(--ink-soft); }
.online-status.ok { background: var(--green-bg); color: var(--green); }
.online-status.warn { background: var(--amber-bg); color: var(--amber); }
.online-status.error { background: var(--red-bg); color: var(--red); }
.online-status .material-symbols-rounded { font-size: 18px; flex: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.guide { margin-top: 20px; }
.guide p { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin: 8px 0; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
td.num, th.num { text-align: right; }
tbody tr:hover td { background: var(--card-2); }
.table-wrap { overflow-x: auto; }
tfoot td { font-weight: 800; border-top: 2px solid var(--line-2); color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad);
  color: var(--lime-ink);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
}
.btn .material-symbols-rounded { font-size: 19px; }
.btn.ghost { background: var(--card-2); color: var(--ink); border: 1px solid var(--line-2); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag-input {
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  width: 150px;
  font-family: inherit;
}
.tag-input:focus { outline: none; border-color: var(--lime); }

.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 44px 20px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--card);
}
.empty .material-symbols-rounded { font-size: 40px; display: block; margin: 0 auto 10px; color: var(--line-2); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--lime);
  font-weight: 700;
  margin-left: auto;
}

.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.chip.g { background: var(--green-bg); color: var(--green); }
.chip.r { background: var(--red-bg); color: var(--red); }
.chip.a { background: var(--amber-bg); color: var(--amber); }
.chip.m { background: var(--card-2); color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; accent-color: var(--lime); cursor: pointer; }

.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }

.roi-pos { color: var(--green); font-weight: 700; }
.roi-neg { color: var(--red); font-weight: 700; }

.detail-row td { background: var(--bg); padding: 0; }
.detail-inner { padding: 12px 16px; }
.detail-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--lime); margin-bottom: 8px; }
.detail-title .material-symbols-rounded { font-size: 17px; }

/* ---------- Rich performance table ---------- */
.perf-table { min-width: 1100px; border-collapse: separate; border-spacing: 0; }
.perf-table thead th { border-bottom: 1px solid var(--line-2); }
.perf-table thead .grp th {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 9px 10px;
}
.perf-table thead tr.sub th { text-align: right; padding: 8px 10px; font-size: 10.5px; }
.perf-table thead th small { display: block; font-weight: 600; color: var(--muted); font-size: 9.5px; text-transform: none; letter-spacing: 0; margin-top: 1px; }
.perf-table thead th.tag-head { text-align: left; vertical-align: middle; font-size: 11px; color: var(--ink-soft); background: var(--card); }
.perf-table thead th.g-meta { background: rgba(96,165,250,.12); color: var(--blue); }
.perf-table thead th.g-shopee { background: rgba(251,191,36,.12); color: var(--amber); }
.perf-table thead th.g-profit { background: rgba(52,211,153,.12); color: var(--green); }
.perf-table thead th.g-extra { background: rgba(167,139,250,.12); color: var(--violet); vertical-align: middle; }
/* vertical separators between column groups */
.perf-table th.gsep, .perf-table tbody td.gsep, .perf-table tfoot td.gsep { border-left: 1px solid var(--line-2); }
.perf-table tbody td { vertical-align: top; padding: 14px 10px; }
.perf-table tbody tr.tag-main td:not(.tag-cell) { padding-top: 16px; }
.perf-table tbody tr.tag-main:hover td { background: var(--card-2); }
.perf-table tbody tr.tag-main { border-bottom: 1px solid var(--line); }
.perf-table td.num b { font-size: 13.5px; }
.cell-sub { font-size: 10px; color: var(--muted); margin-top: 2px; font-weight: 500; white-space: nowrap; }
.strong-blue { color: var(--blue); font-weight: 700; }
.strong-amber { color: var(--amber); font-weight: 700; }
.strong-green { color: var(--green); font-weight: 700; }
.dim { color: var(--line-2); }

.tag-cell { min-width: 200px; }
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--lime-soft);
  color: var(--lime);
  border: 1px solid rgba(198,241,53,.3);
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.tag-badge:hover { background: rgba(198,241,53,.22); }
.tag-badge .material-symbols-rounded { font-size: 16px; }
.tag-badge .exp { transition: transform .2s; }
.tag-badge.open .exp { transform: rotate(180deg); }
.tag-camps { font-size: 10.5px; color: var(--muted); margin-top: 5px; max-width: 220px; line-height: 1.4; }
.tag-camps .warn { display: inline-flex; align-items: center; gap: 3px; color: var(--amber); }
.tag-camps .warn .material-symbols-rounded { font-size: 13px; }

.perf-table tfoot td { font-size: 12.5px; padding: 12px 10px; }
.kaitkan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.kaitkan-head h3 { margin: 0; }
.tbl-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.4; }
.tbl-note .material-symbols-rounded { font-size: 16px; color: var(--amber); flex: none; }

/* ---------- filter bar ---------- */
.filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 16px; margin-bottom: 20px;
  position: sticky; top: 0; z-index: 30;
}
.filterbar > .material-symbols-rounded { color: var(--lime); font-size: 20px; }
.filterbar .fb-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.filterbar input[type="date"] {
  background: var(--bg); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-family: inherit;
  color-scheme: dark;
}
.filterbar .fb-dash { color: var(--muted); }
.tz-shift { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tz-shift .material-symbols-rounded { font-size: 17px; color: var(--amber); }
.tz-shift select {
  background: var(--bg); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 8px; padding: 5px 8px; font-size: 12px; font-family: inherit; color-scheme: dark; cursor: pointer;
}
.fb-tz-info { font-size: 11px; color: var(--amber); }
.fb-info { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.filterbar .fb-info { font-size: 12px; color: var(--muted); margin-left: auto; }
.filterbar.hidden { display: none; }

/* ---------- rekomendasi ---------- */
.reco-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.reco-item {
  --rc: var(--muted);
  --rc-bg: rgba(139,150,171,.12);
  position: relative;
  background:
    radial-gradient(120% 80% at 100% 0%, var(--rc-bg), transparent 60%),
    var(--card-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.reco-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rc); }
.reco-item:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.4); border-color: var(--rc); }
.reco-item.reco-scale, .reco-item.reco-organic { --rc: var(--green); --rc-bg: rgba(52,211,153,.16); }
.reco-item.reco-optimize { --rc: var(--amber); --rc-bg: rgba(251,191,36,.16); }
.reco-item.reco-stop, .reco-item.reco-loss { --rc: var(--red); --rc-bg: rgba(248,113,113,.16); }
.reco-item.reco-need { --rc: var(--blue); --rc-bg: rgba(96,165,250,.16); }

.reco-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.reco-icn {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px;
  background: var(--rc-bg);
  color: var(--rc);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent);
}
.reco-icn .material-symbols-rounded { font-size: 25px; }
.reco-titles { min-width: 0; }
.reco-tag { font-weight: 800; font-size: 16px; color: var(--ink); line-height: 1.2; }
.reco-status { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--rc); margin-top: 2px; }
.reco-reason { font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 14px; }
.reco-metrics { display: flex; gap: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.reco-metrics .rm { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 10px; border-right: 1px solid var(--line); }
.reco-metrics .rm:first-child { padding-left: 0; }
.reco-metrics .rm:last-child { border-right: none; }
.reco-metrics .rm small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.reco-metrics .rm b { font-size: 14px; color: var(--ink); font-weight: 800; white-space: nowrap; }
.reco-metrics .rm b.roi-pos { color: var(--green); }
.reco-metrics .rm b.roi-neg { color: var(--red); }

/* ---------- legend ---------- */
.legend-card { margin-top: 16px; }
.legend-card summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink-soft); list-style: none; }
.legend-card summary::-webkit-details-marker { display: none; }
.legend-card summary .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
.legend-card[open] summary .chev { transform: rotate(180deg); }
.legend-card summary > .material-symbols-rounded:first-child { color: var(--lime); }
.legend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 16px; }
@media (max-width: 900px) { .legend-grid { grid-template-columns: 1fr; } }
.legend-h { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
.lg { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 8px; }
.lg b { color: var(--ink); }
.lg i { color: var(--muted); font-style: normal; }
.legend-colors { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); line-height: 2.2; }
.legend-colors .chip { margin: 0 4px 0 10px; }
.legend-colors .chip:first-of-type { margin-left: 0; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card-2);
  border: 1px solid var(--lime);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform .3s, opacity .3s;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast .material-symbols-rounded { color: var(--lime); }

/* ---------- clickable cells ---------- */
.perf-table td.clk { cursor: pointer; position: relative; transition: background .12s; }
.perf-table td.clk:hover { background: rgba(198,241,53,.08); box-shadow: inset 0 0 0 1px rgba(198,241,53,.35); border-radius: 8px; }
.perf-table td.clk .cell-main { display: inline-flex; align-items: center; gap: 3px; justify-content: flex-end; }
.perf-table td.clk .cell-main::after { content: "open_in_full"; font-family: 'Material Symbols Rounded'; font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .12s; }
.perf-table td.clk:hover .cell-main::after { opacity: .8; }
.perf-table { font-variant-numeric: tabular-nums; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  width: 100%; max-width: 760px;
  max-height: 82vh;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: fade .2s ease;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
/* per-type accent: colored top bar + icon + title tint */
.modal { border-top: 4px solid var(--lime); }
.modal.accent-green { border-top-color: var(--green); }
.modal.accent-green .modal-head { background: var(--green-bg); }
.modal.accent-green .modal-head h3, .modal.accent-green .modal-head h3 .material-symbols-rounded { color: var(--green); }
.modal.accent-amber { border-top-color: var(--amber); }
.modal.accent-amber .modal-head { background: var(--amber-bg); }
.modal.accent-amber .modal-head h3, .modal.accent-amber .modal-head h3 .material-symbols-rounded { color: var(--amber); }
.modal.accent-blue { border-top-color: var(--blue); }
.modal.accent-blue .modal-head { background: var(--blue-bg); }
.modal.accent-blue .modal-head h3, .modal.accent-blue .modal-head h3 .material-symbols-rounded { color: var(--blue); }
.modal-close { background: var(--card-2); border: 1px solid var(--line-2); color: var(--ink-soft); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 8px 20px 20px; overflow-y: auto; }
.modal-body table { min-width: 100%; }
.modal-sum { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.modal-sum .ms { font-size: 12px; color: var(--muted); }
.modal-sum .ms b { display: block; font-size: 17px; color: var(--ink); margin-top: 2px; }
.modal-sum .ms.g b { color: var(--green); }
.modal-sum .ms.r b { color: var(--red); }
.modal-sum .ms.b b { color: var(--blue); }
.modal-sum .ms.a b { color: var(--amber); }
.modal-sum .ms.v b { color: var(--violet); }
.strong-red { color: var(--red); font-weight: 700; }
.modal-body td.c-green { color: var(--green); font-weight: 700; }
.modal-body td.c-red { color: var(--red); font-weight: 700; }
.modal-body td.c-blue { color: var(--blue); font-weight: 700; }
.modal-body th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.plat-dot { display: inline-flex; align-items: center; gap: 6px; }
.plat-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.plat-dot.fb::before { background: #3b82f6; }
.plat-dot.ig::before { background: #ec4899; }
.plat-dot.tk::before { background: #22d3ee; }

/* ---------- confirm modal ---------- */
.confirm-modal { max-width: 420px; padding: 26px 24px 22px; text-align: center; border-top: 3px solid var(--red); }
.confirm-icn { width: 56px; height: 56px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--red-bg); color: var(--red); }
.confirm-icn .material-symbols-rounded { font-size: 32px; }
.confirm-icn.warn { background: var(--amber-bg); color: var(--amber); }
.confirm-modal h3 { justify-content: center; font-size: 18px; margin: 0 0 8px; color: var(--ink); }
.confirm-modal p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 22px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { min-width: 110px; justify-content: center; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: #ef4444; }

/* mobile */
@media (max-width: 820px) {
  .mobile-menu-btn { display: flex; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 64px 16px 32px; }
  h2 { font-size: 19px; }
}
