@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --tint: #F2F2EE;
  --ink: #0F1419;
  --ink-2: #2B3138;
  --muted: #5B6470;
  --line: #E7E4DD;
  --brand: #0077B5;
  --brand-700: #005F91;
  --deep: #003E5C;
  --mist: #E8F1F7;
  --good: #12704F;
  --good-bg: #E3F3EC;
  --bad: #B4380A;
  --bad-bg: #FBEAE1;
  --warn-bg: #FFF5DC;
  --warn: #8A5A00;
  --sans: 'Helvetica Neue', Helvetica, 'Inter', Arial, sans-serif;
  --r: 16px;
  --shadow: 0 1px 2px rgba(15, 20, 25, 0.04), 0 8px 24px -12px rgba(15, 20, 25, 0.10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-side { position: relative; overflow: hidden; background: var(--deep); color: #fff; padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 120% at 100% 0%, rgba(79, 179, 217, 0.30) 0%, rgba(0, 119, 181, 0.18) 40%, transparent 72%); pointer-events: none; }
.auth-side > * { position: relative; }
.auth-logo { height: 54px; width: auto; display: block; background: #fff; border-radius: 12px; padding: 8px 12px; }
.auth-side h1 { margin: 0; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; max-width: 16ch; text-wrap: balance; }
.auth-side h1 span { color: #7CC8EA; }
.auth-side p { margin: 14px 0 0; color: #B7D6E8; max-width: 44ch; font-size: 16px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #D6E8F3; font-size: 14px; }
.auth-points li { display: flex; gap: 10px; align-items: baseline; }
.auth-points li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7CC8EA; flex: none; transform: translateY(-2px); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--tint); border-radius: 999px; margin-bottom: 22px; }
.auth-tabs a { text-align: center; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 9px 12px; border-radius: 999px; }
.auth-tabs a.on { background: var(--ink); color: #fff; }
.auth-card h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.auth-card .sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 28px 20px; gap: 20px; } .auth-points { display: none; } }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--mist); outline: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; border-radius: 999px; padding: 10px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px -2px rgba(0, 119, 181, 0.45); }
.btn-primary:hover { background: var(--brand-700); }
.btn-block { width: 100%; padding: 12px 18px; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #F0C9B6; }
.btn-sm { font-size: 12.5px; padding: 6px 12px; }
.flash { border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }
.flash-ok { background: var(--good-bg); color: var(--good); }
.flash-err { background: var(--bad-bg); color: var(--bad); }
.flash-info { background: var(--mist); color: var(--deep); }

/* App shell */
.topnav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topnav-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, min(4vw, 40px)); }
.topnav-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topnav img { height: 34px; width: auto; display: block; }
.crumb { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.crumb strong { color: var(--ink); }
.topnav-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.who { font-size: 13px; color: var(--muted); }
.page { padding: 28px max(16px, min(4vw, 40px)) 56px; display: grid; gap: 24px; }
.page-head h1 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.035em; line-height: 1.08; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 64ch; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.015em; }
.card .sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

/* Client cards */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.client-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.client-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -20px rgba(0, 62, 92, 0.45); }
.client-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--deep); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.client-card h3 { margin: 0; font-size: 18px; letter-spacing: -0.015em; }
.client-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.client-card .go { color: var(--brand); font-weight: 600; font-size: 14px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* Admin */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.t td { padding: 12px; border-bottom: 1px solid #ECE9E2; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; }
.pill-active { background: var(--good-bg); color: var(--good); }
.pill-pending { background: var(--warn-bg); color: var(--warn); }
.pill-disabled { background: var(--tint); color: var(--muted); }
.pill-admin { background: var(--mist); color: var(--deep); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form .input { padding: 6px 10px; font-size: 13px; width: 170px; }
details.more summary { cursor: pointer; font-size: 13px; color: var(--brand); font-weight: 600; }
details.more[open] { margin-top: 8px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; }
