/* ==========================================================================
   Segara Prima — Social Media Planner · Design System
   Minimalis, biru-putih, tipografi editorial. Tanpa gradient, tanpa shadow
   tebal, tanpa emoji. Flat & presisi. Reuse design language Segara Prima.
   ========================================================================== */

:root {
  --brand: #1B4DF0;
  --brand-600: #1540D4;
  --brand-700: #1136AE;
  --brand-tint: #EDF2FF;
  --brand-tint-2: #DCE5FF;
  --brand-050: #EFF4FF;

  --ink: #0B1424;
  --ink-2: #3D4A5E;
  --ink-3: #6B7789;
  --ink-4: #98A2B3;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --surface-3: #F1F4F8;

  --line: #E3E8EF;
  --line-2: #EDF0F5;
  --line-strong: #CFD7E3;

  --ok: #0E9F6E;      --ok-bg: #E9F7F1;
  --warn: #B45309;    --warn-bg: #FEF5E7;
  --danger: #D92D20;  --danger-bg: #FDECEA;
  --info: #1B4DF0;    --info-bg: #EDF2FF;
  --violet: #6D4AFF;  --violet-bg: #F1EEFF;
  --cyan: #0E7490;    --cyan-bg: #E6F5FA;
  --neutral: #475569; --neutral-bg: #F1F5F9;
  --muted-tone: #6B7789; --muted-bg: #F1F4F8;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(11, 20, 36, .05);
  --shadow-sm: 0 1px 3px rgba(11, 20, 36, .06), 0 1px 2px rgba(11, 20, 36, .04);
  --shadow-md: 0 8px 24px -8px rgba(11, 20, 36, .14), 0 2px 6px rgba(11, 20, 36, .05);
  --shadow-lg: 0 24px 60px -18px rgba(11, 20, 36, .28), 0 6px 18px rgba(11, 20, 36, .08);

  --sidebar-w: 250px;
  --topbar-h: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand-tint-2); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
code, .mono { font-family: var(--mono); }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.smaller { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.spacer { flex: 1 1 auto; }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-3); font-size: 14px; }
.boot-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.noscript { max-width: 520px; margin: 12vh auto; padding: 18px 22px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; height: var(--topbar-h); padding: 0 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.sidebar-brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; flex: none; overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo .brand-initials { color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; flex: none; }
.brand-mark.lg { width: 42px; height: 42px; border-radius: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 14.5px; color: var(--ink); }
.brand-text small { font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .08em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav-group-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .11em; color: var(--ink-4); font-weight: 600; padding: 14px 10px 6px; margin: 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 13.5px; font-weight: 500; position: relative; }
.nav-item:hover { background: var(--surface-3); text-decoration: none; }
.nav-item.is-active { background: var(--brand-tint); color: var(--brand-700); font-weight: 600; }
.nav-item.is-active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-icon { display: inline-flex; color: var(--ink-4); flex: none; }
.nav-item.is-active .nav-icon { color: var(--brand); }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { font-size: 11px; font-weight: 600; background: var(--brand-tint); color: var(--brand-700); border-radius: 99px; padding: 1px 7px; }
.nav-item.is-active .nav-badge { background: #fff; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 10px 12px; position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); cursor: pointer; }
.user-chip:hover { background: var(--surface-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-700); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; }
.avatar.soft { background: var(--brand-tint); color: var(--brand-700); }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.user-chip-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text small { font-size: 11px; color: var(--ink-4); }
.user-chip-caret { color: var(--ink-4); display: inline-flex; }
.user-menu { display: none; position: absolute; left: 12px; right: 12px; bottom: calc(100% - 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 5px; z-index: 50; }
.user-menu.is-open { display: block; }
.user-menu a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 13px; }
.user-menu a:hover { background: var(--surface-3); text-decoration: none; }
.user-menu a.danger { color: var(--danger); }

.sidebar-scrim { display: none; }

.app-main { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px;
}
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 11px; width: 300px; max-width: 40vw; color: var(--ink-4); }
.search-box input { border: none; background: none; outline: none; font: inherit; font-size: 13px; color: var(--ink); width: 100%; }
.search-box kbd { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 24px 24px 64px; width: 100%; max-width: 1560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.content--wide { max-width: none; }

.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head__text { flex: 1; min-width: 220px; }
.page-title { font-size: 20px; }
.page-sub { color: var(--ink-3); font-size: 13.5px; margin: 3px 0 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-4); font-weight: 600; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--ink-4); }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 14px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-flush .card-body { padding: 0; }

