:root {
  color-scheme: light;
  --brand: #0A7F71;
  --brand-dark: #086b5f;
  --brand-wash: #e6f4f1;
  --ink-deep: #0B2A2E;
  --ink: #16282b;
  --ink-2: #4c5d60;
  --ink-3: #6f7f82;
  --line: #e3e8e8;
  --line-2: #cfd7d7;
  --page: #f5f7f7;
  --surface: #ffffff;
  --series-1: #00917E;
  --series-2: #C2571A;
  --series-3: #4A5FC1;
  --good: #0b7a3b; --good-bg: #e5f5ea;
  --warn: #8a5a00; --warn-bg: #fdf3d8;
  --bad: #b3261e; --bad-bg: #fbe9e7;
  --info: #2b4bb0; --info-bg: #e9edfb;
  --mute: #4c5d60; --mute-bg: #eef1f1;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; color: var(--ink-deep); font-weight: 650; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.grow { flex: 1; min-width: 0; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink-deep); color: #cfdcdd; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: #fff; font-weight: 650; font-size: 15px; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; flex: none; }
.logo small { display: block; font-weight: 400; font-size: 11px; color: #9db2b4; }
.nav-group { margin-bottom: 14px; }
.nav-group > span { display: block; padding: 0 8px 4px; font-size: 11px; color: #8ca3a5; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; color: #d9e4e4; }
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a.active svg { opacity: 1; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 12px 8px 0; font-size: 12px; }
.side-foot b { display: block; color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.side-foot .links { display: flex; gap: 12px; margin-top: 6px; }
.side-foot button { background: none; border: 0; padding: 0; color: #a9c4c4; font: inherit; cursor: pointer; }
.side-foot button:hover { color: #fff; }
.topbar { display: none; }
main { padding: 24px 28px 48px; max-width: 1320px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .end { margin-left: auto; }
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* Stat tiles */
.tile .label { color: var(--ink-2); font-size: 12.5px; }
.tile .value { font-size: 24px; font-weight: 650; color: var(--ink-deep); margin-top: 4px; letter-spacing: -.01em; }
.tile .foot { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.hero { background: var(--ink-deep); border-color: var(--ink-deep); color: #d5e2e2; }
.hero .label { color: #b6c9ca; }
.hero .value { color: #fff; font-size: 34px; }
.hero .foot { color: #a8bdbe; }
.delta-up { color: var(--good); font-weight: 600; }
.delta-down { color: var(--bad); font-weight: 600; }
.hero .delta-up { color: #7fe0ad; }
.hero .delta-down { color: #ffb4ab; }

/* Forms */
label.field { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
label.field > span { display: block; margin-bottom: 4px; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 9px; width: 100%; min-height: 36px; }
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); padding: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 7px; cursor: pointer; background: #fff; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 550; padding: 7px 13px; min-height: 36px; border-radius: 7px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f3f6f6; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); border-color: #e7c1bd; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 3px 9px; min-height: 28px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; background: #fff; }
.seg button { font: inherit; font-size: 12.5px; border: 0; background: none; padding: 6px 11px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand-wash); color: var(--brand-dark); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters input[type=search] { flex: 1 1 240px; max-width: 360px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -16px -16px; padding: 0 16px 8px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 550; color: var(--ink-3); padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #eef1f1; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; }
tr.link:hover td { background: #f7f9f9; }
th.right, td.right { text-align: right; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--mute-bg); color: var(--mute); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }

/* Empty & notices */
.empty { text-align: center; color: var(--ink-3); padding: 28px 14px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 3px; font-weight: 600; }
.empty .btn { margin-top: 10px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--info-bg); color: #24356f; font-size: 13px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-bg); color: #5f4100; }
.notice .btn { margin-left: auto; flex: none; }

.hidden { display: none !important; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.thumbs img { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; background: var(--mute-bg); margin: 0; }
.media-full { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.media-full img, .media-full video { width: 100%; max-width: none; max-height: 320px; object-fit: contain; border-radius: 6px; background: #eef2f2; margin: 0; }
.cal-nav { display: flex; gap: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { padding: 6px 8px; font-size: 12px; color: var(--ink-3); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f7f9f9; }
.cal-cell { min-height: 112px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-blank { background: #fafbfb; }
.cal-day { font-size: 12px; color: var(--ink-3); padding: 1px 3px; }
.cal-today { background: var(--brand-wash); }
.cal-today .cal-day { color: var(--brand-dark); font-weight: 700; }
.chip { display: block; width: 100%; text-align: left; font: inherit; font-size: 11.5px; line-height: 1.3; padding: 3px 5px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--mute); border-radius: 4px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { background: #f3f6f6; }
.chip-time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip-facebook { border-left-color: var(--series-3); }
.chip-instagram { border-left-color: var(--series-2); }
.chip-facebook_groups { border-left-color: var(--series-1); }
.key-facebook { background: var(--series-3); }
.key-instagram { background: var(--series-2); }
.key-facebook_groups { background: var(--series-1); }
.cal-agenda { display: none; }
.cal-agenda-day { padding: 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.demo-banner { align-items: center; }
.account-list { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.account-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
.account-row + .account-row { border-top: 1px solid var(--line); }
.account-row .grow { flex: 1 1 200px; }
.connect-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
details.howto { background: #f6f8f8; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
details.howto summary { cursor: pointer; font-weight: 550; color: var(--brand-dark); }
details.howto[open] summary { margin-bottom: 10px; }
.guide { margin: 10px 0; padding-left: 20px; }
.guide li { margin-bottom: 9px; }
.guide code.block { margin: 6px 0; background: #fff; border: 1px solid var(--line); }
.meta-form { margin-bottom: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
details.advanced { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
details.advanced summary { cursor: pointer; color: var(--ink-2); font-weight: 550; margin-bottom: 12px; }
.test-result { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
pre.raw { margin: 6px 0 0; padding: 9px 10px; background: #f0f4f4; border-radius: 7px; font-size: 11.5px; max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 11px var(--font); fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-left: auto; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--ink-deep); color: #fff; font-size: 12px; padding: 7px 9px; border-radius: 7px; white-space: nowrap; z-index: 3; }
.tip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.tip b { display: block; margin-bottom: 2px; font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 130px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 8px; border-radius: 4px; background: #eef2f2; }
.bar-row .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
details.table-view { margin-top: 10px; font-size: 12.5px; }
details.table-view summary { cursor: pointer; color: var(--ink-3); }
details.table-view .scroll { max-height: 220px; overflow: auto; margin-top: 6px; }

/* Wizard */
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; counter-reset: s; }
.steps li { list-style: none; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); padding: 5px 12px 5px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.steps li::before { counter-increment: s; content: counter(s); width: 20px; height: 20px; border-radius: 50%; background: var(--mute-bg); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.steps li.on { color: var(--brand-dark); border-color: var(--brand); font-weight: 600; }
.steps li.on::before { background: var(--brand); color: #fff; }
.steps li.done::before { background: var(--brand-wash); color: var(--brand-dark); }
.steps { padding: 0; margin-top: 0; }
.offer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.pax-row { display: grid; grid-template-columns: 1fr 1fr 150px 110px 34px; gap: 8px; margin-bottom: 8px; align-items: end; }
.summary { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 6px 12px; font-size: 13px; }
.summary dt { color: var(--ink-3); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .strong { font-weight: 650; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }

/* Timeline, posts, calendar */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0 0 12px 14px; border-left: 2px solid var(--line); font-size: 13px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline li:last-child { padding-bottom: 0; }
.post { padding: 12px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; padding-bottom: 0; }
.post:first-child { padding-top: 0; }
.post .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.post .ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.post img { max-width: 120px; max-height: 80px; border-radius: 6px; display: block; margin-top: 6px; }
.err { color: var(--bad); font-size: 12px; margin-top: 4px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: #eef2f2; border-radius: 9px; padding: 9px; min-height: 120px; }
.board-col h3 { margin-bottom: 8px; display: flex; justify-content: space-between; }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; margin-bottom: 7px; cursor: pointer; font-size: 13px; }
.board-card:hover { border-color: var(--line-2); }
.strategy-item { padding: 9px 0; border-bottom: 1px solid #eef1f1; cursor: pointer; }
.strategy-item:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--brand-dark); border-color: var(--brand); font-weight: 600; }
code.block { display: block; background: #f0f4f4; border-radius: 7px; padding: 9px 10px; font-size: 12px; overflow-wrap: anywhere; }

/* Dialog */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 18px 50px rgba(11,42,46,.28); color: var(--ink); }
dialog::backdrop { background: rgba(11,42,46,.45); }
.dlg-body { padding: 20px; }
.dlg-body h2 { font-size: 17px; margin-bottom: 14px; }

/* Toast */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100vw - 32px); }
.toast { background: var(--ink-deep); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--ink-deep); }
.login-card { width: min(380px, 100%); background: #fff; border-radius: 14px; padding: 26px; }
.login-card .logo { color: var(--ink-deep); padding: 0 0 16px; }
.login-card .logo small { color: var(--ink-3); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); }

@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3, .g-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .18s; }
  .shell.open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--ink-deep); color: #fff; padding: 9px 16px; font-weight: 600; }
  .topbar button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; display: flex; }
  main { padding: 16px 16px 40px; }
  .g-2, .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .value { font-size: 20px; }
  .hero .value { font-size: 20px; }
  .pax-row { grid-template-columns: 1fr 1fr; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .filters input, .filters select { flex: 1 1 140px; min-width: 0; max-width: none; }
  .summary { grid-template-columns: 110px minmax(0,1fr); }
  .cal-grid { display: none; }
  .cal-agenda { display: block; }
  .chip { font-size: 13px; padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
