/* FABIM premium operational design system */
:root {
  --app-navy: #1a2d41;
  --app-bronze: #c4b19f;
  --app-muted: #9aa7b0;
  --app-neutral: #828282;
  --app-charcoal: #353535;
  --app-bg: #090f1b;
  --app-bg-alt: #0d1625;
  --app-surface: #111c2e;
  --app-surface-raised: #16253a;
  --app-surface-soft: #0d192a;
  --app-line: rgba(154, 167, 176, 0.22);
  --app-line-strong: rgba(196, 177, 159, 0.42);
  --app-text: #f7f9fc;
  --app-text-soft: #c8d1da;
  --app-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
  --app-shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.16);
  --app-radius: 8px;
  --app-radius-small: 6px;
  --bg: var(--app-bg);
  --bg-2: var(--app-bg-alt);
  --panel: var(--app-surface);
  --panel-2: var(--app-surface-soft);
  --panel-3: var(--app-surface-raised);
  --border: var(--app-line);
  --border-soft: rgba(154, 167, 176, 0.15);
  --text: var(--app-text);
  --muted: var(--app-muted);
  --accent: var(--app-bronze);
  --thead: #1b2a3e;
  --thead-text: #e5d3c1;
  --row-odd: #111e31;
  --row-even: #0d192a;
  --row-hover: #1b2d45;
  --button-text: #102238;
  --chart-grid: rgba(154, 167, 176, 0.18);
  font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
}

html.light {
  --app-bg: #f2f5fa;
  --app-bg-alt: #e9eff6;
  --app-surface: #ffffff;
  --app-surface-raised: #f5f8fc;
  --app-surface-soft: #edf2f8;
  --app-line: rgba(26, 45, 65, 0.15);
  --app-line-strong: rgba(155, 128, 104, 0.38);
  --app-text: #16243a;
  --app-text-soft: #485a70;
  --app-shadow: 0 18px 46px rgba(29, 45, 68, 0.12);
  --app-shadow-soft: 0 10px 28px rgba(29, 45, 68, 0.08);
  --bg: var(--app-bg);
  --bg-2: var(--app-bg-alt);
  --panel: var(--app-surface);
  --panel-2: var(--app-surface-soft);
  --panel-3: var(--app-surface-raised);
  --border: var(--app-line);
  --border-soft: rgba(26, 45, 65, 0.09);
  --text: var(--app-text);
  --muted: #687789;
  --accent: #9b8068;
  --thead: #dfe7f0;
  --thead-text: #21344a;
  --row-odd: #ffffff;
  --row-even: #f2f6fa;
  --row-hover: #e7eef6;
  --button-text: #14263d;
  --chart-grid: rgba(26, 45, 65, 0.12);
}

html { min-height: 100%; background: var(--app-bg); }

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(26, 45, 65, 0.34), transparent 38%),
    linear-gradient(180deg, var(--app-bg), var(--app-bg-alt));
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { letter-spacing: 0; }

button,
input,
select,
textarea,
dialog { transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--app-bronze) 78%, white);
  outline-offset: 2px;
}

