:root {
  --navy: #101012;
  --navy2: #27272a;
  --ivory: #f5f5f6;
  --paper: #ffffff;
  --copper: #c51624;
  --accent: #c51624;
  --accent-strong: #9f101b;
  --accent-soft: #fff0f1;
  --ink: #141416;
  --muted: #6d6d74;
  --line: #dedee2;
  --line-strong: #c7c7cd;
  --shadow: 0 22px 55px rgba(20, 20, 22, .11);
  --shadow-soft: 0 8px 24px rgba(20, 20, 22, .07);
}

::selection { background: rgba(197, 22, 36, .2); color: var(--ink); }
body {
  background:
    radial-gradient(circle at 90% 0, rgba(197, 22, 36, .07), transparent 28rem),
    linear-gradient(180deg, #fafafa 0, var(--ivory) 38rem);
}

a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(197, 22, 36, .22);
  outline-offset: 2px;
}

.topbar {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(20, 20, 22, .09);
  box-shadow: 0 1px 0 rgba(20, 20, 22, .04);
  backdrop-filter: blur(16px);
}
.brand-mark {
  background: var(--accent);
  border-radius: 10px 3px 10px 3px;
  box-shadow: 0 8px 18px rgba(197, 22, 36, .25);
}
.eyebrow { color: var(--accent); }

.button {
  min-height: 46px;
  padding: .78rem 1.2rem;
  border-color: var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(197, 22, 36, .18);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease,
    border-color .18s ease;
}
.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 12px 24px rgba(197, 22, 36, .24);
  transform: translateY(-2px);
}
.button:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(197, 22, 36, .16); }
.button-small { min-height: 38px; padding: .55rem .85rem; border-radius: 10px; }
.button-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: none;
}
.button-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.button:disabled { box-shadow: none; }

