:root {
  --brand: #014f99;
  --brand-strong: #073f78;
  --brand-soft: #eaf4ff;
  --aqua: #55d9c6;
  --aqua-strong: #20bba7;
  --aqua-soft: #e9fbf8;
  --ink: #13253a;
  --ink-2: #32465d;
  --muted: #6d7c90;
  --muted-2: #93a0b1;
  --line: #dfe6ee;
  --line-strong: #cbd6e2;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --page: #f2f6fa;
  --navy: #0d2f54;
  --green: #15966a;
  --green-soft: #e8f8f1;
  --amber: #c47b0d;
  --amber-soft: #fff6df;
  --red: #c43b4b;
  --red-soft: #fff0f2;
  --violet: #7653c9;
  --violet-soft: #f1edff;
  --cyan: #188da4;
  --cyan-soft: #eaf9fc;
  --teal: #16877f;
  --teal-soft: #e9f9f7;
  --slate: #5b6b7d;
  --slate-soft: #eef2f6;
  --shadow-sm: 0 1px 3px rgba(26, 49, 78, .08), 0 8px 24px rgba(26, 49, 78, .04);
  --shadow: 0 14px 38px rgba(25, 48, 76, .09);
  --shadow-lg: 0 30px 80px rgba(10, 40, 75, .18);
  --radius-sm: 9px;
  --radius: 15px;
  --radius-lg: 22px;
  --sidebar: 252px;
  --topbar: 76px;
  --transition: 180ms ease;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.sidebar-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
h1, h2, h3, p { margin-top: 0; }
fieldset { min-width: 0; }
code {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 3px 6px;
  color: var(--brand-strong);
  font-size: 12px;
}
::selection { background: rgba(85, 217, 198, .35); }

.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: currentColor; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 6px 0 28px rgba(25, 48, 76, .025);
}
.sidebar__brand {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 21px;
  border-bottom: 1px solid var(--line);
}
.sidebar__brand > a { width: 154px; }
.sidebar__brand img { width: 154px; height: 44px; object-fit: contain; object-position: left center; }
.sidebar__close { display: none !important; }
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px;
  scrollbar-width: thin;
}
.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 3px 0;
  padding: 10px 13px;
  border-radius: 11px;
  color: #56677a;
  font-weight: 650;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}
