*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #ffffff;
  --bg-2:     #f5f5f7;
  --bg-3:     #e8e8ed;
  --text:     #1d1d1f;
  --text-2:   #6e6e73;
  --text-3:   #b0b0b8;
  --border:   #d2d2d7;
  --blue:     #0071e3;
  --blue-2:   #0077ed;
  --green:    #34c759;
  --red:      #ff3b30;
  --orange:   #ff9f0a;
  --purple:   #af52de;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 2px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --radius:   14px;
  --sidebar-w: 210px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --accent-bg: #1d1d1f;
  --topbar-bg: rgba(245,245,247,0.85);
  color-scheme: light;
}

/* ── Dark theme ── */
[data-theme="dark"] {
  --bg:       #1e1e20;
  --bg-2:     #141416;
  --bg-3:     #2c2c2e;
  --text:     #f5f5f7;
  --text-2:   #9e9ea3;
  --text-3:   #6a6a6e;
  --border:   #343436;
  --blue:     #0a84ff;
  --blue-2:   #409cff;
  --green:    #30d158;
  --red:      #ff453a;
  --orange:   #ff9f0a;
  --purple:   #bf5af2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.30);
  --shadow:    0 4px 16px rgba(0,0,0,.55), 0 1px 4px rgba(0,0,0,.40);
  --accent-bg: #0a84ff;
  --topbar-bg: rgba(20,20,22,0.80);
  color-scheme: dark;
}
[data-theme="dark"] .brand-icon { background: var(--bg-3); }
[data-theme="dark"] .tc-rank { background: var(--bg-3); color: var(--text); }
[data-theme="dark"] .radar-chip.active { background: var(--blue); color: #fff; }
[data-theme="dark"] .preset.active,
[data-theme="dark"] .radar-region.active,
[data-theme="dark"] .task-filter.active { background: #3a3a3c; color: var(--text); }

html, body { height: 100%; background: var(--bg-2); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }

/* ── Layout ── */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 30px; height: 30px;
  background: #1d1d1f;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}

.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }

.account-chip {
  margin: 14px 12px;
  background: var(--bg-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.chip-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}

.chip-handle { font-size: 12px; font-weight: 600; color: var(--text); }
.chip-type   { font-size: 10px; color: var(--text-2); margin-top: 1px; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.chip-dot.live { background: var(--green); box-shadow: 0 0 0 2px #34c75930; }

.sidebar-nav { flex: 1; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

.nav-label {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 8px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); background: none; border: none;
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover   { background: var(--bg-2); color: var(--text); }
.nav-item.active  { background: var(--bg-2); color: var(--text); font-weight: 600; }
.nav-item.active svg { color: var(--blue); }

/* ── Main ── */
.main { flex: 1; overflow-y: auto; background: var(--bg-2); display: flex; flex-direction: column; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
}

.page-title { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.page-sub   { font-size: 11px; color: var(--text-2); margin-top: 1px; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.preset-group { display: flex; background: var(--bg-3); border-radius: 8px; padding: 3px; gap: 2px; }
.preset {
  background: none; border: none; font-family: var(--font);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  padding: 4px 11px; border-radius: 6px; cursor: pointer; transition: all 0.12s;
}
.preset:hover  { color: var(--text); }
.preset.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

.datepicker-wrap { display: flex; align-items: center; gap: 6px; }
.datepicker-wrap input {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 7px;
  padding: 5px 9px; font-size: 11.5px; font-family: var(--font);
  outline: none; cursor: pointer;
}
.datepicker-sep { color: var(--text-3); font-size: 12px; }

.btn-apply {
  background: var(--blue); color: white; border: none;
  padding: 5px 13px; border-radius: 7px;
  font-size: 12px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background 0.12s;
}
.btn-apply:hover { background: var(--blue-2); }

.btn-icon {
  background: var(--bg); border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: all 0.12s;
}
.btn-icon:hover { color: var(--text); }
.btn-icon.spinning svg { animation: spin 0.7s linear infinite; }

.btn-export-top {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-2); padding: 5px 13px;
  border-radius: 7px; font-size: 12px; font-weight: 500; font-family: var(--font);
  cursor: pointer; transition: all 0.12s;
}
.btn-export-top:hover { color: var(--text); border-color: var(--text-3); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── States ── */
.state-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: var(--text-2); padding: 60px;
}
.error-msg { color: var(--red); font-size: 13px; }
.hidden { display: none !important; }

.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--bg-3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Views ── */
.view { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 14px; }

/* ── KPI Strip ── */
.kpi-strip {
  display: flex; gap: 10px; flex-wrap: wrap;
}

.kpi {
  flex: 1; min-width: 140px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid rgba(0,0,0,.04);
}
.kpi.accent { background: var(--accent-bg); }
.kpi.accent .kpi-label,
.kpi.accent .kpi-sub  { color: rgba(255,255,255,.55); }
.kpi.accent .kpi-val  { color: #fff; }

.kpi-label { font-size: 11px; font-weight: 500; color: var(--text-2); letter-spacing: 0.01em; }
.kpi-val   { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; line-height: 1.1; }
.kpi-sub   { font-size: 11px; color: var(--text-2); }
.trend-up   { color: var(--green); }
.trend-down { color: var(--red); }

/* ── Rows ── */
.row-2 { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Cards ── */
.card {
  flex: 1; min-width: 260px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid rgba(0,0,0,.04);
}
.card.span2 { flex: 2; min-width: 360px; }

.card-head { margin-bottom: 18px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }
.card-sub   { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.chart-box { position: relative; }
.h200 { height: 200px; }
.h220 { height: 220px; }
.h240 { height: 240px; }
.h280 { height: 280px; }

/* ── Leads/Sales: slim "last sync + Live" strip di atas ── */
.sheet-live {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-bottom: 12px;
}
.sheet-live-sync { font-size: 11.5px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Clickable KPI (mis. Retainer → daftar klien) */
.kpi-click { cursor: pointer; transition: box-shadow .16s, transform .16s, border-color .16s; }
.kpi-click:hover { box-shadow: 0 10px 30px rgba(0,0,0,.10); transform: translateY(-2px); border-color: var(--border); }
.kpi-click:active { transform: translateY(0); }
.kpi-more { font-size: 10px; font-weight: 600; color: var(--text-3); margin-left: 4px; }

/* Daftar klien retainer di modal */
.ret-cli-list { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; margin-top: 4px; }
.ret-cli-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--border); }
.ret-cli-row:first-child { border-top: none; }
.ret-cli-rank { font-size: 11px; font-weight: 700; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.ret-cli-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ret-cli-amt { font-size: 12.5px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.ret-cli-amt small { font-size: 9.5px; font-weight: 600; color: var(--text-3); margin-left: 2px; }

/* ── Sales: clickable Retainer / Project value cards ── */
.sl-value-card {
  text-align: left; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 5px;
  transition: box-shadow .16s, transform .16s, border-color .16s;
}
.sl-value-card:hover { box-shadow: 0 10px 30px rgba(0,0,0,.10); transform: translateY(-2px); border-color: var(--border); }
.sl-value-card:active { transform: translateY(0); }
.sl-vc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sl-vc-title { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: -.2px; }
.sl-vc-hint { font-size: 11px; font-weight: 600; color: var(--text-3); }
.sl-vc-val { font-size: 30px; font-weight: 750; letter-spacing: -.03em; color: var(--text); line-height: 1.1; }
.sl-vc-sub { font-size: 12px; color: var(--text-2); }
.sl-vc-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.sl-vc-bar { display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center; }
.sl-vc-bar .code { font-size: 12px; font-weight: 700; color: var(--text); }
.sl-vc-bar .track { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.sl-vc-bar .fill { display: block; height: 100%; border-radius: 3px; }
.sl-vc-bar .amt { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ── Table ── */
.table-wrap { overflow-x: auto; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 9px 14px; text-align: left;
  font-size: 10.5px; font-weight: 600;
  color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2); white-space: nowrap;
}
tbody td {
  padding: 10px 14px; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--bg-2); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-2); }
.rank-num  { font-weight: 700; color: var(--text-3); }
.rate-high { color: var(--green); font-weight: 600; }
.rate-med  { color: var(--orange); font-weight: 600; }
.rate-low  { color: var(--red); font-weight: 600; }
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-reels    { background: #af52de18; color: var(--purple); }
.badge-carousel { background: #0071e318; color: var(--blue); }

/* ── Content Stock ── */
.stock-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  overflow: hidden;
}

.stock-card.alert-active { border-color: #ff3b3030; box-shadow: 0 0 0 3px #ff3b3012, var(--shadow-sm); }

.stock-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; gap: 12px; flex-wrap: wrap;
}
.stock-title { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }
.stock-sub   { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.stock-header-right { display: flex; align-items: center; gap: 12px; }

.stock-counter { display: flex; align-items: baseline; gap: 6px; }
.stock-count {
  font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.5px;
  transition: color 0.2s;
}
.stock-count.low  { color: var(--red); }
.stock-label-count { font-size: 12px; color: var(--text-2); }

.stock-alert {
  display: flex; align-items: center; gap: 6px;
  background: #ff3b3010; border: 1px solid #ff3b3030;
  color: var(--red); padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  animation: pulse-alert 2s ease-in-out infinite;
}
@keyframes pulse-alert {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

.stock-input-row {
  display: flex; gap: 8px;
  padding: 0 20px 14px;
}
.stock-input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 14px;
  font-size: 13px; font-family: var(--font); color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.stock-input:focus { border-color: var(--blue); background: var(--bg); }
.stock-input::placeholder { color: var(--text-3); }

.stock-add-btn {
  background: var(--blue); color: white; border: none;
  padding: 9px 18px; border-radius: 9px;
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; white-space: nowrap; transition: background 0.12s;
}
.stock-add-btn:hover { background: var(--blue-2); }

.stock-list {
  list-style: none;
  border-top: 1px solid var(--bg-2);
  max-height: 300px; overflow-y: auto;
}

.stock-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--bg-2);
  transition: background 0.1s;
}
.stock-item:last-child { border-bottom: none; }
.stock-item:hover { background: var(--bg-2); }

.stock-item-num {
  width: 22px; height: 22px; flex-shrink: 0;
  background: var(--bg-2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-3);
}
.stock-item-title { flex: 1; font-size: 13px; color: var(--text); }
.stock-item-date  { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.stock-item-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: 5px;
  display: flex; align-items: center; transition: all 0.12s;
  font-size: 16px; line-height: 1;
}
.stock-item-del:hover { background: #ff3b3015; color: var(--red); }

.stock-empty {
  padding: 28px 20px; text-align: center;
  font-size: 13px; color: var(--text-3);
}

/* ── Top Performing Content ── */
.top-content { display: flex; flex-direction: column; gap: 10px; }

.tc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid rgba(0,0,0,.04);
  border-radius: 11px;
  text-decoration: none; color: inherit;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.tc-item:hover {
  background: var(--bg);
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tc-rank {
  width: 26px; height: 26px; flex-shrink: 0;
  background: var(--text); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

.tc-cover {
  position: relative;
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 9px; overflow: hidden;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
}
/* Fallback icon shown when no cover / image fails to load (sits behind the img) */
.tc-cover::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(255,255,255,.22);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Ccircle cx='8.5' cy='9' r='1.6'/%3E%3Cpath d='M21 16l-5-5L5 21'/%3E%3C/svg%3E") center / 26px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Ccircle cx='8.5' cy='9' r='1.6'/%3E%3Cpath d='M21 16l-5-5L5 21'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.tc-cover img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.tc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tc-top  { display: flex; align-items: center; gap: 8px; }
.tc-date { font-size: 11px; color: var(--text-3); }

.tc-caption {
  font-size: 13px; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tc-nocap { color: var(--text-3); font-style: italic; }

.tc-metrics { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1px; }
.tc-metric  { font-size: 11.5px; color: var(--text-2); }
.tc-metric b { color: var(--text); font-weight: 700; font-size: 12.5px; }

.tc-arrow { flex-shrink: 0; font-size: 15px; color: var(--text-3); transition: color 0.12s; }
.tc-item:hover .tc-arrow { color: var(--blue); }

.tc-empty {
  padding: 24px 16px; text-align: center;
  font-size: 13px; color: var(--text-3);
}

/* ── Market Radar (Twitter feed) ── */
.radar-card { display: flex; flex-direction: column; gap: 14px; }

.radar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.radar-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.radar-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 5px 9px; font-size: 11.5px; font-family: var(--font);
  outline: none; cursor: pointer;
}

.radar-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.radar-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-chip {
  background: var(--bg-2); border: 1px solid transparent; color: var(--text-2);
  font-family: var(--font); font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 20px; cursor: pointer; transition: all 0.12s;
}
.radar-chip:hover  { color: var(--text); }
.radar-chip.active { background: var(--text); color: #fff; }

.radar-regions { display: flex; background: var(--bg-3); border-radius: 8px; padding: 3px; gap: 2px; }
.radar-region {
  background: none; border: none; font-family: var(--font);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  padding: 4px 11px; border-radius: 6px; cursor: pointer; transition: all 0.12s;
}
.radar-region:hover  { color: var(--text); }
.radar-region.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

.radar-list { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; }

.radar-item {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-2); border: 1px solid rgba(0,0,0,.04);
  border-radius: 11px; padding: 12px 14px;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.radar-item:hover { background: var(--bg); border-color: var(--border); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.radar-item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.radar-badge {
  display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 20px; font-size: 10.5px; font-weight: 600;
}
.radar-badge.region { background: #0071e312; color: var(--blue); }
.radar-badge.cat    { background: var(--bg-3); color: var(--text-2); }
.radar-handle { font-size: 12px; font-weight: 600; color: var(--text); }
.radar-eng    { margin-left: auto; font-size: 11px; color: var(--text-3); white-space: nowrap; }

.radar-summary { font-size: 13px; color: var(--text); line-height: 1.4; margin-bottom: 4px; }
.radar-text {
  font-size: 12px; color: var(--text-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.radar-loading, .radar-empty {
  padding: 28px 16px; text-align: center; font-size: 13px; color: var(--text-3);
}

/* ── SMC Task ── */
.task-form { display: flex; flex-direction: column; gap: 10px; }
.task-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.task-select, .task-date {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-family: var(--font); color: var(--text);
  outline: none; cursor: pointer; transition: border-color 0.15s;
}
.task-select { flex: 1; min-width: 140px; }
.task-select:focus, .task-date:focus { border-color: var(--blue); background: var(--bg); }

.stock-add-btn.ghost {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
}
.stock-add-btn.ghost:hover { background: var(--bg-3); }

/* People manager */
.people-block { margin-top: 18px; border-top: 1px solid var(--bg-2); padding-top: 16px; }
.people-head {
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px;
}
.people-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.people-empty { font-size: 12px; color: var(--text-3); }
.person-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 6px 4px 12px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.person-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 15px; line-height: 1;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: all 0.12s;
}
.person-del:hover { background: #ff3b3015; color: var(--red); }
.people-input-row { display: flex; gap: 8px; }

/* Task list head + filters */
.task-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.task-filters { display: flex; background: var(--bg-3); border-radius: 8px; padding: 3px; gap: 2px; }
.task-filter {
  background: none; border: none; font-family: var(--font);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  padding: 4px 11px; border-radius: 6px; cursor: pointer; transition: all 0.12s;
}
.task-filter:hover  { color: var(--text); }
.task-filter.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

/* Task table cells */
.task-cell-title { font-weight: 500; white-space: normal; min-width: 180px; }
.task-muted { color: var(--text-3); }
.deadline-over { color: var(--red); font-weight: 600; }

.task-row-done td { background: #34c7590a; }
.task-row-done .task-cell-title { color: var(--text-2); text-decoration: line-through; }
.task-row-over td { background: #ff3b300a; }

/* Status toggle badge */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; font-family: var(--font);
  cursor: pointer; border: 1px solid transparent; transition: all 0.12s; white-space: nowrap;
}
.status-done   { background: #34c75918; color: var(--green); }
.status-done:hover   { background: #34c75926; }
.status-undone { background: var(--bg-3); color: var(--text-2); }
.status-undone:hover { background: var(--text-3); color: var(--bg); }
.status-over   { background: #ff3b3018; color: var(--red); }
.status-over:hover   { background: #ff3b3026; }

/* Summary pills */
.pill {
  display: inline-flex; align-items: center;
  min-width: 24px; justify-content: center;
  padding: 1px 8px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.pill-done { background: #34c75918; color: var(--green); }
.pill-over { background: #ff3b3018; color: var(--red); }

/* Progress bar in summary */
.progress-cell { min-width: 130px; }
.progress-wrap {
  display: inline-block; vertical-align: middle;
  width: 80px; height: 6px; border-radius: 3px;
  background: var(--bg-3); overflow: hidden; margin-right: 8px;
}
.progress-bar { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s; }
.progress-label { font-size: 12px; font-weight: 600; color: var(--text-2); }

.task-empty { padding: 28px 20px; text-align: center; font-size: 13px; color: var(--text-3); }

/* ── Custom dropdown + calendar (aesthetic form controls) ── */
.cdrop, .cdate { position: relative; }
.cdrop { flex: 1; min-width: 150px; }
.cdate { min-width: 160px; }

.cdrop-trigger, .cdate-trigger {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px;
  font-size: 13px; font-family: var(--font); color: var(--text);
  cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.cdrop-trigger:hover, .cdate-trigger:hover { background: var(--bg); border-color: var(--text-3); }
.cdrop.open .cdrop-trigger, .cdate.open .cdate-trigger {
  background: var(--bg); border-color: var(--blue); box-shadow: 0 0 0 3px #0071e320;
}
.cdrop-value { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cdrop-value > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdrop-placeholder, .cdate-placeholder { color: var(--text-3); }
.cdrop-caret { color: var(--text-2); flex-shrink: 0; transition: transform .18s; }
.cdrop.open .cdrop-caret { transform: rotate(180deg); }
.cdate-trigger svg { color: var(--text-2); flex-shrink: 0; }
.cdate-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avatar badge */
.cavatar {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; line-height: 1;
}
.cavatar-none { background: var(--bg-3); color: var(--text-3); font-weight: 600; }

/* Dropdown menu */
.cdrop-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; max-height: 260px; overflow-y: auto;
  animation: pop-in .14s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cdrop-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: none; border: none; border-radius: 8px; padding: 7px 9px;
  font-size: 13px; font-family: var(--font); color: var(--text);
  cursor: pointer; text-align: left; transition: background .1s;
}
.cdrop-item:hover    { background: var(--bg-2); }
.cdrop-item.selected { background: #0071e30d; font-weight: 600; }
.cdrop-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdrop-check { color: var(--blue); flex-shrink: 0; }

/* Calendar popup */
.cdate-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: 268px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 12px;
  animation: pop-in .14s ease;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.cal-nav {
  width: 28px; height: 28px; border-radius: 8px; background: var(--bg-2);
  border: none; cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; transition: all .12s;
}
.cal-nav:hover { background: var(--bg-3); color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell { height: 32px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.cal-dow { margin-bottom: 2px; }
.cal-dow-cell { color: var(--text-3); font-weight: 600; font-size: 10px; height: 24px; text-transform: uppercase; letter-spacing: .02em; }
.cal-day {
  border: none; background: none; border-radius: 8px; cursor: pointer;
  color: var(--text); font-family: var(--font); font-size: 12.5px; font-weight: 500;
  transition: background .1s, color .1s;
}
.cal-day:hover  { background: var(--bg-2); }
.cal-today      { color: var(--blue); font-weight: 700; }
.cal-selected   { background: var(--blue) !important; color: #fff !important; font-weight: 700; box-shadow: 0 2px 6px #0071e355; }
.cal-empty      { pointer-events: none; }
.cal-foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bg-2); }
.cal-foot-btn {
  flex: 1; padding: 7px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-family: var(--font);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .12s;
}
.cal-foot-btn:hover { background: var(--bg-3); }
.cal-clear { color: var(--red); }
.cal-clear:hover { background: #ff3b3010; border-color: #ff3b3040; }

/* ── Minute of Meeting ── */
.mom-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.mom-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mom-form-row .stock-input { flex: 1; min-width: 200px; }
.mom-textarea {
  width: 100%; resize: vertical; min-height: 92px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
  font-size: 13px; font-family: var(--font); color: var(--text);
  line-height: 1.5; outline: none; transition: border-color .15s, background .15s;
}
.mom-textarea:focus { border-color: var(--blue); background: var(--bg); }
.mom-textarea::placeholder { color: var(--text-3); }
.mom-form-actions { display: flex; justify-content: flex-end; }

.mom-list {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--bg-2); padding-top: 16px;
  max-height: 560px; overflow-y: auto;
}
.mom-item {
  position: relative;
  background: var(--bg-2); border: 1px solid rgba(0,0,0,.04);
  border-left: 3px solid var(--blue);
  border-radius: 11px; padding: 13px 15px;
  transition: background .12s, box-shadow .12s;
}
.mom-item:hover { background: var(--bg); box-shadow: var(--shadow-sm); }
.mom-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mom-date {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; color: var(--blue);
  text-transform: capitalize;
}
.mom-date-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.mom-title { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 6px; letter-spacing: -.2px; }
.mom-notes {
  font-size: 13px; color: var(--text-2); line-height: 1.5;
  margin-top: 5px; white-space: pre-wrap; word-break: break-word;
}
.mom-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--text-3); }

/* Clamp preview to 3 lines; full text shown in modal */
.mom-clamp {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.mom-item.mom-clickable { cursor: pointer; }
.mom-more {
  margin-top: 7px; font-size: 12px; font-weight: 600; color: var(--blue);
}
.mom-item.mom-clickable:hover .mom-more { text-decoration: underline; }

/* MoM detail modal */
.mom-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: mom-fade .15s ease;
}
@keyframes mom-fade { from { opacity: 0; } to { opacity: 1; } }
.mom-modal-card {
  position: relative; background: var(--bg);
  width: 100%; max-width: 560px; max-height: 80vh;
  border-radius: 16px; box-shadow: var(--shadow);
  padding: 24px 26px; overflow-y: auto;
  animation: pop-in .16s ease;
}
.mom-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-2); border: none; cursor: pointer;
  color: var(--text-2); font-size: 19px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: all .12s;
}
.mom-modal-close:hover { background: var(--bg-3); color: var(--text); }
.mom-modal-date {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--blue); text-transform: capitalize;
  margin-bottom: 8px; padding-right: 40px;
}
.mom-modal-title { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.3px; margin-bottom: 12px; }
.mom-modal-notes { font-size: 14px; color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ── Team Workload ───────────────────────────────────────────────────────── */
.wl-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.wl-live-badge {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; color: var(--text-2);
}
.wl-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  animation: wl-pulse-anim 2s ease-in-out infinite;
}
@keyframes wl-pulse-anim {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,199,89,.5); }
  50%      { box-shadow: 0 0 0 5px rgba(52,199,89,0); }
}

/* Ranked list — editorial, hairline-separated rows */
.wl-grid { margin-top: 6px; }

.wl-row {
  display: grid;
  grid-template-columns: 34px minmax(120px, 1.4fr) minmax(140px, 2fr) 62px 14px;
  align-items: center; gap: 18px;
  padding: 15px 8px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background .14s ease;
}
.wl-row:first-child { border-top: none; }
.wl-row:hover { background: var(--bg-2); }

.wl-rank {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-3); font-variant-numeric: tabular-nums;
}

.wl-id { min-width: 0; }
.wl-name { font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.wl-sub  { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

.wl-load { display: flex; flex-direction: column; gap: 7px; }
.wl-load-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  letter-spacing: .01em;
}
.wl-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.wl-dot-overload  { background: var(--red); }
.wl-dot-atrisk    { background: var(--orange); }
.wl-dot-normal    { background: var(--green); }
.wl-dot-underload { background: var(--text-3); }

.wl-track { height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.wl-fill  { height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.wl-fill-overload  { background: var(--red); }
.wl-fill-atrisk    { background: var(--orange); }
.wl-fill-normal    { background: var(--green); }
.wl-fill-underload { background: var(--text-3); opacity: .55; }

.wl-metric { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.wl-metric-val { font-size: 20px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wl-metric-lbl { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 1px; }

.wl-chevron { font-size: 20px; color: var(--text-3); text-align: center; transition: color .14s, transform .14s; }
.wl-row:hover .wl-chevron { color: var(--text-2); transform: translateX(2px); }

.wl-empty {
  padding: 44px 20px; text-align: center;
  font-size: 13px; color: var(--text-3);
}

@media (max-width: 620px) {
  .wl-row { grid-template-columns: 26px 1fr 58px 12px; gap: 12px; }
  .wl-load { display: none; }
}

/* ── PIC detail modal — refined ── */
.wl-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.wl-modal.hidden { display: none; }
.wl-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); }
.wl-modal-box {
  position: relative; z-index: 1; width: min(420px, 100%);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 18px; padding: 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  animation: wlPop .18s cubic-bezier(.2,.8,.3,1);
}
@keyframes wlPop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }

.wl-d-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wl-d-title { display: flex; align-items: center; gap: 12px; }
.wl-d-name { font-size: 22px; font-weight: 650; color: var(--text); letter-spacing: -.02em; }
.wl-d-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  padding: 4px 10px; border-radius: 20px; background: var(--bg-2);
}
.wl-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--text-3);
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.wl-modal-close:hover { background: var(--bg-2); color: var(--text); }

.wl-d-stats { display: flex; gap: 10px; margin: 22px 0 4px; }
.wl-d-stat {
  flex: 1; background: var(--bg-2); border-radius: 13px;
  padding: 14px 10px; text-align: center;
  display: flex; flex-direction: column; gap: 3px;
}
.wl-d-stat-accent { background: var(--text); }
.wl-d-stat-accent .wl-d-stat-val { color: var(--bg); }
.wl-d-stat-accent .wl-d-stat-lbl { color: var(--text-3); }
.wl-d-stat-val { font-size: 24px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wl-d-stat-lbl { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

.wl-d-listtitle { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 24px 0 12px; }
.wl-d-list { display: flex; flex-direction: column; gap: 12px; max-height: 42vh; overflow-y: auto; }
.wl-d-row { display: grid; grid-template-columns: 68px 1fr 26px; align-items: center; gap: 12px; }
.wl-d-svc { font-size: 12.5px; font-weight: 600; color: var(--text); }
.wl-d-track { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.wl-d-fill { height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.wl-d-num { font-size: 13px; font-weight: 650; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.wl-d-empty { font-size: 12.5px; color: var(--text-3); padding: 8px 0; }

/* ── Finance modal — lega & rapi (dedicated, gak pakai wl-d-* yang sempit) ── */
.fin-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.fin-modal.hidden { display: none; }
.fin-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.fin-modal-box {
  position: relative; z-index: 1; width: min(600px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 22px;
  padding: 30px 30px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.30);
  animation: finPop .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes finPop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.fin-m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fin-m-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.fin-m-title { font-size: 24px; font-weight: 680; letter-spacing: -.02em; color: var(--text); line-height: 1.15; }
.fin-m-close {
  background: none; border: none; cursor: pointer; font-size: 24px; line-height: 1; color: var(--text-3);
  width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .12s, color .12s;
}
.fin-m-close:hover { background: var(--bg-2); color: var(--text); }
.fin-m-summary { display: flex; gap: 12px; margin: 24px 0 6px; flex-wrap: wrap; }
.fin-m-stat { flex: 1; min-width: 128px; background: var(--bg-2); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 5px; }
.fin-m-stat.accent { background: var(--accent-bg); }
.fin-m-stat.accent .v, .fin-m-stat.accent .l { color: #fff; }
.fin-m-stat.accent .l { opacity: .62; }
.fin-m-stat .v { font-size: 19px; font-weight: 680; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-m-stat .l { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.fin-m-listhead { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 28px 2px 16px; }
.fin-m-list { display: flex; flex-direction: column; gap: 17px; }
.fin-m-row { display: flex; flex-direction: column; gap: 8px; }
.fin-m-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.fin-m-label { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 0; }
.fin-m-label .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-m-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; background: var(--bg-3); color: var(--text-2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.fin-m-val { font-size: 14px; font-weight: 680; color: var(--text); font-variant-numeric: tabular-nums; flex-shrink: 0; letter-spacing: -.01em; white-space: nowrap; }
.fin-m-val em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-3); margin-left: 6px; }
.fin-m-bar { height: 8px; background: var(--bg-3); border-radius: 5px; overflow: hidden; }
.fin-m-bar i { display: block; height: 100%; border-radius: 5px; transition: width .55s cubic-bezier(.4,0,.2,1); }
.fin-m-note { font-size: 12px; line-height: 1.55; color: var(--text-2); margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.fin-m-empty { font-size: 13px; color: var(--text-3); padding: 20px 0; text-align: center; }

/* Wrapper sub-tab finance: pulihkan jarak antar-section (bungkusan #fnSummary bikin
   flex-gap .view nggak kena ke KPI/chart di dalamnya). Khusus finance — tab lain gak kena. */
#fnSummary, #fnReminder { display: flex; flex-direction: column; gap: 16px; }

/* ── Finance sub-tabs (Ringkasan / Invoice Reminder) ── */
.fn-subtabs { display: flex; margin: 2px 0 18px; border-bottom: 1px solid var(--border); }
.fn-sub { background: none; border: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); padding: 9px 2px; margin-right: 22px; border-bottom: 2px solid transparent; position: relative; top: 1px; display: inline-flex; align-items: center; gap: 8px; transition: color .12s; }
.fn-sub:hover { color: var(--text); }
.fn-sub.active { color: var(--text); border-bottom-color: var(--blue); }
.fn-sub-badge { background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ── Invoice Reminder ── */
.fn-rem-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.fn-rt { background: var(--bg-2); border: 1px solid var(--border); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 8px 14px; border-radius: 20px; display: inline-flex; align-items: center; gap: 7px; transition: all .12s; }
.fn-rt:hover { color: var(--text); }
.fn-rt.active { background: var(--accent-bg); color: #fff; border-color: transparent; }
.fn-rt-count { background: rgba(0,0,0,.12); font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.fn-rt.active .fn-rt-count { background: rgba(255,255,255,.25); }
.fn-rem-search { width: 100%; box-sizing: border-box; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 13.5px; margin-bottom: 16px; }
.fn-rem-search:focus { outline: none; border-color: var(--blue); }
.fn-rem-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.fn-card { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 11px; box-shadow: var(--shadow-sm); }
.fn-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fn-card-client { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.25; }
.fn-card-inv { font-size: 11.5px; color: var(--text-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.fn-card-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; border-radius: 7px; white-space: nowrap; flex-shrink: 0; }
.fn-b-out { background: #fff0e6; color: #c2410c; }
.fn-b-new { background: #e6f0ff; color: #1d4ed8; }
.fn-b-sent { background: #e7f7ec; color: #15803d; }
[data-theme="dark"] .fn-b-out { background: #3a2213; color: #fb923c; }
[data-theme="dark"] .fn-b-new { background: #16233d; color: #7ca8ff; }
[data-theme="dark"] .fn-b-sent { background: #14301f; color: #5fd08a; }
.fn-card-amt { font-size: 18px; font-weight: 750; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fn-card-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12px; color: var(--text-2); }
.fn-card-meta b { color: var(--text); font-weight: 650; }
.fn-card-actions { display: flex; gap: 8px; margin-top: 3px; }
.fn-card-btn { flex: 1; border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 650; padding: 9px; border-radius: 10px; transition: filter .12s; }
.fn-card-btn:hover { filter: brightness(1.06); }
.fn-btn-primary { background: var(--blue); color: #fff; }
.fn-btn-ghost { background: var(--bg-2); color: var(--text); }
.fn-rem-empty { grid-column: 1 / -1; text-align: center; color: var(--text-3); padding: 44px 0; font-size: 14px; line-height: 1.6; }

/* ── Kirim Invoice / Reminder — email modal ── */
.inv-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.inv-modal.hidden { display: none; }
.inv-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.inv-modal-box { position: relative; z-index: 1; width: min(1000px, 100%); max-height: 90vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: finPop .2s cubic-bezier(.2,.8,.3,1); }
.inv-m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px 16px; border-bottom: 1px solid var(--border); }
.inv-m-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.inv-m-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.inv-m-close { background: none; border: none; cursor: pointer; font-size: 24px; line-height: 1; color: var(--text-3); width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inv-m-close:hover { background: var(--bg-2); color: var(--text); }
.inv-m-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; flex: 1; min-height: 0; overflow: hidden; }
.inv-m-form { padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; }
.inv-m-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
.inv-m-label:first-child { margin-top: 0; }
.inv-m-hint { font-weight: 500; color: var(--text-3); }
.inv-m-input, .inv-m-textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 13.5px; }
.inv-m-textarea { resize: vertical; line-height: 1.55; min-height: 180px; }
.inv-m-input:focus, .inv-m-textarea:focus { outline: none; border-color: var(--blue); }
.inv-m-attach { margin-top: 14px; font-size: 12px; color: var(--text-2); background: var(--bg-2); border-radius: 9px; padding: 10px 12px; line-height: 1.5; }
.inv-m-preview { border-left: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; }
.inv-m-preview-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 20px 8px; }
.inv-m-iframe { flex: 1; width: 100%; border: none; background: #eef0f3; min-height: 300px; }
.inv-m-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 26px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.inv-m-status { font-size: 12.5px; color: var(--text-2); flex: 1; min-width: 200px; line-height: 1.5; }
.inv-m-actions { display: flex; gap: 10px; }
.inv-m-btn { border: none; cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 650; padding: 10px 20px; border-radius: 11px; transition: filter .12s; }
.inv-m-btn.primary { background: var(--blue); color: #fff; }
.inv-m-btn.ghost { background: var(--bg-2); color: var(--text); }
.inv-m-btn:hover { filter: brightness(1.06); }
@media (max-width: 760px) {
  .inv-modal { padding: 12px; }
  .inv-m-body { grid-template-columns: 1fr; }
  .inv-m-preview { border-left: none; border-top: 1px solid var(--border); }
  .inv-m-iframe { min-height: 340px; }
}

/* ── Konten Siap Post (tab Content) ── */
.ct-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 4px; }
.ct-card { display: flex; gap: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.ct-cover { width: 96px; height: 128px; border-radius: 10px; object-fit: cover; background: var(--bg-3); flex-shrink: 0; }
.ct-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ct-date { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ct-caption { font-size: 14.5px; font-weight: 700; color: var(--text); margin-top: 3px; line-height: 1.32; }
.ct-meta { font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.ct-actions { margin-top: auto; padding-top: 12px; }
.ct-btn { width: 100%; border: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 700; padding: 10px; border-radius: 10px; color: #fff; background: linear-gradient(45deg,#f09433 0%,#dc2743 50%,#bc1888 100%); transition: filter .12s; }
.ct-btn:hover { filter: brightness(1.06); }
.ct-btn.posted, .ct-btn:disabled { background: var(--bg-3); color: var(--text-3); cursor: default; filter: none; }
.ct-empty { grid-column: 1 / -1; text-align: center; color: var(--text-3); padding: 34px 0; font-size: 13.5px; line-height: 1.6; }

/* client list inside detail modal */
.wl-c-list { display: flex; flex-direction: column; gap: 14px; max-height: 34vh; overflow-y: auto; padding-right: 2px; }
.wl-c-item { display: flex; flex-direction: column; gap: 7px; }
.wl-c-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wl-c-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.wl-c-pct { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; flex-shrink: 0; letter-spacing: -.01em; }
.wl-c-pct em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.wl-c-svcs { display: flex; flex-wrap: wrap; gap: 5px; }
.wl-c-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 2px 4px 2px 8px; border-radius: 6px; letter-spacing: .01em;
}
.wl-c-tag em {
  font-style: normal; font-weight: 700; color: var(--text);
  background: var(--bg-3); border-radius: 5px; padding: 1px 6px; font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.wl-c-track { height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.wl-c-fill { height: 100%; border-radius: 3px; background: var(--text); opacity: .82; transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ── Accounting vs Tax + Reviewer duo ── */
.wl-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px){ .wl-duo { grid-template-columns: 1fr; } }
.wl-cat-card, .wl-rev-card { display: flex; flex-direction: column; }

/* category colors */
.cat-acc   { background: var(--blue) !important; }
.cat-tax   { background: var(--purple) !important; }
.cat-other { background: var(--text-3) !important; }

/* split bar */
.wl-cat-bar { display: flex; height: 12px; border-radius: 7px; overflow: hidden; margin: 16px 0 20px; background: var(--bg-3); gap: 2px; }
.wl-cat-seg { height: 100%; transition: width .5s cubic-bezier(.4,0,.2,1); }
.wl-cat-seg:first-child { border-radius: 7px 0 0 7px; }
.wl-cat-seg:last-child  { border-radius: 0 7px 7px 0; }

.wl-cat-stats { display: flex; flex-direction: column; gap: 4px; }
.wl-cat-stat {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 10px 10px; border-radius: 10px; text-align: left; transition: background .12s;
}
.wl-cat-stat:hover { background: var(--bg-2); }
.wl-cat-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.wl-cat-info { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wl-cat-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.wl-cat-num  { font-size: 18px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wl-cat-num em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-3); margin-left: 7px; }

/* reviewer rows */
.wl-rev-row {
  display: grid; grid-template-columns: 42px 1fr 34px; align-items: center; gap: 12px;
  width: 100%; background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 11px 8px; border-radius: 10px; text-align: left; transition: background .12s;
}
.wl-rev-row:hover { background: var(--bg-2); }
.wl-rev-name { font-size: 14px; font-weight: 650; color: var(--text); letter-spacing: -.01em; }
.wl-rev-track { height: 7px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.wl-rev-fill { display: block; height: 100%; border-radius: 4px; background: var(--text); opacity: .85; transition: width .5s cubic-bezier(.4,0,.2,1); }
.wl-rev-total { font-size: 15px; font-weight: 650; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.wl-rev-card .card-sub strong { color: var(--text); font-weight: 700; }

/* client lists in modals */
.wl-cl-list { display: flex; flex-direction: column; max-height: 34vh; overflow-y: auto; }
.wl-cl-row { font-size: 12.5px; color: var(--text); padding: 8px 2px; border-top: 1px solid var(--border); }
.wl-cl-row:first-child { border-top: none; }
.wl-cl-role { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wl-cl-tags { display: flex; gap: 5px; flex-shrink: 0; }
.wl-role-tag { font-size: 10px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 6px; }
.wl-d-fill.cat-acc, .wl-d-fill.cat-tax, .wl-d-fill.cat-other { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════
   SMART CAROUSEL — self-contained dark ChatGPT-style canvas (theme-agnostic)
   ═══════════════════════════════════════════════════════════════════════ */
#viewCarousel {
  --sc-bg:      #0a0a0c;
  --sc-panel:   #161619;
  --sc-border:  #2a2a30;
  --sc-text:    #ededee;
  --sc-dim:     #8b8b93;
  --sc-faint:   #5c5c64;
  --sc-gold:    #e8b556;
  --sc-gold-2:  #f6cf6e;
  /* Fill ONLY the main content area (right of the sidebar), not the viewport */
  position: absolute; inset: 0;
  margin: 0; padding: 0;
}

/* Confine the dark canvas to .main so the sidebar stays visible.
   .main becomes the containing block for the absolute view. */
body.sc-active .main { padding: 0; overflow: hidden; position: relative; }
body.sc-active .topbar { display: none; }
body.sc-active .state-wrap { display: none !important; }

.sc-stage {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232,181,86,.05), transparent 60%),
    var(--sc-bg);
  border-left: 1px solid #1c1c20;
  overflow: hidden;
}

/* ── Dynamic gold ambient glow ── */
.sc-glow {
  position: absolute;
  top: -25%; left: 50%;
  width: 70vw; height: 70vw;
  max-width: 900px; max-height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(246,207,110,.16) 0%, rgba(232,181,86,.06) 35%, transparent 68%);
  filter: blur(40px);
  pointer-events: none;
  animation: scDrift 14s ease-in-out infinite;
}
@keyframes scDrift {
  0%,100% { transform: translateX(-50%) translateY(0)    scale(1);    opacity: .85; }
  50%     { transform: translateX(-42%) translateY(28px) scale(1.08); opacity: 1;   }
}

/* ── Thread (messages) ── */
.sc-thread {
  flex: 1 1 auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 1;
}
.sc-thread::-webkit-scrollbar { width: 8px; }
.sc-thread::-webkit-scrollbar-thumb { background: #2c2c33; border-radius: 8px; }

/* Hero (empty state) — centered with composer just below */
.sc-stage.empty .sc-thread { flex: 0 0 auto; justify-content: flex-end; padding-bottom: 0; }
.sc-stage.empty { justify-content: center; }
.sc-hero { text-align: center; margin-bottom: 26px; }
.sc-hero-title {
  font-size: 34px; font-weight: 600; letter-spacing: -.6px;
  color: var(--sc-text);
}
.sc-grad {
  background: linear-gradient(92deg, var(--sc-gold) 0%, var(--sc-gold-2) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sc-hero-sub { margin-top: 10px; font-size: 14.5px; color: var(--sc-dim); }
.sc-stage:not(.empty) .sc-hero { display: none; }

/* ── Message bubbles ── */
.sc-msg { display: flex; flex-direction: column; gap: 6px; animation: scFade .25s ease; }
.sc-msg.user  { align-items: flex-end; }
.sc-msg.bot   { align-items: flex-start; }
.sc-bubble {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.sc-msg.user .sc-bubble { background: #232329; color: var(--sc-text); border-bottom-right-radius: 5px; }
.sc-msg.bot  .sc-bubble {
  background: var(--sc-panel); color: var(--sc-text);
  border: 1px solid var(--sc-border); border-bottom-left-radius: 5px;
}
.sc-bubble.err { border-color: #5a2f2f; background: #241718; color: #f0b6b6; }
.sc-bubble code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--sc-gold-2); }
.sc-role { font-size: 11px; font-weight: 600; letter-spacing: .3px; color: var(--sc-faint); padding: 0 4px; }
.sc-slidelist { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sc-slidelist li {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--sc-dim);
}
.sc-slidelist .si-idx {
  flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: #26241c; color: var(--sc-gold-2);
  font-weight: 700; font-size: 11px;
}
.sc-slidelist .si-type {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 5px; border: 1px solid var(--sc-border); color: var(--sc-faint);
}
.sc-slidelist .si-text { color: var(--sc-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes scFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Composer ── */
.sc-composer {
  flex: 0 0 auto;
  width: 100%; max-width: 760px;
  margin: 0 auto;
  padding: 8px 24px 28px;
  z-index: 2;
}
.sc-input-wrap {
  background: var(--sc-panel);
  border: 1px solid var(--sc-border);
  border-radius: 18px;
  padding: 6px 6px 6px 0;
  transition: border-color .18s, box-shadow .18s;
}
.sc-input-wrap:focus-within {
  border-color: rgba(232,181,86,.5);
  box-shadow: 0 0 0 3px rgba(232,181,86,.10), 0 8px 30px rgba(0,0,0,.35);
}
.sc-input {
  width: 100%;
  max-height: 240px;
  resize: none;
  border: 0; outline: 0; background: transparent;
  color: var(--sc-text);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; line-height: 1.55;
  padding: 14px 18px 6px;
}
.sc-input::placeholder { color: var(--sc-faint); font-family: var(--font); }
.sc-input-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; }
.sc-input-tools { display: flex; gap: 4px; }
.sc-tool {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--sc-dim); cursor: pointer;
  transition: background .15s, color .15s;
}
.sc-tool:hover { background: #232329; color: var(--sc-text); }
.sc-send {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 11px; border: 0; cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: #1a1505;
  background: linear-gradient(95deg, var(--sc-gold) 0%, var(--sc-gold-2) 100%);
  box-shadow: 0 4px 16px rgba(232,181,86,.22);
  transition: transform .12s, box-shadow .15s, opacity .15s;
}
.sc-send:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,181,86,.34); }
.sc-send:active { transform: translateY(0); }
.sc-send:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.sc-send svg { stroke: #1a1505; }

/* ── Chips ── */
.sc-chips { display: flex; gap: 9px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.sc-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--sc-border);
  color: var(--sc-dim); font-size: 12.5px; font-weight: 500;
  transition: border-color .15s, color .15s, background .15s;
}
.sc-chip:hover { border-color: rgba(232,181,86,.45); color: var(--sc-gold-2); background: rgba(232,181,86,.06); }

/* ── Result: open-in-Canva button ── */
.sc-actions { margin-top: 12px; }
.sc-open {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; text-decoration: none;
  font-size: 13px; font-weight: 600; color: #1a1505;
  background: linear-gradient(95deg, var(--sc-gold) 0%, var(--sc-gold-2) 100%);
  box-shadow: 0 4px 16px rgba(232,181,86,.22);
  transition: transform .12s, box-shadow .15s;
}
.sc-open:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,181,86,.34); }
.sc-open svg { stroke: #1a1505; }

/* ── Asset request panel (fase PROVIDE) ── */
.sc-assets {
  margin-top: 12px; padding: 12px; border-radius: 10px;
  background: rgba(232,181,86,.06); border: 1px solid rgba(232,181,86,.22);
  display: flex; flex-direction: column; gap: 8px;
}
.sc-assets-title { font-size: 12.5px; font-weight: 600; color: var(--sc-gold-2); }
.sc-asset {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--sc-panel); border: 1px solid var(--sc-border);
}
.sc-asset.provided { border-color: rgba(120,200,120,.4); background: rgba(120,200,120,.07); }
.sc-asset-label { flex: 1; font-size: 13px; color: var(--sc-text); }
.sc-asset-label em { color: var(--sc-faint); font-style: normal; font-size: 11.5px; }
.sc-asset-btn {
  cursor: pointer; font-size: 12px; font-weight: 600; color: #1a1505;
  padding: 5px 12px; border-radius: 7px;
  background: linear-gradient(95deg, var(--sc-gold) 0%, var(--sc-gold-2) 100%);
}
.sc-asset-status { font-size: 11.5px; min-width: 42px; text-align: right; color: var(--sc-faint); }
.sc-asset-status[data-st="ok"]   { color: #78c878; }
.sc-asset-status[data-st="err"]  { color: #e2686d; }
.sc-note { margin-top: 8px; font-size: 12px; color: var(--sc-dim); }
.sc-gen-btn {
  cursor: pointer; font-size: 13px; font-weight: 700; color: #1a1505;
  padding: 9px 18px; border-radius: 10px; border: none;
  background: linear-gradient(95deg, var(--sc-gold) 0%, var(--sc-gold-2) 100%);
  box-shadow: 0 4px 16px rgba(232,181,86,.22); transition: transform .12s, box-shadow .15s;
}
.sc-gen-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,181,86,.34); }
.sc-gen-btn:disabled { opacity: .6; cursor: default; }

/* ── Loading: subtle grey shimmer + muted dots, no bubble (blends with canvas) ── */
.sc-loading { display: inline-flex; align-items: center; gap: 9px; padding: 2px 2px; }
.sc-shimmer {
  font-size: 13.5px; font-weight: 500; letter-spacing: .2px;
  background: linear-gradient(100deg, #5f5f67 0%, #5f5f67 40%, #c4c4cc 50%, #5f5f67 60%, #5f5f67 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: scShimmer 3.6s ease-in-out infinite;
}
@keyframes scShimmer { 0% { background-position: 200% 0; } 100% { background-position: -120% 0; } }
.sc-dots { display: inline-flex; gap: 5px; }
.sc-dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--sc-dim);
  animation: scDot 1.7s ease-in-out infinite;
}
.sc-dots i:nth-child(2) { animation-delay: .25s; }
.sc-dots i:nth-child(3) { animation-delay: .5s; }
@keyframes scDot {
  0%, 70%, 100% { transform: translateY(0); opacity: .28; }
  35%           { transform: translateY(-3px); opacity: .8; }
}

/* Stop (abort) state of the Generate button */
.sc-send.stopping {
  background: #2a2a30; color: var(--sc-text); box-shadow: none;
}
.sc-send.stopping:hover { background: #34343b; transform: none; box-shadow: none; }
.sc-send.stopping svg { stroke: none; fill: var(--sc-text); }

/* ── User menu (topbar) ── */
.user-menu { position: relative; }
.um-btn {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 0; border-radius: 50%;
}
.um-av {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 1px solid var(--border);
  transition: box-shadow .15s;
}
.um-btn:hover .um-av { box-shadow: 0 0 0 3px var(--bg-3); }
.um-av img { width: 100%; height: 100%; object-fit: cover; }
.um-initial { font-size: 14px; font-weight: 650; color: var(--text-2); }

.um-drop {
  position: absolute; top: 42px; right: 0; z-index: 200;
  min-width: 210px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 13px; box-shadow: var(--shadow); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.um-drop.show { opacity: 1; visibility: visible; transform: none; }
.um-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.um-name { font-size: 13.5px; font-weight: 650; color: var(--text); }
.um-email { font-size: 11.5px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text);
  padding: 9px 12px; border-radius: 8px; text-decoration: none;
}
.um-item:hover { background: var(--bg-2); }
.um-logout { color: var(--red); }

/* ── Leads redesign: source table, conversion badges, funnel, notes ── */
.src-name { font-weight: 600; font-size: 13px; color: var(--text); }
.src-cat  { font-size: 10px; color: var(--text-2); margin-top: 1px; }
.src-vol  { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.src-vol .bar { flex: 1; height: 7px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.src-vol .bar > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.src-vol .n { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-2);
  min-width: 34px; text-align: right; }
.cv { display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.cv-good { background: #34c75918; color: var(--green); }
.cv-ok   { background: #0071e318; color: var(--blue); }
.cv-warn { background: #ff9f0a18; color: var(--orange); }
.cv-crit { background: #ff3b3018; color: var(--red); }

.funnel { display: flex; flex-direction: column; gap: 14px; }
.fn-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.fn-lab { font-size: 12px; font-weight: 600; color: var(--text); }
.fn-val { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: var(--text); }
.fn-val small { color: var(--text-2); font-weight: 500; margin-left: 6px; }
.fn-track { height: 30px; background: var(--bg-2); border-radius: 8px; overflow: hidden; }
.fn-track > i { display: block; height: 100%; background: var(--blue); border-radius: 8px; transition: width .4s; }
.fn-track.win > i { background: var(--green); }
.fn-drop { font-size: 11px; margin-top: 5px; color: var(--text-2); }
.fn-drop.warn { color: var(--orange); }
.fn-drop.good { color: var(--green); }

.lead-note { font-size: 12px; color: var(--text-2); margin-top: 14px; padding: 10px 12px;
  background: var(--bg-2); border-radius: 8px; line-height: 1.5; }
.lead-note b { color: var(--text); font-weight: 600; }
.badge-incomplete { background: #ff9f0a18; color: var(--orange); }
.badge-won  { background: #34c75918; color: var(--green); }
.badge-open { background: var(--bg-3); color: var(--text-2); }

/* ── Month quick-picker (topbar) — matches SMC Task .cdate popover ── */
#monthPick { min-width: 132px; }
.cdate-pop.month-pop { width: 232px; left: auto; right: 0; }
.mon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mon-cell {
  padding: 10px 0; border: none; background: var(--bg-2); border-radius: 9px;
  cursor: pointer; color: var(--text); font-family: var(--font);
  font-size: 12.5px; font-weight: 600; transition: background .12s, color .12s;
}
.mon-cell:hover:not(:disabled) { background: var(--bg-3); }
.mon-cell.mon-selected { background: var(--blue) !important; color: #fff !important;
  box-shadow: 0 2px 6px #0071e355; }
.mon-cell:disabled { opacity: .32; cursor: default; }

/* ── Custom date-range pickers in the topbar (compact .cdate) ── */
.datepicker-wrap .cdate-sm { min-width: 116px; }
.datepicker-wrap .cdate-sm .cdate-trigger { padding: 6px 10px; font-size: 12px; border-radius: 8px; gap: 7px; }
.datepicker-wrap .cdate-sm .cdate-trigger svg { width: 13px; height: 13px; }
#dtPop { left: auto; right: 0; }

/* ── PIC ratings ── */
.wl-starmini { color: #f5a623; font-weight: 700; }

/* rating summary in detail modal */
.wl-rate-summary {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin: 18px 0 4px;
}
.wl-rate-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wl-rate-headline { display: flex; align-items: center; gap: 14px; }
.wl-rate-score { font-size: 30px; font-weight: 700; color: var(--text); letter-spacing: -.03em; line-height: 1; }
.wl-rate-score span { font-size: 14px; color: var(--text-3); font-weight: 600; }
.wl-rate-stars .wl-star-ic { font-size: 15px; }
.wl-rate-sub { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.wl-star-ic { color: var(--bg-3); letter-spacing: 1px; }
.wl-star-ic.on { color: #f5a623; }
.wl-rate-btn {
  background: var(--text); color: var(--bg); border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 650;
  padding: 9px 16px; border-radius: 10px; white-space: nowrap; transition: opacity .12s;
}
.wl-rate-btn:hover { opacity: .85; }

.wl-crit-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.wl-crit-row { display: grid; grid-template-columns: 1fr auto 30px; align-items: center; gap: 10px; }
.wl-crit-lbl { font-size: 12px; color: var(--text-2); }
.wl-crit-stars .wl-star-ic { font-size: 13px; }
.wl-crit-num { font-size: 12px; font-weight: 650; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

.wl-trend-wrap { margin-top: 16px; }
.wl-trend-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 8px; }
.wl-trend { display: flex; align-items: flex-end; gap: 10px; height: 60px; }
.wl-trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.wl-trend-bar { width: 100%; max-width: 34px; background: var(--text); opacity: .78; border-radius: 5px 5px 0 0; min-height: 4px; transition: height .4s ease; }
.wl-trend-lbl { font-size: 9.5px; color: var(--text-3); }

/* rating form modal */
.wl-rate-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.wl-rate-crit-lbl { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.wl-opt { font-weight: 400; color: var(--text-3); font-size: 11px; }
.wl-stars-input { display: flex; align-items: center; gap: 4px; }
.wl-star-btn {
  background: none; border: none; cursor: pointer; padding: 2px;
  font-size: 26px; line-height: 1; color: var(--bg-3); transition: color .1s, transform .1s;
}
.wl-star-btn:hover { transform: scale(1.12); }
.wl-star-btn.on { color: #f5a623; }
.wl-star-val { margin-left: 10px; font-size: 13px; font-weight: 650; color: var(--text-2); min-width: 14px; }
.wl-rate-comment {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: 13px; color: var(--text); resize: vertical;
  outline: none;
}
.wl-rate-comment:focus { border-color: var(--text-3); }
.wl-rate-submit {
  background: var(--text); color: var(--bg); border: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 650; padding: 12px; border-radius: 11px;
  margin-top: 4px; transition: opacity .12s, background .12s;
}
.wl-rate-submit:hover { opacity: .88; }
.wl-rate-submit.warn { background: var(--orange); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE / MOBILE — layout only, no data changes
   ═══════════════════════════════════════════════════════════════════════ */
.hamburger  { display: none; }
.nav-overlay { display: none; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-titles { min-width: 0; }

@media (max-width: 900px) {
  /* Hamburger button */
  .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; transition: background .12s;
  }
  .hamburger:hover { background: var(--bg-2); }

  /* Off-canvas sidebar */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
    width: 250px; min-width: 250px;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 50px rgba(0,0,0,.28);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 150;
    background: rgba(0,0,0,.42); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  body.nav-open .nav-overlay { opacity: 1; visibility: visible; }

  .main { width: 100%; }
  .topbar { padding: 11px 14px; gap: 10px; }
  .page-title { font-size: 16px; }
  .view { padding: 16px 13px 28px; }

  /* KPI cards → 2 per row */
  .kpi { min-width: calc(50% - 5px); }

  /* Modals full-height scroll */
  .wl-modal { padding: 14px; }
  .wl-modal-box { max-height: 88vh; overflow-y: auto; }
  .fin-modal { padding: 14px; }
  .fin-modal-box { padding: 22px 18px 20px; border-radius: 18px; }
  .fin-m-title { font-size: 21px; }
  .fin-m-summary { gap: 8px; }
  .fin-m-stat { min-width: calc(50% - 4px); padding: 13px; }
  .fin-m-stat .v { font-size: 17px; }
}

@media (max-width: 560px) {
  .topbar-right { gap: 6px; row-gap: 8px; }
  .preset { padding: 4px 10px; }
  .datepicker-wrap { order: 3; }
  .kpi { min-width: 100%; }
  .card { min-width: 100%; padding: 16px; }
  .wl-duo { grid-template-columns: 1fr; }
  .wl-rate-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .wl-rate-btn { width: 100%; }
  .page-sub { display: none; }
}
