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

:root {
  color-scheme: light;
  font-family: Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
  color: #14222c;
  background: #cbdced;
  font-synthesis: none;
  --ink: #14222c;
  --muted: #788793;
  --blue: #315cf5;
  --blue-soft: #e8edff;
  --panel: rgba(246, 250, 255, .78);
  --line: rgba(65, 90, 115, .12);
  --shadow: 0 28px 80px rgba(44, 67, 91, .18);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #cbdced; }
body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(12px, 2.2vw, 34px);
  background:
    radial-gradient(circle at 10% 10%, rgba(233, 250, 255, .9), transparent 32%),
    radial-gradient(circle at 90% 88%, rgba(238, 227, 255, .76), transparent 34%),
    linear-gradient(135deg, #c9ddec 0%, #d5e2f5 52%, #d6d8f0 100%);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.app-shell {
  width: min(2100px, 100%);
  min-height: calc(100vh - clamp(24px, 4.4vw, 68px));
  margin: auto;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 36px;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  backdrop-filter: blur(22px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 36px 26px 26px;
  border-right: 1px solid var(--line);
  background: rgba(222, 238, 249, .54);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 13px 13px 13px 5px;
  color: white;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(20, 34, 44, .18);
}
.main-nav { display: grid; gap: 7px; margin-top: 64px; }
.main-nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 50px;
  padding: 12px 15px;
  border-radius: 17px;
  color: #4f606d;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.main-nav a:hover { color: var(--ink); background: rgba(255,255,255,.55); transform: translateX(2px); }
.main-nav a.active { color: var(--ink); background: rgba(255,255,255,.92); box-shadow: 0 10px 25px rgba(74, 98, 122, .08); }
.main-nav svg, .sidebar-user svg, .site-link svg, .search svg { width: 21px; height: 21px; flex: 0 0 auto; fill: currentColor; }
.main-nav a.active svg { color: var(--blue); }
.sidebar-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: auto;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 18px;
  color: #50616e;
  background: rgba(255,255,255,.48);
}
.sidebar-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.sidebar-note strong { color: var(--ink); }
.sidebar-note span { color: var(--muted); }
.note-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #36bf84; box-shadow: 0 0 0 5px rgba(54, 191, 132, .12); }
.sidebar-user { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; padding-top: 21px; border-top: 1px solid var(--line); }
.avatar { display: grid; width: 39px; aspect-ratio: 1; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #315cf5, #7755f7); font-size: 13px; font-weight: 800; }
.sidebar-user div { min-width: 0; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.sidebar-user button { display: grid; width: 34px; aspect-ratio: 1; place-items: center; border: 0; border-radius: 11px; color: #6c7d89; background: transparent; cursor: pointer; }
.sidebar-user button:hover { color: #db4251; background: #fff; }

.workspace { min-width: 0; padding: 38px clamp(25px, 4vw, 64px) 46px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; min-height: 74px; }
.topbar-title { display: flex; align-items: center; gap: 14px; }
.eyebrow { margin: 0 0 6px; color: #84929c; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: clamp(24px, 3vw, 35px); line-height: 1.05; letter-spacing: -.05em; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.search { display: flex; width: min(300px, 24vw); align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid rgba(55, 78, 100, .18); color: #6f7f8c; }
.search input { width: 100%; padding: 12px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search input::placeholder { color: #9da8b0; }
.site-link { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 14px; color: #273944; background: rgba(255,255,255,.72); font-size: 12px; font-weight: 700; text-decoration: none; box-shadow: 0 8px 22px rgba(71,90,109,.07); }
.site-link svg { width: 17px; }
.content { min-height: calc(100vh - 190px); padding-top: 44px; }
.dashboard-blank { min-height: calc(100vh - 250px); }

.list-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 28px;
  background: rgba(255,255,255,.63);
  box-shadow: 0 20px 55px rgba(62, 84, 105, .08);
}
.list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 25px 28px 22px; border-bottom: 1px solid var(--line); }
.list-head h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.list-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.count-pill { padding: 8px 11px; border-radius: 999px; color: #3852a2; background: var(--blue-soft); font-size: 11px; font-weight: 800; white-space: nowrap; }
.list-summary { display: flex; align-items: center; gap: 10px; }
.clear-filters { padding: 8px 11px; border: 0; border-radius: 999px; color: #6b7b87; background: rgba(233, 239, 247, .75); font-size: 10px; font-weight: 750; cursor: pointer; }
.clear-filters:hover { color: #315cf5; background: #edf1ff; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
[data-table="fns"] table { min-width: 1640px; }
[data-table="jobs"] table { min-width: 1420px; }
[data-table="companies"] table { min-width: 1120px; }
th { padding: 14px 28px; color: #8997a1; background: rgba(235, 241, 249, .45); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.filter-row th { padding-top: 0; padding-bottom: 15px; }
.filter-control {
  width: 100%;
  min-width: 105px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(65, 90, 115, .14);
  border-radius: 10px;
  outline: 0;
  color: #31434f;
  background: rgba(255, 255, 255, .82);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.filter-control:focus { border-color: rgba(49, 92, 245, .5); background: #fff; box-shadow: 0 0 0 3px rgba(49, 92, 245, .08); }
.filter-control::placeholder { color: #a0acb4; font-weight: 550; }
select.filter-control { cursor: pointer; }
td { padding: 17px 28px; border-top: 1px solid rgba(60, 80, 100, .075); color: #465864; font-size: 13px; vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(255,255,255,.62); }
.primary-cell { color: var(--ink); font-weight: 750; }
.code-chip { display: inline-flex; min-width: 42px; justify-content: center; padding: 7px 9px; border-radius: 10px; color: #315cf5; background: #edf1ff; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: #37775e; background: #e9f8f1; font-size: 10px; font-weight: 800; }
.status-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #42bd88; }
.status-queued { color: #6d648c; background: #f0edfa; }
.status-queued::before { background: #8b79c6; }
.status-running { color: #315cf5; background: #edf1ff; }
.status-running::before { background: #315cf5; animation: pulse 1.2s ease-in-out infinite; }
.status-paused { color: #8a671d; background: #fff4d8; }
.status-paused::before { background: #d8a530; }
.status-partial, .status-failed { color: #9c3943; background: #ffebee; }
.status-partial::before, .status-failed::before { background: #c34753; }
.metric-cell { color: #283d4b; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-muted { color: #8b6170; }
.metric-found { color: #27815e; }
.metric-remaining { color: #315cf5; }
.metric-error { color: #a33d4b; }
.job-errors { min-width: 220px; max-width: 380px; }
.job-errors summary { color: #a33d4b; font-size: 11px; font-weight: 800; cursor: pointer; }
.job-errors ul { display: grid; gap: 9px; margin: 10px 0 0; padding: 11px; border-radius: 12px; background: #fff3f4; list-style: none; }
.job-errors li { display: grid; gap: 3px; color: #7b4650; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.job-errors li strong { color: #8f2f3e; font-size: 11px; }
.company-json { min-width: 116px; }
.company-json summary {
  width: max-content;
  padding: 8px 11px;
  border-radius: 10px;
  color: #315cf5;
  background: #edf1ff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.company-json summary::-webkit-details-marker { display: none; }
.company-json summary:hover { background: #e2e8ff; }
.company-json .json-close-label { display: none; }
.company-json[open] .json-open-label { display: none; }
.company-json[open] .json-close-label { display: inline; }
.company-json pre {
  width: min(720px, 70vw);
  max-height: 520px;
  margin: 12px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(65, 90, 115, .12);
  border-radius: 14px;
  color: #31434f;
  background: #f7f9fc;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
  tab-size: 2;
}
.json-empty { color: var(--muted); font-size: 11px; }
.generate-inns-button { min-width: 142px; padding: 9px 12px; border: 0; border-radius: 10px; color: #fff; background: #315cf5; font-size: 10px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(49,92,245,.2); transition: transform .15s ease, opacity .15s ease; }
.generate-inns-button:hover:not(:disabled) { transform: translateY(-1px); }
.generate-inns-button:disabled { color: #7e8c96; background: #e8edf3; box-shadow: none; cursor: default; }
.generate-inns-button.busy { color: #315cf5; background: #edf1ff; }
.search-job-button { min-width: 136px; padding: 9px 12px; border: 0; border-radius: 10px; color: #fff; background: #152b39; font-size: 10px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(21,43,57,.18); transition: transform .15s ease, opacity .15s ease; }
.search-job-button:hover:not(:disabled) { transform: translateY(-1px); }
.search-job-button:disabled { opacity: .58; cursor: default; box-shadow: none; }
.search-job-button.busy { color: #315cf5; background: #edf1ff; }
.pause-job-button { min-width: 116px; padding: 9px 12px; border: 0; border-radius: 10px; color: #8a5b10; background: #fff0c7; font-size: 10px; font-weight: 800; cursor: pointer; transition: transform .15s ease, opacity .15s ease; }
.pause-job-button:hover:not(:disabled) { transform: translateY(-1px); background: #ffe7a6; }
.pause-job-button:disabled { opacity: .58; cursor: default; }
.pause-job-button.busy { color: #7e8c96; background: #e8edf3; }
.app-toast { position: fixed; z-index: 1000; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 48px)); padding: 14px 18px; border-radius: 14px; color: #fff; background: #27815e; font-size: 12px; font-weight: 750; box-shadow: 0 18px 45px rgba(32,55,70,.2); }
.app-toast.info { background: #315cf5; }
.app-toast.error { background: #a33d4b; }
.empty-row { padding: 64px 24px; color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination-actions { display: flex; gap: 8px; }
.pagination button { padding: 8px 12px; border: 0; border-radius: 10px; color: #40515e; background: #fff; cursor: pointer; box-shadow: 0 5px 14px rgba(70,90,110,.07); }
.pagination button:disabled { opacity: .42; cursor: default; }
.loader { display: grid; min-height: 340px; place-items: center; }
.loader::after { content: ''; width: 32px; aspect-ratio: 1; border: 3px solid rgba(49,92,245,.15); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.error-card { padding: 36px; border-radius: 24px; color: #9c3943; background: rgba(255,235,238,.75); }
.list-card.loading { opacity: .62; pointer-events: none; transition: opacity .18s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }

.menu-button { display: none; width: 42px; aspect-ratio: 1; padding: 11px; border: 0; border-radius: 13px; background: rgba(255,255,255,.72); cursor: pointer; }
.menu-button span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--ink); }
.sidebar-backdrop { display: none; }

.login-screen {
  width: min(1440px, 100%);
  min-height: calc(100vh - clamp(24px, 4.4vw, 68px));
  margin: auto;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 36px;
  background: rgba(246,250,255,.75);
  box-shadow: var(--shadow);
}
.login-visual { position: relative; overflow: hidden; padding: clamp(35px, 6vw, 88px); background: linear-gradient(145deg, rgba(219,239,251,.9), rgba(221,222,250,.72)); }
.login-copy { position: relative; z-index: 2; max-width: 540px; }
.brand-large { margin-bottom: min(18vh, 170px); }
.login-copy h1 { margin: 12px 0 22px; font-size: clamp(48px, 6.2vw, 86px); line-height: .98; letter-spacing: -.07em; }
.login-copy > p:last-child { max-width: 470px; color: #647481; font-size: 15px; line-height: 1.8; }
.orb { position: absolute; border-radius: 50%; filter: blur(1px); }
.orb-one { width: 380px; height: 380px; right: -100px; top: -80px; background: radial-gradient(circle at 30% 30%, #fff, rgba(90,125,255,.2) 45%, transparent 70%); }
.orb-two { width: 460px; height: 460px; left: 20%; bottom: -310px; background: radial-gradient(circle at 50% 10%, rgba(100,211,236,.6), rgba(119,89,247,.12) 55%, transparent 72%); }
.login-panel { display: grid; place-items: center; padding: 34px; background: rgba(249,251,255,.74); }
.login-card { width: min(390px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.66); box-shadow: 0 25px 70px rgba(59,79,99,.1); }
.login-icon { display: grid; width: 48px; aspect-ratio: 1; margin-bottom: 30px; place-items: center; border-radius: 15px; color: white; background: var(--blue); font-size: 21px; box-shadow: 0 12px 30px rgba(49,92,245,.28); }
.login-card h2 { margin: 5px 0 8px; font-size: 30px; letter-spacing: -.05em; }
.muted { margin: 0 0 27px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-card label { display: grid; gap: 8px; margin-top: 17px; color: #667681; font-size: 11px; font-weight: 700; }
.login-card input { width: 100%; padding: 14px 15px; border: 1px solid rgba(65,85,105,.14); border-radius: 13px; outline: 0; color: var(--ink); background: rgba(246,249,253,.9); transition: border .2s, box-shadow .2s; }
.login-card input:focus { border-color: rgba(49,92,245,.55); box-shadow: 0 0 0 4px rgba(49,92,245,.08); }
.form-error { min-height: 18px; margin: 12px 0 0; color: #c34753; font-size: 11px; }
.primary-button { display: flex; width: 100%; justify-content: space-between; margin-top: 12px; padding: 14px 17px; border: 0; border-radius: 13px; color: #fff; background: var(--ink); font-weight: 750; cursor: pointer; transition: transform .2s, background .2s; }
.primary-button:hover { background: var(--blue); transform: translateY(-1px); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; inset: 12px auto 12px 12px; width: min(300px, calc(100vw - 48px)); min-height: auto; border: 1px solid rgba(255,255,255,.75); border-radius: 28px; box-shadow: 20px 0 60px rgba(36,52,68,.22); transform: translateX(calc(-100% - 30px)); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 19; inset: 0; display: block; background: rgba(28,45,58,.24); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .menu-button { display: block; }
  .workspace { padding: 28px 24px 36px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { min-height: 300px; padding: 38px; }
  .brand-large { margin-bottom: 70px; }
  .login-copy h1 { font-size: clamp(42px, 10vw, 70px); }
}

@media (max-width: 680px) {
  body { padding: 0; }
  .app-shell, .login-screen { min-height: 100vh; border: 0; border-radius: 0; }
  .workspace { padding: 22px 16px 28px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { gap: 7px; }
  .site-link span { display: none; }
  .site-link { padding: 11px; }
  .search { position: absolute; top: 95px; left: 16px; width: calc(100% - 32px); padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.65); }
  .content { padding-top: 76px; }
  .content:has(.dashboard-blank) { padding-top: 25px; }
  .list-card { border-radius: 21px; }
  .list-head, th, td { padding-left: 18px; padding-right: 18px; }
  .list-head { align-items: center; }
  .list-summary { align-items: flex-end; flex-direction: column-reverse; }
  .filter-row th { padding-left: 18px; padding-right: 18px; }
  .pagination { padding: 15px 18px; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 20px; }
  .login-card { padding: 28px 24px; }
}
