/* Sonologik Ops — brand styles matching sonologik.com (Fraunces + Inter, ink / blue / green gradient). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/fraunces-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #050225;
  --blue: #0575E6;
  --green: #00F260;
  --grad: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  --grad-soft: linear-gradient(135deg, rgba(0,242,96,.14), rgba(5,117,230,.14));
  --hero:
    radial-gradient(900px 420px at 85% -10%, rgba(0,242,96,.22), transparent 60%),
    radial-gradient(700px 380px at 0% 110%, rgba(5,117,230,.32), transparent 60%),
    linear-gradient(160deg, #050225 0%, #0a0840 55%, #050225 100%);
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --secondary: #eef3fb;
  --text: #050225;
  --muted: #5b6478;
  --line: #e3e7f0;
  --brand: #0575E6;
  --brand-ink: #ffffff;
  --brand-soft: #e8f1fd;
  --red: #d42a3c; --red-soft: #fdecee;
  --amber: #a35b00; --amber-soft: #fff3df;
  --green-t: #0b7a43; --green-soft: #e3f8ec;
  --info-soft: #eef2f7;
  --radius: 18px;
  --shadow-card: 0 1px 2px rgba(5,2,37,.04), 0 8px 24px -10px rgba(5,2,37,.12);
  --shadow-float: 0 20px 50px -20px rgba(5,2,37,.25);
  --shadow-glow: 0 18px 50px -18px rgba(5,117,230,.55);
  --nav-w: 248px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", "Inter", ui-serif, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070a1d; --surface: #0f1430; --surface-2: #141a3a; --secondary: #18204a; --text: #eef1fb; --muted: #a2abc6; --line: #242c55;
    --brand: #4aa3ff; --brand-soft: #142a4d; --red: #ff6b7a; --red-soft: #3a1720; --amber: #f3b65a; --amber-soft: #3a2a12;
    --green-t: #4fe08f; --green-soft: #11321f; --info-soft: #1b2347;
    --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070a1d; --surface: #0f1430; --surface-2: #141a3a; --secondary: #18204a; --text: #eef1fb; --muted: #a2abc6; --line: #242c55;
  --brand: #4aa3ff; --brand-soft: #142a4d; --red: #ff6b7a; --red-soft: #3a1720; --amber: #f3b65a; --amber-soft: #3a2a12;
  --green-t: #4fe08f; --green-soft: #11321f; --info-soft: #1b2347;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--hero); color: #fff; font-family: var(--display); font-size: 1.2rem; }

/* ---------------------------------------------------------------- Layout */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); color: #fff;
  background: var(--hero); border-bottom: 1px solid rgba(255,255,255,.08); overflow: hidden;
}
.topbar::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 40px 40px; }
.topbar > * { position: relative; }
.topbar .title { font-family: var(--display); font-weight: 500; font-size: 1.08rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: inherit; font: inherit; width: 38px; height: 38px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.brand img { width: 26px; height: 29px; filter: drop-shadow(0 4px 10px rgba(0,242,96,.35)); }
.brand .word { font-weight: 700; letter-spacing: -.01em; font-size: 1.05rem; }
.brand .tag { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; padding: 3px 7px; border-radius: 999px; background: var(--grad); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--grad); color: #fff; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }

.sidenav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); background: var(--surface); border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .35s var(--ease); z-index: 40; overflow-y: auto; padding: 14px 10px 40px; display: flex; flex-direction: column;
}
.sidenav.open { transform: none; box-shadow: var(--shadow-float); }
.sidenav .brand { color: var(--text); padding: 8px 10px 16px; }
.sidenav .who { display: flex; align-items: center; gap: 10px; padding: 12px; margin: 0 2px 10px; border-radius: 14px; background: var(--grad-soft); }
.sidenav .who strong { display: block; font-size: .92rem; }
.sidenav .group { padding: 14px 12px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.sidenav a.nav { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 1px 0; color: var(--text); text-decoration: none; border-radius: 12px; font-weight: 500; font-size: .94rem; transition: background .2s, transform .2s var(--ease), color .2s; }
.sidenav a.nav svg { width: 18px; height: 18px; flex: none; color: var(--muted); transition: color .2s; }
.sidenav a.nav:hover { background: var(--secondary); transform: translateX(3px); }
.sidenav a.nav.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sidenav a.nav.active svg { color: var(--brand); }
.sidenav a.nav.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.sidenav a.nav .count { margin-left: auto; }
.sidenav .foot { margin-top: auto; padding: 12px; }
.scrim { position: fixed; inset: 0; background: rgba(5,2,37,.45); backdrop-filter: blur(3px); z-index: 30; animation: fade .25s var(--ease); }
main.content { padding: 18px 16px 110px; max-width: 1120px; margin: 0 auto; }
.bottombar {
  position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 20; display: flex; padding: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-float);
}
.bottombar a { flex: 1; text-align: center; padding: 6px 2px 4px; font-size: .7rem; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 16px; transition: color .2s, background .2s; }
.bottombar a svg { display: block; margin: 0 auto 2px; width: 21px; height: 21px; }
.bottombar a.active { color: var(--brand); background: var(--brand-soft); }
.bottombar a.primary { color: var(--text); background: none; }
.bottombar a.primary .fab { width: 46px; height: 46px; margin: -22px auto 0; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--shadow-glow); transition: transform .2s var(--ease); }
.bottombar a.primary:active .fab { transform: scale(.92); }
.bottombar a.primary .fab svg { margin: 0; }

