/* Digiwigi Portal — app styles */
:root {
  --ink: #0b1c3a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e8edf3;
  --line-2: #f0f3f7;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --brand: #0e7490;
  --brand-2: #14b8c4;
  --brand-soft: #e6f6f8;
  --brand-ink: #0b5566;
  --lime: #7cc31a;
  --lime-soft: #f1f9e3;
  --grad: linear-gradient(135deg, #0e7490 0%, #14b8c4 100%);
  --grad-lime: linear-gradient(135deg, #5fa80f 0%, #9ad62a 100%);
  --grad-ink: linear-gradient(140deg, #0b1c3a 0%, #0e3b55 55%, #0e7490 100%);
  --ok: #16a34a;   --ok-soft: #eaf7ef;
  --warn: #c2770a; --warn-soft: #fdf4e3;
  --bad: #dc2626;  --bad-soft: #fdecec;
  --info: #2563eb; --info-soft: #eaf1ff;
  --r: 16px; --r-sm: 11px; --r-xs: 8px;
  --sh-1: 0 1px 2px rgba(11,28,58,.04), 0 1px 3px rgba(11,28,58,.05);
  --sh-2: 0 6px 24px -8px rgba(11,28,58,.14), 0 2px 6px -2px rgba(11,28,58,.06);
  --sh-3: 0 24px 60px -20px rgba(11,28,58,.35);
  --ease: cubic-bezier(.2,.8,.2,1);
  --tabbar-h: 64px;
  color-scheme: light;
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.wrap-any { overflow-wrap: anywhere; word-break: break-word; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- icons */
.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.i.lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; width: 248px; flex: none;
  display: flex; flex-direction: column; gap: 6px; padding: 18px 14px;
  background: var(--surface); border-right: 1px solid var(--line); z-index: 10;
}
.brand { display: flex; align-items: center; padding: 4px 8px 16px; }
.brand .logo-full { height: 34px; width: auto; }
.brand .logo-mark { display: none; height: 30px; width: auto; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: 13.5px; position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.side-nav a.on::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--grad);
}
.side-nav a.on .i { color: var(--brand); }
.side-foot { display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 12px; color: var(--ink); }
.me:hover { background: var(--surface-2); color: var(--ink); }
.me span { display: flex; flex-direction: column; min-width: 0; }
.me b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); font-size: 11.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 9; display: flex; align-items: center; gap: 12px;
  padding: 18px 28px; background: rgba(244,247,250,.82); backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.appbar-logo, .avatar-link { display: none; }
.appbar-logo img { height: 26px; width: auto; display: block; }
.appbar-title { flex: 1; min-width: 0; }
.appbar-title h1 { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title p { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.content { width: 100%; max-width: 1240px; padding: 4px 28px 48px; }

/* tablet: icon rail */
@media (max-width: 1100px) and (min-width: 721px) {
  .sidebar { width: 76px; padding: 16px 10px; align-items: center; }
  .brand .logo-full { display: none; }
  .brand .logo-mark { display: block; }
  .brand { padding: 4px 0 14px; }
  .side-nav a { justify-content: center; padding: 11px; }
  .side-nav a span, .me span { display: none; }
  .side-nav a.on::before { left: -10px; }
  .side-foot { flex-direction: column; }
  .content { padding: 4px 22px 40px; }
  .appbar { padding: 16px 22px; }
}

/* phone: app bar + bottom tabs */
.tabbar, .sheet { display: none; }
@media (max-width: 720px) {
  body { font-size: 13.5px; }
  .sidebar { display: none; }
  .appbar { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); gap: 10px; background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); }
  .appbar-logo, .avatar-link { display: inline-flex; }
  .appbar-title h1 { font-size: 16.5px; font-weight: 800; }
  .appbar-title p { font-size: 11.5px; margin-top: 0; }
  .appbar-actions .btn span.lbl { display: none; }
  .content { padding: 14px 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(255,255,255,.92); backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar > a, .tabbar > button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; justify-content: center; height: 100%;
    color: var(--faint); font: 600 10.5px/1 inherit; background: none; border: 0; padding: 0; cursor: pointer;
    transition: color .15s;
  }
  .tabbar > a.on, .tabbar > button.on { color: var(--brand); }
  .tabbar > a.on .i { transform: translateY(-1px); }
  .tabbar .i { width: 21px; height: 21px; transition: transform .2s var(--ease); }
  .tabbar .fab {
    justify-self: center; width: 50px; height: 50px; border-radius: 17px; margin-top: -18px;
    background: var(--grad); color: #fff; box-shadow: 0 10px 22px -8px rgba(14,116,144,.7);
    display: flex; align-items: center; justify-content: center;
  }
  .tabbar .fab .i { width: 24px; height: 24px; }
  .tabbar .fab:active { transform: scale(.94); }
  .sheet { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(11,28,58,.35); animation: fade .2s var(--ease); }
  .sheet[hidden] { display: none; }
  .sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 22px 22px 0 0;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheetUp .28s var(--ease);
  }
  .sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 14px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .sheet-grid a {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 14px;
    background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 12px; text-align: center;
  }
  .sheet-grid a .i { width: 22px; height: 22px; color: var(--brand); }
}

/* ---------------------------------------------------------------- avatar */
.avatar {
  --h: 192; width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  color: hsl(var(--h) 70% 28%); background: hsl(var(--h) 70% 92%); overflow: hidden;
}
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11.5px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 19px; }
.avatar.xl { width: 72px; height: 72px; border-radius: 22px; font-size: 24px; }
.avatar.img { background: #fff; border: 1px solid var(--line); }
.avatar.img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }

/* ---------------------------------------------------------------- cards & grids */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-1); padding: 20px; margin-bottom: 16px; min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card.pad-sm { padding: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-width: 0; }
.card-head h2 { flex: 1; min-width: 0; }
.card-head .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.card.flush .card-head { padding: 16px 18px 0; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cols-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.cols > *, .cols-3 > *, .cols-main > * { min-width: 0; }
.cols .card, .cols-3 .card, .cols-main .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .cols-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .cols, .cols-3 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cols-main, .stack { gap: 12px; }
  .card { padding: 15px; border-radius: 14px; margin-bottom: 12px; }
  .card-head { margin-bottom: 12px; }
  .card-head .ic { width: 30px; height: 30px; border-radius: 9px; }
}

/* hero */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 24px 26px; margin-bottom: 18px;
  color: #fff; background: var(--grad-ink); box-shadow: var(--sh-2);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,195,26,.55), rgba(124,195,26,0) 68%); pointer-events: none;
}
.hero::before {
  content: ""; position: absolute; right: 90px; bottom: -120px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,184,196,.45), rgba(20,184,196,0) 70%); pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 22px; font-weight: 800; }
.hero p { color: rgba(255,255,255,.78); margin-top: 4px; max-width: 560px; }
.hero .row { margin-top: 16px; }
.hero .btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.22); }
.hero .btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.hero .btn.light { background: #fff; color: var(--ink); border-color: #fff; }
@media (max-width: 720px) { .hero { padding: 18px; border-radius: 18px; margin-bottom: 12px; } .hero h2 { font-size: 18px; } .hero p { font-size: 12.5px; } }

/* KPIs */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); color: var(--ink);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: #d5e8ee; color: var(--ink); }
.kpi .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi .n { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi.t-warn .ic { background: var(--warn-soft); color: var(--warn); }
.kpi.t-info .ic { background: var(--info-soft); color: var(--info); }
.kpi.t-ok .ic { background: var(--ok-soft); color: var(--ok); }
.kpi.t-bad .ic { background: var(--bad-soft); color: var(--bad); }
.kpi.t-brand .ic { background: var(--brand-soft); color: var(--brand); }
.kpi.t-lime .ic { background: var(--lime-soft); color: #4d7c0f; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .kpis { gap: 10px; margin-bottom: 12px; }
  .kpi { padding: 12px; gap: 10px; border-radius: 14px; }
  .kpi .ic { width: 34px; height: 34px; border-radius: 10px; }
  .kpi .n { font-size: 18px; }
  .kpi .l { font-size: 11px; }
}

/* ---------------------------------------------------------------- lists (replace tables) */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-width: 0;
  border-top: 1px solid var(--line-2); color: var(--ink); transition: background .15s;
}
.list > .item:first-child { border-top: 0; }
a.item:hover { background: var(--surface-2); color: var(--ink); }
.item .body { flex: 1; min-width: 0; }
.item .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.item .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.item .chev { color: var(--faint); }
.card:not(.flush) .list .item { padding-left: 0; padding-right: 0; }
@media (max-width: 720px) { .item { padding: 11px 14px; gap: 10px; } .item .chev { display: none; } }

