:root {
  --bg: #05080d;
  --bg-soft: #08111e;
  --surface: #0b111b;
  --surface-2: #101824;
  --surface-3: #151e2b;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f9fd;
  --muted: #9aa7ba;
  --muted-2: #6f7d91;
  --blue: #1c69d4;
  --blue-2: #5aa1ff;
  --green: #31d095;
  --amber: #ffb84d;
  --red: #ff5c73;
  --radius: 4px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 22% -12%, rgba(28, 105, 212, 0.25), transparent 36%),
    radial-gradient(circle at 82% 8%, rgba(90, 161, 255, 0.11), transparent 30%),
    linear-gradient(135deg, #030407 0%, #08111e 50%, #05080d 100%);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: -0.02em;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }

.ambient { position: fixed; pointer-events: none; filter: blur(44px); opacity: 0.55; z-index: 0; }
.ambient-a { width: 420px; height: 420px; background: rgba(28,105,212,.23); right: 3vw; top: 2vh; }
.ambient-b { width: 360px; height: 360px; background: rgba(49,208,149,.09); left: 20vw; bottom: -4vh; }

.rail {
  position: fixed;
  inset: 24px auto 24px 24px;
  width: 248px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(5, 8, 13, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 10;
}
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #05080d;
  font-weight: 1000;
  letter-spacing: -0.08em;
}
.rail-tabs { display: grid; gap: 8px; }

.tab-btn, .ghost, .primary, .secondary, .mini, .quick-buttons button, .text-btn {
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.tab-btn {
  min-height: 46px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
}
.tab-btn:hover, .tab-btn.is-active { background: rgba(255,255,255,.085); color: #fff; }
.tab-btn.is-active { box-shadow: inset 3px 0 0 var(--blue); }
.logout { margin-top: auto; width: 100%; }

.primary, .secondary, .ghost, .mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 850;
}
.primary { background: var(--blue); box-shadow: 0 16px 36px rgba(28,105,212,.26); }
.secondary, .ghost, .mini { background: rgba(255,255,255,.065); border: 1px solid var(--line); }
.mini { min-height: 36px; padding: 0 12px; font-size: 13px; }
.primary:hover, .secondary:hover, .ghost:hover, .mini:hover, .quick-buttons button:hover { transform: translateY(-1px); border-color: var(--line-strong); }

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 40px 72px 328px;
}
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
  margin-bottom: 34px;
}
.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  max-width: 320px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .22em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 900px;
  margin-bottom: 16px;
  font-size: clamp(39px, 4.8vw, 64px);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