@media (min-width: 900px) {
  .sidenav { transform: none; box-shadow: none; }
  .scrim, .bottombar, .topbar .menu-btn, .topbar .brand { display: none; }
  .topbar { margin-left: var(--nav-w); padding: 14px 28px; }
  main.content { margin-left: calc(var(--nav-w) + max(0px, (100vw - var(--nav-w) - 1120px) / 2)); padding: 28px 28px 60px; }
}

/* ------------------------------------------------------------ Components */
.view-enter > * { animation: fade-up .55s var(--ease) both; }
.view-enter > *:nth-child(2) { animation-delay: .05s; } .view-enter > *:nth-child(3) { animation-delay: .1s; }
.view-enter > *:nth-child(4) { animation-delay: .15s; } .view-enter > *:nth-child(n+5) { animation-delay: .2s; }
.stagger > * { animation: fade-up .5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .04s; } .stagger > *:nth-child(3) { animation-delay: .08s; } .stagger > *:nth-child(4) { animation-delay: .12s; }
.stagger > *:nth-child(5) { animation-delay: .16s; } .stagger > *:nth-child(n+6) { animation-delay: .2s; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 18px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .card-head h3, .card-head h1 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .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)); } }

.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-card); transition: transform .25s var(--ease), box-shadow .25s; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--grad-soft); }
.stat .v { position: relative; font-family: var(--display); font-size: clamp(1.05rem, 2.1vw, 1.75rem); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .l { position: relative; color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat.red .v { color: var(--red); } .stat.amber .v { color: var(--amber); }
a.stat { text-decoration: none; color: inherit; display: block; }
a.stat:hover, a.jobcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); }

.hero-banner { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px; margin-bottom: 18px; color: #fff; background: var(--hero); box-shadow: var(--shadow-glow); }
.hero-banner::before { content: ""; position: absolute; inset: 0; opacity: .4; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 44px 44px; }
.hero-banner .blob { position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(0,242,96,.22); filter: blur(40px); animation: float-y 6s ease-in-out infinite; }
.hero-banner > *:not(.blob):not(svg) { position: relative; }
.hero-banner h1 { font-size: 1.9rem; font-weight: 500; margin-bottom: 4px; }
.hero-banner h1 em { color: var(--green); font-style: italic; font-weight: 400; }
.hero-banner p { margin: 0; color: rgba(255,255,255,.72); }
.hero-banner .pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 12px; }
.hero-banner .pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(0,242,96,.6); animation: pulse 2s infinite; }
.hero-banner svg.ecg { position: absolute; left: 0; right: 0; bottom: 6px; width: 100%; height: 56px; opacity: .55; }
.hero-banner svg.ecg path { fill: none; stroke: var(--green); stroke-width: 2; stroke-dasharray: 1400; animation: ecg 5s linear infinite; }
.hero-banner .actions { position: relative; }

