/* SafarERP — prototype design system */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --border: #e3e8e6;
  --border-strong: #cfd8d4;
  --text: #13201b;
  --text-2: #4a5a54;
  --text-3: #7d8c86;
  --brand: #1f7a5a;
  --brand-600: #186449;
  --brand-50: #e8f4ef;
  --brand-100: #cfe8dd;
  --blue: #2f5fd0;   --blue-50: #eaf0fd;
  --violet: #6e47d1; --violet-50: #f1ecfd;
  --amber: #b86e00;  --amber-50: #fdf3e2;
  --red: #c4372f;    --red-50: #fdecea;
  --gray-50: #eef1f0;
  --shadow: 0 1px 2px rgba(16, 32, 26, .05), 0 1px 3px rgba(16, 32, 26, .06);
  --shadow-lg: 0 12px 32px rgba(16, 32, 26, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1513;
  --surface: #151e1b;
  --surface-2: #1a2522;
  --border: #25322e;
  --border-strong: #33443e;
  --text: #e7eeeb;
  --text-2: #a9b8b2;
  --text-3: #75857f;
  --brand: #3fae84;
  --brand-600: #56c096;
  --brand-50: #16302a;
  --brand-100: #1d4136;
  --blue: #7c9ef0;   --blue-50: #1a2440;
  --violet: #a78bf0; --violet-50: #251d3d;
  --amber: #e4a23f;  --amber-50: #33270f;
  --red: #ef7a72;    --red-50: #3a1c1a;
  --gray-50: #1f2a27;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.pos { color: var(--brand); }
.neg { color: var(--red); }
[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid var(--border); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #2a9d74);
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }
.nav { flex: 1; overflow-y: auto; padding: 10px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; margin-bottom: 1px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.nav a .count { margin-left: auto; font-size: 11px; background: var(--gray-50); color: var(--text-2); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.nav a .tag { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--brand); color: #fff; }
.nav a.soon { opacity: .6; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.agency-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.agency-card .name { font-weight: 600; font-size: 13px; }
.agency-card .sub { font-size: 11.5px; color: var(--text-3); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 10px; height: 38px; color: var(--text-3);
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.search kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; background: var(--violet-50); color: var(--violet); flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.user-chip .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-chip .role { font-size: 11px; color: var(--text-3); line-height: 1.2; }

.content { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-3); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; margin-bottom: 6px; }
.crumbs a:hover { color: var(--brand); }
.footer { padding: 16px 24px; color: var(--text-3); font-size: 12px; text-align: center; }

.overlay { position: fixed; inset: 0; background: rgba(8, 16, 13, .45); z-index: 35; display: none; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-head .link { color: var(--brand); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; }

.kpi { padding: 16px 18px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: var(--text-2); font-weight: 500; font-size: 13px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.kpi-foot { margin-top: 4px; font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.trend { font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.trend.up { color: var(--brand); }
.trend.down { color: var(--red); }
.tone-green { background: var(--brand-50); color: var(--brand); }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-violet { background: var(--violet-50); color: var(--violet); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-gray { background: var(--gray-50); color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.whatsapp { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table th.right, .table td.right { text-align: right; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--text-3); }
.person { display: flex; align-items: center; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--red); }
.input, .select, .textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; width: 100%;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 13px; }
.field.error .input, .field.error .select { border-color: var(--red); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field.error .hint { color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.segmented { display: inline-flex; background: var(--gray-50); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented button .n { font-size: 11px; color: var(--text-3); margin-left: 4px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 12px; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.date-chip { width: 44px; text-align: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); padding: 3px 0; flex-shrink: 0; }
.date-chip .d { font-weight: 700; font-size: 16px; line-height: 1.1; }
.date-chip .m { font-size: 10.5px; text-transform: uppercase; color: var(--text-3); font-weight: 600; }

.progress { height: 6px; background: var(--gray-50); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 10px; background: var(--gray-50); }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.callout.info { background: var(--blue-50); color: var(--text); }
.callout.info [data-lucide] { color: var(--blue); }
.callout.warn { background: var(--amber-50); }
.callout.warn [data-lucide] { color: var(--amber); }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 500; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline .t { font-weight: 600; font-size: 13.5px; }
.timeline .s { font-size: 12.5px; color: var(--text-3); }

.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.sum-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-size: 17px; font-weight: 700; }
.sum-row .l { color: var(--text-2); }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar span.v { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--brand-100); position: relative; transition: background .15s; }
.bars .bar.current span.v { background: var(--brand); }
.bars .bar:hover span.v { background: var(--brand); }
.bars .bar .lbl { font-size: 11px; color: var(--text-3); }
.bars .bar .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 5px; white-space: nowrap; opacity: 0; pointer-events: none; }
.bars .bar:hover .tip { opacity: 1; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 16, 13, .5); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Toast */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--surface); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .2s; max-width: 360px; }
.toast [data-lucide] { color: #5fd3a3; }

/* Dropdown */
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; }
.dropdown .head { padding: 12px 16px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif:last-child { border-bottom: 0; }
.notif .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }

/* Stepper */
.stepper { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; color: var(--text-3); font-size: 13px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-50); font-size: 12px; }
.step.on { color: var(--text); border-color: var(--brand); }
.step.on .n { background: var(--brand); color: #fff; }
.step.done { color: var(--brand); }
.step.done .n { background: var(--brand-50); color: var(--brand); }

.svc-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.svc-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px dashed var(--border-strong); background: var(--surface-2); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.svc-pick button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

.line-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--surface-2); }
.line-card .lc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.line-card .lc-grid { display: grid; grid-template-columns: 2fr 1.4fr .8fr 1fr 1fr; gap: 10px; }
.line-card .field label { font-size: 12px; }

.client-hit { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.client-hit:hover, .client-hit.on { border-color: var(--brand); background: var(--brand-50); }

/* Mobile cards replacing tables */
.m-cards { display: none; }
.m-card { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.m-card:last-child { border-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: grid; }
  .user-chip .txt, .search kbd { display: none; }
  .user-chip { padding: 3px; }
  .content { padding: 16px; }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .line-card .lc-grid { grid-template-columns: 1fr 1fr; }
  .line-card .lc-grid .wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 19px; }
  .kpi-icon { display: none; }
  .search { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .table-wrap.cards-on-mobile { display: none; }
  .m-cards { display: block; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .dl { grid-template-columns: 110px 1fr; }
  .svc-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toasts { left: 16px; right: 16px; }
  .card-body .search { display: flex !important; max-width: none !important; margin-left: 0 !important; width: 100%; }
  .card-body > .select { flex: 1; }
  .dropdown { position: fixed; top: 64px; left: 8px; right: 8px; width: auto; }
}

@media print {
  .sidebar, .topbar, .no-print, .footer, .toasts { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
}

/* Phase 2 */
.nav a .count.tone-amber { background: var(--amber-50); color: var(--amber); }
.drawer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.wa-bubble { background: #e7f8ee; color: #13201b; border-radius: 10px 10px 10px 2px; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; max-width: 420px; }
.wa-phone { background: #ece5dd; border-radius: 14px; padding: 16px; min-height: 260px; }
:root[data-theme="dark"] .wa-phone { background: #1d2a26; }
.var { font-family: var(--mono); font-size: 11.5px; background: var(--violet-50); color: var(--violet); padding: 1px 6px; border-radius: 4px; cursor: pointer; border: 0; }
.hbar { display: grid; grid-template-columns: 120px 1fr 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--gray-50); border-radius: 99px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
@media (max-width: 1180px) { .drawer-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .hbar { grid-template-columns: 84px minmax(0, 1fr) 96px; } .hbar > span:last-child { white-space: normal; font-size: 12px; } }

/* Packages */
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pk-card { overflow: hidden; display: flex; flex-direction: column; }
.pk-cover { position: relative; height: 132px; color: #fff; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.pk-cover .pk-ico { position: absolute; right: -14px; top: -14px; opacity: .22; }
.pk-cover .pk-ico svg { width: 130px; height: 130px; stroke-width: 1.2; }
.pk-cover h3 { font-size: 18px; color: #fff; }
.pk-cover .pk-tags { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.pk-tag { background: rgba(255,255,255,.2); backdrop-filter: blur(4px); color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.pk-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pk-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pk-hero { border-radius: var(--radius); color: #fff; padding: 22px; position: relative; overflow: hidden; margin-bottom: 16px; }
.pk-hero .pk-ico { position: absolute; right: 10px; top: -20px; opacity: .18; }
.pk-hero .pk-ico svg { width: 180px; height: 180px; stroke-width: 1.1; }
.story { width: 100%; max-width: 270px; aspect-ratio: 9 / 16; border-radius: 18px; color: #fff; padding: 22px 18px; display: flex; flex-direction: column; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.counter { display: flex; align-items: center; gap: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; width: max-content; }
.counter button { width: 34px; height: 36px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 16px; font-weight: 700; color: var(--text-2); }
.counter span { min-width: 36px; text-align: center; font-weight: 700; }
