/* Appearance only: no changes to fields, business rules, chart data or actions. */
:root {
  --ink: #292c33;
  --muted: #626770;
  --line: #e3e2e1;
  --paper: #f7f6f4;
  --brand: #a8323e;
  --brand-hover: #8b2732;
  --brand-soft: #fcf0f0;
  --brand-line: #e6bfc2;
  --green: var(--brand);
  --lime: #f5d9dc;
  --red: #b42332;
}

body {
  font-size: 15px;
  line-height: 1.6;
}
.text-xs {
  font-size: 13px;
  line-height: 1.6;
}
.text-sm {
  font-size: 15px;
  line-height: 1.6;
}

/* White navigation with restrained red brand and selected state. */
.sidebar {
  background: #fff;
  color: var(--muted);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  overflow-y: auto;
}
.brand {
  color: var(--brand);
  padding-bottom: 24px;
  letter-spacing: 0.2px;
}
.brand small {
  color: var(--muted);
  font-size: 10px;
}
.brand img {
  flex-shrink: 0;
}
.nav-caption {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  padding-top: 16px;
}
.nav-link {
  color: #4d525c;
  font-size: 15px;
  padding: 11px 14px;
}
.nav-link:hover {
  background: #f7f5f4;
  color: var(--ink);
}
.nav-link.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.nav-link.active:after {
  background: var(--brand);
}
.sidebar-bottom {
  border-color: var(--line);
  color: var(--muted);
  padding-top: 18px;
  font-size: 12px;
}
.sidebar-bottom .bg-lime-200 {
  background: var(--brand);
}
.sidebar-bottom .opacity-50 {
  opacity: 1;
}
.topbar {
  height: 68px;
  padding: 0 28px;
}
.crumb {
  color: var(--muted);
  font-size: 13px;
}
.crumb strong {
  color: var(--ink);
}
.avatar {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}

