:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --panel: #ffffff;
  --panel-soft: #f2f4f7;
  --text: #12263c;
  --muted: #657080;
  --line: #d9dee7;
  --brand: #12263c;
  --brand-dark: #0c1a2a;
  --brand-soft: #1c3858;
  --accent: #d6b16d;
  --danger: #b84d4d;
  --blue: #315f92;
  --success: #2f7d5b;
  --warning: #a97818;
  --shadow: 0 18px 60px rgba(18, 38, 60, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--brand);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 28px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
}

button:hover {
  border-color: var(--brand-soft);
}

.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.primary:hover {
  background: var(--brand-soft);
  border-color: var(--brand-soft);
}

.danger-text {
  color: var(--danger);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--brand);
  color: #fff;
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--brand);
  font-weight: 900;
  font-size: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.nav small {
  color: rgba(255, 255, 255, 0.72);
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 22px;
  padding-bottom: 22px;
}

.nav button {
  width: 100%;
  justify-content: flex-start;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  padding: 11px 12px;
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 20px;
  place-items: center;
  width: 20px;
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.nav button.active {
  border-left-color: var(--accent);
}

.nav button.active .nav-icon {
  color: var(--accent);
}

.form-section {
  display: grid;
  gap: 12px;
}

.permission-matrix {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.permission-module {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 12px;
}

.check-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  color: var(--text);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  white-space: nowrap;
}

.user-chip strong,
.user-chip span {
  display: block;
  font-size: 12px;
}

.user-chip span {
  color: var(--muted);
}

.user-chip button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.notification-button {
  position: relative;
  min-width: 36px;
  font-size: 15px !important;
}

.notification-button.has-notifications {
  border-color: var(--accent);
  background: #fff9e8;
}

.notification-button b {
  position: absolute;
  right: -6px;
  top: -7px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
  width: 100%;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

#global-search {
  width: min(360px, 42vw);
}

.global-search-results {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.search-category {
  display: grid;
  gap: 8px;
}

.search-category h3 {
  margin: 0;
  font-size: 14px;
}

.search-result-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.search-result-row:hover,
.search-result-row:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 10px 28px rgba(17, 72, 63, 0.13);
  outline: 0;
  transform: translateY(-1px);
}

.search-result-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.search-result-row small {
  color: var(--muted);
  line-height: 1.35;
}

.search-result-row em {
  flex: 0 0 auto;
  color: var(--brand);
  font-style: normal;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(20, 40, 34, 0.04);
}

.metric {
  padding: 16px;
}

.metric-link {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.metric-link:hover,
.metric-link:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 10px 28px rgba(17, 72, 63, 0.13);
  outline: 0;
  transform: translateY(-1px);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(214, 177, 109, 0.22), 0 1px 0 rgba(18, 38, 60, 0.04) !important;
}

.metric.warning {
  border-color: #e7c77a;
  background: #fff9e8;
}

.metric.blue {
  border-color: #c6d4e6;
  background: #f3f6fa;
}

.metric.danger {
  border-color: #e8b5b5;
  background: #fff1f1;
}

.smart-report {
  margin-bottom: 16px;
}

.import-panel {
  margin-bottom: 16px;
}

.fiscal-panel {
  margin-bottom: 16px;
}

.finance-launch-panel,
.finance-alert-panel,
.finance-governance-panel {
  margin-bottom: 16px;
}

.finance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.finance-actions button {
  min-height: 36px;
  font-weight: 900;
}

.finance-alert-panel .insight button {
  margin-top: 10px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.rs-work-panel {
  border-color: #cfd9e7;
}

.rs-action-grid,
.rs-candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rs-action-card {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
}

.rs-action-card.primary {
  border-color: #d6b16d;
  background: #fff9ea;
}

.rs-action-card strong {
  font-size: 15px;
}

.rs-action-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rs-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.rs-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rs-card-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.fiscal-metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.inline-filter {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-downloads {
  margin-bottom: 16px;
}

.reports-hub {
  min-height: 0;
  margin-bottom: 16px;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.report-option {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.report-option h3 {
  margin-top: 8px;
  font-size: 20px;
}

.report-option p {
  color: var(--muted);
  line-height: 1.5;
}

.ai-feedback-panel {
  margin-bottom: 16px;
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.report-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--brand);
  font-weight: 900;
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.report-actions button {
  font-weight: 800;
}

.report-metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  min-width: 0;
}

.command-indicator-card,
.command-indicator-row,
.command-indicator-tile {
  cursor: pointer;
}

.command-indicator-card,
.command-indicator-row {
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.command-indicator-card:hover,
.command-indicator-card:focus-visible,
.command-indicator-row:hover,
.command-indicator-row:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 10px 28px rgba(17, 72, 63, 0.13);
  outline: 0;
  transform: translateY(-1px);
}

.indicator-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.indicator-card-head h3 {
  margin: 0;
}

.indicator-card-head span,
.breadcrumb {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.indicator-detail {
  display: grid;
  gap: 14px;
}

.indicator-subpanel {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.indicator-table {
  margin-top: 8px;
}

.kpi-row,
.rank-row {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.kpi-row strong,
.rank-row strong {
  display: block;
  font-size: 13px;
}

.kpi-row span,
.rank-row span {
  color: var(--muted);
  font-size: 12px;
}

.kpi-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebe7;
}

.kpi-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(34px, 1fr));
  gap: 10px;
  align-items: end;
  height: 180px;
}

.bar-group {
  display: grid;
  gap: 6px;
  align-items: end;
  height: 100%;
  text-align: center;
}

.bars {
  display: flex;
  gap: 3px;
  align-items: end;
  justify-content: center;
  height: 145px;
  border-bottom: 1px solid var(--line);
}

.bar {
  width: 9px;
  min-height: 4px;
  border-radius: 999px 999px 0 0;
}

.bar.expected {
  background: var(--blue);
}

.bar.received {
  background: var(--brand);
}

.bar.expense {
  background: var(--accent);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 999px;
  background: var(--blue);
}

.chart-legend span:nth-child(2)::before {
  background: var(--brand);
}

.chart-legend span:nth-child(3)::before {
  background: var(--accent);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.insight {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.insight p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.insight.danger {
  border-left-color: var(--danger);
  background: #fff8f8;
}

.insight.warning {
  border-left-color: var(--accent);
  background: #fffaf0;
}

.insight.good {
  border-left-color: var(--brand);
  background: #f3faf7;
}

.compact {
  padding: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.command-section {
  margin-bottom: 16px;
}

.command-executive-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: stretch;
  padding: 30px;
  margin-bottom: 18px;
  border-radius: 8px;
  border: 1px solid rgba(198, 157, 84, .34);
  background:
    linear-gradient(135deg, rgba(198, 157, 84, .18) 0%, rgba(198, 157, 84, 0) 36%),
    linear-gradient(135deg, #061f1a 0%, #12382f 54%, #2f5d50 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(7, 28, 23, .24);
}

.command-release-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(198, 157, 84, .72);
  border-radius: 999px;
  background: rgba(198, 157, 84, .16);
  color: #f5d38a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.command-executive-hero h1 {
  margin: 4px 0 8px;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

.command-executive-hero p,
.command-executive-hero strong,
.command-executive-hero .eyebrow {
  color: rgba(255,255,255,.86);
}

.command-executive-hero strong {
  display: block;
  max-width: 820px;
  margin-top: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.command-hero-status {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
}

.command-hero-status span {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

.command-hero-status strong {
  margin: 0;
  font-size: 24px;
  color: #fff;
}

.command-hero-status small {
  color: rgba(255,255,255,.76);
}

.operational-hero {
  border-left: 4px solid var(--gold);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 68%, #fff8e6 100%);
}

.command-decision-panel {
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, #ffffff 0%, #f6f9f8 58%, #eef5f2 100%);
}

.command-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.chart-card {
  min-height: 260px;
}

.command-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
}

.command-kpi-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  min-height: 172px;
  padding: 16px;
  border: 1px solid #d9e3df;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.command-kpi-card:hover,
.command-kpi-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 14px 32px rgba(17, 72, 63, .14);
  outline: 0;
}

.command-kpi-card.warning {
  border-color: #e7c77a;
  background: #fffaf0;
}

.command-kpi-card.danger {
  border-color: #e8b5b5;
  background: #fff4f4;
}

.command-kpi-card.blue {
  border-color: #c8d8d3;
  background: #f7fbfa;
}

.command-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.command-kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-kpi-card strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.1;
  color: var(--brand-dark);
}

.command-kpi-card small {
  display: block;
  margin-top: 6px;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-kpi-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 170px;
}

.donut-chart {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 24px #fff;
}

.donut-chart span {
  width: 76px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  font-weight: 900;
  box-shadow: 0 1px 8px rgba(18, 38, 60, .1);
}

.donut-legend {
  display: grid;
  gap: 8px;
}

.donut-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
}

.donut-legend strong,
.donut-legend span {
  grid-column: 2;
}

.donut-legend span {
  color: var(--muted);
  font-size: 12px;
}

.swot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.swot-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.command-insight {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #fff;
}

.command-insight p,
.list-row small {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.command-insight small {
  color: var(--muted);
  font-size: 12px;
}

.command-insight button,
.list-row button {
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.command-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.command-entry-actions button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.command-table {
  margin-top: 10px;
}

.command-attachment-row td {
  padding-top: 0;
  background: #fbfcfb;
}

.command-data-alerts {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.no-margin {
  margin-bottom: 0;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.segmented button {
  min-height: 32px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(16, 38, 31, 0.1);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-soft);
  color: var(--brand);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.status.danger {
  background: #ffe8e8;
  color: var(--danger);
}

.status.warning {
  background: #fff4d8;
  color: #8a6412;
}

.status.blue {
  background: #eaf0f7;
  color: var(--brand);
}

.finance-operator-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.finance-alert-group {
  display: grid;
  gap: 8px;
}

.finance-alert-group h3 {
  margin: 0;
  font-size: 14px;
}

.finance-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.finance-settings label {
  display: inline-flex;
  grid-auto-flow: column;
  gap: 6px;
  align-items: center;
}

.finance-settings input[type="checkbox"] {
  width: auto;
  min-height: 0;
}

.finance-settings input[type="time"] {
  width: 120px;
}

.finance-alert-row {
  border-left: 4px solid var(--line);
}

.finance-alert-row.critica {
  border-left-color: var(--danger);
}

.finance-alert-row.alta {
  border-left-color: #c98511;
}

.finance-alert-row.media {
  border-left-color: var(--blue);
}

.notification-center {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 22, 18, 0.42);
}

.notification-center-card {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notification-center-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.column {
  background: #edf2ee;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 360px;
}

.column h3 {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.card {
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: none;
}

.card strong {
  display: block;
  margin-bottom: 8px;
}

.card small {
  color: var(--muted);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.document-card {
  display: grid;
  gap: 12px;
}

.document-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.document-filter-grid {
  margin: 14px 0;
}

.agenda-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.agenda-filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agenda-filter-grid select {
  min-width: 0;
}

.document-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ai-warning,
.document-ai-panel {
  border: 1px solid #efdcae;
  border-radius: 8px;
  background: #fff9e8;
  color: #684d0c;
  padding: 10px;
}

.ai-warning p,
.document-ai-panel p {
  margin: 0 0 6px;
}

.ai-warning p:last-child,
.document-ai-panel p:last-child {
  margin-bottom: 0;
}

.client-attachment-list a {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.calendar-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.agenda-alerts {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #efdcae;
  border-radius: 8px;
  background: #fff9e8;
}

.agenda-alerts > div:first-child {
  display: grid;
  gap: 3px;
}

.agenda-alerts strong {
  color: var(--brand-dark);
}

.agenda-alerts span {
  color: var(--muted);
  font-size: 12px;
}

.agenda-alert-list {
  display: grid;
  gap: 8px;
}

.agenda-alert-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border-color: #efdcae;
  background: #fff;
  text-align: left;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 36px));
}

.agenda-toast {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #efdcae;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #fffdf6;
  box-shadow: var(--shadow);
}

.task-toast {
  border-left-color: var(--brand);
  background: #f7fbf9;
}

.agenda-toast strong {
  display: block;
  color: var(--brand-dark);
  font-size: 14px;
}

.agenda-toast span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #fff;
}

.calendar-weekday {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #edf2ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 128px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.today {
  background: #fff9e8;
}

.muted-day {
  background: #f7f8f6;
}

.calendar-date {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

.today .calendar-date {
  background: var(--brand);
  color: #fff;
}

.calendar-events {
  display: grid;
  gap: 6px;
}

.calendar-event {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 0;
  padding: 7px;
  border-color: #c8d8d1;
  background: #eef7f3;
  text-align: left;
}

.calendar-event:hover,
.calendar-event:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 6px 16px rgba(17, 72, 63, 0.14);
  outline: 0;
}

.calendar-event.warning {
  border-color: #efdcae;
  background: #fff9e8;
}

.calendar-event.danger {
  border-color: #f0b7b0;
  background: #fff0ee;
}

.calendar-event.done {
  border-color: #c8d8d1;
  background: #f4f7f5;
  opacity: .78;
}

.row-warning td {
  background: #fff9e8;
}

.row-danger td {
  background: #fff0ee;
}

.row-done td {
  background: #f7f8f6;
}

.calendar-event strong,
.calendar-event span,
.calendar-event em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event strong {
  font-size: 12px;
}

.calendar-event span {
  color: var(--muted);
  font-size: 11px;
}

.calendar-event em {
  color: #8a6412;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.attachments {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.upload-button {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0 10px;
}

.upload-button input {
  display: none;
}

.attachment-list {
  display: grid;
  gap: 6px;
}

.attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  font-size: 13px;
}

.attachment-row a {
  color: var(--brand-dark);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-row span,
.small-text {
  font-size: 12px;
}

.mini-danger {
  min-height: 28px;
  padding: 0 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--brand);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.muted {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.actions button,
.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.actions .text-button {
  width: auto;
  min-width: 70px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.danger-button {
  color: var(--danger);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

dialog {
  width: min(780px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(12, 22, 18, 0.46);
}

.modal-card {
  padding: 18px;
}

.modal-card header,
.modal-card menu {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
  padding: 0;
}

.modal-card menu {
  justify-content: flex-end;
  margin: 18px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field.full {
  grid-column: 1 / -1;
}

.payment-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payment-summary span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payment-summary small {
  color: var(--muted);
  font-weight: 800;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-table-wrap {
  max-height: 360px;
}

.payment-table th,
.payment-table td {
  min-width: 130px;
}

.payment-table th:first-child,
.payment-table td:first-child {
  min-width: 76px;
}

.payment-table input,
.payment-table select {
  min-width: 120px;
}

.payment-table .payment-number {
  min-width: 66px;
}

.payment-ai {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payment-ai p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.register-history {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.register-entry {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.register-entry span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.register-entry p {
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty {
  padding: 24px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.contract-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.contract-card {
  display: grid;
  gap: 12px;
}

.contract-card .actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #global-search {
    width: 100%;
  }

  .metrics,
  .rs-action-grid,
  .rs-candidate-grid,
  .dashboard-grid,
  .command-chart-grid,
  .command-kpi-grid,
  .command-executive-hero,
  .report-grid,
  .insight-grid,
  .report-actions,
  .reports-grid,
  .split,
  .payment-summary,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .command-executive-hero h1 {
    font-size: 34px;
  }

  .calendar {
    grid-template-columns: repeat(7, minmax(92px, 1fr));
  }

  .calendar-day {
    min-height: 112px;
  }
}

@media (max-width: 560px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .nav {
    grid-template-columns: 1fr;
  }
}
