/* ============================================================================
   Client Portal — styles. Dark, glass, light-on-depth. No framework.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #04060e;
  --bg-2: #080d1c;
  --panel: rgba(13, 19, 40, 0.62);
  --panel-2: rgba(18, 26, 54, 0.78);
  --panel-solid: #0c1228;
  --line: rgba(148, 163, 255, 0.12);
  --line-2: rgba(148, 163, 255, 0.22);
  --text: #e9edff;
  --muted: #98a3c7;
  --dim: #5f6a8e;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #ec4899;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --grad: linear-gradient(120deg, #22d3ee 0%, #8b5cf6 52%, #ec4899 100%);
  --grad-soft: linear-gradient(120deg, rgba(34, 211, 238, 0.16), rgba(139, 92, 246, 0.16) 52%, rgba(236, 72, 153, 0.16));
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); letter-spacing: 0.005em; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
[hidden] { display: none !important; }
:where(svg[aria-hidden='true']) { width: 18px; height: 18px; flex: none; }
.who > svg { width: 16px; height: 16px; color: var(--dim); }
.noscript { position: relative; z-index: 2; padding: 40px; text-align: center; }

/* ---- the living background ------------------------------------------------ */
.bg-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.85; }
.aurora { position: fixed; inset: -20vmax; z-index: 0; pointer-events: none; filter: blur(70px) saturate(130%); opacity: 0.55; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aurora i:nth-child(1) { width: 52vmax; height: 52vmax; left: 8%; top: 4%; background: radial-gradient(circle, rgba(34, 211, 238, 0.55), transparent 62%); animation: drift1 26s var(--ease) infinite alternate; }
.aurora i:nth-child(2) { width: 46vmax; height: 46vmax; right: 2%; top: 18%; background: radial-gradient(circle, rgba(139, 92, 246, 0.6), transparent 62%); animation: drift2 32s var(--ease) infinite alternate; }
.aurora i:nth-child(3) { width: 40vmax; height: 40vmax; left: 34%; bottom: -6%; background: radial-gradient(circle, rgba(236, 72, 153, 0.38), transparent 64%); animation: drift3 38s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 8vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, 10vmax) scale(0.9); } }
@keyframes drift3 { to { transform: translate(8vmax, -12vmax) scale(1.2); } }
.grid-floor {
  position: fixed; left: -50%; right: -50%; bottom: -10vh; height: 60vh; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(34, 211, 238, 0.16) 1px, transparent 1px), linear-gradient(90deg, rgba(139, 92, 246, 0.16) 1px, transparent 1px);
  background-size: 64px 64px; transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 85%); mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 85%);
  animation: floor 9s linear infinite; opacity: 0.55;
}
@keyframes floor { to { background-position: 0 64px, 0 0; } }
.noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 30%, transparent 40%, rgba(2, 3, 8, 0.72) 100%); }

#app { position: relative; z-index: 1; min-height: 100vh; }

/* ---- glass ------------------------------------------------------------------ */
.glass {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); box-shadow: var(--shadow);
}
.glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 30%);
}
.glow-border { position: relative; }
.glow-border::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), rgba(34, 211, 238, 0.0), rgba(34, 211, 238, 0.9), rgba(139, 92, 246, 0.9), rgba(236, 72, 153, 0.8), rgba(34, 211, 238, 0.0) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin-border 6s linear infinite; opacity: 0.85;
}
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spin-border { to { --angle: 360deg; } }