h1, h2, h3 {
  color: var(--ink);
  text-wrap: balance;
}
h1 em { color: var(--accent); }
.hero { background: linear-gradient(115deg, #fff 0 57%, #f8eeee 100%); }
.hero-panel, .security-band { background: #111113; }
.hero-panel { box-shadow: 0 30px 70px rgba(20, 20, 22, .2); }
.metric-grid article { border: 1px solid rgba(255, 255, 255, .08); }
.timeline-preview i { background: var(--accent); box-shadow: 0 0 0 4px #ffe5e7; }
.timeline-preview small, .feature-grid article > span { color: var(--accent); }
.feature-grid article { transition: background .2s ease, transform .2s ease; }
.feature-grid article:hover { background: #fff7f7; transform: translateY(-3px); }
footer { background: #0d0d0f; color: #c6c6cb; }

.auth-shell {
  background:
    radial-gradient(circle at 15% 22%, rgba(197, 22, 36, .25), transparent 22rem),
    linear-gradient(125deg, #111113 0 46%, #f5f5f6 46%);
}
.auth-card {
  border: 1px solid rgba(20, 20, 22, .1);
  border-top: 4px solid var(--accent);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.app-body { background: #f2f2f3; }
.sidebar {
  background: linear-gradient(180deg, #0a0a0b 0, #18181b 100%);
  border-right: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 12px 0 32px rgba(20, 20, 22, .08);
}
.brand-mark-light, .avatar { background: var(--accent); }
.side-nav a {
  position: relative;
  border-radius: 10px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.side-nav a:hover { transform: translateX(3px); }
.side-nav a.active {
  background: linear-gradient(90deg, rgba(197, 22, 36, .24), rgba(255, 255, 255, .07));
  color: #fff;
}
.side-nav a.active::before {
  content: "";
  position: absolute;
  inset: .55rem auto .55rem -.25rem;
  width: 3px;
  border-radius: 99px;
  background: #ef3340;
  box-shadow: 0 0 16px rgba(239, 51, 64, .55);
}
.app-top {
  background: rgba(255, 255, 255, .96);
  border-color: rgba(20, 20, 22, .08);
  box-shadow: 0 8px 22px rgba(20, 20, 22, .04);
  backdrop-filter: blur(14px);
}
.top-actions a:first-child {
  padding: .55rem .8rem;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
}
.workspace-content { padding: clamp(1.2rem, 2.5vw, 2.6rem); }
.page-head { position: relative; padding-left: 1rem; }
.page-head::before {
  content: "";
  position: absolute;
  inset: .15rem auto .15rem 0;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(var(--accent), #fa5963);
}
.page-head h1 { letter-spacing: -.035em; }

.kpi-grid article, .content-card, .action-nav-panel {
  border: 1px solid rgba(20, 20, 22, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow-soft);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.kpi-grid article:hover, .content-card:hover {
  border-color: rgba(197, 22, 36, .25);
  box-shadow: 0 16px 34px rgba(20, 20, 22, .09);
}
.kpi-grid article { position: relative; overflow: hidden; }
.kpi-grid article::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 72%);
}
.card-head { gap: 1rem; }
.card-head h2 { font-size: 1.35rem; }
.chip {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(197, 22, 36, .12);
  font-weight: 750;
}
.quick-list a, .quick-item {
  border-color: #ececef;
  border-radius: 10px;
  transition: background .18s ease, padding .18s ease;
}
.quick-list a:hover, .quick-item:hover { background: #fff7f7; padding-inline: .65rem; }
.quick-list a > span, .quick-item > span {
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-state { border-radius: 14px; background: linear-gradient(145deg, #fff, #fafafa); }
.empty-state > span { color: var(--accent); }

form { accent-color: var(--accent); }
form label {
  color: #26262a;
  font-size: .91rem;
  font-weight: 720;
  line-height: 1.35;
}
form label small { color: var(--muted); }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select, textarea {
  width: 100%;
  min-height: 48px;
  padding: .78rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background-color: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(20, 20, 22, .035);
  font: inherit;
  line-height: 1.35;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease,
    transform .18s ease;
}
select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23141416' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
}
select[multiple] { min-height: 140px; padding-right: .9rem; background-image: none; }
textarea { min-height: 116px; resize: vertical; }
.stack-form select,
.stack-form textarea {
  border-color: var(--line-strong);
  border-radius: 12px;
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(20, 20, 22, .035);
}
input::placeholder, textarea::placeholder { color: #909096; opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):hover,
select:hover, textarea:hover { border-color: #9f9fa6; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(197, 22, 36, .12), 0 8px 20px rgba(20, 20, 22, .06);
  transform: translateY(-1px);
}
.auth-card input:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(197, 22, 36, .12), 0 8px 20px rgba(20, 20, 22, .06);
  transform: translateY(-1px);
}
input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
  background-color: #eeeeef;
  color: #85858b;
  opacity: .85;
}
input[type="file"] { min-height: 52px; padding: .38rem; cursor: pointer; }
input[type="file"]::file-selector-button {
  height: 42px;
  margin-right: .75rem;
  padding: 0 .95rem;
  border: 0;
  border-radius: 9px;
  background: #171719;
  color: #fff;
  font: inherit;
  font-weight: 720;
  cursor: pointer;
  transition: background .18s ease;
}
input[type="file"]::file-selector-button:hover { background: var(--accent); }
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex: 0 0 auto;
  border: 1.5px solid #a8a8ae;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(20, 20, 22, .06);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10 4 4 8-9' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input[type="radio"]:checked { border-color: var(--accent); box-shadow: inset 0 0 0 4px #fff; background: var(--accent); }
.check, .check-row, .consent-row {
  display: inline-flex !important;
  align-items: center;
  gap: .6rem;
  min-height: 48px;
  margin: 0;
  padding: .55rem .7rem;
  border: 1px solid #e2e2e5;
  border-radius: 11px;
  background: #fafafa;
  font-weight: 650;
}
.privacy-check { align-items: flex-start !important; }

.stack-form { display: grid; gap: .25rem; }
.stack-form > label { margin: .65rem 0; }
.form-row { gap: .9rem; }
.inline-form,
.content-card > form:not(.stack-form) {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .8rem;
  margin-top: 1rem;
}
.inline-form > label,
.content-card > form:not(.stack-form) > label {
  flex: 1 1 180px;
  min-width: min(180px, 100%);
  margin: 0;
}
.inline-form > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.inline-form > select,
.content-card > form:not(.stack-form) > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.content-card > form:not(.stack-form) > select { flex: 1 1 150px; width: auto; }
.inline-form > .button,
.content-card > form:not(.stack-form) > .button { flex: 0 0 auto; }
.inline-form > [data-form-message],
.content-card > form:not(.stack-form) > [data-form-message] { flex-basis: 100%; margin: 0; }
.form-message { border-radius: 9px; }
.form-message:not(:empty) { padding: .7rem .8rem; background: #fafafa; }

.global-search input {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f3f3f4;
  box-shadow: none;
}
.global-search input:focus { border-color: rgba(197, 22, 36, .45); }
.search-results { border-radius: 14px; box-shadow: var(--shadow); }

table { border-separate: separate; border-spacing: 0; }
thead th {
  padding-block: .85rem;
  border-bottom: 2px solid var(--accent);
  background: #171719;
  color: #fff;
  font-size: .75rem;
  letter-spacing: .055em;
  text-transform: uppercase;
}
thead th:first-child { border-radius: 10px 0 0; }
thead th:last-child { border-radius: 0 10px 0 0; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #fff7f7; }
td { border-color: #ececef; }

.view-tabs a { border-radius: 12px; background: #f5f5f6; }
.view-tabs a > span { color: var(--accent); }
.view-tabs a[aria-selected="true"] {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: rgba(197, 22, 36, .22);
  box-shadow: inset 3px 0 0 var(--accent);
}
.view-tabs-horizontal a[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--accent); }
.pagination-bar { border-top: 1px solid #eeeeef; }
.form-disclosure { border-radius: 14px; background: #fafafa; }
.form-disclosure summary span { color: var(--ink); }
.wizard-progress-track span { background: linear-gradient(90deg, var(--accent), #f04450); }
.intake-assurance span { background: var(--accent-soft); color: var(--accent-strong); }
.required-mark { background: var(--accent-soft); color: var(--accent-strong); }
.intake-review { border-color: #e1e1e5; border-radius: 14px; background: #fafafa; }
.pipeline-column { border-radius: 15px; background: #f7f7f8; }
.pipeline-card { border-radius: 12px; border-color: #e1e1e5; box-shadow: 0 5px 14px rgba(20, 20, 22, .05); }
.callout-card { background: linear-gradient(140deg, #fff, #fff1f2); }
.provider-pending { background: #fff3f3; color: #8e1720; }

@media (max-width: 850px) {
  .auth-shell { background: #f5f5f6; }
  .page-head { padding-left: .8rem; }
  .content-card { border-radius: 15px; }
  .inline-form,
  .content-card > form:not(.stack-form) { align-items: stretch; }
  .inline-form > *,
  .content-card > form:not(.stack-form) > * { flex-basis: 100% !important; width: 100% !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