.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 18px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .25s, background .2s, border-color .2s;
}
.btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--grad); box-shadow: var(--shadow-glow); border-color: transparent; }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.btn-sm { min-height: 34px; padding: 5px 13px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; width: 100%; min-height: 48px; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .18; animation: ripple .6s var(--ease); pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; letter-spacing: .01em; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=month], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.field { margin-bottom: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; color: var(--text); font-size: .94rem; margin: 6px 0; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--blue); }
.form-row { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row > .field { margin-bottom: 0; }
@media (max-width: 520px) { .form-row.three { grid-template-columns: 1fr 1fr; } .form-row.three > .field:first-child { grid-column: 1 / -1; } }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0 0 12px; min-width: 0; }
legend { font-weight: 700; font-size: .85rem; padding: 0 6px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { text-align: left; padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.clickable { cursor: pointer; transition: background .15s; }
table.t tr.clickable:hover td { background: var(--secondary); }
table.t tfoot td { font-weight: 700; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--info-soft); color: var(--muted); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); } .badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.green { background: var(--green-soft); color: var(--green-t); } .badge.blue { background: var(--brand-soft); color: var(--brand); }

.alert { padding: 11px 14px; border-radius: 14px; margin: 8px 0; font-size: .92rem; border: 1px solid transparent; animation: fade .35s var(--ease); }
.alert-red { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 22%, transparent); }
.alert-amber { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 22%, transparent); }
.alert-green { background: var(--green-soft); color: var(--green-t); }
.alert-info { background: var(--info-soft); color: var(--text); }

.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

.jobcard { display: block; text-decoration: none; color: inherit; transition: transform .25s var(--ease), box-shadow .25s; }
.jobcard .tests { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }

.stepper { display: flex; gap: 4px; margin: 10px 0 4px; }
.stepper span { flex: 1; height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; }
.stepper span.done::after, .stepper span.now::after { content: ""; position: absolute; inset: 0; background: var(--grad); transform-origin: left; animation: grow .6s var(--ease) both; }
.stepper span.now::after { opacity: .55; animation: grow .6s var(--ease) both, breathe 1.8s ease-in-out .6s infinite; }
.steplabel { font-size: .8rem; color: var(--muted); }

.order { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; background: var(--surface); position: relative; overflow: hidden; }
.order::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.order.sev-red::before { background: var(--red); } .order.sev-amber::before { background: #f5a524; } .order.sev-green::before { background: var(--grad); }
.flags { list-style: none; padding: 0; margin: 8px 0; }
.flags li { padding: 8px 11px; border-radius: 10px; margin-bottom: 5px; font-size: .9rem; }
.flags li.red { background: var(--red-soft); color: var(--red); } .flags li.amber { background: var(--amber-soft); color: var(--amber); }
.flags li.green { background: var(--green-soft); color: var(--green-t); } .flags li.info { background: var(--info-soft); }

.docs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.doc { border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px; font-size: .85rem; min-height: 70px; background: var(--surface-2); transition: border-color .2s, transform .2s var(--ease); }
.doc:hover { transform: translateY(-2px); }
.doc.have { border-style: solid; border-color: color-mix(in srgb, var(--green-t) 55%, var(--line)); background: var(--surface); }
.doc.need { border-color: #f5a524; }
.doc .k { font-weight: 700; display: block; margin-bottom: 5px; }
.doc a { word-break: break-all; }

/* Document viewer for doctors */
.viewer { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface-2); margin-top: 10px; }
.viewer .tabs { margin: 0; padding: 0 8px; background: var(--surface); }
.viewer .pane { padding: 10px; }
.viewer iframe { width: 100%; height: 72vh; min-height: 420px; border: 0; border-radius: 10px; background: #fff; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; aspect-ratio: 3 / 4; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.gallery a:hover img { transform: scale(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(5,2,37,.9); display: grid; place-items: center; animation: fade .2s; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .3s var(--ease); }
.lightbox .bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }

/* Skeleton */
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--secondary) 25%, var(--surface-2) 37%, var(--secondary) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skel-line { height: 14px; margin: 10px 0; border-radius: 7px; }
.skel-card { height: 96px; margin-bottom: 14px; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(5,2,37,.5); backdrop-filter: blur(4px); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .25s var(--ease); }
.modal { background: var(--surface); width: 100%; max-width: 660px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); box-shadow: var(--shadow-float); animation: sheet .4s var(--ease); }
.modal-back.closing { animation: fade-out .2s forwards; } .modal-back.closing .modal { animation: sheet-out .2s forwards; }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: 24px; animation: pop .35s var(--ease); } }
.modal h2 { margin-bottom: 12px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 80; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; box-shadow: var(--shadow-float); max-width: calc(100vw - 32px); font-weight: 500; animation: toast-in .4s var(--ease); border: 1px solid rgba(255,255,255,.1); }
.toast::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 9px; background: var(--green); vertical-align: middle; }
.toast.err { background: var(--red); } .toast.err::before { background: #fff; }
@media (min-width: 900px) { .toast { bottom: 28px; } }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a, .tabs button { position: relative; padding: 10px 14px; text-decoration: none; color: var(--muted); border: 0; background: none; font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tabs a.active, .tabs button.active { color: var(--brand); }
.tabs a.active::after, .tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); animation: grow .35s var(--ease); }