.thumb { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.thumb.t-warn { background: var(--warn-soft); color: var(--warn); }
.thumb.t-ok { background: var(--ok-soft); color: var(--ok); }
.thumb.t-bad { background: var(--bad-soft); color: var(--bad); }
.thumb.t-info { background: var(--info-soft); color: var(--info); }
@media (max-width: 720px) { .thumb { width: 38px; height: 38px; border-radius: 11px; } }

/* ---------------------------------------------------------------- pills & chips */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.t-info { background: var(--info-soft); color: var(--info); }
.pill.t-brand { background: var(--brand-soft); color: var(--brand); }
.pill.t-brand i { animation: pulse 1.4s ease-in-out infinite; }
.pill.t-warn { background: var(--warn-soft); color: var(--warn); }
.pill.t-bad { background: var(--bad-soft); color: var(--bad); }
.pill.t-ok { background: var(--ok-soft); color: var(--ok); }
.pill.t-lime { background: var(--lime-soft); color: #4d7c0f; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; transition: all .15s;
}
.chip .i { width: 14px; height: 14px; }
a.chip:hover { border-color: var(--brand-2); color: var(--brand-ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip b { font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--lime-soft); color: #4d7c0f; }

/* segmented tabs (wrap, never scroll sideways) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: #e9eef3; margin-bottom: 16px; width: fit-content; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs a .i { width: 15px; height: 15px; }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
@media (max-width: 720px) { .tabs { width: 100%; margin-bottom: 12px; } .tabs a { flex: 1 1 auto; justify-content: center; padding: 7px 8px; font-size: 12px; } }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 13px/1 inherit; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { border-color: #cfdbe5; background: var(--surface-2); color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(14,116,144,.8); }
.btn.primary:hover { filter: brightness(1.06); color: #fff; box-shadow: 0 10px 22px -10px rgba(14,116,144,.9); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #142c55; color: #fff; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); box-shadow: 0 6px 16px -8px rgba(22,163,74,.8); }
.btn.ok:hover { filter: brightness(1.06); color: #fff; }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f6caca; color: var(--bad); }
.btn.warn-soft { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; flex: none;
  color: var(--muted); background: transparent; border: 0; cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.back { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
@media (max-width: 720px) {
  .btn { height: 36px; padding: 0 13px; font-size: 12.5px; }
  .btn.sm { height: 30px; padding: 0 10px; font-size: 11.5px; }
  .icon-btn { width: 34px; height: 34px; }
}

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
input, select, textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid #dfe6ee; border-radius: var(--r-sm); padding: 9px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:not([type=checkbox]):not([type=radio]):not([type=color]), select { height: 40px; }
input::placeholder, textarea::placeholder { color: #a8b4c3; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(20,184,196,.14); }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 11px center; }
input:disabled { background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { display: grid; gap: 0 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full, .form-grid-3 .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 2px 0 12px; cursor: pointer; font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: inline-block; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line); font-weight: 600; font-size: 12px; color: var(--muted); transition: all .15s; }
.days input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.divider { height: 1px; background: var(--line); margin: 6px 0 16px; border: 0; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 4px 0 12px; }
@media (max-width: 720px) {
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  input, select, textarea { font-size: 16px; } /* stops iOS zoom */
  input:not([type=checkbox]):not([type=radio]):not([type=color]), select { height: 40px; }
  .field { margin-bottom: 12px; }
}

/* color picker field */
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type=color] {
  width: 40px; height: 40px; padding: 3px; border-radius: 11px; border: 1px solid #dfe6ee; background: var(--surface); cursor: pointer; flex: none;
}
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-field input[type=color]::-moz-color-swatch { border: 0; border-radius: 8px; }
.color-field input[type=text] { text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.palette { display: flex; height: 54px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 16px; }
.palette div { flex: 1; display: flex; align-items: flex-end; padding: 6px 8px; font: 700 10.5px/1 ui-monospace, Consolas, monospace; }
.font-preview { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--line); font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.font-preview small { display: block; font-size: 12px; color: var(--muted); font-family: "Plus Jakarta Sans", sans-serif; margin-top: 2px; }
.logo-drop { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed #cfdbe5; border-radius: 14px; background: var(--surface-2); margin-bottom: 14px; }
.logo-drop .avatar { width: 64px; height: 64px; border-radius: 16px; }
.logo-drop input[type=file] { font-size: 12.5px; border: 0; padding: 0; background: none; height: auto; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 520px); padding: 11px 16px;
  border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px;
  box-shadow: var(--sh-3); animation: toastIn .4s var(--ease), toastOut .4s var(--ease) 4.6s forwards;
}
.toast.ok .i { color: #86efac; }
.toast.err { background: #7f1d1d; }
.toast.err .i { color: #fecaca; }

/* ---------------------------------------------------------------- misc components */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-ic { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-ic .i { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 14px; font-size: 13px; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.kv > div { padding: 10px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.kv dt, .kv .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 3px; }
.kv .v { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 720px) { .kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; } }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl { position: relative; padding: 0 0 16px; }
.tl::before { content: ""; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--faint); }
.tl.client::before { border-color: var(--bad); }
.tl.internal::before { border-color: var(--warn); }
.tl.system::before { border-color: var(--brand-2); }
.tl .meta { font-size: 11.5px; color: var(--muted); }
.tl .bubble { margin-top: 5px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); white-space: pre-line; overflow-wrap: anywhere; }
.tl.client .bubble { background: var(--bad-soft); }
.tl.internal .bubble { background: var(--warn-soft); }
.tl.system .bubble { background: transparent; padding: 0; color: var(--ink-2); }

.player { position: relative; width: 100%; max-width: 380px; aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #0b1c3a; box-shadow: var(--sh-2); }
.player.wide { max-width: 100%; aspect-ratio: 16 / 9; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-ph { display: grid; place-items: center; gap: 8px; text-align: center; padding: 30px 16px; border-radius: 16px; background: var(--surface-2); border: 1px dashed var(--line); color: var(--muted); }
.video-ph .i { width: 30px; height: 30px; color: var(--faint); }

.steps { display: flex; gap: 0; margin: 2px 0 6px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; font-size: 11px; font-weight: 600; color: var(--faint); text-align: center; min-width: 0; }
.step::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); position: relative; z-index: 1; font-size: 11px; }
.step b .i { width: 13px; height: 13px; }
.step.done { color: var(--ink-2); }
.step.done b { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.done::before, .step.cur::before { background: var(--brand-2); }
.step.cur { color: var(--brand-ink); }
.step.cur b { border-color: var(--brand-2); color: var(--brand); box-shadow: 0 0 0 4px rgba(20,184,196,.15); }
.step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; padding: 0 2px; }
@media (max-width: 720px) { .step { font-size: 10px; } }

.script-pick { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); max-height: 380px; overflow-y: auto; padding: 2px; }
.script-pick label { cursor: pointer; }
.script-pick input { position: absolute; opacity: 0; pointer-events: none; }
.script-pick .opt { display: flex; gap: 10px; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); transition: all .15s; height: 100%; }
.script-pick .opt .no { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.script-pick .opt .t { font-weight: 700; font-size: 13px; line-height: 1.3; }
.script-pick .opt .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.script-pick input:checked + .opt { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(20,184,196,.15); }
.script-pick input:checked + .opt .no { background: var(--grad); color: #fff; }
.script-pick input:disabled + .opt { opacity: .45; cursor: not-allowed; }
@media (max-width: 720px) { .script-pick { grid-template-columns: minmax(0, 1fr); max-height: 300px; } }

.picked { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--brand-soft), var(--lime-soft)); margin: 4px 0 16px; animation: rise .3s var(--ease); }
.picked .k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-ink); opacity: .7; }
.picked .v { font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 720px) { .picked { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 38px; border-radius: 8px 8px 4px 4px; background: var(--grad); transform-origin: bottom; animation: grow .7s var(--ease) both; }
.bars .b:last-child i { background: var(--grad-lime); }
.bars .b span { font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.bars .b em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--ink-2); }
.spark { width: 100%; height: 60px; display: block; }
.metric-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { padding: 13px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.metric .l { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.metric .l .i { width: 14px; height: 14px; }
.metric .n { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.metric .d { font-size: 11.5px; font-weight: 700; }
.up { color: var(--ok); } .down { color: var(--bad); }
@media (max-width: 900px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .metric .n { font-size: 17px; } .bars { height: 120px; gap: 5px; } }

.progress { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 6px; background: var(--grad); animation: growX .8s var(--ease) both; transform-origin: left; }

.copy-box { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.copy-box code { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.client-head { display: flex; gap: 16px; align-items: center; min-width: 0; }
.client-head h2 { font-size: 20px; font-weight: 800; }
.client-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.client-head .meta span, .client-head .meta a { display: inline-flex; align-items: center; gap: 5px; }
.client-head .meta .i { width: 14px; height: 14px; }
@media (max-width: 720px) { .client-head { gap: 12px; } .client-head h2 { font-size: 17px; } }

.client-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.client-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease); min-width: 0; }
.client-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); color: var(--ink); }
.client-card .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.client-card .name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-card .handle { color: var(--muted); font-size: 12px; }
.client-card .stats { display: flex; gap: 6px; flex-wrap: wrap; }
.client-card .swatches { display: flex; gap: 4px; }
.client-card .swatches i { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,.06); }
@media (max-width: 720px) { .client-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

.cal-day { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.cal-day:first-child { border-top: 0; }
.cal-date { width: 52px; flex: none; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--surface-2); }
.cal-date b { display: block; font-size: 19px; font-weight: 800; line-height: 1.1; }
.cal-date small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.cal-date.today { background: var(--grad); color: #fff; }
.cal-date.today small { color: rgba(255,255,255,.8); }
.cal-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* login */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: var(--grad-ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::after { content: ""; position: absolute; right: -120px; top: -120px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(124,195,26,.5), rgba(124,195,26,0) 65%); }
.auth-art::before { content: ""; position: absolute; left: -120px; bottom: -160px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(20,184,196,.45), rgba(20,184,196,0) 68%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .logo-chip { display: inline-flex; background: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: var(--sh-2); }
.auth-art .logo-chip img { height: 30px; width: auto; display: block; }
.auth-art h2 { font-size: 34px; font-weight: 800; line-height: 1.15; max-width: 440px; letter-spacing: -.02em; }
.auth-art h2 em { font-style: normal; background: var(--grad-lime); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: rgba(255,255,255,.75); max-width: 420px; margin-top: 12px; }
.auth-feats { display: flex; flex-direction: column; gap: 10px; }
.auth-feats div { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.9); font-weight: 500; }
.auth-feats .i { color: #a3e635; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.auth-box { width: 100%; max-width: 360px; animation: rise .5s var(--ease); }
.auth-box .mob-logo { display: none; height: 34px; width: auto; margin-bottom: 26px; }
.auth-box h1 { font-size: 24px; font-weight: 800; }
.auth-box > p { color: var(--muted); margin: 6px 0 24px; }
.input-ic { position: relative; }
.input-ic .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; pointer-events: none; }
.input-ic input { padding-left: 38px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-form { align-items: flex-start; padding-top: 12vh; background: radial-gradient(120% 60% at 100% 0%, var(--lime-soft), transparent 60%), radial-gradient(100% 60% at 0% 0%, var(--brand-soft), transparent 60%), var(--surface); }
  .auth-box .mob-logo { display: block; }
  .auth-box h1 { font-size: 21px; }
}

/* print (reports → PDF) */
@media print {
  .sidebar, .appbar, .tabbar, .sheet, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-head { display: flex !important; }
}
.print-head { display: none; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ---------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -16px); visibility: hidden; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.content > * { animation: rise .45s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
.content > *:nth-child(5) { animation-delay: .16s; }
.content > *:nth-child(n+6) { animation-delay: .2s; }
.kpis > *, .client-grid > * { animation: rise .45s var(--ease) both; }
.kpis > *:nth-child(2), .client-grid > *:nth-child(2) { animation-delay: .05s; }
.kpis > *:nth-child(3), .client-grid > *:nth-child(3) { animation-delay: .1s; }
.kpis > *:nth-child(4), .client-grid > *:nth-child(4) { animation-delay: .15s; }
.client-grid > *:nth-child(n+5) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
