:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0d12;
  color: #f4f6f8;
  --bg: #0b0d12;
  --surface: #11151d;
  --surface-2: #171c26;
  --line: #242b37;
  --line-soft: #1d232e;
  --muted: #8e98a8;
  --text: #f4f6f8;
  --accent: #d8e9ff;
  --accent-ink: #0b1118;
  --danger: #ff9b9b;
  --success: #83d6a1;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-height: 100vh; }
button, input, select { font: inherit; }
button { color: inherit; }

.hidden { display: none !important; }
.app-shell { min-height: 100vh; background: radial-gradient(circle at 16% 8%, rgba(92, 119, 160, .14), transparent 33%), var(--bg); }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 680; letter-spacing: -.02em; }
.brand-mark { width: 29px; height: 29px; border-radius: 50%; display: block; background: var(--accent); position: relative; overflow: hidden; box-shadow: 0 0 28px rgba(216,233,255,.12); }
.brand-mark::after { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; top: -4px; left: 9px; background: #10141b; }
.session-actions { display: flex; align-items: center; gap: 16px; }
.session-email { color: var(--muted); font-size: 13px; }

.view { min-height: calc(100vh - 76px); }
.auth-layout { max-width: 1240px; margin: 0 auto; padding: 56px 42px 70px; display: grid; grid-template-columns: 1.16fr .84fr; gap: 76px; align-items: center; }
.hero-panel { max-width: 680px; }
.eyebrow { margin: 0 0 15px; color: #8996a8; font-size: 11px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.hero-panel h1, .onboarding-copy h1, .dashboard-heading h1 { margin: 0; font-size: clamp(44px, 5.2vw, 76px); line-height: .98; letter-spacing: -.055em; font-weight: 620; }
.hero-copy { max-width: 570px; margin: 26px 0 38px; color: #a3adba; font-size: 18px; line-height: 1.55; }
.hero-points { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-points span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: #929dab; font-size: 12px; background: rgba(20,24,32,.7); }

.panel { background: linear-gradient(180deg, rgba(20,25,34,.96), rgba(15,19,26,.96)); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.18); }
.auth-panel { padding: 9px 30px 32px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; margin: 0 -20px 30px; border-radius: 15px; background: #0d1016; }
.tab { border: 0; border-radius: 11px; padding: 11px 14px; background: transparent; color: #7f8996; cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--text); }
.panel-heading h2, .card-heading h2, .company-card h2, .compact-panel h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; font-weight: 620; }
.panel-heading { margin-bottom: 25px; }
.form-stack { display: grid; gap: 17px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 12px; color: #b1bac7; font-weight: 650; }
.field small { color: #707b8b; font-weight: 500; margin-left: 4px; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #0d1118; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: #4f5865; }
.field input:focus, .field select:focus { border-color: #61728a; box-shadow: 0 0 0 3px rgba(111,137,171,.09); }
.field-help { margin: -2px 0 0 !important; font-size: 11px; }
.form-error { margin: -4px 0 0; color: var(--danger); font-size: 12px; line-height: 1.4; }
.check-field { display: flex; align-items: flex-start; gap: 10px; color: #b1bac7; font-size: 12px; cursor: pointer; }
.check-field input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: #d8e9ff; flex: 0 0 auto; }
.check-field > span { display: grid; gap: 3px; }
.check-field strong { font-weight: 650; }
.check-field small { color: #707b8b; line-height: 1.45; }

.button { border: 0; border-radius: 11px; min-height: 42px; padding: 0 17px; font-weight: 670; cursor: pointer; transition: transform .12s, opacity .12s, background .12s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover:not(:disabled) { background: #eef6ff; }
.button-ghost { border: 1px solid var(--line); background: transparent; color: #c1c8d2; min-height: 36px; }

.centered-view { display: grid; place-items: center; padding: 40px; }
.compact-panel { width: min(460px, 100%); padding: 34px; text-align: center; }
.compact-panel .muted { color: var(--muted); line-height: 1.55; margin: 14px 0 25px; }
.status-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 20px; border-radius: 50%; background: rgba(131,214,161,.12); color: var(--success); }

.onboarding-layout { max-width: 1080px; margin: 0 auto; padding: 70px 42px; display: grid; grid-template-columns: 1fr 470px; gap: 90px; align-items: center; }
.onboarding-copy h1 { font-size: clamp(46px, 5vw, 68px); }
.onboarding-copy > p:last-child { max-width: 520px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.onboarding-panel { padding: 30px; }

.dashboard { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 76px); }
.sidebar { border-right: 1px solid var(--line-soft); padding: 27px 18px 22px; display: flex; flex-direction: column; background: rgba(12,15,20,.7); }
.company-chip { display: flex; align-items: center; gap: 11px; padding: 8px; margin-bottom: 25px; }
.company-avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: #1f2631; border: 1px solid #2f3948; font-weight: 750; }
.company-chip div { min-width: 0; display: grid; gap: 3px; }
.company-chip strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-chip span:last-child { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.nav-list { display: grid; gap: 4px; }
.nav-item { text-align: left; border: 0; border-radius: 10px; padding: 10px 12px; background: transparent; color: #818b99; font-size: 13px; cursor: pointer; }
.nav-item.active { background: #171c24; color: #ecf0f5; }
.nav-item:disabled { opacity: .45; cursor: not-allowed; }
.sidebar-note { margin-top: auto; padding: 10px; color: #596473; font-size: 10px; line-height: 1.45; }
.dashboard-main { padding: 42px min(5vw, 68px) 70px; overflow: hidden; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 34px; }
.dashboard-heading h1 { font-size: 42px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 13px; }
.stat-card { min-height: 145px; padding: 20px; border-radius: 17px; background: #10141b; border: 1px solid var(--line-soft); display: flex; flex-direction: column; }
.stat-card > span { color: #8993a2; font-size: 11px; }
.stat-card strong { font-size: 28px; letter-spacing: -.04em; margin: 20px 0 5px; }
.stat-card small { color: #5f6977; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 13px; }
.checklist-card, .company-card { padding: 25px; min-height: 325px; }
.card-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.progress-badge { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.checklist { padding: 0; margin: 0; list-style: none; display: grid; gap: 4px; }
.checklist li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: center; padding: 11px 9px; border-radius: 11px; }
.checklist li > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #303846; color: #768190; font-size: 10px; }
.checklist li.done { background: rgba(131,214,161,.035); }
.checklist li.done > span { color: var(--success); border-color: rgba(131,214,161,.3); background: rgba(131,214,161,.07); }
.checklist li div { display: grid; gap: 3px; }
.checklist strong { font-size: 12px; font-weight: 620; }
.checklist small { color: #6f7987; font-size: 10px; }
.company-card h2 { margin-bottom: 26px; overflow-wrap: anywhere; }
.company-card dl { margin: 0; display: grid; gap: 15px; }
.company-card dl div { display: flex; justify-content: space-between; gap: 20px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 11px; }
.company-card dt { color: #6d7785; }
.company-card dd { margin: 0; color: #b9c1cc; text-align: right; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); margin-right: 5px; }
.section-copy { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.workers-card { min-height: 310px; padding: 0; overflow: hidden; }
.empty-state { min-height: 310px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 30px; }
.empty-state strong { font-size: 18px; }
.empty-state span { color: var(--muted); font-size: 12px; }
.workers-list { display: grid; }
.worker-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(120px, .8fr) minmax(100px, .6fr) minmax(120px, auto); gap: 18px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.worker-row:last-child { border-bottom: 0; }
.worker-person { display: flex; gap: 12px; align-items: center; min-width: 0; }
.worker-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #1d2530; border: 1px solid #2d3745; font-size: 12px; font-weight: 750; flex: 0 0 auto; }
.worker-person div { min-width: 0; display: grid; gap: 3px; }
.worker-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.worker-person span, .worker-meta { color: var(--muted); font-size: 11px; }
.worker-status { justify-self: end; padding: 5px 8px; border-radius: 999px; background: rgba(131,214,161,.08); color: var(--success); border: 1px solid rgba(131,214,161,.18); font-size: 10px; }
.tasks-card { min-height: 310px; padding: 0; overflow: hidden; }
.tasks-list { display: grid; }
.task-row { display: grid; grid-template-columns: minmax(220px, 1.7fr) minmax(110px, .65fr) minmax(130px, .8fr) minmax(150px, auto); gap: 18px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.task-row:last-child { border-bottom: 0; }
.task-main { min-width: 0; display: grid; gap: 5px; }
.task-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.task-main span { color: var(--muted); font-size: 10px; }
.task-amount { color: #d5dbe4; font-size: 12px; font-weight: 650; white-space: nowrap; }
.task-status { justify-self: start; padding: 5px 8px; border-radius: 999px; background: rgba(216,233,255,.06); color: #a9b8ca; border: 1px solid rgba(216,233,255,.12); font-size: 10px; white-space: nowrap; }
.task-status.succeeded { background: rgba(131,214,161,.08); color: var(--success); border-color: rgba(131,214,161,.18); }
.task-action-cell { min-height: 36px; display: flex; justify-content: flex-end; }
.task-action { white-space: nowrap; font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(3,6,10,.72); backdrop-filter: blur(9px); }
.modal-card { width: min(560px, 100%); padding: 27px; box-shadow: 0 30px 80px rgba(0,0,0,.42); }
.task-modal-card { width: min(620px, 100%); }
.pin-modal-card { width: min(470px, 100%); }
.modal-copy { margin: -8px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.modal-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.modal-heading h2 { margin-top: 7px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: #9ba5b3; font-size: 22px; cursor: pointer; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 3px; }
.invite-panel { text-align: left; }
.invite-link-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.invite-link-box input { min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; background: #0d1118; color: #b9c1cc; outline: none; }
.worker-summary-card { padding: 25px; }
.worker-summary-card h2 { margin: 6px 0 12px; }
.worker-summary-card .muted { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.worker-decision-actions { gap: 8px; }

@media (max-width: 900px) {
  .topbar { padding: 0 22px; }
  .auth-layout, .onboarding-layout { grid-template-columns: 1fr; gap: 40px; padding: 42px 22px 60px; }
  .hero-panel { max-width: 760px; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dashboard-main { padding: 32px 22px 55px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .worker-row { grid-template-columns: 1fr auto; }
  .worker-meta { display: none; }
  .task-row { grid-template-columns: minmax(180px, 1fr) auto; }
  .task-status { justify-self: end; }
  .task-action-cell { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 560px) {
  .session-email { display: none; }
  .hero-panel h1 { font-size: 45px; }
  .hero-copy { font-size: 16px; }
  .auth-panel { padding-left: 22px; padding-right: 22px; }
  .stat-grid { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .form-grid-two { grid-template-columns: 1fr; }
  .worker-row { grid-template-columns: 1fr; }
  .worker-status { justify-self: start; }
  .task-row { grid-template-columns: 1fr; }
  .task-status { justify-self: start; }
  .task-action-cell { grid-column: auto; }
  .invite-link-box { grid-template-columns: 1fr; }
}