.search-results { border: 1px solid var(--line); border-radius: 14px; margin-top: 6px; max-height: 280px; overflow-y: auto; background: var(--surface); box-shadow: var(--shadow-card); animation: fade-up .25s var(--ease); }
.search-results button { display: block; width: 100%; text-align: left; padding: 11px 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.search-results button:hover { background: var(--secondary); }
.chip-select { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-select label { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--text); font-weight: 500; font-size: .9rem; cursor: pointer; background: var(--surface); margin: 0; transition: all .2s var(--ease); }
.chip-select input { margin: 0; accent-color: var(--blue); }
.chip-select label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-card); }

/* --------------------------------------------------------------- Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--hero); color: #fff; position: relative; overflow: hidden; }
.login-body::before { content: ""; position: absolute; inset: 0; opacity: .4; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 56px 56px; }
.login-body .blob { position: absolute; width: 360px; height: 360px; border-radius: 50%; filter: blur(70px); }
.login-body .blob.g { background: rgba(0,242,96,.25); top: -80px; right: -60px; animation: float-y 7s ease-in-out infinite; }
.login-body .blob.b { background: rgba(5,117,230,.35); bottom: -100px; left: -80px; animation: float-y 9s ease-in-out infinite reverse; }
.login-card { position: relative; width: 100%; max-width: 400px; padding: 30px 26px; text-align: center; border-radius: 26px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: pop .6s var(--ease); }
.login-card h1 { font-size: 2rem; font-weight: 500; margin: 14px 0 4px; }
.login-card h1 em { color: var(--green); font-weight: 400; }
.login-card .muted { color: rgba(255,255,255,.7); }
.login-card .btn { margin-top: 16px; }
.login-card .alert { text-align: left; }
.link-small { display: block; margin-top: 16px; font-size: .9rem; color: rgba(255,255,255,.8); }
.fine { font-size: .74rem; color: rgba(255,255,255,.55); margin-top: 20px; }
.pw-login { margin-top: 12px; }
.pw-login > summary { list-style: none; cursor: pointer; padding: 10px; border-radius: 12px; font-size: .92rem; color: rgba(255,255,255,.85); transition: background .2s, color .2s; }
.pw-login > summary::-webkit-details-marker { display: none; }
.pw-login > summary:hover, .pw-login > summary:focus-visible { color: #fff; background: rgba(255,255,255,.07); outline: none; }
.pw-login[open] > summary { color: #fff; font-weight: 600; }
.pw-form { text-align: left; }
.pw-form h2 { margin: 18px 0 4px; font-size: 1.25rem; color: #fff; text-align: center; }
.pw-form p { margin: 0 0 6px; text-align: center; }
.pw-form label:not(.check) { margin: 12px 0 5px; color: rgba(255,255,255,.78); }
.pw-form input[type=text], .pw-form input[type=email], .pw-form input[type=password] { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: rgba(255,255,255,.96); color: #050225; font: inherit; font-size: 16px; }
.pw-form input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(0,242,96,.25); }
.pw-form .btn { width: 100%; min-height: 48px; }
.pw-form .link-small { text-align: center; }
.coin { width: 76px; height: 84px; margin: 0 auto; perspective: 500px; position: relative; }
.coin::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,242,96,.45), rgba(5,117,230,.2) 60%, transparent); filter: blur(6px); animation: breathe 2.8s ease-in-out infinite; }
.coin .in { position: absolute; inset: 0; transform-style: preserve-3d; animation: wobble 6s cubic-bezier(.45,.05,.55,.95) infinite; }
.coin img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.coin img.l { transform: translateZ(var(--z)); filter: brightness(var(--b)) saturate(1.2); }
.coin img.f { transform: translateZ(1px); filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); }

/* --------------------------------------------------------------- Motion */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-out { to { transform: translateY(30px); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes breathe { 0%, 100% { opacity: .45; } 50% { opacity: .9; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes ecg { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,242,96,.6); } 100% { box-shadow: 0 0 0 10px rgba(0,242,96,0); } }
@keyframes wobble { 0%, 100% { transform: rotateX(8deg) rotateY(-26deg); } 50% { transform: rotateX(-4deg) rotateY(26deg); } }
/* ------------------------------------------------------- Sales report KPIs */
.kpi-band { position: relative; overflow: hidden; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0; border-radius: var(--radius); color: #fff;
  background: radial-gradient(120% 160% at 0% 0%, rgba(5,117,230,.30), transparent 55%), radial-gradient(90% 140% at 100% 100%, rgba(0,242,96,.14), transparent 55%), #050225;
  box-shadow: var(--shadow-float); border: 1px solid rgba(255,255,255,.06); animation: fade-up .5s var(--ease) both; }
.kpi-band::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.kpi { min-width: 0; padding: 18px 18px 16px; }
.kpi:nth-child(even) { border-left: 1px solid rgba(255,255,255,.09); }
.kpi:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.09); }
@media (min-width: 1000px) {
  .kpi-band { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 1px solid rgba(255,255,255,.09); }
  .kpi:nth-child(n+3) { border-top: 0; }
}
.kpi .k-l { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #a0acd0; }
.kpi .k-v { margin: 6px 0 6px; font-family: var(--display); font-size: clamp(1.5rem, 2.7vw, 2.2rem); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-s { font-size: .84rem; font-weight: 600; line-height: 1.35; }
.kpi .k-n { margin-top: 3px; font-size: .76rem; line-height: 1.35; color: #a0acd0; }
.kpi .k-bar { margin: 2px 0 9px; }
.kpi .prog-track { height: 9px; background: rgba(255,255,255,.14); }
.kpi .prog-pace { background: #fff; }
.kpi .k-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; margin-top: 2px; font-size: .78rem; color: #c4cce6; }
.kpi .k-list b { text-align: right; font-weight: 600; color: #ffc45a; font-variant-numeric: tabular-nums; }
.kpi .k-list b.zero { color: #c4cce6; font-weight: 500; }
.k-up { color: #00F260; } .k-down { color: #ff7f8d; } .k-warn { color: #ffc45a; } .k-soft { color: #c4cce6; }
.prog { min-width: 150px; }
.prog-share { min-width: 90px; }
.prog-track { position: relative; height: 8px; border-radius: 99px; background: var(--line); }
.prog-fill { height: 100%; border-radius: 99px; background: var(--grad); transform-origin: left; animation: grow .8s var(--ease) both; }
.prog-fill.behind { background: var(--red); }
.prog-fill.share { background: var(--brand); }
.prog-pace { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); }
.prog-txt { margin-top: 4px; font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prog-txt strong { color: var(--text); }
.partners table.t td { vertical-align: middle; }
@media (max-width: 600px) {
  .kpi-band { grid-template-columns: 1fr; }
  .kpi { padding: 14px 16px; }
  .kpi:nth-child(even) { border-left: 0; }
  .kpi + .kpi { border-top: 1px solid rgba(255,255,255,.09); }
  .kpi .k-v { margin: 2px 0 4px; }
  .partners table.t thead { display: none; }
  .partners table.t, .partners table.t tbody { display: block; }
  .partners table.t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .partners table.t td { display: block; padding: 0; border: 0; text-align: left; }
  .partners table.t td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .partners table.t td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  .partners table.t td:nth-child(2) { grid-column: 1 / -1; }
  .partners table.t td:nth-child(5) { text-align: right; }
  .partners table.t td:nth-child(4)::before { content: "Sales "; color: var(--muted); font-size: .8rem; }
  .partners table.t td:nth-child(5)::before { content: "Income "; color: var(--muted); font-size: .8rem; font-weight: 400; }
  .partners table.t td:nth-child(6) { display: none; }
  .partners .prog { min-width: 0; }
}
.grid-rep { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.nw { white-space: nowrap; }
.strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 26px; margin: 2px 0 12px; }
.strip b { font-family: var(--display); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.strip span { margin-left: 6px; font-size: .85rem; color: var(--muted); }
.strip .warn b { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- Print */
#print-root { display: none; }
.doc-print { color: #000; background: #fff; font: 11pt/1.4 "Inter", Arial, Helvetica, sans-serif; }
.doc-print .lh { display: flex; gap: 14px; align-items: center; border-bottom: 3px solid; border-image: linear-gradient(90deg, #00F260, #0575E6) 1; padding-bottom: 10px; margin-bottom: 12px; }
.doc-print .lh img { height: 44px; width: auto; }
.doc-print .lh .co { font-weight: 800; font-size: 13pt; color: #050225; }
.doc-print .lh .sub { font-size: 8.5pt; color: #333; }
.doc-print h1 { font-family: "Fraunces", Georgia, serif; font-size: 15pt; text-align: center; margin: 10px 0; letter-spacing: .02em; color: #050225; }
.doc-print table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.doc-print th, .doc-print td { border: 1px solid #9aa3b5; padding: 4px 6px; font-size: 9.5pt; text-align: left; vertical-align: top; }
.doc-print th { background: #eef3fb; }
.doc-print td.num { text-align: right; white-space: nowrap; }
.doc-print .meta td { border: 0; padding: 2px 6px 2px 0; }
.doc-print .meta td.k { color: #555; width: 22%; }
.doc-print .sig { display: flex; gap: 30px; margin-top: 26px; align-items: flex-end; }
.doc-print .sig > div { flex: 1; border-top: 1px solid #000; padding-top: 4px; font-size: 8.5pt; text-align: center; position: relative; }
.doc-print .sig img.signature { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); max-height: 60px; max-width: 200px; }
.doc-print .note { font-size: 7.5pt; color: #444; margin-top: 10px; }
.doc-print .copy { font-size: 8pt; font-weight: 700; text-align: right; color: #555; }
.doc-print .cut { border-top: 1px dashed #777; margin: 18px 0; }
.doc-print .flag-red { color: #b00020; font-weight: 700; } .doc-print .flag-amber { color: #8a4b00; font-weight: 700; }
.doc-print .interp { border: 1px solid #9aa3b5; padding: 10px; white-space: pre-wrap; min-height: 90px; }
.doc-print .diary td { height: 30px; }
.doc-print .pagebreak { page-break-before: always; break-before: page; }
.print-preview { position: fixed; inset: 0; z-index: 90; background: rgba(5,2,37,.85); overflow: auto; padding: 16px; animation: fade .2s; }
.print-preview .paper { background: #fff; max-width: 820px; margin: 0 auto 16px; padding: 30px; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .35s var(--ease); }
.print-preview .bar { position: sticky; top: 0; display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; z-index: 2; }
@media print {
  @page { size: A4; margin: 12mm; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  body { background: #fff; }
}

/* Setup → Sales recorded outside the app */
.opening-group { margin-top: 14px; }
.opening-group h3 { margin: 0 0 2px; font-size: 1rem; }
.opening-group table.t td { vertical-align: middle; }
.opening-group input[type=number] { max-width: 150px; min-height: 38px; padding: 6px 10px; }
.fine a { color: rgba(255,255,255,.78); text-decoration: underline; text-underline-offset: 2px; }