/* Recover space above the content without hiding any filter or explanation. */
.main {
  padding: 20px 28px 40px;
}
.main > .flex:first-child {
  flex-wrap: wrap;
  row-gap: 8px;
  margin-bottom: 12px;
}
.page-head {
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 26px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.page-head .subtitle {
  margin: 0;
}
.subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.filterbar {
  padding: 16px 18px;
  margin-bottom: 16px;
  gap: 12px;
}
.filterbar .field {
  min-width: 146px;
  max-width: 240px;
}
.filterbar .wide {
  min-width: 210px;
}

/* Forms and controls: readable text with matching control height. */
.field {
  gap: 6px;
}
.field label,
.field .multi-label {
  color: #505660;
  font-size: 14px;
  line-height: 1.5;
}
.field input,
.field select,
.field textarea,
.search-input {
  border-color: #c9cbd0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  min-height: 42px;
  padding: 9px 11px;
}
.filterbar .field input,
.filterbar .field select {
  font-size: 14px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--brand);
  border-color: var(--brand);
  outline-offset: 2px;
}
.search-input:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.field input::placeholder,
.field textarea::placeholder,
.search-input::placeholder {
  color: #737880;
  opacity: 1;
}
.field input[readonly] {
  background: #f3f3f2;
  color: var(--muted);
}
.field textarea {
  min-height: 108px;
  line-height: 1.7;
}
.field .hint {
  color: var(--muted);
  font-size: 13px;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
}
.btn {
  color: #424852;
  border-color: #c9cbd0;
  font-size: 14px;
  min-height: 42px;
  padding: 9px 14px;
  line-height: 1.5;
}
.btn:hover {
  color: var(--brand);
  background: #fdf5f5;
  border-color: var(--brand-line);
}
.btn.primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.btn.primary:hover {
  color: #fff;
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.btn.small {
  font-size: 13px;
  min-height: 34px;
  padding: 6px 10px;
}
.btn.danger {
  color: #b42332;
  background: #fff;
  border-color: #d6a1a7;
}
.btn.danger:hover {
  color: #9b1d2a;
  background: #fff0f0;
  border-color: #b42332;
}
.text-button {
  color: var(--brand);
  font-size: 14px;
  line-height: 1.5;
}
.checkline {
  font-size: 14px;
}
.required {
  color: #b42332;
}

/* Keep status colors meaningful; they are not brand decoration. */
.pill {
  font-size: 13px;
  line-height: 1.5;
  color: #535965;
  background: #eff0f2;
}
.pill.green {
  color: #276143;
  background: #eaf4ed;
}
.pill.amber {
  color: #805809;
  background: #fff3d6;
}
.pill.red {
  color: #a32b38;
  background: #fcecef;
}
.pill.blue {
  color: #315f8e;
  background: #eaf1fa;
}

.panel-title {
  border-color: #ecebea;
  padding: 17px 20px;
  flex-wrap: wrap;
}
.panel-title h2 {
  font-size: 16px;
}
.panel-body {
  padding: 20px;
}
.stat {
  padding: 18px 20px;
}
.stat.featured {
  background: #fff5f3;
  border-color: #ecd0d0;
}
.stat-top {
  color: #545a64;
  font-size: 14px;
}
.stat-top svg {
  color: #8a6470;
}
.stat-value {
  font-size: 30px;
  line-height: 1.4;
  margin: 12px 0 8px;
  letter-spacing: -0.6px;
}
.stat-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.task-row {
  border-color: #ecebea;
}
.task-date {
  background: #f3f0ed;
  width: 46px;
  height: 48px;
  font-size: 17px;
}
.task-date small {
  color: var(--muted);
  font-size: 12px;
}
.task-name {
  font-size: 15px;
}
.task-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.bar-row {
  font-size: 14px;
}
.bar-track {
  background: #f0eceb;
}
.bar-fill {
  background: #bf747d;
}
.bar-value {
  font-size: 13px;
  color: var(--muted);
}

/* Tables retain all columns and scroll within their own container. */
table {
  font-size: 14px;
  line-height: 1.6;
}
th {
  color: #555b65;
  background: #f8f7f6;
  font-weight: 600;
  padding: 13px 14px;
}
td {
  padding: 13px 14px;
  border-color: #ecebea;
}
tbody tr:hover {
  background: #fff8f7;
}
.cell-main {
  font-size: 15px;
  text-align: left;
  min-width: 150px;
}
.table-wrap td {
  min-width: 88px;
}
.table-wrap .bulk-cell {
  min-width: 42px;
}
.cell-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.pager {
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.pager select {
  border: 1px solid #c9cbd0;
  border-radius: 6px;
  min-height: 34px;
  padding: 4px 8px;
  color: var(--ink);
  background: #fff;
}
.bulk-toolbar {
  color: #555b65;
  font-size: 14px;
}
.bulk-toolbar .hint {
  color: var(--muted);
  font-size: 13px;
}
.bulk-cell input,
.export-options input,
.field .multi-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
.empty {
  color: var(--muted);
  font-size: 14px;
}
.empty strong {
  color: #4d525c;
  font-size: 16px;
}
.note {
  color: #5b6068;
  background: #f3f2f0;
  border-color: #e1dfdc;
  font-size: 13px;
  line-height: 1.7;
}
.notice {
  border-color: #c87880;
  color: #5b6068;
  font-size: 13px;
  line-height: 1.7;
}
.error-box {
  color: #a32b38;
  background: #fff0f0;
  font-size: 14px;
}
.trend-day {
  font-size: 12px;
  color: var(--muted);
}
.trend-day > span:last-child {
  white-space: nowrap;
  align-self: center;
}
.trend-column {
  background: #dba4a9;
}
.trend-day:nth-child(3n) .trend-column {
  background: #b85562;
}

/* Dropdown stacking and native hidden/disabled behavior remain untouched. */
.multi-select > summary {
  border-color: #c9cbd0;
  color: var(--ink);
  font-size: 15px;
  min-height: 42px;
  padding: 9px 30px 9px 11px;
  line-height: 1.5;
}
.filterbar .multi-select > summary {
  font-size: 14px;
}
.multi-select > summary:focus-visible {
  outline-color: var(--brand);
}
.multi-panel {
  border-color: #d3d0d0;
  box-shadow: 0 12px 32px #30272a20;
}
.multi-tools {
  font-size: 13px;
  color: var(--muted);
}
.field .multi-option {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
.field .multi-option:hover {
  background: var(--brand-soft);
}
.multi-option small {
  color: var(--muted);
}
.multi-label .btn {
  font-size: 13px;
}

/* Pie slice colors, percentages, ordering and label geometry are preserved. */
.pie-name {
  font-size: 13px;
  fill: var(--ink);
}
.pie-count {
  font-size: 13px;
  fill: #555b65;
}
.pie-percent {
  font-size: 13px;
  fill: var(--ink);
}
.pie-total {
  fill: var(--ink);
}
.pie-total-caption {
  font-size: 12px;
  fill: #555b65;
}
.distribution-other summary {
  background: #f5f1f1;
  color: var(--brand);
  font-size: 14px;
}
.export-group {
  border-color: var(--line);
}
.export-group legend {
  color: var(--brand);
  font-size: 15px;
}
.export-options label {
  font-size: 14px;
}

/* Dialogs grow only enough to accommodate readable form text. */
dialog {
  border-color: #d8d5d3;
  width: min(840px, 94vw);
  box-shadow: 0 20px 90px #29242a30;
}
dialog::backdrop {
  background: #28252b66;
}
.modal-head {
  padding: 18px 24px;
}
.modal-head h2 {
  font-size: 20px;
}
.modal-body {
  padding: 20px 24px;
}
.modal-foot {
  background: #fcfbfa;
  padding: 15px 24px;
  flex-wrap: wrap;
}
.form-grid {
  gap: 16px 20px;
}
.section-label {
  font-size: 15px;
}
.section-label:before {
  background: var(--brand);
}
.section-label small {
  font-size: 13px;
  color: var(--muted);
}
.detail-grid dt {
  color: var(--muted);
  font-size: 14px;
}
.detail-grid dd {
  font-size: 15px;
  line-height: 1.7;
}
.timeline {
  border-color: #e4cbcd;
}
.timeline-item:before {
  background: #bb7880;
}
.timeline-item p {
  font-size: 15px;
}
.photo-grid img {
  border-color: var(--line);
}
.toast {
  font-size: 14px;
  background: #315d49;
  box-shadow: 0 4px 25px #29242a22;
}
.toast.error {
  background: #a32b38;
}
.loading-screen,
.skeleton {
  color: var(--muted);
}
.audit-json {
  font-size: 13px;
  background: #f6f5f4;
  border-color: var(--line);
}
.switches button.active {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}

.login-story {
  background: #fff3f1;
  color: var(--ink);
  padding: 48px 10%;
  border-right: 1px solid #ecdada;
}
.login-story .brand {
  color: var(--brand);
}
.login-story h1 em {
  color: var(--brand);
}
.login-story p {
  color: #62616a;
  font-size: 15px;
}
.login-story .decor {
  border-color: #ddb6bc;
}
.login-form {
  background: #fff;
}
.login-card {
  width: 380px;
  max-width: 100%;
}
.login-foot {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .main {
    padding: 18px 22px 36px;
  }
  .topbar {
    padding: 0 22px;
  }
  .sidebar {
    width: 224px;
  }
  .workspace {
    margin-left: 224px;
  }
  .stat {
    padding: 16px;
  }
}
@media (max-width: 850px) {
  .workspace {
    margin-left: 0;
  }
  .main {
    padding: 16px;
  }
  .topbar {
    height: auto;
    min-height: 65px;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .topbar > .flex {
    flex-wrap: wrap;
    gap: 10px;
  }
  .filterbar .field {
    max-width: none;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .modal-body {
    padding: 18px;
  }
  .modal-head,
  .modal-foot {
    padding: 16px 18px;
  }
  .panel-title {
    padding: 16px;
  }
  .panel-body {
    padding: 16px;
  }
  .task-row {
    flex-wrap: wrap;
  }
}