/* ---- buttons ---------------------------------------------------------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04);
  color: var(--text); font-weight: 600; font-size: 14px; letter-spacing: 0.01em; cursor: pointer; white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s; overflow: hidden; text-decoration: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(148, 163, 255, 0.36); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { border: 0; background: var(--grad); color: #060914; box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12) inset; }
.btn-primary:hover { background: var(--grad); box-shadow: 0 14px 40px -10px rgba(34, 211, 238, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.25) inset; }
.btn-primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); transition: left 0.7s var(--ease);
}
.btn-primary:hover::after { left: 130%; }
.btn-lg { height: 50px; font-size: 15px; padding: 0 24px; border-radius: 14px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); border-color: var(--line); }
.btn-danger { border-color: rgba(251, 113, 133, 0.35); color: #ffd1d9; background: rgba(251, 113, 133, 0.08); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.16); border-color: rgba(251, 113, 133, 0.55); }
.btn-icon { width: 38px; padding: 0; height: 38px; border-radius: 11px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.btn-primary.loading::before { border-color: rgba(6, 9, 20, 0.3); border-top-color: #060914; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- form fields --------------------------------------------------------------- */
.field { position: relative; display: block; margin: 0 0 14px; }
.field input, .field select, .field textarea {
  width: 100%; height: 56px; padding: 25px 14px 7px; border-radius: 13px; border: 1px solid var(--line-2);
  background: rgba(6, 10, 24, 0.55); color: var(--text); outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
.field select { padding-right: 40px; cursor: pointer; }
.field select option { background: #0c1228; color: var(--text); }
.field .chev { position: absolute; right: 14px; top: 20px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.field label {
  position: absolute; left: 15px; top: 17px; color: var(--muted); font-size: 14px; pointer-events: none;
  transition: transform 0.18s var(--ease), color 0.18s, font-size 0.18s; transform-origin: left top;
}
.field input:focus, .field select:focus { border-color: rgba(34, 211, 238, 0.6); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12); background: rgba(6, 10, 24, 0.75); }
.field input:focus + label, .field input:not(:placeholder-shown) + label, .field select + label, .field.filled label {
  transform: translateY(-11px); font-size: 10.5px; color: var(--cyan); letter-spacing: 0.06em; text-transform: uppercase;
}
.field input::placeholder { color: transparent; }
.field input:focus::placeholder { color: var(--dim); }
.field .hint { display: block; margin: 6px 4px 0; font-size: 12.5px; color: var(--dim); }
.field .req { color: var(--magenta); margin-left: 2px; }
.field .eye { position: absolute; right: 8px; top: 8px; }
.field.has-eye input { padding-right: 52px; }
.caps { display: none; margin: 6px 4px 0; font-size: 12.5px; color: var(--warn); }
.caps.on { display: block; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; color: var(--muted); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .knob { position: relative; width: 40px; height: 23px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line-2); transition: background 0.25s; flex: none; }
.toggle .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #cfd6f5; transition: transform 0.25s var(--ease), background 0.25s; }
.toggle input:checked + .knob { background: linear-gradient(120deg, rgba(34, 211, 238, 0.8), rgba(139, 92, 246, 0.8)); border-color: transparent; }
.toggle input:checked + .knob::after { transform: translateX(17px); background: #fff; }
.toggle input:focus-visible + .knob { outline: 2px solid var(--cyan); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.chip-check input:checked + span { color: #fff; border-color: rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.12); box-shadow: 0 0 18px -6px rgba(34, 211, 238, 0.7); }
.chip-check input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.dropzone {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; margin-bottom: 14px; cursor: pointer;
  border: 1.5px dashed rgba(148, 163, 255, 0.3); background: rgba(6, 10, 24, 0.45); transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.over { border-color: rgba(34, 211, 238, 0.7); background: rgba(34, 211, 238, 0.06); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); flex: none; }
.dropzone .dz-icon svg { width: 20px; height: 20px; color: var(--cyan); }
.dropzone strong { display: block; font-size: 14px; }
.dropzone small { color: var(--dim); font-size: 12.5px; }
.dropzone .dz-clear { position: relative; z-index: 2; margin-left: auto; }

/* ---- auth screens -------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 48px; max-width: 1240px; margin: 0 auto; padding: 48px 32px; }
.auth-hero { padding: 12px 8px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.02em; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font: 500 11px/1 var(--mono); letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase; margin-top: 4px; }
.logo { width: 40px; height: 40px; flex: none; }
.logo .ring { transform-origin: 50% 50%; animation: spin 14s linear infinite; }
.logo .ring2 { transform-origin: 50% 50%; animation: spin 9s linear infinite reverse; }
.logo .core { animation: pulse 3.2s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes pulse { 50% { transform: scale(0.82); opacity: 0.75; } }
.auth h1 { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 5.2vw, 66px); line-height: 1.02; letter-spacing: -0.035em; margin: 34px 0 18px; }
.auth .lede { font-size: 17.5px; color: var(--muted); max-width: 520px; margin: 0 0 30px; }
.features { display: grid; gap: 12px; max-width: 520px; }
.feature { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); }
.feature .fi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); flex: none; }
.feature .fi svg { width: 18px; height: 18px; color: var(--cyan); }
.feature b { display: block; font-size: 14.5px; }
.feature span { color: var(--dim); font-size: 13.5px; }
.ticker { margin-top: 26px; display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.ticker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); animation: ping 2.2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); } 80%, 100% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } }

.auth-card { padding: 34px 32px 30px; border-radius: 24px; }
.auth-card h2 { font-family: var(--display); font-size: 26px; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 14.5px; }
.auth-card .between { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 20px; }
.auth-card .foot { margin-top: 18px; text-align: center; color: var(--dim); font-size: 12.5px; }
.auth-card .btn-primary { width: 100%; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; font-size: 13.5px; border: 1px solid; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.alert-bad { color: #ffd5dc; border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.08); }
.alert-warn { color: #fde9b3; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.07); }
.alert-ok { color: #c9f7e4; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.07); }
.alert-info { color: #cdf4fb; border-color: rgba(34, 211, 238, 0.32); background: rgba(34, 211, 238, 0.06); }
.shake { animation: shake 0.45s var(--ease); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* ---- app shell -------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: rgba(4, 6, 14, 0.55); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--muted); }
.badge-admin { color: #f5d0fe; border-color: rgba(236, 72, 153, 0.45); background: rgba(236, 72, 153, 0.1); }
.who { display: flex; align-items: center; gap: 12px; padding: 5px 6px 5px 5px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); cursor: pointer; }
.who:hover { border-color: var(--line-2); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 13px/1 var(--display); color: #060914; background: var(--grad); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.who .wt { line-height: 1.2; text-align: left; }
.who .wt b { display: block; font-size: 13.5px; }
.who .wt span { font-size: 12px; color: var(--dim); }
.menu { position: absolute; right: 28px; top: 64px; min-width: 240px; padding: 8px; border-radius: 14px; z-index: 40; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop 0.18s var(--ease); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; color: var(--text); font-size: 14px; }
.menu button:hover { background: rgba(255, 255, 255, 0.06); }
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

.page { max-width: 1240px; margin: 0 auto; padding: 34px 28px 80px; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.hello h1 { font-family: var(--display); font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.03em; margin: 0; line-height: 1.1; }
.hello p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { font: 600 11.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--cyan); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi { padding: 18px 20px; border-radius: 18px; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .k-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line); }
.kpi .k-ico svg { width: 16px; height: 16px; color: var(--cyan); }
.kpi .k-val { font: 600 34px/1.1 var(--display); letter-spacing: -0.03em; margin-top: 12px; }
.kpi .k-val small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.kpi .k-sub { margin-top: 4px; font-size: 12.5px; color: var(--dim); }
.kpi .spark { position: absolute; right: -10px; bottom: -14px; width: 120px; height: 60px; opacity: 0.5; }
.kpi.live .k-ico { background: rgba(251, 191, 36, 0.12); }
.kpi.live .k-ico svg { color: var(--warn); }

/* sections */
.section { padding: 24px; border-radius: 22px; margin-bottom: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-size: 20px; letter-spacing: -0.015em; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head h2 .count { font: 600 12px/1 var(--mono); color: var(--muted); padding: 5px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.section-head p { margin: 4px 0 0; color: var(--dim); font-size: 13.5px; }

/* report types */
.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.type-card {
  position: relative; text-align: left; padding: 18px 18px 16px; border-radius: 16px; cursor: pointer; overflow: hidden;
  border: 1px solid var(--line-2); background: rgba(6, 10, 24, 0.5); color: var(--text); transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.type-card:hover { transform: translateY(-2px); border-color: rgba(148, 163, 255, 0.4); }
.type-card[aria-pressed='true'] { border-color: rgba(34, 211, 238, 0.65); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4) inset, 0 18px 50px -20px rgba(34, 211, 238, 0.55); background: linear-gradient(160deg, rgba(34, 211, 238, 0.09), rgba(139, 92, 246, 0.07)); }
.type-card .tc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.type-card .tc-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); flex: none; }
.type-card .tc-ico svg { width: 21px; height: 21px; color: var(--cyan); }
.type-card b { font-family: var(--display); font-size: 17px; letter-spacing: -0.01em; }
.type-card .tc-time { margin-left: auto; font: 500 11.5px/1 var(--mono); color: var(--dim); white-space: nowrap; }
.type-card p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.type-card .outs { display: flex; flex-wrap: wrap; gap: 6px; }
.out-chip { font: 500 11px/1 var(--mono); padding: 5px 8px; border-radius: 7px; color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.type-card .tick { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--cyan); color: #04121a; opacity: 0; transform: scale(0.5); transition: all 0.25s var(--ease); }
.type-card .tick svg { width: 13px; height: 13px; }
.type-card[aria-pressed='true'] .tick { opacity: 1; transform: scale(1); }
.type-card[aria-pressed='true'] .tc-time { opacity: 0; }

.gen-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; animation: rise 0.35s var(--ease); }
.gen-form .full { grid-column: 1 / -1; }
.gen-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* vault table */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search input { height: 38px; width: 240px; padding: 0 12px 0 36px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(6, 10, 24, 0.55); outline: none; }
.search input:focus { border-color: rgba(34, 211, 238, 0.55); }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--dim); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(6, 10, 24, 0.5); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed='true'] { background: rgba(255, 255, 255, 0.09); color: var(--text); }

.vault { width: 100%; border-collapse: separate; border-spacing: 0; }
.vault th { text-align: left; font: 600 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding: 0 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vault td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.vault tr:last-child td { border-bottom: 0; }
.vault tbody tr { transition: background 0.2s; }
.vault tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.vault tr.fresh { animation: fresh 2.4s var(--ease); }
@keyframes fresh { 0% { background: rgba(52, 211, 153, 0.22); } 100% { background: transparent; } }
.r-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.r-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--grad-soft); border: 1px solid var(--line); }
.r-ico svg { width: 18px; height: 18px; color: var(--cyan); }
.r-title b { display: block; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.r-title small { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 12px; margin-top: 2px; flex-wrap: wrap; }
.type-tag { font: 600 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px; color: #bdf3fb; background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.25); }
.type-tag.sector { color: #ddd0ff; background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.3); }
.when b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; }
.when small { color: var(--dim); font-size: 12px; }
.size { font-family: var(--mono); font-size: 13.5px; color: var(--text); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.pill .pd { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill-ready { color: var(--ok); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.pill-processing { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.pill-processing .pd { animation: blink 1.2s ease-in-out infinite; }
.pill-failed { color: var(--bad); border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.08); }
@keyframes blink { 50% { opacity: 0.25; } }
.scan { position: relative; height: 4px; margin-top: 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; width: 170px; }
.scan i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: width 1s linear; }
.scan::after { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: sweep 1.6s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.eta { display: block; margin-top: 6px; font: 500 11.5px/1 var(--mono); color: var(--dim); }
.err { display: block; margin-top: 6px; font-size: 12px; color: #fda4b4; max-width: 260px; }
.files { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; }
.file-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px 0 6px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.035); color: var(--text); font-size: 13px; font-weight: 600; transition: all 0.2s; white-space: nowrap;
}
.file-btn:hover { border-color: rgba(34, 211, 238, 0.6); background: rgba(34, 211, 238, 0.09); box-shadow: 0 0 22px -8px rgba(34, 211, 238, 0.8); }
.file-btn .fx { font: 700 10px/1 var(--mono); letter-spacing: 0.06em; padding: 4px 5px; border-radius: 5px; color: #050711; }
.file-btn svg { width: 15px; height: 15px; color: var(--muted); }
.file-btn:hover svg { color: var(--cyan); }
.when small, .built { white-space: nowrap; }
.built { color: var(--dim); font-size: 12px; margin-top: 2px; }
.fx-pdf { background: #fb7185; }
.fx-xlsx { background: #34d399; }
.fx-html { background: #a78bfa; }
.file-btn small { font: 500 11.5px/1 var(--mono); color: var(--dim); }
.file-btn.busy { opacity: 0.6; pointer-events: none; }

.empty { text-align: center; padding: 46px 20px 40px; }
.empty .orb { width: 120px; height: 120px; margin: 0 auto 18px; }
.empty h3 { font-family: var(--display); font-size: 20px; margin: 0 0 6px; }
.empty p { margin: 0 auto; color: var(--muted); max-width: 380px; }

/* skeletons */
.sk { position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); animation: sk 1.4s infinite; }
@keyframes sk { to { transform: translateX(100%); } }

/* admin */
.client-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.client-cell .avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; }
.client-cell b { display: block; font-size: 14.5px; }
.client-cell small { display: block; color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.status-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.banner { margin-bottom: 18px; }

/* drawers & modals */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(2, 3, 9, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100vw); overflow-y: auto; padding: 26px 26px 40px;
  background: linear-gradient(180deg, rgba(14, 20, 42, 0.97), rgba(8, 12, 28, 0.98)); border-left: 1px solid var(--line-2);
  box-shadow: -40px 0 80px -20px rgba(0, 0, 0, 0.7); animation: slide 0.32s var(--ease);
}
.drawer.wide { width: min(980px, 100vw); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.drawer-head h2 { font-family: var(--display); font-size: 24px; letter-spacing: -0.02em; margin: 0; }
.drawer-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.drawer h3 { font: 600 11.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin: 26px 0 12px; }
.modal-wrap { position: fixed; inset: 0; z-index: 61; display: grid; place-items: center; padding: 16px; }
.modal { width: min(460px, 100%); padding: 26px; border-radius: 22px; background: linear-gradient(180deg, rgba(16, 23, 48, 0.98), rgba(9, 13, 30, 0.98)); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop 0.22s var(--ease); }
.modal h2 { font-family: var(--display); font-size: 22px; margin: 0 0 6px; letter-spacing: -0.02em; }
.modal p { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; }
.modal .btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.cred { padding: 16px; border-radius: 14px; background: rgba(6, 10, 24, 0.7); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13.5px; line-height: 1.8; margin-bottom: 14px; word-break: break-all; }
.cred span { color: var(--dim); }
.strength { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin: -6px 2px 14px; }
.strength i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.3s, background 0.3s; }
.pw-tools { display: flex; gap: 8px; margin: -4px 0 14px; }
.logo-prev { width: 56px; height: 56px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; border: 1px solid var(--line-2); }
.logo-prev img { max-width: 90%; max-height: 90%; object-fit: contain; }

/* toasts */
.toasts { position: fixed; right: 20px; top: 20px; z-index: 90; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(12, 18, 40, 0.94);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); backdrop-filter: blur(14px); animation: toast-in 0.35s var(--ease); font-size: 14px;
}
.toast.out { animation: toast-out 0.3s var(--ease) forwards; }
.toast .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast .ti svg { width: 15px; height: 15px; }
.toast-ok .ti { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.toast-bad .ti { background: rgba(251, 113, 133, 0.15); color: var(--bad); }
.toast-info .ti { background: rgba(34, 211, 238, 0.15); color: var(--cyan); }
.toast b { display: block; }
.toast span { color: var(--muted); font-size: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo { width: 72px; height: 72px; }
.boot p { font: 500 12px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); text-align: center; margin-top: 18px; }

.burst { position: fixed; pointer-events: none; z-index: 95; width: 8px; height: 8px; border-radius: 2px; }

/* ---- responsive ------------------------------------------------------------------ */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .files { flex-wrap: wrap; }
}
@media (max-width: 920px) {
  .auth { grid-template-columns: 1fr; gap: 28px; padding: 28px 16px 40px; }
  .auth-hero h1 { margin-top: 26px; }
  .features { display: none; }
  .auth .lede { margin-bottom: 8px; }
  .ticker { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar .brand small, .who .wt { display: none; }
  .page { padding: 22px 16px 60px; }
  .section { padding: 18px 16px; border-radius: 18px; }
  .gen-form { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-val { font-size: 26px; }
  .search input { width: 100%; }
  .search, .toolbar { width: 100%; }
  .vault thead { display: none; }
  .vault, .vault tbody, .vault tr, .vault td { display: block; width: 100%; }
  .vault tr { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
  .vault td:nth-child(1), .vault td:nth-child(4), .vault td:nth-child(5), .vault td:nth-child(6) { grid-column: 1 / -1; }
  .vault td:nth-child(1)::before { display: none !important; }
  .vault td:nth-child(1) { margin-bottom: 6px; }
  .vault td { border: 0; padding: 6px 2px; }
  .vault td[data-label]::before { content: attr(data-label); display: block; font: 600 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
  .files, .acts { justify-content: flex-start; }
  .menu { right: 16px; left: 16px; top: 60px; }
  .drawer { padding: 20px 16px 36px; }
  .auth-card { padding: 26px 20px 22px; }
  .toasts { right: 16px; top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  #field { display: none; }
}
