:root {
  --ink: #123230;
  --ink-2: #28504d;
  --teal-950: #072c2a;
  --teal-900: #0a3734;
  --teal-800: #0f4944;
  --teal-700: #17635b;
  --teal-600: #1d7b70;
  --mint: #b8f1dc;
  --mint-2: #dff8ee;
  --lime: #ccef80;
  --cream: #f5f3eb;
  --paper: #fffef9;
  --surface: #ffffff;
  --line: #dfe8e5;
  --muted: #6e817e;
  --danger: #b54141;
  --warning: #9a6513;
  --shadow: 0 18px 50px rgba(18, 50, 48, .09);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Inter, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand > span:last-child { display: grid; line-height: 1.08; }
.brand b { font-size: 16px; letter-spacing: -.02em; }
.brand small { margin-top: 4px; color: var(--teal-600); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.brand-light { color: #fff; }
.brand-light small { color: var(--mint); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--teal-900); background: var(--lime); border-radius: 13px; transform: rotate(-3deg); box-shadow: 0 8px 22px rgba(0,0,0,.16); }
.brand-mark svg { width: 29px; height: 29px; stroke-width: 2.2; }

.eyebrow { display: inline-block; color: var(--mint); font-size: 10px; font-weight: 850; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow.ink { color: var(--teal-600); }
.muted { color: var(--muted); }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1.05fr) minmax(480px, .95fr); background: var(--paper); }
.login-story { position: relative; min-height: 100vh; padding: 48px clamp(48px, 7vw, 112px); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; background: var(--teal-950); isolation: isolate; }
.login-story::before { content: ""; position: absolute; inset: 0; z-index: -3; opacity: .08; background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(to bottom right, transparent, #000); }
.login-story::after { content: "Aa"; position: absolute; right: -35px; bottom: 2vh; z-index: -2; color: rgba(184,241,220,.055); font-family: Georgia, serif; font-size: min(35vw, 520px); font-style: italic; line-height: .75; transform: rotate(-8deg); }
.story-copy { max-width: 680px; margin: auto 0; padding: 90px 0; }
.story-copy h1 { max-width: 660px; margin: 15px 0 24px; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: clamp(50px, 5.7vw, 88px); font-weight: 400; letter-spacing: -.055em; line-height: .96; }
.story-copy h1 em { color: var(--lime); font-weight: 400; }
.story-copy p { max-width: 550px; margin: 0; color: #b9ccca; font-size: 18px; line-height: 1.65; }
.story-proof { display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); color: #d9e7e4; }
.story-proof div { display: grid; gap: 4px; }
.story-proof strong { color: var(--lime); font-size: 11px; letter-spacing: .15em; }
.story-proof span { font-size: 12px; white-space: nowrap; }
.story-proof i { flex: 1; max-width: 48px; height: 1px; background: #31524f; }
.story-orbit { position: absolute; z-index: -1; border: 1px solid rgba(204,239,128,.15); border-radius: 50%; }
.orbit-one { width: 340px; height: 340px; right: -170px; top: -100px; }
.orbit-two { width: 180px; height: 180px; right: -80px; top: -20px; }
.login-panel { min-height: 100vh; padding: 50px clamp(42px, 7vw, 104px) 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper); }
.login-card { width: min(100%, 470px); }
.login-card h2 { margin: 10px 0 8px; font-family: Georgia, serif; font-size: clamp(34px, 3vw, 48px); font-weight: 500; letter-spacing: -.045em; }
.login-card > p { margin: 0 0 34px; }
.otp-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#otpCode { font-size: 20px; font-weight: 800; letter-spacing: .28em; }
.mobile-brand { display: none; margin-bottom: 60px; }
.stack-lg { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field > span:first-child { color: var(--ink-2); font-size: 12px; font-weight: 750; letter-spacing: .01em; }
.field input, .field select, .field textarea { width: 100%; height: 50px; padding: 0 15px; color: var(--ink); background: #fbfcf9; border: 1px solid #d9e3df; border-radius: 12px; outline: none; transition: .2s ease; }
.field textarea { height: auto; min-height: 86px; padding-top: 13px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(29,123,112,.1); background: #fff; }
.field input::placeholder { color: #9aaaa7; }
.input-wrap { position: relative; display: block; }
.input-wrap svg { position: absolute; left: 15px; top: 15px; width: 19px; height: 19px; color: #718783; }
.input-wrap input { padding-left: 45px; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.5; }
.button { min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 750; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { color: #fff; background: var(--teal-700); box-shadow: 0 8px 20px rgba(23,99,91,.2); }
.button.primary:hover:not(:disabled) { background: var(--teal-800); box-shadow: 0 10px 25px rgba(23,99,91,.28); }
.button.secondary { color: var(--teal-800); background: var(--mint-2); border-color: #cdece1; }
.button.ghost { color: var(--ink-2); background: transparent; border-color: var(--line); }
.button.danger { color: #fff; background: var(--danger); }
.button.wide { width: 100%; }
.button svg { width: 18px; height: 18px; }
.form-error { min-height: 17px; margin: -5px 0 -4px; color: var(--danger); font-size: 12px; }
.first-run { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.first-run span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.first-run p { margin: 8px 0 0; color: var(--ink-2); font-size: 12px; }
code { padding: 3px 6px; color: var(--teal-800); background: var(--mint-2); border-radius: 5px; font-size: 11px; }
.login-foot { margin: auto 0 0; padding-top: 40px; color: #82918f; font-size: 11px; }

/* Shell */
.app-shell { min-height: 100vh; display: grid; grid-template: 92px 1fr / 246px 1fr; background: var(--cream); }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 246px; padding: 28px 18px 20px; display: flex; flex-direction: column; background: var(--teal-950); }
.sidebar-brand { margin: 0 12px 44px; }
.side-nav { display: grid; gap: 7px; }
.side-nav button { width: 100%; height: 47px; padding: 0 13px; display: flex; align-items: center; gap: 13px; color: #a9bdb9; background: transparent; border: 0; border-radius: 11px; cursor: pointer; font-size: 12.5px; font-weight: 650; text-align: left; transition: .18s ease; }
.side-nav button:hover { color: #fff; background: rgba(255,255,255,.055); }
.side-nav button.active { color: #fff; background: var(--teal-800); box-shadow: inset 3px 0 var(--lime); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.nav-icon svg { width: 19px; height: 19px; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.09); }
.profile-button { width: 100%; padding: 7px; display: flex; align-items: center; gap: 10px; color: #fff; background: transparent; border: 0; border-radius: 12px; cursor: pointer; text-align: left; }
.profile-button:hover { background: rgba(255,255,255,.06); }
.profile-button > svg { width: 16px; margin-left: auto; color: #78918c; }
.avatar { flex: 0 0 auto; width: 37px; height: 37px; display: grid; place-items: center; color: var(--teal-950); background: var(--lime); border-radius: 11px; font-size: 13px; font-weight: 850; }
.avatar.large { width: 76px; height: 76px; border-radius: 22px; font-size: 26px; }
.profile-copy { min-width: 0; display: grid; gap: 3px; }
.profile-copy b { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: #89a19c; font-size: 10px; }
.topbar { position: sticky; z-index: 10; top: 0; grid-area: 1 / 2; min-width: 0; height: 92px; padding: 0 clamp(26px, 3.5vw, 54px); display: flex; align-items: center; gap: 18px; background: rgba(245,243,235,.88); border-bottom: 1px solid rgba(210,220,216,.75); backdrop-filter: blur(18px); }
.topbar h1 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; letter-spacing: -.025em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.status-badge { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--teal-700); background: #e4f5ed; border: 1px solid #cde9dd; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.status-badge i { width: 7px; height: 7px; background: #2ba66f; border-radius: 50%; box-shadow: 0 0 0 3px rgba(43,166,111,.13); }
.status-badge.offline { color: var(--warning); background: #fff5dd; border-color: #f1dfb1; }
.status-badge.offline i { background: #d08d26; box-shadow: 0 0 0 3px rgba(208,141,38,.13); }
.mobile-menu { display: none !important; }
.workspace { grid-area: 2 / 2; min-width: 0; padding: 38px clamp(26px, 3.5vw, 54px) 60px; }
.view { display: none; animation: view-in .28s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

.section-heading { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h2 { margin: 7px 0 5px; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 38px); font-weight: 500; letter-spacing: -.035em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid rgba(218,229,225,.9); border-radius: var(--radius); box-shadow: 0 7px 26px rgba(18,50,48,.045); }

/* Dashboard */
.welcome-card { position: relative; min-height: 245px; margin-bottom: 22px; padding: clamp(30px, 4vw, 52px); overflow: hidden; display: flex; align-items: center; color: #fff; background: var(--teal-900); border-radius: 26px; isolation: isolate; }
.welcome-card::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 78% 50%, rgba(184,241,220,.18), transparent 24%), linear-gradient(110deg, transparent 58%, rgba(204,239,128,.08)); }
.welcome-card::after { content: ""; position: absolute; z-index: -1; width: 390px; height: 390px; right: -60px; top: -75px; border: 1px solid rgba(204,239,128,.22); border-radius: 50%; box-shadow: 0 0 0 65px rgba(184,241,220,.035), 0 0 0 130px rgba(184,241,220,.022); }
.welcome-card h2 { max-width: 610px; margin: 9px 0 13px; font-family: Georgia, serif; font-size: clamp(35px, 4vw, 52px); font-weight: 400; letter-spacing: -.04em; line-height: 1.05; }
.welcome-card h2 em { color: var(--lime); font-weight: 400; }
.welcome-card p { max-width: 560px; margin: 0 0 26px; color: #b9ceca; font-size: 14px; line-height: 1.65; }
.welcome-card .button { width: fit-content; color: var(--teal-950); background: var(--lime); box-shadow: none; }
.stats-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat-card { min-height: 144px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-card p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.stat-icon { width: 35px; height: 35px; display: grid; place-items: center; color: var(--teal-700); background: var(--mint-2); border-radius: 10px; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-value { display: flex; align-items: baseline; gap: 6px; }
.stat-value strong { font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -.04em; }
.stat-value span { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
.recent-panel, .usage-panel { padding: 23px; }
.panel-title { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-title h3 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 21px; font-weight: 550; letter-spacing: -.02em; }
.panel-title p { margin: 0; color: var(--muted); font-size: 11px; }
.text-button { padding: 5px; color: var(--teal-600); background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 750; }
.text-button:disabled { opacity: .4; }
.recent-list { display: grid; }
.recent-item { padding: 13px 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-top: 1px solid #edf1ef; }
.recent-item:first-child { border-top: 0; }
.file-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--teal-700); background: var(--mint-2); border-radius: 11px; }
.file-icon svg { width: 17px; }
.recent-item b { overflow: hidden; display: block; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.recent-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.accuracy-mini { color: var(--teal-600); font-size: 11px; font-weight: 800; }
.usage-ring { --percent: 0; width: 154px; height: 154px; margin: 5px auto 24px; display: grid; place-items: center; background: conic-gradient(var(--teal-600) calc(var(--percent) * 1%), #e5eeea 0); border-radius: 50%; position: relative; }
.usage-ring::after { content: ""; position: absolute; inset: 13px; background: #fff; border-radius: 50%; }
.usage-ring div { position: relative; z-index: 1; display: grid; place-items: center; }
.usage-ring strong { font-family: Georgia, serif; font-size: 32px; font-weight: 500; }
.usage-ring span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.usage-legend { display: flex; justify-content: space-around; gap: 16px; padding-top: 15px; border-top: 1px solid #edf1ef; }
.usage-legend div { display: grid; gap: 3px; text-align: center; }
.usage-legend b { font-size: 16px; }
.usage-legend span { color: var(--muted); font-size: 9px; }

/* Process */
.quota-pill { padding: 11px 15px; color: var(--teal-700); background: var(--mint-2); border: 1px solid #cce9df; border-radius: 12px; font-size: 11px; font-weight: 750; }
.alert { margin: 0 0 22px; padding: 15px 18px; display: flex; align-items: center; gap: 13px; border-radius: 14px; }
.alert svg { flex: 0 0 auto; }
.alert div { display: grid; gap: 3px; }
.alert b { font-size: 12px; }
.alert span { font-size: 11px; }
.alert.warning { color: #77511a; background: #fff3d5; border: 1px solid #eddda9; }
.security-bypass-banner { box-shadow: 0 10px 28px rgba(154, 101, 19, .08); }
.process-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 20px; align-items: start; }
.upload-panel { padding: 22px; }
.drop-zone { padding: 34px 24px; text-align: center; background: #f8fbf8; border: 1.5px dashed #bad4cc; border-radius: 17px; transition: .2s ease; }
.drop-zone.dragover { background: var(--mint-2); border-color: var(--teal-600); transform: scale(1.005); }
.upload-art { width: 64px; height: 64px; margin: 0 auto 17px; display: grid; place-items: center; color: var(--teal-700); background: var(--mint-2); border-radius: 19px; transform: rotate(-3deg); }
.upload-art svg { width: 34px; height: 34px; }
.drop-zone h3 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 22px; font-weight: 550; }
.drop-zone p { max-width: 470px; margin: 0 auto 21px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.button-row { display: flex; align-items: center; gap: 10px; }
.button-row.center { justify-content: center; }
.queue-head { margin: 24px 2px 10px; display: flex; align-items: flex-end; justify-content: space-between; }
.queue-head h3 { margin: 0 0 3px; font-size: 12px; }
.queue-head span { color: var(--muted); font-size: 10px; }
.queue-list { max-height: 360px; overflow: auto; display: grid; gap: 7px; }
.queue-list.empty { min-height: 105px; place-items: center; }
.empty-state { padding: 22px; display: grid; place-items: center; gap: 7px; color: #91a29f; text-align: center; }
.empty-state svg { width: 22px; }
.empty-state p { margin: 0; font-size: 10px; }
.queue-item { padding: 10px 11px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; background: #fbfcfa; border: 1px solid #e7ecea; border-radius: 12px; }
.queue-thumb { width: 42px; height: 42px; object-fit: cover; background: #e8efec; border-radius: 9px; }
.queue-copy { min-width: 0; }
.queue-copy b { overflow: hidden; display: block; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.queue-copy span { margin-top: 4px; display: block; color: var(--muted); font-size: 9px; }
.queue-state { min-width: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 9.5px; font-weight: 750; }
.queue-state .dot { width: 7px; height: 7px; background: #c5d0cd; border-radius: 50%; }
.queue-state.processing, .queue-state.uploading { color: var(--teal-600); }
.queue-state.processing .dot, .queue-state.uploading .dot { background: var(--teal-600); animation: pulse 1s infinite; }
.queue-state.done, .queue-state.queued { color: #24865e; }
.queue-state.done .dot, .queue-state.queued .dot { background: #32a873; }
.queue-state.failed { color: var(--danger); }
.queue-state.failed .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }
.process-button { margin-top: 17px; }
.button-count { min-width: 24px; height: 24px; display: grid; place-items: center; color: var(--teal-900); background: var(--lime); border-radius: 7px; font-size: 10px; }
.result-panel { position: sticky; top: 112px; min-height: 535px; max-height: calc(100vh - 132px); overflow: auto; }
.result-placeholder { min-height: 535px; padding: 35px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.result-placeholder > span { width: 68px; height: 68px; display: grid; place-items: center; color: #9cafaa; background: #edf3f0; border-radius: 21px; }
.result-placeholder svg { width: 36px; height: 36px; }
.result-placeholder h3 { margin: 18px 0 7px; font-family: Georgia, serif; font-size: 21px; font-weight: 550; }
.result-placeholder p { max-width: 300px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.result-content { padding: 22px; }
.result-header { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.result-header h3 { max-width: 300px; overflow: hidden; margin: 5px 0 0; font-family: Georgia, serif; font-size: 20px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.confidence-badge { --score: 0; flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; background: conic-gradient(var(--teal-600) calc(var(--score) * 1%), #e4ece9 0); border-radius: 50%; position: relative; }
.confidence-badge::after { content: ""; position: absolute; inset: 6px; background: #fff; border-radius: 50%; }
.confidence-badge b { position: relative; z-index: 1; font-size: 11px; }
.metric-row { margin-bottom: 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.metric { padding: 12px; background: #f5f8f6; border-radius: 11px; }
.metric strong { display: block; font-size: 17px; }
.metric span { color: var(--muted); font-size: 8.5px; text-transform: uppercase; }
.transcript { padding: 18px; background: #fbfaf5; border: 1px solid #ebe7db; border-radius: 13px; }
.transcript-head { margin-bottom: 13px; display: flex; justify-content: space-between; align-items: center; }
.transcript-head b { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.transcript pre { max-height: 290px; margin: 0; overflow: auto; color: #253a38; font-family: "Segoe UI", sans-serif; font-size: 12px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.line-view { margin-top: 14px; display: grid; gap: 6px; }
.line-item { display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 8px; font-size: 10.5px; line-height: 1.5; }
.line-item span:first-child { color: #94a5a1; font-size: 8.5px; padding-top: 2px; }
.result-note { margin: 13px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }

/* Tables */
.table-panel { overflow: hidden; }
.table-toolbar { min-height: 74px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #e7ecea; }
.search { position: relative; width: min(100%, 360px); }
.search svg { position: absolute; left: 13px; top: 11px; width: 17px; color: #7f918e; }
.search input { width: 100%; height: 39px; padding: 0 13px 0 39px; outline: none; background: #f8faf8; border: 1px solid #e0e8e5; border-radius: 10px; font-size: 11px; }
.table-count { color: var(--muted); font-size: 10px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 46px; padding: 0 20px; color: #768986; background: #fbfcfa; border-bottom: 1px solid #e7ecea; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.data-table td { height: 68px; padding: 10px 20px; border-bottom: 1px solid #edf1ef; font-size: 10.5px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfdfb; }
.table-primary { max-width: 240px; overflow: hidden; display: block; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.table-secondary { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.table-error { max-width: 320px; display: block; margin-top: 5px; color: #a44848; font-size: 9px; line-height: 1.4; }
.tag { padding: 5px 8px; display: inline-flex; color: var(--teal-700); background: var(--mint-2); border-radius: 7px; font-size: 9px; font-weight: 750; }
.tag.inactive { color: #7c7770; background: #ececea; }
.tag.status-failed { color: #9d3838; background: #fde8e8; }
.tag.status-cancelled { color: #746b5d; background: #efede8; }
.tag.status-processing { color: #755d13; background: #fff3c9; }
.tag.status-completed { color: #17664e; background: #dcf5eb; }
.tag.review-pending { color: #755d13; background: #fff3c9; }
.tag.review-approved, .tag.review-notrequired { color: #17664e; background: #dcf5eb; }
.tag.review-rejected { color: #9d3838; background: #fde8e8; }
.table-actions { display: flex; align-items: center; gap: 8px; }
.document-cell { min-width: 235px; display: flex; align-items: center; gap: 11px; }
.document-cell > span { min-width: 0; }
.job-preview { width: 46px; height: 46px; display: block; object-fit: cover; background: #e8efec; border: 1px solid #dce7e2; border-radius: 9px; }
.progress-cell { min-width: 120px; }
.progress-label { margin-bottom: 6px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.progress-line { height: 5px; overflow: hidden; background: #e6ece9; border-radius: 5px; }
.progress-line i { display: block; height: 100%; background: var(--teal-600); border-radius: 5px; }
.table-action { width: 31px; height: 31px; display: grid; place-items: center; color: var(--teal-700); background: #f0f6f3; border: 0; border-radius: 9px; cursor: pointer; }
.table-action svg { width: 14px; }
.empty-table { padding: 65px 25px; color: var(--muted); text-align: center; }
.empty-table svg { width: 32px; height: 32px; margin-bottom: 8px; }
.empty-table p { margin: 0; font-size: 11px; }

/* Admin & account */
.create-user-page { max-width: 980px; padding: clamp(22px, 3vw, 34px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid.compact { gap: 12px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink-2); background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.icon-button svg { width: 17px; }
.settings-grid { max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.settings-card, .security-card, .password-card { padding: 27px; }
.settings-card { display: grid; gap: 21px; }
.sms-settings-card { margin-bottom: 20px; }
.sms-settings-card .form-actions { align-items: center; justify-content: space-between; }
.settings-section { padding: 21px; display: grid; gap: 18px; background: #f9fbf9; border: 1px solid #e3ebe8; border-radius: 15px; }
.settings-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.settings-section-head > div { display: grid; gap: 5px; }
.settings-section-head b { font-size: 12px; }
.settings-section-head small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.full-field { grid-column: 1 / -1; }
.inline-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.switch { flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 45px; height: 25px; padding: 3px; display: block; background: #c9d5d1; border-radius: 999px; transition: .2s ease; }
.switch span::after { content: ""; width: 19px; height: 19px; display: block; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .2s ease; }
.switch input:checked + span { background: var(--teal-600); }
.switch input:checked + span::after { transform: translateX(20px); }
.credential-status { padding: 14px; display: flex; align-items: flex-start; gap: 11px; color: #725415; background: #fff7dc; border: 1px solid #eadca8; border-radius: 12px; }
.credential-status i { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 4px; background: #d09524; border-radius: 50%; }
.credential-status div { display: grid; gap: 4px; }
.credential-status b { font-size: 10.5px; }
.credential-status span { color: inherit; opacity: .78; font-size: 9.5px; line-height: 1.45; }
.credential-status.ready { color: #17664e; background: #e4f7ef; border-color: #c3e8d9; }
.credential-status.ready i { background: #2ba66f; }
.ai-mark { width: 40px; height: 40px; display: grid; place-items: center; color: #6f4bc2; background: #eee8ff; border-radius: 12px; font-size: 20px; }
.check-row { padding: 14px; display: flex; align-items: flex-start; gap: 10px; background: #f8faf8; border: 1px solid #e5ebe8; border-radius: 12px; cursor: pointer; }
.check-row input { margin-top: 2px; accent-color: var(--teal-600); }
.check-row span { display: grid; gap: 4px; }
.check-row b { font-size: 10.5px; }
.check-row small { color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.security-card { color: #e2eeeb; background: var(--teal-900); border-color: var(--teal-900); }
.security-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--teal-900); background: var(--lime); border-radius: 17px; }
.security-icon svg { width: 31px; height: 31px; }
.security-card h3 { margin: 23px 0 9px; color: #fff; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.security-card p { margin: 0; color: #adc3bf; font-size: 11px; line-height: 1.7; }
.security-card ul { margin: 25px 0 0; padding: 0; display: grid; gap: 12px; list-style: none; }
.security-card li { padding-left: 20px; position: relative; font-size: 10.5px; }
.security-card li::before { content: "✓"; position: absolute; left: 0; color: var(--lime); font-weight: 900; }
.account-grid { max-width: 920px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 20px; }
.account-card { padding: 32px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.account-card h3 { margin: 15px 0 4px; font-family: Georgia, serif; font-size: 23px; font-weight: 550; }
.account-card > p { margin: 0; color: var(--muted); font-size: 11px; }
.role-chip { margin: 13px 0 25px; padding: 6px 10px; color: var(--teal-700); background: var(--mint-2); border-radius: 8px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.account-usage { width: 100%; padding-top: 18px; border-top: 1px solid #e8eeeb; color: var(--muted); font-size: 10px; line-height: 1.7; }
.password-card { display: grid; gap: 17px; }
.divider { height: 1px; background: #e7ecea; }
.quota-panel { margin-bottom: 20px; padding: 23px; }
.quota-overview { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); gap: 9px; }
.quota-overview > div { min-width: 0; padding: 13px; background: #f4f8f6; border: 1px solid #e5ece9; border-radius: 12px; }
.quota-overview span, .quota-overview small { display: block; color: var(--muted); font-size: 8.5px; }
.quota-overview b { margin: 5px 0 3px; overflow: hidden; display: block; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.queue-file-type { width: 42px; height: 42px; display: grid; place-items: center; color: var(--teal-700); background: var(--mint-2); border-radius: 9px; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.notification-icon { font-size: 24px; line-height: 1; }
.notification-icon.error { color: #a73f3f; background: #fde8e8; }
.compact-feed { max-height: 620px; overflow: auto; }
.compact-feed > div { padding: 15px 18px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px 10px; border-bottom: 1px solid #edf1ef; }
.compact-feed > div:last-child { border-bottom: 0; }
.compact-feed b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.compact-feed small { grid-column: 2; color: var(--muted); font-size: 9px; line-height: 1.45; }
.audit-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Modals & toast */
.modal { width: min(calc(100% - 30px), 510px); padding: 27px; color: var(--ink); background: var(--paper); border: 0; border-radius: 20px; box-shadow: 0 30px 90px rgba(4,29,27,.28); }
#userDialog { width: min(calc(100% - 30px), 760px); max-height: 90vh; overflow: auto; }
.modal::backdrop { background: rgba(5,31,29,.58); backdrop-filter: blur(5px); }
.modal form { display: grid; gap: 17px; }
.modal-head { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.modal-head h3 { margin: 6px 0 0; font-family: Georgia, serif; font-size: 25px; font-weight: 550; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; }
.report-modal { width: min(calc(100% - 30px), 720px); max-height: 88vh; overflow: auto; }
.report-meta { margin-bottom: 17px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.report-meta div { padding: 12px; background: #f3f7f5; border-radius: 10px; }
.report-meta b { display: block; font-size: 15px; }
.report-meta span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.report-text { padding: 19px; background: #fbfaf5; border: 1px solid #e8e3d7; border-radius: 12px; font-size: 12px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.report-image-link { margin: 0 0 17px; display: grid; gap: 7px; color: var(--teal-700); font-size: 9.5px; font-weight: 750; text-decoration: none; }
.report-image-preview { width: 100%; max-height: 420px; display: block; object-fit: contain; background: #eef3f0; border: 1px solid #dfe8e4; border-radius: 13px; }
.report-fields { margin: 0 0 17px; display: grid; gap: 7px; }
.report-fields h4, .review-fields h4, .provider-timeline h4 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 17px; font-weight: 550; }
.report-fields > div { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #f5f8f6; border-radius: 10px; }
.report-fields span { display: grid; gap: 3px; }
.report-fields b, .report-fields strong { font-size: 10.5px; }
.report-fields small { color: var(--muted); font-size: 8.5px; }
.review-banner { margin: 0 0 16px; padding: 13px 15px; display: grid; gap: 4px; color: #17664e; background: #e4f7ef; border: 1px solid #c3e8d9; border-radius: 11px; }
.review-banner.status-pending { color: #725415; background: #fff7dc; border-color: #eadca8; }
.review-banner.status-rejected { color: #8c3636; background: #fdeaea; border-color: #f0c8c8; }
.review-banner b { font-size: 10.5px; }
.review-banner span { font-size: 9.5px; line-height: 1.5; }
.review-reason { max-width: 410px; display: block; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.review-modal { width: min(calc(100% - 30px), 920px); max-height: 92vh; overflow: auto; }
.review-fields { margin: 0 0 17px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.review-fields h4 { grid-column: 1 / -1; }
.review-field { padding: 13px; background: #f8faf8; border: 1px solid #e4ebe8; border-radius: 12px; }
.review-field > span { display: grid; gap: 3px; }
.review-field > span small { color: var(--muted); font-weight: 500; }
.review-transcript { margin: 0 0 17px; }
.provider-timeline { margin: 0 0 18px; display: grid; gap: 7px; }
.provider-timeline > div { padding: 10px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: #f6f9f7; border-radius: 9px; }
.provider-timeline b { font-size: 9.5px; }
.provider-timeline small { color: var(--muted); font-size: 8.5px; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; }
.toast { width: min(360px, calc(100vw - 40px)); padding: 14px 16px; display: flex; align-items: flex-start; gap: 11px; color: #fff; background: var(--teal-900); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; box-shadow: 0 18px 50px rgba(5,38,35,.25); animation: toast-in .25s ease; }
.toast.error { background: #783333; }
.toast svg { flex: 0 0 auto; width: 18px; color: var(--lime); }
.toast.error svg { color: #ffd3d3; }
.toast b { display: block; margin-bottom: 3px; font-size: 11px; }
.toast span { color: #c4d6d2; font-size: 10px; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-scrim { display: none; }

@media (max-width: 1100px) {
  .login-page { grid-template-columns: minmax(380px, .9fr) minmax(430px, 1.1fr); }
  .login-story { padding: 40px 46px; }
  .story-proof div:nth-of-type(2), .story-proof i:nth-of-type(2) { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: 1fr; }
  .result-panel { position: static; max-height: none; }
  .quota-overview { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
}

@media (max-width: 820px) {
  .login-page { display: block; }
  .login-story { display: none; }
  .login-panel { padding: 38px 25px 24px; }
  .mobile-brand { display: inline-flex; }
  .app-shell { display: block; }
  .sidebar { width: 250px; transform: translateX(-100%); transition: transform .25s ease; }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 15; inset: 0; display: block; pointer-events: none; opacity: 0; background: rgba(4,29,27,.5); transition: .25s ease; }
  .app-shell.menu-open .mobile-scrim { pointer-events: auto; opacity: 1; }
  .topbar { height: 78px; padding: 0 20px; }
  .mobile-menu { display: grid !important; }
  .topbar .button span, .status-badge span { display: none; }
  .topbar .button { width: 40px; min-height: 40px; padding: 0; }
  .status-badge { width: 34px; padding: 0; justify-content: center; }
  .workspace { padding: 28px 20px 50px; }
  .dashboard-grid, .settings-grid, .account-grid, .audit-grid { grid-template-columns: 1fr; }
  .data-table { min-width: 720px; }
  #reportsTable, #usersTable, #jobsTable { overflow-x: auto; }
}

@media (max-width: 560px) {
  .login-card h2 { font-size: 36px; }
  .first-run { display: none; }
  .topbar h1 { font-size: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > .button, .quota-pill { width: 100%; }
  .welcome-card { min-height: 290px; align-items: flex-start; }
  .welcome-card h2 { font-size: 36px; }
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { min-height: 125px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .inline-checks, .review-fields { grid-template-columns: 1fr; }
  .review-fields h4 { grid-column: auto; }
  .provider-timeline > div { grid-template-columns: 1fr; }
  .form-actions { grid-column: auto; }
  .sms-settings-card .form-actions, .otp-actions { align-items: stretch; flex-direction: column; }
  .button-row.center { align-items: stretch; flex-direction: column; }
  .metric-row, .report-meta { grid-template-columns: repeat(2, 1fr); }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
  .modal { padding: 21px; }
  .quota-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quota-edit-grid { grid-template-columns: 1fr; }
}