h1 { color: var(--app-text); font-size: 24px; font-weight: 750; line-height: 1.2; }
h2 { color: var(--app-text); font-size: 17px; font-weight: 700; line-height: 1.3; }
.eyebrow { color: var(--app-bronze); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.muted { color: var(--muted); }

/* Application shell */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 72px;
  padding: 10px clamp(18px, 2.2vw, 36px);
  border-bottom: 1px solid var(--app-line);
  background: linear-gradient(105deg, #17283b 0%, var(--app-navy) 48%, #10243a 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--app-bronze), var(--app-muted), transparent);
  opacity: 0.72;
}

.topbar .brand-logo { width: 118px; }

.account {
  min-height: 42px;
  gap: 10px;
  color: #c5ced7;
}

.account > span {
  max-width: 190px;
  overflow: hidden;
  padding: 0 4px;
  color: #dce3e9;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account button,
.theme-btn,
.alerts-button {
  min-width: 38px;
  min-height: 38px;
  border-color: rgba(196, 177, 159, 0.48);
  background: rgba(8, 17, 29, 0.34);
  color: #e4d4c4;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.account button:hover,
.theme-btn:hover,
.alerts-button:hover {
  border-color: var(--app-bronze);
  background: rgba(196, 177, 159, 0.13);
  color: #ffffff;
  transform: translateY(-1px);
}

.alerts-button span {
  top: -6px;
  right: -6px;
  border: 2px solid var(--app-navy);
  background: linear-gradient(145deg, #e3d2c1, #aa917a);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}

.view-tabs {
  position: sticky;
  top: 72px;
  z-index: 60;
  min-height: 48px;
  align-items: end;
  gap: 6px;
  padding: 7px clamp(18px, 2.2vw, 36px) 0;
  border-bottom: 1px solid var(--app-line);
  background: color-mix(in srgb, var(--app-surface) 94%, transparent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
}

.view-tab {
  position: relative;
  min-height: 40px;
  padding: 8px 15px 10px;
  border: 0;
  border-radius: 6px 6px 0 0;
  color: var(--app-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.view-tab::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--app-bronze), #d9c7b6);
  box-shadow: 0 0 10px rgba(196, 177, 159, 0.5);
  opacity: 0;
  transform: scaleX(0.55);
  transition: opacity 160ms ease, transform 160ms ease;
}

.view-tab:hover,
.view-tab.is-active {
  color: var(--app-text);
  background: linear-gradient(180deg, rgba(196, 177, 159, 0.1), rgba(196, 177, 159, 0.03));
}

.view-tab.is-active::after { opacity: 1; transform: scaleX(1); }

.dashboard-content {
  width: min(100%, 1840px);
  margin: 0 auto;
  padding: 28px clamp(18px, 2.2vw, 34px) 40px;
}

.view-heading {
  min-height: 76px;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--app-line);
}

.view-heading > div { min-width: 0; }
.view-heading h1 { margin-top: 5px; }
.view-heading .muted { margin-top: 4px; color: var(--muted); }
.view-actions { flex-wrap: wrap; }
.status-message { color: var(--app-bronze); font-size: 13px; font-weight: 600; }
.status-message.error, .error { color: #f5a9a9; }

/* Commands and fields */
button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--app-radius-small);
  background: linear-gradient(145deg, #d8c5b3, #b59d87);
  color: #13263b;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.14), inset 0 1px rgba(255, 255, 255, 0.35);
  font-size: 13px;
  font-weight: 720;
}

button:hover {
  border-color: #e1d0c0;
  background: linear-gradient(145deg, #e3d1c0, #c2aa94);
  color: #0f2135;
  transform: translateY(-1px);
}

button:active { transform: translateY(0); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.12); }

.button-secondary,
.table-action,
.filter-actions button:not(:first-child) {
  border-color: var(--app-line-strong);
  background: linear-gradient(145deg, rgba(196, 177, 159, 0.08), rgba(154, 167, 176, 0.03));
  color: var(--app-bronze);
  box-shadow: none;
}

.button-secondary:hover,
.table-action:hover,
.filter-actions button:not(:first-child):hover {
  border-color: var(--app-bronze);
  background: rgba(196, 177, 159, 0.12);
  color: var(--app-text);
}

label { gap: 6px; color: var(--app-text-soft); font-size: 12px; font-weight: 620; }

input,
select,
textarea,
.entry-form textarea {
  min-height: 40px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-small);
  background: linear-gradient(180deg, var(--app-surface-soft), color-mix(in srgb, var(--app-surface-soft) 92%, black));
  color: var(--app-text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

input:hover,
select:hover,
textarea:hover { border-color: rgba(196, 177, 159, 0.38); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--app-bronze);
  background: var(--app-surface-soft);
  box-shadow: 0 0 0 3px rgba(196, 177, 159, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

input::placeholder,
textarea::placeholder { color: color-mix(in srgb, var(--app-muted) 68%, transparent); }

select { color-scheme: dark; }
html.light select { color-scheme: light; }

/* Operational panels */
.entry-form,
.entries-panel,
.project-card,
.insight-card,
.chart-card,
.team-bar-card {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface) 97%, var(--app-bronze)), var(--app-surface));
  box-shadow: var(--app-shadow-soft);
}

.entry-form { gap: 16px; padding: 22px; }
.entries-panel { padding: 20px; }
.form-title-row { min-height: 34px; padding-bottom: 10px; border-bottom: 1px solid var(--app-line); }
.table-header { min-height: 42px; align-items: center; margin-bottom: 14px; }
.filters { align-items: end; gap: 9px; }
.filters label { min-width: 135px; width: 150px; }
.filters input, .filters select { min-height: 36px; }

.consultation-filters {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: linear-gradient(110deg, rgba(196, 177, 159, 0.05), rgba(154, 167, 176, 0.025));
  box-shadow: var(--app-shadow-soft);
}

.filter-actions { align-items: center; }
.project-card > header { background: linear-gradient(100deg, rgba(196, 177, 159, 0.06), transparent 46%); }
.project-card > header > span { color: var(--app-bronze); }

/* Tables */
.table-wrap,
.consultation-table-wrap {
  overflow: auto;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface-soft);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

table { color: var(--app-text-soft); font-size: 12px; }

th,
td {
  padding: 11px 12px;
  border-color: var(--app-line);
}

th {
  background: linear-gradient(180deg, #26384d, #192a3f);
  color: #e8d7c6;
  font-size: 11px;
  font-weight: 760;
  text-transform: none;
  box-shadow: inset 0 -1px rgba(196, 177, 159, 0.22);
}

th:last-child { background: linear-gradient(180deg, #26384d, #192a3f); }
tbody tr:nth-child(odd) td,
tbody tr:nth-child(odd) td:last-child { background: #111e31; }
tbody tr:nth-child(even) td,
tbody tr:nth-child(even) td:last-child { background: #0d192a; }
tbody tr:hover td,
tbody tr:hover td:last-child { background: #1a2d45; }
td:last-child { border-left: 1px solid var(--app-line); box-shadow: -10px 0 20px rgba(0, 0, 0, 0.08); }

.column-resizer::after { background: rgba(196, 177, 159, 0.35); }
.column-resizer:hover::after,
.is-resizing-column .column-resizer::after { background: var(--app-bronze); box-shadow: 0 0 8px rgba(196, 177, 159, 0.6); }

.table-action { min-height: 29px; padding: 4px 8px; font-size: 11px; }
.table-action.danger { color: #e8b8b8; border-color: rgba(216, 92, 92, 0.38); }
.table-action.danger:hover { background: rgba(216, 92, 92, 0.12); color: #ffd1d1; }

.status-badge {
  min-width: 108px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.status-menu,
.alerts-panel {
  border: 1px solid var(--app-line-strong);
  border-radius: var(--app-radius);
  background: linear-gradient(145deg, var(--app-surface-raised), var(--app-surface));
  box-shadow: var(--app-shadow);
}

.alerts-panel { top: 62px; padding: 16px; }
.alerts-panel-header { padding-bottom: 10px; border-bottom: 1px solid var(--app-line); }
.alert-item { border-color: var(--app-line); background: var(--app-surface-soft); color: var(--app-text); box-shadow: none; }
.alert-item:hover { border-color: var(--app-bronze); background: rgba(196, 177, 159, 0.08); color: var(--app-text); }

/* Dialogs */
dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--app-radius);
  background: linear-gradient(145deg, var(--app-surface-raised), var(--app-surface));
  color: var(--app-text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

dialog::backdrop { background: rgba(3, 8, 15, 0.72); }
dialog .entry-form { border: 0; background: transparent; box-shadow: none; }

/* Requests */
.requests-layout { grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); gap: 22px; }
#requests-view > .view-heading { margin-bottom: 20px; }
#requests-view .entry-form { position: sticky; top: 142px; }
#requests-view .entries-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }
.requests-panel-header { padding: 2px 2px 10px; border-bottom: 1px solid var(--app-line); }
.requests-panel-header > div { display: flex; align-items: center; gap: 12px; }
.live-state { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; color: var(--app-muted); font-size: 10px; }
.live-state span { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 9px rgba(74, 222, 128, 0.65); }

.recipient-field { color: var(--app-text-soft); font-size: 12px; font-weight: 620; }
.recipient-dropzone {
  min-height: 68px;
  border: 1px dashed rgba(196, 177, 159, 0.48);
  border-radius: var(--app-radius-small);
  background: rgba(196, 177, 159, 0.035);
}
.recipient-dropzone.is-dragover { border-color: var(--app-bronze); background: rgba(196, 177, 159, 0.1); }
.recipient-picker { gap: 7px; }
.person-token,
.recipient-chip {
  min-height: 34px;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  background: var(--app-surface-soft);
  color: var(--app-text-soft);
  box-shadow: none;
}
.person-token:hover { border-color: var(--app-bronze); background: rgba(196, 177, 159, 0.08); color: var(--app-text); }
.recipient-avatar,
.request-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid rgba(196, 177, 159, 0.42);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(196, 177, 159, 0.2), rgba(154, 167, 176, 0.06));
  color: #e3d3c4;
  font-size: 10px;
  font-weight: 800;
}

.requests-list { display: grid; gap: 14px; }
.request-card {
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: linear-gradient(145deg, var(--app-surface), color-mix(in srgb, var(--app-surface) 96%, var(--app-bronze)));
  box-shadow: var(--app-shadow-soft);
}

.request-card.is-highlighted { border-color: var(--app-bronze); box-shadow: 0 0 0 2px rgba(196, 177, 159, 0.12), 0 18px 46px rgba(0, 0, 0, 0.2); }
.request-card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--app-line); background: linear-gradient(100deg, rgba(196, 177, 159, 0.075), transparent 48%); }
.request-card-title { display: flex; min-width: 0; align-items: center; gap: 10px; }
.request-card-title > div { min-width: 0; }
.request-card-title h2 { overflow: hidden; color: var(--app-text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.request-card-title p { margin: 3px 0 0; color: var(--app-muted); font-size: 10px; }
.request-card-state { display: grid; justify-items: end; gap: 4px; }
.request-card-state span { color: var(--app-muted); font-size: 9px; }
.request-card-state strong { padding: 3px 7px; border: 1px solid var(--app-line-strong); border-radius: 5px; color: var(--app-bronze); background: rgba(196, 177, 159, 0.06); font-size: 9px; text-transform: capitalize; }
.request-recipients-summary { display: flex; gap: 8px; margin: 0; padding: 9px 16px; border-bottom: 1px solid var(--app-line); color: var(--app-text-soft); font-size: 10px; }
.request-recipients-summary span { color: var(--app-bronze); font-weight: 750; text-transform: uppercase; }
.request-messages { display: grid; gap: 9px; max-height: 360px; overflow: auto; padding: 14px 16px; background: rgba(4, 10, 18, 0.12); }
.request-message {
  width: min(84%, 720px);
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: var(--app-surface-soft);
  color: var(--app-text-soft);
}
.request-message.is-own { justify-self: end; border-color: rgba(196, 177, 159, 0.3); background: linear-gradient(145deg, rgba(196, 177, 159, 0.11), rgba(196, 177, 159, 0.045)); }
.request-message header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.request-message strong { color: var(--app-text); font-size: 10px; }
.request-message time { color: var(--app-muted); font-size: 9px; white-space: nowrap; }
.request-message p { margin: 0; color: var(--app-text-soft); font-size: 12px; white-space: pre-wrap; }
.request-reply-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 16px 15px; border-top: 1px solid var(--app-line); }
.request-reply-form input { min-height: 38px; }

/* Administration */
.admin-layout { grid-template-columns: minmax(310px, 370px) minmax(0, 1fr); }
.backup-panel { background: linear-gradient(120deg, rgba(196, 177, 159, 0.055), var(--app-surface) 44%); }
.backup-status div { border-color: var(--app-line); background: var(--app-surface-soft); }
.backup-status dt { color: var(--app-bronze); }
.backup-status dd { color: var(--app-text); }

/* Dashboard integration */
.fabim-report-shell { border-radius: var(--app-radius); box-shadow: var(--app-shadow-soft); }
.report-topbar { top: 120px; }
.report-topbar img { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.16)); }

/* Premium cohesion: access, modules and account settings */
.login-view {
  position: relative;
  isolation: isolate;
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(196, 177, 159, 0.08), transparent 36%),
    linear-gradient(180deg, #14263a, #0f2134);
}
.login-view::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 119px, rgba(154, 167, 176, 0.035) 120px);
}
.login-view .brand-logo { width: 168px; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.28)); }
.login-form {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  gap: 17px;
  padding: 30px;
  overflow: hidden;
  border-color: rgba(196, 177, 159, 0.4);
  background: linear-gradient(145deg, rgba(31, 51, 72, 0.98), rgba(20, 38, 58, 0.98));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35), inset 0 1px rgba(255, 255, 255, 0.055);
}
.login-form::before,
.entry-form::before,
.entries-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--app-bronze), var(--app-muted), transparent);
  opacity: 0.7;
}
.login-form h1 { font-size: 27px; }
.login-form label { color: #dce4eb; }
.login-form select,
.login-form input { min-height: 46px; border-color: rgba(154, 167, 176, 0.48); }
.login-form button[type="submit"] { min-height: 44px; margin-top: 2px; }

.entry-form,
.entries-panel { position: relative; overflow: hidden; }
.view-heading h1 { font-size: 26px; }
.view-heading .eyebrow { letter-spacing: 0.7px; }
.view-heading::before {
  content: "";
  align-self: stretch;
  width: 3px;
  margin-right: -7px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--app-bronze), var(--app-muted));
  box-shadow: 0 0 14px rgba(196, 177, 159, 0.28);
}
.view-tab:disabled { cursor: not-allowed; opacity: 0.34; }
.view-tab:disabled:hover { color: var(--app-muted); background: transparent; }