h2 { margin-bottom: 14px; font-size: clamp(24px, 2.15vw, 34px); line-height: 1.04; font-weight: 900; letter-spacing: -0.032em; }
h3 { margin-bottom: 10px; font-size: 17px; line-height: 1.12; font-weight: 900; }
.subhead { max-width: 670px; margin-bottom: 0; color: #b4c0d3; font-size: 17px; line-height: 1.55; letter-spacing: -0.015em; }
.muted { color: var(--muted); line-height: 1.55; }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric {
  min-height: 118px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  border: 1px solid var(--line);
}
.metric b { display: block; margin-bottom: 10px; font-size: 34px; line-height: 1; font-weight: 900; letter-spacing: -0.055em; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }

.layout-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-one { grid-template-columns: minmax(0, 2fr) minmax(310px, 1fr); }
.one-one { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.panel {
  padding: 28px;
  background: rgba(8, 14, 23, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 16px 46px rgba(0,0,0,.22);
}
.hero-panel { min-height: 360px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.panel-head h2, .panel-head .eyebrow { margin-bottom: 0; }
.panel-head .eyebrow { margin-bottom: 8px; }
.sticky-tools { margin-bottom: 22px; }
.inline-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.pulse-panel p:not(.eyebrow) { margin-bottom: 24px; color: #f0f4fb; font-size: 17px; line-height: 1.45; font-weight: 650; }
.pulse-list { display: grid; gap: 10px; margin-top: 10px; }
.pulse-list span {
  display: block;
  padding: 15px 16px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  color: #fff;
  font-weight: 850;
}

.action-stack, .capture-list, .lead-list, .report-list { display: grid; gap: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.item-card {
  padding: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
}
.item-card.high { border-color: rgba(255,92,115,.42); box-shadow: inset 3px 0 0 var(--red); }
.item-card.done { opacity: .72; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  background: rgba(255,255,255,.065);
  border: 1px solid var(--line);
  color: #ccd6e7;
  font-size: 12px;
  font-weight: 800;
}
.pill.green { color: var(--green); border-color: rgba(49,208,149,.28); }
.pill.amber { color: var(--amber); border-color: rgba(255,184,77,.32); }
.pill.red { color: var(--red); border-color: rgba(255,92,115,.34); }
.workspace-preview {
  margin: 12px 0 0;
  padding: 12px 13px;
  background: rgba(49,208,149,.07);
  border: 1px solid rgba(49,208,149,.2);
  color: #d8f7ec;
  font-size: 13px;
  line-height: 1.45;
}
.workspace-preview b { color: var(--green); }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.text-btn { padding: 0; background: transparent; color: var(--blue-2); font-size: 13px; font-weight: 900; }
.text-btn.danger { color: var(--red); }
.empty {
  min-height: 74px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  border: 1px dashed rgba(255,255,255,.18);
  text-align: center;
}

.kanban { display: grid; gap: 12px; }
.agenda-day {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  background: rgba(8,14,23,.78);
  border: 1px solid var(--line);
}
.agenda-date {
  position: sticky;
  top: 18px;
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  background: rgba(255,255,255,.045);
  border-left: 3px solid var(--blue);
}
.agenda-date span { color: #fff; font-size: 20px; font-weight: 1000; letter-spacing: -0.04em; }
.agenda-date b { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.agenda-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lane {
  min-height: 480px;
  padding: 18px;
  background: rgba(8,14,23,.78);
  border: 1px solid var(--line);
}
.lane > h3 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.lane > h3 span { color: var(--muted); font-size: 13px; }

.capture-pad { min-height: 420px; }
.quick-buttons { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 24px; }
.quick-buttons button {
  min-height: 56px;
  padding: 0 15px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  text-align: left;
  font-weight: 850;
}
.playbook-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.playbook ol { margin: 18px 0 0; padding-left: 20px; color: #d8e0ed; }
.playbook li { margin-bottom: 12px; line-height: 1.45; }

.search, input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 13px;
  background: rgba(255,255,255,.065);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #fff;
  outline: none;
}
.search { width: min(320px, 100%); }
textarea { min-height: 72px; padding: 10px 13px; resize: vertical; }
select option { color: #101824; }
input:focus, select:focus, textarea:focus, .search:focus { border-color: rgba(90,161,255,.62); box-shadow: 0 0 0 3px rgba(28,105,212,.18); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(12px);
  z-index: 30;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  position: relative;
  width: min(980px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: 22px 30px 20px;
  background: #090f18;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  color: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 22px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px 16px; margin-top: 16px; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; color: #dbe4f2; }
.check-row label { display: inline-flex; align-items: center; gap: 8px; margin: 0; text-transform: none; letter-spacing: 0; font-size: 14px; }
.check-row input { width: auto; min-height: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.instruction-card {
  padding: 16px;
  background: rgba(90,161,255,.07);
  border: 1px solid rgba(90,161,255,.22);
}
.instruction-card p:last-child {
  margin: 0;
  color: #eaf2ff;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
}
.advanced-fields {
  padding: 12px 14px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
}
.advanced-fields summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.advanced-fields .field { margin-top: 12px; }
.task-workspace {
  margin-top: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(28,105,212,.13), rgba(255,255,255,.035));
  border: 1px solid rgba(90,161,255,.28);
  box-shadow: inset 3px 0 0 var(--blue);
}
.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.workspace-head h3 { margin-bottom: 0; font-size: 22px; }
.workspace-help {
  margin: 0 0 16px;
  color: #c9d8ef;
  line-height: 1.5;
  font-weight: 650;
}
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.workspace-grid .field:first-child { grid-column: 1 / -1; }
.workspace-grid textarea { min-height: 74px; background: rgba(4,8,14,.72); }
.todo-form-grid { gap: 12px 16px; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 12%, rgba(28,105,212,.24), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(90,161,255,.10), transparent 28%),
    linear-gradient(135deg, #030407 0%, #08111e 56%, #05080d 100%);
}
.login-card {
  width: min(100%, 560px);
  padding: 38px;
  background: rgba(7, 12, 20, .86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-card .brand-mark { margin-bottom: 30px; }
.login-card h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: .98;
  letter-spacing: -0.04em;
}
.login-card .muted {
  margin-bottom: 28px;
  color: #b4c0d3;
  font-size: 16px;
}
.login-form { display: grid; gap: 10px; }
.login-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-form input { min-height: 48px; }
.login-form button {
  min-height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(28,105,212,.26);
}
.login-form button:hover { transform: translateY(-1px); }
.error { margin: 4px 0 0; color: var(--red); font-weight: 800; }

@media (max-width: 1180px) {
  .shell { padding-left: 300px; padding-right: 28px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .two-one, .one-one { grid-template-columns: 1fr; }
  .playbook-grid, .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .agenda-items { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .rail {
    position: static;
    width: auto;
    margin: 14px;
    padding: 14px;
  }
  .rail-tabs { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .logout { margin-top: 0; }
  .shell { padding: 16px 14px 44px; }
  .topbar { grid-template-columns: 1fr; gap: 18px; }
  .top-actions { justify-content: stretch; max-width: none; }
  .top-actions > * { flex: 1 1 150px; }
  .metric-grid, .playbook-grid, .card-grid { grid-template-columns: 1fr; }
  .agenda-day { grid-template-columns: 1fr; }
  .agenda-date { position: static; }
  .panel, .modal { padding: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .rail-tabs { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 40px; }
  .metric { min-height: 96px; }
  .quick-buttons { grid-template-columns: 1fr; }
  .panel-head, .inline-tools { display: grid; justify-content: stretch; }
  .search { width: 100%; }
}