/* ---------- Stat / KPI ---------- */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow-xs); }
.stat-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.stat-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-700); flex: none; }
.stat-icon.ok { background: var(--ok-bg); color: var(--ok); }
.stat-icon.warn { background: var(--warn-bg); color: var(--warn); }
.stat-icon.violet { background: var(--violet-bg); color: var(--violet); }
.stat-icon.cyan { background: var(--cyan-bg); color: var(--cyan); }
.stat-label { font-size: 12px; color: var(--ink-4); font-weight: 500; }
.stat-value { font-size: 25px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.stat-value.sm { font-size: 20px; }
.stat-meta { margin-top: 6px; font-size: 12px; color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 500; padding: 8px 14px; min-height: 38px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--brand); color: #fff;
  cursor: pointer; line-height: 1.2; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--brand-600); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-outline { background: var(--surface); border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-tint); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: #F3C9C4; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-wa { background: #128C4A; }
.btn-wa:hover { background: #0F7A40; }
.btn-sm { font-size: 12.5px; padding: 6px 10px; min-height: 32px; }
.btn-lg { font-size: 14.5px; padding: 10px 18px; min-height: 44px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; min-width: 36px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-3); text-decoration: none; }
.icon-btn.is-alert { color: var(--danger); border-color: #F3C9C4; }
.dot-count { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.btn-group { display: inline-flex; }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap; }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); border-color: #E2E8F0; }
.badge-muted { background: var(--muted-bg); color: var(--muted-tone); border-color: #E2E8F0; }
.badge-info { background: var(--info-bg); color: var(--brand-700); border-color: #DBE6FE; }
.badge-violet { background: var(--violet-bg); color: var(--violet); border-color: #DEDAFF; }
.badge-warn, .badge-amber { background: var(--warn-bg); color: var(--warn); border-color: #FDE9C4; }
.badge-ok, .badge-success { background: var(--ok-bg); color: var(--ok); border-color: #BBF7D0; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: #FECACA; }
.badge-cyan { background: var(--cyan-bg); color: var(--cyan); border-color: #C7E9F2; }
.badge.plain { background: var(--surface-3); color: var(--ink-3); border-color: var(--line); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.pill.is-active { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-700); }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

.chip-platform { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--p, var(--line-strong)); color: var(--p, var(--ink-3)); background: #fff; white-space: nowrap; }
.chip-platform svg { flex: none; }
@supports (background: color-mix(in srgb, red 10%, white)) {
  .chip-platform { background: color-mix(in srgb, var(--p, #fff) 9%, #fff); }
}
.chip-platform.sm { font-size: 10.5px; padding: 1px 6px; }

/* ---------- Notices ---------- */
.notice { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 11px 14px; font-size: 13.5px; display: flex; gap: 9px; align-items: flex-start; }
.notice-ok, .notice-success { background: var(--ok-bg); border-color: #BBF7D0; color: #0A6E4C; }
.notice-danger { background: var(--danger-bg); border-color: #FECACA; color: var(--danger); }
.notice-warn, .notice-warning { background: var(--warn-bg); border-color: #FDE9C4; color: var(--warn); }
.notice-info { background: var(--info-bg); border-color: #DBE6FE; color: var(--brand-700); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-4); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.table tbody tr:hover { background: var(--brand-050); }
table.table tbody tr:last-child td { border-bottom: none; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table td.center, table.table th.center { text-align: center; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field-label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field-label em { color: var(--danger); font-style: normal; }
.field-hint { font-size: 11.5px; color: var(--ink-4); }
.field-error { font-size: 11.5px; color: var(--danger); }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="search"], input[type="time"], select, textarea {
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; min-height: 38px;
}
textarea { resize: vertical; line-height: 1.5; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27, 77, 240, .13); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7789' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 15px; height: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field-span2 { grid-column: 1 / -1; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; cursor: pointer; }

/* ---------- Progress & meters ---------- */
.progress { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); border-radius: 99px; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-3); color: var(--ink-4); display: grid; place-items: center; margin: 0 auto 12px; }
.empty-title { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.empty-text { font-size: 13px; max-width: 42ch; margin: 0 auto; }

/* ---------- Tabs & segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 13px; font-size: 13.5px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; cursor: pointer; background: none; font-family: inherit; margin-bottom: -1px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--brand-700); border-bottom-color: var(--brand); font-weight: 600; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button, .segmented a { font: inherit; font-size: 12.5px; background: var(--surface); border: none; border-right: 1px solid var(--line); padding: 7px 12px; cursor: pointer; color: var(--ink-3); text-decoration: none; }
.segmented button:last-child, .segmented a:last-child { border-right: none; }
.segmented .is-active { background: var(--brand-tint); color: var(--brand-700); font-weight: 600; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .field { margin-bottom: 0; }
.toolbar select, .toolbar input { width: auto; min-width: 130px; }
.toolbar .spacer { flex: 1; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 20, 36, .42); display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 80; overflow-y: auto; }
.modal-backdrop.is-open { display: flex; }
.modal-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: modalIn .16s ease; }
.modal-card.md { max-width: 720px; }
.modal-card.lg { max-width: 940px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 16px; }
.modal-sub { font-size: 12.5px; color: var(--ink-4); margin-top: 2px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 11px 15px; font-size: 13px; max-width: 340px; box-shadow: var(--shadow-md); border-left: 3px solid var(--brand); animation: toastIn .18s ease; }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 5px; min-width: 190px; z-index: 60; display: none; }
.dropdown-menu.is-open { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-2); background: none; border: none; font-family: inherit; cursor: pointer; }
.dropdown-item:hover { background: var(--surface-3); text-decoration: none; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- Avatar group ---------- */
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-head { display: flex; align-items: center; gap: 8px; }
.timeline-time { font-size: 11.5px; color: var(--ink-4); }
.timeline-text { font-size: 13px; color: var(--ink-2); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.kanban-col.is-over { border-color: var(--brand); background: var(--brand-050); }
.kanban-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.kanban-title { font-size: 13px; font-weight: 600; }
.kanban-count { font-size: 11.5px; color: var(--ink-4); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.kanban-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; flex: 1; overflow-y: auto; max-height: 60vh; }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; box-shadow: var(--shadow-xs); cursor: grab; position: relative; }
.kanban-card:hover { border-color: var(--line-strong); }
.kanban-card.is-dragging { opacity: .5; }
.kanban-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--stripe, var(--line-strong)); }
.kanban-title-text { font-size: 13.5px; font-weight: 600; padding-left: 6px; }
.kanban-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-left: 6px; }
.kanban-empty { text-align: center; color: var(--ink-4); font-size: 12.5px; padding: 18px 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }

/* ---------- Charts (CSS-only) ---------- */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 54px; gap: 10px; align-items: center; }
.bar-name { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.bar-track { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); min-width: 2px; transition: width .4s ease; }
.bar-value { font-size: 12.5px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; }
.funnel-track { height: 26px; background: var(--surface-3); border-radius: var(--radius-sm); overflow: hidden; }
.funnel-bar { height: 100%; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: #fff; font-size: 11.5px; font-weight: 600; min-width: 26px; }

.trend { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 8px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .4s ease; }
.trend-label { font-size: 10.5px; color: var(--ink-4); }
.sparkline { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.sparkline span { width: 4px; background: var(--brand); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }

.metric-big { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.metric-unit { font-size: 12px; color: var(--ink-4); }

/* ---------- Checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checklist-item:hover { background: var(--surface-3); }
.checklist-item input { margin-top: 2px; }
.checklist-item.done span { color: var(--ink-4); text-decoration: line-through; }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-title { font-size: 15px; font-weight: 600; min-width: 150px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: var(--surface-2); padding: 8px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-4); font-weight: 600; text-align: center; }
.cal-day { background: var(--surface); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-date { color: var(--ink-4); }
.cal-day.today { background: var(--brand-050); }
.cal-day.is-over { background: var(--brand-tint); outline: 2px dashed var(--brand); outline-offset: -2px; }
.cal-date { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; }
.cal-date .cal-today-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.cal-chip { display: flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 6px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); border-left: 3px solid var(--p, var(--line-strong)); cursor: grab; text-decoration: none; color: var(--ink-2); overflow: hidden; }
.cal-chip:hover { background: var(--surface-3); text-decoration: none; }
.cal-chip.is-dragging { opacity: .4; }
.cal-chip .cal-time { font-variant-numeric: tabular-nums; color: var(--ink-4); font-size: 10.5px; }
.cal-chip .cal-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cal-more { font-size: 10.5px; color: var(--ink-4); padding-left: 3px; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Composer ---------- */
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.platform-panel { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.platform-panel-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.platform-panel-head .pp-title { font-size: 13.5px; font-weight: 600; }
.platform-panel-body { padding: 14px; display: none; }
.platform-panel.is-open .platform-panel-body { display: block; }
.platform-panel.is-off { opacity: .6; }
.charcount { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-4); }
.charcount.warn { color: var(--warn); }
.charcount.over { color: var(--danger); font-weight: 600; }
.best-time-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ok); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: .15s; cursor: pointer; }
.switch-track::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::before { transform: translateX(16px); }

/* preview kartu caption */
.preview-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.preview-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.preview-media { aspect-ratio: 1 / 1; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-4); }
.preview-body { padding: 10px 12px; font-size: 13px; white-space: pre-wrap; color: var(--ink-2); }
.preview-tags { padding: 0 12px 12px; font-size: 12.5px; color: var(--brand); }

/* ---------- Media grid ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); position: relative; }
.media-thumb { aspect-ratio: 1; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-4); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-meta { padding: 8px 10px; font-size: 11.5px; color: var(--ink-3); }
.media-item .icon-btn { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; background: rgba(255,255,255,.9); }

/* ---------- Template caption & hashtag ---------- */
.template-body {
  background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap;
  line-height: 1.55; max-height: 220px; overflow: auto;
}
.chip-hash-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-hash {
  font-size: 12px; font-weight: 500; color: var(--brand-700); background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2); border-radius: 99px; padding: 3px 10px;
}

/* ---------- Lampiran konten (tautan & berkas) ---------- */
.attach-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.attach-ico {
  width: 28px; height: 28px; border-radius: 7px; background: var(--surface);
  border: 1px solid var(--line); display: grid; place-items: center; flex: none;
  color: var(--ink-3); font-size: 13px; line-height: 1;
}
.attach-body { flex: 1; min-width: 0; }
.icon-btn.sm { width: 28px; height: 28px; }

/* ---------- Kalender: konten berulang ---------- */
.cal-chip .cal-repeat { display: inline-flex; color: var(--ink-4); flex: none; }
.cal-chip.is-virtual { border-style: dashed; }

/* ---------- Strategy ---------- */
.pillar-card { border: 1px solid var(--line); border-left: 4px solid var(--pc, var(--brand)); border-radius: var(--radius); padding: 13px 15px; background: var(--surface); }
.pillar-card h4 { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.cadence-grid { display: grid; grid-template-columns: 70px repeat(1, 1fr); gap: 6px; }
.cadence-day { font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 8px 0; }

/* ---------- Login / auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.05fr; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-form { width: 100%; max-width: 372px; }
.auth-aside { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; background: radial-gradient(circle, rgba(59,130,246,.35), transparent 70%); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand strong { font-size: 16px; }
.auth-aside h1 { font-size: 30px; line-height: 1.2; margin-bottom: 14px; letter-spacing: -.02em; }
.auth-aside p { color: rgba(255,255,255,.72); font-size: 14.5px; max-width: 46ch; }
.auth-features { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 11px; }
.auth-features li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.9); }
.auth-features .af-ico { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: none; }
.auth-note { margin-top: 18px; font-size: 12.5px; color: var(--ink-4); text-align: center; }

/* ---------- Install ---------- */
.install-body { background: var(--bg); min-height: 100vh; padding: 40px 20px 60px; }
.install-wrap { max-width: 560px; margin: 0 auto; }
.install-head { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.install-head h1 { font-size: 19px; }
.install-head p { font-size: 12.5px; color: var(--ink-4); margin: 2px 0 0; }
.install-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.install-step { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-4); padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.install-step span { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); color: var(--ink-3); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.install-step.active { border-color: var(--brand); color: var(--brand-700); font-weight: 600; }
.install-step.active span { background: var(--brand); color: #fff; }
.install-step.done { color: var(--ok); border-color: #BBF7D0; }
.install-step.done span { background: var(--ok); color: #fff; }
.install-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.install-card h2 { font-size: 16px; margin-bottom: 6px; }
.install-card > .btn-block { margin-top: 16px; }
.install-foot { text-align: center; font-size: 11.5px; color: var(--ink-4); margin-top: 18px; }

/* ---------- Utilities ---------- */
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.link-quiet { color: var(--ink-3); }
.link-quiet:hover { color: var(--brand); }
.badge-count { font-size: 11px; color: var(--ink-4); }
.scroll-x { overflow-x: auto; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.hide-mobile { display: initial; }
.mobile-only { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(11, 20, 36, .38); z-index: 35; }
  .app-main { margin-left: 0; }
  .menu-btn { display: inline-flex !important; }
  .mobile-only { display: inline-grid !important; }
  .hide-mobile { display: none !important; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 18px 14px 56px; }
  .topbar { padding: 0 14px; }
  .search-box { display: none; }
  .grid-2, .grid-3, .grid-4, .stat-grid, .form-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 84px; }
  .bar-row { grid-template-columns: 84px 1fr 44px; }
}