.report-topbar { grid-template-columns: 128px minmax(560px, 1fr) auto; }
.report-title strong {
  color: var(--report-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.report-period { align-items: flex-end; }
.report-period-control label { align-content: end; }
.report-period-control input,
.report-period-control button,
.report-period-badge { height: 34px; min-height: 34px; }
.report-nav { width: min(100%, 680px); }

.settings-layout { display: grid; grid-template-columns: minmax(260px, 0.72fr) minmax(480px, 1.28fr); gap: 18px; align-items: start; }
.first-access-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(196, 177, 159, 0.5);
  border-radius: var(--app-radius);
  background: linear-gradient(145deg, rgba(196, 177, 159, 0.12), rgba(26, 45, 65, 0.76));
  box-shadow: var(--app-shadow-soft), inset 0 1px rgba(255, 255, 255, 0.05);
}
.first-access-notice[hidden] + .settings-form { grid-column: 1 / -1; width: min(720px, 100%); }
.notice-icon {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--app-bronze);
  border-radius: 50%;
  color: #f2dfcc;
  background: rgba(196, 177, 159, 0.14);
  box-shadow: 0 0 18px rgba(196, 177, 159, 0.2);
  font-size: 18px;
  font-weight: 800;
}
.first-access-notice strong { display: block; margin: 2px 0 7px; color: var(--app-text); font-size: 16px; }
.first-access-notice p { margin: 0; color: var(--app-muted); font-size: 12px; line-height: 1.55; }
.settings-form { gap: 20px; padding: 24px; }
.settings-profile { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--app-line); }
.settings-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(196, 177, 159, 0.55);
  border-radius: 8px;
  color: #f0dfcf;
  background: linear-gradient(145deg, rgba(196, 177, 159, 0.18), rgba(154, 167, 176, 0.08));
  box-shadow: 0 0 22px rgba(196, 177, 159, 0.12);
  font-weight: 800;
}
.settings-profile strong { display: block; color: var(--app-text); font-size: 16px; }
.settings-profile div span { display: block; margin-top: 3px; color: var(--app-muted); font-size: 11px; }
.password-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.password-grid label:first-child { grid-column: 1 / -1; }
.password-guidance { margin: -4px 0 0; color: var(--app-muted); font-size: 11px; }