.sidebar__link .icon { width: 19px; height: 19px; }
.sidebar__link:hover { color: var(--brand); background: var(--brand-soft); transform: translateX(2px); }
.sidebar__link.is-active {
  color: var(--brand);
  background: linear-gradient(100deg, var(--brand-soft), #f4faff);
  box-shadow: inset 3px 0 0 var(--aqua-strong);
}
.sidebar__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 13px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.user-chip {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border-radius: 10px;
}
.user-chip:hover { background: var(--surface-2); }
.user-chip > span:last-child { min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: var(--ink); font-size: 12px; }
.user-chip small { color: var(--muted); font-size: 10px; }
.sidebar__footer form { margin: 0; }
.sidebar-backdrop { display: none; }
.main { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  height: var(--topbar);
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(240px, 430px) minmax(160px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 clamp(20px, 3vw, 42px);
  border-bottom: 1px solid rgba(203, 214, 226, .85);
  background: rgba(255, 255, 255, .91);
  backdrop-filter: blur(18px);
}
.topbar__title h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.02em; }
.topbar__menu { display: none !important; }
.topbar__search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.topbar__search:hover { border-color: #b6c8da; background: var(--surface); box-shadow: 0 5px 18px rgba(20, 53, 88, .06); }
.topbar__search .icon { width: 17px; height: 17px; }
.topbar__search span { flex: 1; }
kbd {
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.topbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.topbar__avatar { display: none; }
.content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px);
}

/* Generic controls */
.btn {
  appearance: none;
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(85, 217, 198, .42);
  outline-offset: 2px;
}
.btn .icon { width: 17px; height: 17px; }
.btn--primary { color: #fff; background: linear-gradient(135deg, var(--brand), #0873cc); box-shadow: 0 7px 16px rgba(1, 79, 153, .18); }
.btn--primary:hover { background: linear-gradient(135deg, var(--brand-strong), var(--brand)); box-shadow: 0 10px 22px rgba(1, 79, 153, .24); }
.btn--secondary { color: var(--brand); border-color: #c6dbed; background: #f6fbff; }
.btn--secondary:hover { border-color: #9fc1de; background: var(--brand-soft); }
.btn--ghost { color: var(--ink-2); border-color: var(--line); background: var(--surface); }
.btn--ghost:hover { border-color: #b9c8d7; background: var(--surface-2); }
.btn--success { color: #fff; background: var(--green); box-shadow: 0 7px 16px rgba(21, 150, 106, .17); }
.btn--danger-ghost { color: var(--red); border-color: #efc5cc; background: #fffafb; }
.btn--danger-ghost:hover { background: var(--red-soft); }
.btn--sm { min-height: 33px; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.btn--lg { min-height: 48px; padding: 12px 19px; border-radius: 12px; }
.btn--block { width: 100%; }
.icon-btn {
  appearance: none;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.icon-btn:hover { color: var(--brand); border-color: var(--line); background: var(--surface-2); transform: translateY(-1px); }
.icon-btn .icon { width: 19px; height: 19px; }
.button-row, .inline-actions, .inline-actions a, .card__actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.inline-actions { margin-top: 14px; }
.inline-actions a { color: var(--brand); font-size: 12px; font-weight: 750; }
.inline-actions .icon { width: 15px; height: 15px; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-size: 12px; font-weight: 750; }
.link .icon { width: 15px; height: 15px; }
.link:hover { color: var(--aqua-strong); }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input, .select { min-height: 42px; padding: 8px 11px; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, #728397 50%), linear-gradient(135deg, #728397 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: #aebfd0; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--aqua-strong); box-shadow: 0 0 0 3px rgba(85, 217, 198, .16); }
.input::placeholder, .textarea::placeholder { color: #9aa7b6; }
.input--lg { min-height: 49px; padding: 11px 13px; }
.input--sm, .select--sm { min-height: 33px; padding: 5px 9px; border-radius: 8px; font-size: 12px; }
.select--sm { padding-right: 27px; background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px; background-size: 4px 4px, 4px 4px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field__label { color: var(--ink-2); font-size: 11px; font-weight: 760; letter-spacing: .01em; }
.field__label em { margin-left: 3px; color: var(--red); font-style: normal; }
.field > small { color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.field--compact { min-width: 150px; }
.field--compact .field__label { display: none; }
.form-grid { display: grid; gap: 16px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-stack { display: grid; gap: 20px; }
.align-end { align-items: end; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 19px; }
.form-actions--sticky { position: sticky; z-index: 15; bottom: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.toggle-field { display: flex; align-items: center; gap: 11px; padding: 8px 0; cursor: pointer; }
.toggle-field > input { position: absolute; opacity: 0; pointer-events: none; }
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: #cbd5df;
  transition: background var(--transition);
}
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 40, 70, .2); transition: transform var(--transition); }
.toggle-field > input:checked + .toggle { background: var(--aqua-strong); }
.toggle-field > input:checked + .toggle::after { transform: translateX(18px); }
.toggle-field > input:focus-visible + .toggle { outline: 3px solid rgba(85,217,198,.3); outline-offset: 2px; }
.toggle-field > span:last-child strong, .toggle-field > span:last-child small { display: block; }
.toggle-field > span:last-child strong { font-size: 12px; }
.toggle-field > span:last-child small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 58px; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--brand); font-size: 11px; font-weight: 800; cursor: pointer; }

/* Alerts, badges and cards */
.alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 44px 13px 14px;
  border: 1px solid #b7dfd1;
  border-radius: 12px;
  background: var(--green-soft);
  color: #17694d;
  box-shadow: var(--shadow-sm);
}
.alert > span { margin-top: 1px; }
.alert .icon { width: 18px; height: 18px; }
.alert p { margin: 0; }
.alert--danger { border-color: #efc1c8; background: var(--red-soft); color: #96303d; }
.alert--warning { border-color: #efd69e; background: var(--amber-soft); color: #8d5b0e; }
.alert__close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; background: transparent; color: currentColor; opacity: .65; cursor: pointer; }
.alert__close .icon { width: 17px; height: 17px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--slate-soft);
  color: var(--slate);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.badge--blue { color: var(--brand); background: var(--brand-soft); }
.badge--navy { color: #fff; background: var(--navy); }
.badge--cyan { color: var(--cyan); background: var(--cyan-soft); }
.badge--teal { color: var(--teal); background: var(--teal-soft); }
.badge--green, .badge--success { color: var(--green); background: var(--green-soft); }
.badge--amber { color: var(--amber); background: var(--amber-soft); }
.badge--danger, .badge--red { color: var(--red); background: var(--red-soft); }
.badge--violet { color: var(--violet); background: var(--violet-soft); }
.badge--indigo { color: #5650bb; background: #efefff; }
.badge--lime { color: #5d850e; background: #f2f9df; }
.badge--gray, .badge--slate { color: var(--slate); background: var(--slate-soft); }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card__header {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
}
.card__header h2 { margin: 0; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.card__header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.card__body { padding: 19px; }
.card__body--flush { padding: 0; }
.empty-state { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px; color: var(--muted); text-align: center; }
.empty-state > .icon { width: 32px; height: 32px; margin-bottom: 9px; color: #b1bfcd; }
.empty-state h3 { margin: 0 0 4px; color: var(--ink-2); font-size: 14px; }
.empty-state p { max-width: 390px; margin: 0 0 14px; font-size: 12px; }
.notice {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 16px 0;
  padding: 13px 15px;
  border: 1px solid #c9ddeb;
  border-radius: 12px;
  background: #f4faff;
  color: #315d7f;
}
.notice .icon { width: 19px; height: 19px; color: var(--brand); }
.notice p { margin: 0; }

/* Login */
.login-page { min-height: 100vh; overflow-x: hidden; background: #eef4f8; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.14fr) minmax(390px, .86fr); }
.login-brand {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(40px, 6vw, 84px);
  color: #fff;
  background: radial-gradient(circle at 80% 20%, rgba(85,217,198,.26), transparent 32%), radial-gradient(circle at 18% 84%, rgba(45,146,225,.30), transparent 40%), linear-gradient(145deg, #052f58 0%, #014f99 60%, #0870b9 100%);
}
.login-brand::before, .login-brand::after { content: ""; position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.login-brand::before { width: 620px; height: 620px; top: -260px; right: -230px; }
.login-brand::after { width: 430px; height: 430px; bottom: -270px; left: -150px; }
.login-brand > img { width: 210px; min-height: 62px; padding: 8px 12px; border-radius: 11px; background: rgba(255,255,255,.96); box-shadow: 0 15px 35px rgba(0,0,0,.13); }
.login-brand > div:nth-of-type(1) { max-width: 660px; margin: auto 0; padding: 60px 0; }
.login-brand .eyebrow { color: var(--aqua); }
.login-brand h1 { max-width: 620px; margin: 13px 0 17px; font-size: clamp(42px, 5vw, 70px); line-height: .99; letter-spacing: -.055em; }
.login-brand p { max-width: 590px; margin: 0; color: rgba(255,255,255,.78); font-size: clamp(15px, 1.6vw, 19px); line-height: 1.6; }
.login-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.login-feature-grid > div { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; background: rgba(255,255,255,.07); backdrop-filter: blur(8px); }
.login-feature-grid .icon { color: var(--aqua); }
.login-feature-grid strong, .login-feature-grid small { display: block; }
.login-feature-grid strong { font-size: 11px; }
.login-feature-grid small { color: rgba(255,255,255,.62); font-size: 9.5px; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 72px); background: #f6f9fc; }
.login-card { width: min(100%, 430px); padding: clamp(27px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.login-card__header { margin-bottom: 27px; text-align: center; }
.login-card__header .spark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 13px; border-radius: 13px; background: var(--aqua-soft); color: var(--aqua-strong); font-size: 20px; }
.login-card__header h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.login-card__header p { margin: 5px 0 0; color: var(--muted); }
.login-card > .field { margin-bottom: 17px; }
.login-help { margin: 18px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.login-footer { margin: 22px 0 0; color: var(--muted); font-size: 10px; }

/* Dashboard */
.hero {
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 19px;
  padding: clamp(25px, 3.5vw, 42px);
  border-radius: var(--radius-lg);
  color: #fff;
  background: radial-gradient(circle at 85% 35%, rgba(85,217,198,.23), transparent 27%), linear-gradient(120deg, #083867 0%, var(--brand) 55%, #0c72b7 100%);
  box-shadow: 0 18px 40px rgba(1,79,153,.16);
}
.hero::after { content: ""; position: absolute; width: 330px; height: 330px; right: -145px; top: -180px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.hero .eyebrow { color: var(--aqua); }
.hero h2 { margin: 8px 0 6px; font-size: clamp(25px, 3vw, 38px); line-height: 1.12; letter-spacing: -.04em; }
.hero p { margin: 0; color: rgba(255,255,255,.73); font-size: 14px; }
.hero__spark { position: relative; z-index: 1; display: grid; place-items: center; width: 70px; height: 70px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: rgba(255,255,255,.09); color: var(--aqua); font-size: 32px; transform: rotate(8deg); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.metrics-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metrics-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 105px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
a.metric:hover { transform: translateY(-2px); border-color: #bed0df; box-shadow: var(--shadow); }
.metric__icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--brand-soft); color: var(--brand); }
.metric__icon .icon { width: 21px; height: 21px; }
.metric__content { min-width: 0; }
.metric__content small, .metric__content strong, .metric__content em { display: block; overflow: hidden; text-overflow: ellipsis; }
.metric__content small { color: var(--muted); font-size: 10px; font-weight: 730; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.metric__content strong { margin: 3px 0 1px; color: var(--ink); font-size: clamp(19px, 2vw, 27px); line-height: 1.1; letter-spacing: -.035em; white-space: nowrap; }
.metric__content em { color: var(--muted); font-size: 10.5px; font-style: normal; white-space: nowrap; }
.metric--amber .metric__icon { background: var(--amber-soft); color: var(--amber); }
.metric--teal .metric__icon { background: var(--teal-soft); color: var(--teal); }
.metric--green .metric__icon { background: var(--green-soft); color: var(--green); }
.metric--red .metric__icon { background: var(--red-soft); color: var(--red); }
.metric--violet .metric__icon { background: var(--violet-soft); color: var(--violet); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 19px; align-items: start; }
.dashboard-grid__main, .dashboard-grid__side { display: grid; gap: 19px; }
.status-chart { display: grid; gap: 13px; }
.status-chart__row { display: grid; grid-template-columns: 142px minmax(100px, 1fr) 28px; align-items: center; gap: 12px; }
.status-chart__row:hover strong { color: var(--brand); }
.status-chart__label { overflow: hidden; }
.status-chart__bar { height: 8px; overflow: hidden; border-radius: 99px; background: #edf1f5; }
.status-chart__bar i { display: block; width: var(--bar); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--aqua-strong)); }
.status-chart__row strong { text-align: right; }
.plan-chart { display: grid; gap: 10px; }
.plan-chart__item { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.plan-chart__item:hover { border-color: #b9ccdc; background: var(--surface); }
.plan-chart__item > span strong, .plan-chart__item > span small { display: block; }
.plan-chart__item > span strong { font-size: 19px; line-height: 1; }
.plan-chart__item > span small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.donut { --donut-color: var(--brand); position: relative; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--donut-color) calc(var(--value) * 1%), #e7edf3 0); }
.donut::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface-2); }
.donut em { position: relative; z-index: 1; font-size: 9px; font-style: normal; font-weight: 800; }
.plan-chart__item--express .donut { --donut-color: var(--green); }
.plan-chart__item--moderate .donut { --donut-color: var(--brand); }
.plan-chart__item--full .donut { --donut-color: var(--navy); }
.case-mini { display: block; padding: 14px 17px; border-bottom: 1px solid var(--line); transition: background var(--transition); }
.case-mini:last-child { border-bottom: 0; }
.case-mini:hover { background: var(--surface-2); }
.case-mini__top, .case-mini__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-mini__top strong { color: var(--brand); font-size: 11px; }
.case-mini__name { display: block; margin: 7px 0; font-size: 13px; font-weight: 750; }
.case-mini__meta { color: var(--muted); font-size: 10px; }
.case-mini__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.case-mini__meta .icon { width: 13px; height: 13px; }
.insight-card { display: flex; align-items: center; gap: 15px; padding: 19px; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, #149d8f, #0b776f); box-shadow: 0 14px 28px rgba(20,157,143,.18); }
.insight-card > span { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: rgba(255,255,255,.14); }
.insight-card small, .insight-card strong, .insight-card a { display: block; }
.insight-card small { color: rgba(255,255,255,.72); font-size: 10px; }
.insight-card strong { margin: 2px 0 6px; font-size: 22px; }
.insight-card a { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; }
.insight-card a .icon { width: 13px; height: 13px; }
.task-list { display: grid; }
.task-line { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.task-line:last-child { border-bottom: 0; }
a.task-line:hover .task-line__main strong { color: var(--brand); }
.task-line__check { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border: 2px solid #cbd6e1; border-radius: 6px; color: #fff; }
.task-line__check.is-done { border-color: var(--green); background: var(--green); }
.task-line__check .icon { width: 14px; height: 14px; }
.task-line__main { min-width: 0; flex: 1; }
.task-line__main strong, .task-line__main small { display: block; }
.task-line__main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.task-line__main small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.task-line__main p { margin: 5px 0 0; color: var(--ink-2); font-size: 11px; }
.task-list.detailed .task-line { flex-wrap: wrap; padding: 14px 0; }
.task-list.detailed form { flex: 0 0 auto; }

/* Lists and tables */
.page-intro { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; color: var(--muted); }
.page-intro p { margin: 0; }
.legend { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot--danger { background: var(--red); }
.dot--amber { background: var(--amber); }
.filter-bar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.filter-search { min-width: 210px; flex: 1; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.filter-search:focus-within { border-color: var(--aqua-strong); box-shadow: 0 0 0 3px rgba(85,217,198,.15); }
.filter-search .icon { width: 17px; height: 17px; color: var(--muted); }
.filter-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f9fbfd; color: var(--muted); font-size: 9.5px; font-weight: 820; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #fbfdff; }
td { color: var(--ink-2); font-size: 12px; }
td > strong, td > small, td > a + small, td > span + small { display: block; }
td > small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.case-code { color: var(--brand); font-weight: 820; white-space: nowrap; }
.table-primary { color: var(--ink); font-weight: 750; }
.number-cell { text-align: right; }
.date-cell { white-space: nowrap; }
.date-cell.is-late { color: var(--red); font-weight: 780; }
.table-form { min-width: 305px; display: flex; align-items: center; gap: 6px; }
.table-form .select, .table-form .input { width: 100px; }
.mobile-list { display: none; }
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 17px; }
.pagination__page { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 11px; font-weight: 750; }
.pagination__page:hover, .pagination__page.is-active { border-color: var(--brand); background: var(--brand); color: #fff; }
.pagination__page.is-disabled { opacity: .42; pointer-events: none; }

/* Forms */
.narrow-form { width: min(100%, 950px); margin: 0 auto; }
.narrow-form .card__body > .field, .profile-grid .card__body > .field { margin-bottom: 17px; }
.case-form { max-width: 1450px; margin: 0 auto; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 19px; align-items: start; }
.form-layout__main { display: grid; gap: 19px; }
.form-layout__side { position: sticky; top: calc(var(--topbar) + 18px); display: grid; gap: 14px; }
.price-panel { padding: 20px; border: 1px solid #bed8e9; border-radius: var(--radius); background: linear-gradient(180deg, #f5fbff, #fff); box-shadow: var(--shadow); }
.price-panel > .eyebrow { margin-bottom: 16px; }
.price-panel > .field { margin-bottom: 15px; }
.price-preview { margin: 17px 0 12px; padding: 16px; border: 1px solid #bee6de; border-radius: 13px; background: var(--aqua-soft); }
.price-preview small, .price-preview strong, .price-preview span { display: block; }
.price-preview small { color: var(--teal); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.price-preview strong { margin: 4px 0; color: #096b61; font-size: 27px; line-height: 1.15; letter-spacing: -.04em; }
.price-preview span { color: #427c76; font-size: 10px; }
.fine-print { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.sticky-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }

/* Case detail */
.case-hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 15px; padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-lg); color: #fff; background: radial-gradient(circle at 75% 35%, rgba(85,217,198,.2), transparent 30%), linear-gradient(125deg, #063765, var(--brand)); box-shadow: 0 16px 35px rgba(1,79,153,.15); }
.case-hero::after { content: ""; position: absolute; right: -80px; top: -140px; width: 290px; height: 290px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.case-hero__main { position: relative; z-index: 1; min-width: 0; }
.case-hero__code { display: flex; align-items: center; gap: 9px; }
.case-hero__code > span { color: var(--aqua); font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.case-hero h2 { margin: 8px 0 4px; font-size: clamp(27px, 3vw, 40px); line-height: 1.05; letter-spacing: -.04em; }
.case-hero p { margin: 0 0 14px; color: rgba(255,255,255,.72); }
.case-hero .badge { background: rgba(255,255,255,.13); color: #fff; backdrop-filter: blur(5px); }
.case-hero__date { position: relative; z-index: 1; min-width: 260px; padding: 18px; border: 1px solid rgba(255,255,255,.17); border-radius: 15px; background: rgba(255,255,255,.08); backdrop-filter: blur(7px); text-align: right; }
.case-hero__date small, .case-hero__date strong, .case-hero__date span { display: block; }
.case-hero__date small { color: var(--aqua); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.case-hero__date strong { margin: 4px 0; font-size: 22px; }
.case-hero__date span { color: rgba(255,255,255,.67); font-size: 9.5px; }
.case-hero__date.is-late { border-color: rgba(255,178,187,.45); background: rgba(196,59,75,.19); }
.case-hero__date.is-late small { color: #ffbac2; }
.approval-panel { display: flex; justify-content: space-between; gap: 20px; margin: 15px 0; padding: 17px; border: 1px solid #efd798; border-radius: var(--radius); background: var(--amber-soft); }
.approval-panel > div:first-child { display: flex; align-items: flex-start; gap: 12px; }
.approval-panel > div:first-child > span { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: rgba(196,123,13,.12); color: var(--amber); }
.approval-panel small { color: #88631e; font-size: 9px; font-weight: 820; letter-spacing: .08em; }
.approval-panel h3 { margin: 4px 0; }
.approval-panel p { margin: 0; color: #715a2c; font-size: 11px; }
.approval-panel--approved { border-color: #b4dfcf; background: var(--green-soft); }
.approval-panel--approved > div:first-child > span { background: rgba(21,150,106,.12); color: var(--green); }
.approval-panel--changes_requested { border-color: #eebec6; background: var(--red-soft); }
.approval-actions { min-width: 280px; display: grid; gap: 8px; align-content: start; }
.approval-actions > form:first-child .btn { width: 100%; }
.approval-change-form { display: grid; gap: 7px; }
.quick-status { display: flex; align-items: flex-end; gap: 9px; margin-bottom: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.quick-status .field { width: 220px; }
.quick-status > .input { flex: 1; }
.anchor-nav { position: sticky; z-index: 24; top: calc(var(--topbar) + 8px); display: flex; align-items: center; gap: 5px; overflow-x: auto; margin: 15px 0 22px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.95); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); scrollbar-width: none; }
.anchor-nav::-webkit-scrollbar { display: none; }
.anchor-nav a { flex: 0 0 auto; padding: 8px 11px; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 730; }
.anchor-nav a:hover { background: var(--brand-soft); color: var(--brand); }
.anchor-nav a span { margin-left: 3px; padding: 2px 5px; border-radius: 99px; background: var(--slate-soft); font-size: 9px; }
.case-section { scroll-margin-top: calc(var(--topbar) + 75px); margin-bottom: 25px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 17px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.02em; }
.info-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.info-strip > div { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 13px; border-right: 1px solid var(--line); }
.info-strip > div:last-child { border-right: 0; }
.info-strip .icon { width: 19px; height: 19px; color: var(--brand); }
.info-strip small, .info-strip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-strip small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.info-strip strong { font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.detail-grid dl { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.detail-item { display: grid; grid-template-columns: 42% 58%; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.detail-item:last-child { border-bottom: 0; }
.detail-item dt { color: var(--muted); font-size: 10px; }
.detail-item dd { margin: 0; color: var(--ink); font-size: 11px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.confirmed-count { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 15px; border: 1px solid #a9ddcb; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.confirmed-count > .icon { width: 24px; height: 24px; }
.confirmed-count small, .confirmed-count strong { display: block; }
.confirmed-count small { font-size: 8.5px; font-weight: 820; letter-spacing: .08em; }
.confirmed-count strong { color: #116648; font-size: 15px; }
.clinical-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.clinical-block { min-height: 145px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; }
.clinical-block h3 { margin: 0 0 9px; color: var(--brand-strong); font-size: 12px; }
.clinical-block p { margin: 0; color: var(--ink-2); font-size: 11.5px; line-height: 1.65; }
.internal-note { margin-top: 13px; padding: 15px; border-left: 4px solid var(--amber); border-radius: 9px; background: var(--amber-soft); }
.internal-note strong { font-size: 11px; }
.internal-note p { margin: 5px 0 0; color: #715a2c; font-size: 11px; }
.split-panel { display: grid; grid-template-columns: minmax(0, 1fr) 355px; gap: 18px; align-items: start; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.file-row:first-child { padding-top: 0; }
.file-row:last-child { border-bottom: 0; }
.file-row__icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.file-row__main { min-width: 0; flex: 1; }
.file-row__main strong, .file-row__main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__main strong { font-size: 11.5px; }
.file-row__main small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.file-row__main p { margin: 4px 0 0; color: var(--ink-2); font-size: 10px; }
.file-row__actions { display: flex; align-items: center; gap: 5px; }
.file-row__actions form { margin: 0; }
.upload-form { padding: 15px; border: 1px solid #c7dae9; border-radius: 14px; background: #f7fbfe; }
.drop-zone { position: relative; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 13px; padding: 18px; border: 1.5px dashed #9cbcd3; border-radius: 12px; background: #fff; color: var(--muted); text-align: center; cursor: pointer; transition: background var(--transition), border-color var(--transition), transform var(--transition); }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--aqua-strong); background: var(--aqua-soft); transform: translateY(-1px); }
.drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-zone > span { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.drop-zone strong { color: var(--ink); font-size: 11.5px; }
.drop-zone small { margin-top: 3px; font-size: 9px; }
.upload-form .form-grid { margin-bottom: 12px; }
.inline-form { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.inline-form summary { display: flex; align-items: center; gap: 7px; padding: 12px 14px; color: var(--brand); font-size: 11px; font-weight: 800; cursor: pointer; list-style: none; }
.inline-form summary::-webkit-details-marker { display: none; }
.inline-form summary .icon { width: 15px; height: 15px; }
.inline-form[open] summary { border-bottom: 1px solid var(--line); }
.inline-form > form { padding: 15px; }
.inline-form > form > .btn { margin-top: 13px; }
.finance-summary { display: flex; align-items: center; gap: 22px; }
.finance-summary span { text-align: right; }
.finance-summary small, .finance-summary strong { display: block; }
.finance-summary small { color: var(--muted); font-size: 8.5px; text-transform: uppercase; }
.finance-summary strong { font-size: 13px; }
.commercial-note { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; padding: 12px; border: 1px solid #cde5de; border-radius: 11px; background: var(--green-soft); color: #3f7160; font-size: 10px; }
.payment-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.payment-row { display: grid; grid-template-columns: 1fr .8fr .8fr minmax(300px, 1.2fr); align-items: center; gap: 13px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.payment-row:last-child { border-bottom: 0; }
.payment-row > div small, .payment-row > div strong, .payment-row > div span { display: block; }
.payment-row > div small { color: var(--muted); font-size: 9px; }
.payment-row > div strong { font-size: 13px; }
.payment-row > form { display: flex; gap: 6px; }
.note-form { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.note-form > div { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.note-form > div label { color: var(--muted); font-size: 10px; }
.note-form > div .btn { margin-left: auto; }
.notes-list { display: grid; gap: 13px; }
.note { display: flex; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.note > div { min-width: 0; flex: 1; }
.note header { display: flex; align-items: center; gap: 8px; }
.note header time { margin-left: auto; color: var(--muted); font-size: 9px; }
.note p { margin: 8px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.6; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 6px; width: 1px; background: var(--line); }
.timeline__item { position: relative; display: flex; gap: 13px; padding: 0 0 18px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: relative; z-index: 1; width: 13px; height: 13px; flex: 0 0 auto; margin-top: 5px; border: 3px solid var(--surface); border-radius: 50%; background: var(--aqua-strong); box-shadow: 0 0 0 1px var(--aqua-strong); }
.timeline__item > div strong, .timeline__item > div small { display: block; }
.timeline__item > div small { margin-top: 4px; color: var(--muted); font-size: 9.5px; }
.timeline__item p { margin: 5px 0 0; color: var(--ink-2); font-size: 10.5px; }

/* Production */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(245px, 1fr)); gap: 12px; overflow-x: auto; padding: 2px 2px 15px; scroll-snap-type: x proximity; }
.kanban__column { min-width: 245px; scroll-snap-align: start; }
.kanban__column > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding: 0 4px; }
.kanban__column > header > strong { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 10px; box-shadow: var(--shadow-sm); }
.kanban__cards { min-height: 500px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #eaf0f5; }
.kanban-card { overflow: hidden; margin-bottom: 9px; border: 1px solid #d3dee8; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.kanban-card.is-late { border-left: 4px solid var(--red); }
.kanban-card > a { display: block; padding: 13px; }
.kanban-card:hover { border-color: #afc4d5; box-shadow: var(--shadow); }
.kanban-card__top, .kanban-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-card__top > strong { color: var(--brand); font-size: 10.5px; }
.kanban-card h3 { margin: 11px 0 2px; font-size: 13px; line-height: 1.25; }
.kanban-card p { margin: 0; color: var(--muted); font-size: 9.5px; }
.kanban-card__badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0; }
.kanban-card__footer { padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8.5px; }
.kanban-card__footer span { display: inline-flex; align-items: center; gap: 4px; }
.kanban-card__footer .icon { width: 12px; height: 12px; }
.kanban-card__status { padding: 8px; border-top: 1px solid var(--line); background: #fafcfe; }
.kanban-empty { min-height: 105px; display: grid; place-items: center; color: #94a1ae; font-size: 10px; }

/* People, reports, settings */
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.person-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.person-card.is-inactive { opacity: .68; }
.person-card__top { display: flex; align-items: center; gap: 11px; }
.person-card__top > div { min-width: 0; flex: 1; }
.person-card__top h3 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.person-card__top p { overflow: hidden; margin: 2px 0 0; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; }
.person-card dl { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin: 15px 0; }
.person-card dl > div { padding: 9px; border-radius: 9px; background: var(--surface-2); }
.person-card dt { color: var(--muted); font-size: 8.5px; text-transform: uppercase; }
.person-card dd { margin: 2px 0 0; font-size: 11px; font-weight: 760; }
.person-card__contact { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.person-card__actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 12px; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: linear-gradient(135deg, var(--brand), #1975bd); color: #fff; font-size: 10px; font-weight: 850; letter-spacing: .03em; }
.avatar--sm { width: 30px; height: 30px; border-radius: 9px; font-size: 8px; }
.avatar--xl { width: 72px; height: 72px; border-radius: 20px; font-size: 20px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .7fr); gap: 17px; margin-bottom: 19px; }
.monthly-chart { min-height: 240px; display: flex; align-items: end; gap: 10px; padding-top: 25px; }
.monthly-chart__item { min-width: 35px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.monthly-chart__item span { width: min(100%, 42px); min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--aqua), var(--brand)); }
.monthly-chart__item strong { font-size: 10px; }
.monthly-chart__item small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.report-line { display: grid; grid-template-columns: 86px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.report-line:last-child { border-bottom: 0; }
.report-line > div { height: 7px; overflow: hidden; border-radius: 99px; background: #edf1f5; }
.report-line > div span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--aqua-strong)); }
.report-line small { color: var(--muted); font-size: 9px; }
.report-line strong { font-size: 10px; }
.plan-editors { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.plan-editor { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.plan-editor > header { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 3px solid var(--brand); background: var(--surface); }
.plan-editor--express > header { border-bottom-color: var(--green); }
.plan-editor--full > header { border-bottom-color: var(--navy); }
.plan-editor > header span:last-child { color: var(--muted); font-size: 8.5px; }
.plan-editor .form-grid { padding: 13px; }
.settings-form { display: grid; gap: 18px; }
.profile-grid { width: min(100%, 950px); margin: 0 auto; display: grid; grid-template-columns: 290px minmax(0,1fr); gap: 17px; align-items: start; }
.profile-card { padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); text-align: center; }
.profile-card .avatar { margin: 0 auto 13px; }
.profile-card h2 { margin: 0 0 2px; font-size: 19px; }
.profile-card > p { margin: 0 0 10px; color: var(--muted); }
.profile-card dl { margin: 20px 0 0; text-align: left; }
.profile-card dl > div { padding: 11px 0; border-top: 1px solid var(--line); }
.profile-card dt { color: var(--muted); font-size: 9px; }
.profile-card dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 700; }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: #e9eef3; }
.progress span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--aqua)); }
.progress-label { display: block; margin-top: 4px; color: var(--muted); font-size: 8.5px; }

/* IPP print view */
.print-body { padding: 0; background: #e9eef3; }
.print-toolbar { position: sticky; z-index: 10; top: 0; display: flex; justify-content: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
.ipp-document { width: min(100% - 28px, 210mm); min-height: 297mm; margin: 22px auto 45px; padding: 18mm 17mm 13mm; background: #fff; box-shadow: 0 18px 50px rgba(20,44,70,.18); }
.ipp-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 11mm; border-bottom: 1px solid #d8e1e9; }
.ipp-header img { width: 48mm; height: 16mm; object-fit: contain; object-position: left center; }
.ipp-header > div { text-align: right; }
.ipp-header span, .ipp-header strong { display: block; }
.ipp-header span { color: var(--brand); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.ipp-header strong { margin-top: 3px; color: var(--muted); font-size: 9px; }
.ipp-cover { padding: 16mm 0 12mm; }
.ipp-cover h1 { margin: 4mm 0 2mm; color: var(--navy); font-size: 31px; line-height: 1.05; letter-spacing: -.04em; }
.ipp-cover p { margin: 0 0 6mm; color: var(--muted); }
.ipp-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 9mm; border: 1px solid var(--line); border-radius: 3mm; background: #f7fafc; }
.ipp-summary > div { min-width: 0; padding: 4mm; border-right: 1px solid var(--line); }
.ipp-summary > div:last-child { border-right: 0; }
.ipp-summary small, .ipp-summary strong { display: block; }
.ipp-summary small { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.ipp-summary strong { overflow: hidden; margin-top: 1mm; text-overflow: ellipsis; font-size: 9px; }
.ipp-section { display: grid; grid-template-columns: 13mm minmax(0,1fr); gap: 5mm; padding: 6mm 0; border-top: 1px solid var(--line); break-inside: avoid; }
.ipp-section > span { width: 10mm; height: 10mm; display: grid; place-items: center; border-radius: 3mm; background: var(--brand-soft); color: var(--brand); font-size: 8px; font-weight: 850; }
.ipp-section h2 { margin: 0 0 2mm; color: var(--navy); font-size: 13px; }
.ipp-section p { margin: 0; color: #35485d; font-size: 9.5px; line-height: 1.65; }
.ipp-commercial { margin-top: 8mm; overflow: hidden; border: 1px solid #a8d9cf; border-radius: 4mm; break-inside: avoid; }
.ipp-commercial > header { padding: 6mm; color: #fff; background: linear-gradient(115deg, #0d8175, #18a897); }
.ipp-commercial > header span { font-size: 7px; font-weight: 850; letter-spacing: .13em; }
.ipp-commercial > header h2 { margin: 1mm 0 0; font-size: 20px; }
.ipp-price { padding: 6mm; border-bottom: 1px solid #cae7e1; background: var(--aqua-soft); }
.ipp-price small, .ipp-price strong, .ipp-price span { display: block; }
.ipp-price small { color: #438079; font-size: 7px; text-transform: uppercase; }
.ipp-price strong { margin: 1mm 0; color: #0b7168; font-size: 25px; }
.ipp-price span { color: #4e7e78; font-size: 8px; }
.ipp-commercial-grid { display: grid; grid-template-columns: repeat(4,1fr); }
.ipp-commercial-grid > div { padding: 5mm; border-right: 1px solid #d9e9e5; }
.ipp-commercial-grid > div:last-child { border-right: 0; }
.ipp-commercial-grid small, .ipp-commercial-grid strong { display: block; }
.ipp-commercial-grid small { color: var(--muted); font-size: 7px; }
.ipp-commercial-grid strong { margin-top: 1mm; font-size: 11px; }
.ipp-commercial > p { margin: 0; padding: 4mm 6mm; border-top: 1px solid #d9e9e5; color: var(--muted); font-size: 7.5px; }
.ipp-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 12mm; padding-top: 5mm; border-top: 1px solid var(--line); color: var(--muted); font-size: 7px; }
.ipp-footer strong, .ipp-footer span { display: block; }
.ipp-footer strong { color: var(--brand); font-size: 9px; }

/* Error page */
.error-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.error-page > span { color: var(--brand); font-size: 78px; font-weight: 900; line-height: 1; letter-spacing: -.08em; opacity: .17; }
.error-page h2 { margin: 10px 0 5px; font-size: 26px; }
.error-page p { max-width: 520px; margin: 0 0 18px; color: var(--muted); }

@media (max-width: 1280px) {
  .topbar { grid-template-columns: minmax(150px, 1fr) minmax(220px, 350px) minmax(150px, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-editors { grid-template-columns: 1fr; }
  .payment-row { grid-template-columns: .8fr .7fr .7fr minmax(260px,1.2fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar: 238px; }
  .topbar { grid-template-columns: 1fr auto; }
  .topbar__search { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid__side { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid__side .insight-card { grid-column: 1 / -1; }
  .form-layout { grid-template-columns: 1fr; }
  .form-layout__side { position: static; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .sticky-actions { min-height: 100%; align-items: center; }
  .split-panel { grid-template-columns: 1fr; }
  .info-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .info-strip > div:nth-child(2) { border-right: 0; }
  .info-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .payment-row { grid-template-columns: repeat(3,1fr); }
  .payment-row > form { grid-column: 1 / -1; }
  .login-shell { grid-template-columns: 1fr 430px; }
  .login-brand { padding: 38px; }
  .login-feature-grid { grid-template-columns: 1fr; max-width: 270px; }
  .login-feature-grid > div:nth-child(n+2) { display: none; }
}

@media (max-width: 820px) {
  :root { --topbar: 64px; }
  .sidebar { width: min(86vw, 290px); transform: translateX(-105%); transition: transform 220ms ease; box-shadow: 15px 0 45px rgba(17,43,73,.2); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar__brand { height: var(--topbar); }
  .sidebar__close { display: inline-flex !important; }
  .sidebar-backdrop { position: fixed; z-index: 45; inset: 0; display: block; pointer-events: none; opacity: 0; background: rgba(8,31,56,.38); backdrop-filter: blur(2px); transition: opacity 220ms ease; }
  body.sidebar-open .sidebar-backdrop { pointer-events: auto; opacity: 1; }
  .main { margin-left: 0; }
  .topbar { height: var(--topbar); grid-template-columns: auto 1fr auto; gap: 9px; padding: 0 13px; }
  .topbar__menu { display: inline-flex !important; }
  .topbar__title h1 { font-size: 17px; }
  .topbar__actions > .btn, .topbar__actions > .button-row { display: none; }
  .topbar__avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: #fff; font-size: 9px; font-weight: 850; }
  .content { padding: 17px 13px 28px; }
  .hero { min-height: 145px; padding: 23px; }
  .hero__spark { width: 53px; height: 53px; border-radius: 16px; font-size: 24px; }
  .dashboard-grid__side { grid-template-columns: 1fr; }
  .dashboard-grid__side .insight-card { grid-column: auto; }
  .form-grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .quick-status { align-items: stretch; flex-wrap: wrap; }
  .quick-status .field { width: calc(50% - 5px); }
  .quick-status > .input { min-width: 200px; }
  .case-hero { align-items: flex-start; flex-direction: column; }
  .case-hero__date { width: 100%; min-width: 0; text-align: left; }
  .clinical-grid { grid-template-columns: 1fr; }
  .finance-summary { gap: 12px; }
  .people-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 28px 24px 34px; }
  .login-brand > img { width: 170px; }
  .login-brand > div:nth-of-type(1) { padding: 55px 0 20px; }
  .login-brand h1 { max-width: 520px; font-size: 44px; }
  .login-brand p { font-size: 15px; }
  .login-feature-grid { display: none; }
  .login-panel { min-height: 520px; padding: 28px 18px; }
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .topbar__title h1 { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { min-height: 170px; }
  .hero__spark { display: none; }
  .metrics-grid, .metrics-grid--3, .metrics-grid--4 { grid-template-columns: 1fr; gap: 10px; }
  .metric { min-height: 88px; }
  .metric__content strong { font-size: 24px; }
  .card__header { align-items: flex-start; padding: 14px; }
  .card__body { padding: 14px; }
  .status-chart__row { grid-template-columns: 112px minmax(70px,1fr) 25px; gap: 8px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-search, .field--compact { width: 100%; min-width: 0; }
  .filter-bar .btn { width: 100%; }
  .table-wrap { display: none; }
  .mobile-list { display: grid; }
  .mobile-case-card { display: block; padding: 15px; border-bottom: 1px solid var(--line); }
  .mobile-case-card:last-child { border-bottom: 0; }
  .mobile-case-card__top, .mobile-case-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; flex-wrap: wrap; }
  .mobile-case-card__top > strong { color: var(--brand); }
  .mobile-case-card h3 { margin: 11px 0 2px; font-size: 14px; }
  .mobile-case-card p { margin: 0 0 10px; color: var(--muted); font-size: 10px; }
  .mobile-case-card__meta em { margin-left: auto; color: var(--muted); font-size: 9px; font-style: normal; }
  .form-grid--2, .form-grid--3 { grid-template-columns: 1fr; }
  .form-layout__side { grid-template-columns: 1fr; }
  .sticky-actions { min-height: 0; }
  .sticky-actions .btn { flex: 1; }
  .case-section { padding: 16px 13px; border-radius: var(--radius); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > .btn { width: 100%; }
  .info-strip { grid-template-columns: 1fr; }
  .info-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .info-strip > div:last-child { border-bottom: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item { grid-template-columns: 40% 60%; }
  .approval-panel { flex-direction: column; }
  .approval-actions { min-width: 0; }
  .file-row { align-items: flex-start; flex-wrap: wrap; }
  .file-row__actions { width: 100%; padding-left: 51px; }
  .file-row__actions .btn { flex: 1; }
  .payment-row { grid-template-columns: repeat(2,1fr); }
  .payment-row > div:nth-child(3) { grid-column: 1 / -1; }
  .payment-row > form { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .payment-row > form .btn { grid-column: 1 / -1; }
  .finance-summary { width: 100%; justify-content: space-between; }
  .finance-summary span { text-align: left; }
  .note-form > div { align-items: flex-start; flex-direction: column; }
  .note-form > div .btn { width: 100%; margin-left: 0; }
  .note header { flex-wrap: wrap; }
  .note header time { width: 100%; margin-left: 0; }
  .person-card__actions .btn { flex: 1; }
  .plan-editor .form-grid { grid-template-columns: 1fr 1fr; }
  .table-card .empty-state { min-height: 230px; }
  .print-toolbar { flex-wrap: wrap; }
  .ipp-document { width: 100%; min-height: 0; margin: 0; padding: 20px 17px; box-shadow: none; }
  .ipp-header { align-items: flex-start; flex-direction: column; padding-bottom: 18px; }
  .ipp-header > div { text-align: left; }
  .ipp-header img { width: 170px; height: auto; }
  .ipp-summary { grid-template-columns: repeat(2,1fr); }
  .ipp-summary > div:nth-child(2) { border-right: 0; }
  .ipp-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ipp-section { grid-template-columns: 36px minmax(0,1fr); gap: 12px; }
  .ipp-commercial-grid { grid-template-columns: repeat(2,1fr); }
  .ipp-commercial-grid > div:nth-child(2) { border-right: 0; }
  .ipp-commercial-grid > div:nth-child(-n+2) { border-bottom: 1px solid #d9e9e5; }
  .login-brand h1 { font-size: 37px; }
  .login-card { padding: 26px 20px; }
}

@media print {
  @page { size: A4; margin: 0; }
  body.print-body { background: #fff; }
  .print-toolbar { display: none !important; }
  .ipp-document { width: 210mm; min-height: 297mm; margin: 0; padding: 16mm 16mm 12mm; box-shadow: none; }
  .ipp-section, .ipp-commercial { break-inside: avoid; }
  .ipp-header, .ipp-footer { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