html.light .login-view { background: linear-gradient(145deg, #f7f9fc, #e7edf4); }
html.light .login-form { background: linear-gradient(145deg, #ffffff, #edf2f7); }
html.light .login-form label { color: #26394e; }
html.light .first-access-notice { background: linear-gradient(145deg, #fffaf4, #eef3f7); }

@media (max-width: 1320px) {
  .report-topbar { grid-template-columns: 112px minmax(520px, 1fr); }
  .report-period { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 1024px) {
  .settings-layout { grid-template-columns: 1fr; }
  .first-access-notice[hidden] + .settings-form { grid-column: auto; }
}

@media (max-width: 680px) {
  .password-grid { grid-template-columns: 1fr; }
  .password-grid label:first-child { grid-column: auto; }
  .settings-form { padding: 18px; }
}

/* Light theme parity */
html.light body {
  background:
    linear-gradient(135deg, rgba(196, 177, 159, 0.15), transparent 34%),
    linear-gradient(180deg, #f5f7fb, #edf2f8);
}

html.light .topbar { background: linear-gradient(105deg, #ffffff, #f6f8fb 58%, #edf2f7); }
html.light .topbar::after { opacity: 0.48; }
html.light .account { color: #5f6e7e; }
html.light .account > span { color: #31445a; }
html.light .account button,
html.light .theme-btn,
html.light .alerts-button { border-color: rgba(155, 128, 104, 0.38); background: rgba(255, 255, 255, 0.72); color: #7e6754; }
html.light .view-tabs { background: rgba(255, 255, 255, 0.94); }
html.light button { color: #14263d; }
html.light .button-secondary,
html.light .table-action { color: #806852; }
html.light input,
html.light select,
html.light textarea,
html.light .entry-form textarea { background: linear-gradient(180deg, #ffffff, #f5f8fb); color: var(--app-text); }
html.light th,
html.light th:last-child { background: linear-gradient(180deg, #e8eef5, #dbe4ed); color: #26394e; }
html.light tbody tr:nth-child(odd) td,
html.light tbody tr:nth-child(odd) td:last-child { background: #ffffff; }
html.light tbody tr:nth-child(even) td,
html.light tbody tr:nth-child(even) td:last-child { background: #f2f6fa; }
html.light tbody tr:hover td,
html.light tbody tr:hover td:last-child { background: #e7eef6; }
html.light .request-avatar,
html.light .recipient-avatar { color: #745e4c; }
html.light .request-messages { background: rgba(26, 45, 65, 0.025); }
html.light .request-message { background: #f1f5f9; }
html.light .request-message.is-own { background: linear-gradient(145deg, #f2eae2, #f7f3ee); }
html.light .alert-item { background: #f4f7fa; color: var(--app-text); }
html.light dialog::backdrop { background: rgba(21, 34, 50, 0.38); }

@media (max-width: 1240px) {
  .entry-layout,
  .admin-layout { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .requests-layout { grid-template-columns: 330px minmax(0, 1fr); }
  .account > span { max-width: 130px; }
}

@media (max-width: 1024px) {
  .topbar { position: relative; }
  .view-tabs { position: sticky; top: 0; }
  .dashboard-content { padding-top: 22px; }
  .entry-layout,
  .admin-layout,
  .requests-layout { grid-template-columns: minmax(0, 1fr); }
  #requests-view .entry-form { position: static; }
  .report-topbar { top: 48px; }
  .consultation-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar { min-height: 66px; padding: 8px 14px; }
  .topbar .brand-logo { width: 94px; }
  .account { gap: 6px; }
  .account > span { display: none; }
  .view-tabs { padding-right: 12px; padding-left: 12px; }
  .view-tab { padding-right: 11px; padding-left: 11px; }
  .dashboard-content { padding: 20px 14px 32px; }
  .view-heading { align-items: flex-start; }
  .entry-form,
  .entries-panel { padding: 16px; }
  .consultation-filters { grid-template-columns: 1fr; padding: 14px; }
  .filter-actions { grid-column: auto; }
  .request-card-header { align-items: flex-start; }
  .request-card-state span { display: none; }
  .request-message { width: 94%; }
  .request-reply-form { grid-template-columns: 1fr; }
  .requests-panel-header > div { align-items: flex-start; flex-direction: column; gap: 2px; }
  .alerts-panel { right: 12px; }
}

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