:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-muted: #fbfaf7;
  --line: #e5ded0;
  --text: #17232b;
  --muted: #64748b;
  --green: #1f6b45;
  --green-strong: #144d32;
  --blue: #153b4b;
  --amber: #8a6a2e;
  --red: #ab3b33;
  --navy: #153b4b;
  --gold: #d6c097;
  --ink: #17232b;
  --shadow: 0 16px 40px rgba(27, 38, 49, 0.1);
  --soft-shadow: 0 8px 22px rgba(27, 38, 49, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #fbfaf7;
  color: var(--ink);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.brand {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
}

.brand-logo {
  width: 92px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.brand-logo img {
  width: 155px;
  flex: 0 0 auto;
  max-width: none;
  height: auto;
  display: block;
  object-fit: contain;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand span,
.sidebar-foot strong,
.sidebar-foot span {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand span,
.sidebar-foot span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #475569;
  background: transparent;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.nav-item.is-active {
  border-color: var(--gold);
  background: #f5efe3;
  color: var(--navy);
  box-shadow: inset 3px 0 0 #d8b334;
}

.sidebar-foot {
  margin-top: auto;
  flex: 0 0 auto;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e4c33b;
}

.status-dot.is-online {
  background: #42c178;
}

.status-dot.is-error {
  background: #e45b52;
}

.main {
  min-width: 0;
  max-width: 100%;
  padding: 0 24px 32px;
  overflow-x: hidden;
}

.is-booting .app-shell {
  min-height: 100vh;
  display: block;
}

.is-booting .sidebar,
.is-booting .topbar,
.is-booting .toolbar {
  display: none;
}

.is-booting .main {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.boot-screen {
  width: min(100%, 560px);
}

.boot-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 24px;
  box-shadow: var(--shadow);
}

.boot-card p {
  margin: 0;
  color: var(--muted);
}

.auth-gated .app-shell {
  min-height: 100vh;
  display: block;
}

.auth-gated .sidebar,
.auth-gated .topbar,
.auth-gated .toolbar {
  display: none;
}

.auth-gated .main {
  min-height: 100vh;
  padding: 0;
  display: block;
  background: var(--bg);
}

.access-screen {
  width: min(100%, 760px);
  padding: 24px;
}

.module-login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 540px;
  background: var(--bg);
}

.module-login-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 100vh;
  padding: 56px;
  color: #ffffff;
  background: #153b4b;
}

.hero-grid-line {
  position: absolute;
  inset: 7% -90px 7% auto;
  width: 520px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-float {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-float span {
  display: block;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-float strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.hero-float-top {
  top: 11%;
  right: 7%;
}

.hero-float-bottom {
  right: 12%;
  bottom: 12%;
}

.module-login-hero-content {
  position: relative;
  width: min(100%, 620px);
  display: grid;
  gap: 44px;
}

.hero-logo-card {
  width: 290px;
  max-width: 100%;
  display: flex;
  justify-content: center;
  border-radius: 8px;
  padding: 20px 32px;
  background: #f7f5f0;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.18);
}

.hero-logo-card img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
}

.module-login-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1.08;
}

.module-login-hero p {
  max-width: 620px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.75;
}

.hero-icon-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 580px;
}

.hero-icon-row span {
  min-height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.module-login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #f7f5f0;
}

.module-login-card {
  width: min(100%, 390px);
  gap: 0;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(27, 38, 49, 0.12);
}

.login-lock {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 8px;
  color: var(--amber);
  background: #f5efe3;
}

.module-login-card h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.module-login-card .view-subtitle {
  margin: 10px 0 0;
  line-height: 1.55;
}

.login-fields {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.access-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  background: #ffffff;
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
}

.access-brand {
  color: var(--text);
}

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

.login-panel {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  gap: 14px;
}

.muted-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.muted-actions .button {
  width: 100%;
  justify-content: center;
  color: var(--muted);
}

.login-submit {
  min-height: 38px;
  margin-top: 24px;
}

.button-spinner {
  width: 16px;
  height: 16px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: phiori-spin 0.75s linear infinite;
}

.is-submitting .button-spinner {
  display: inline-block;
}

.is-submitting .button-arrow {
  display: none;
}

.login-back-link {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 22px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.login-back-link:hover {
  text-decoration: underline;
}

@keyframes phiori-spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -24px 18px;
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.96);
  backdrop-filter: blur(12px);
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
}

.view-subtitle {
  margin: 7px 0 0;
  max-width: 720px;
  color: var(--muted);
}

h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

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

.topbar-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.period-pill {
  min-height: 32px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  background: #fff3ca;
  color: #6c4a08;
  border: 1px solid #ead58d;
  font-weight: 700;
}

.session-pill {
  min-height: 32px;
  max-width: 240px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #eef6f0;
  color: var(--green);
  border: 1px solid #c9decf;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-pill[hidden] {
  display: none;
}

.sidebar-logout {
  margin-left: auto;
  color: #b42318;
  border-color: #f0c5bd;
  background: #fff6f4;
}

.period-pill.is-closed {
  background: #e6edf7;
  border-color: #c9d8ec;
  color: var(--blue);
}

.button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--soft-shadow);
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.button.secondary {
  background: #f5f7f3;
}

.button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.button.danger {
  background: #f7e8e6;
  border-color: #efc6c1;
  color: var(--red);
}

.icon-button {
  width: 38px;
  padding: 0;
}

.button:hover,
.icon-button:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.toolbar {
  min-height: 74px;
  display: grid;
  grid-template-columns: 220px minmax(240px, 1.4fr) repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: var(--soft-shadow);
}

.filter-summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.filter-chip-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-chip {
  min-height: 28px;
  border: 1px solid #cbd6c7;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef5ed;
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 700;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
  grid-column: span 2;
}

.decision-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid #cfd9cc;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 239, 0.96)),
    var(--surface);
  box-shadow: var(--soft-shadow);
}

.decision-panel h2 {
  margin: 5px 0 7px;
  font-size: 22px;
}

.decision-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.organization-decision {
  border-color: #d9d2bd;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(249, 246, 237, 0.98)),
    var(--surface);
}

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

.decision-metrics button {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  gap: 4px;
  align-content: center;
  text-align: left;
  padding: 12px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.decision-metrics button:hover {
  border-color: #9abd9f;
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.decision-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.decision-metrics strong {
  font-size: 24px;
}

.access-warning {
  border: 1px solid #d9d2bd;
  border-radius: 8px;
  padding: 12px;
  background: #fbf7ea;
  color: #514019;
}

.access-warning strong,
.access-warning span {
  display: block;
}

.access-warning span {
  margin-top: 4px;
  line-height: 1.45;
}

.toolbar.is-hidden {
  display: none;
}

.toolbar-title {
  display: grid;
  gap: 4px;
}

.toolbar-title strong {
  font-size: 13px;
}

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

.search-field,
.select-field,
.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.search-field {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  padding: 0 12px;
}

.search-field input {
  border: 0;
  outline: 0;
  min-width: 0;
  background: transparent;
  color: var(--text);
}

.select-field select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.select-field select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: #80a98d;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(31, 107, 69, 0.13);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  padding: 10px;
}

.view {
  display: grid;
  gap: 18px;
}

.view > *,
.panel,
.command-center,
.command-main,
.command-status,
.kpi-grid,
.process-strip,
.dashboard-grid,
.workbench-grid {
  min-width: 0;
  max-width: 100%;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.command-main,
.command-status {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.command-main {
  min-height: 248px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(25, 39, 58, 0.98), rgba(31, 107, 69, 0.94)),
    var(--navy);
  color: #ffffff;
}

.command-main .eyebrow,
.command-main p {
  color: #c8d7ce;
}

.command-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.command-main h2 {
  margin: 8px 0 8px;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
}

.command-main p {
  max-width: 680px;
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

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

.command-status {
  padding: 18px;
  display: grid;
  gap: 14px;
  background: var(--surface);
}

.command-status-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.command-status-head span,
.command-next span,
.command-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.command-status-head strong {
  font-size: 20px;
}

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

.command-metric {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.command-metric strong {
  font-size: 19px;
}

.command-next {
  display: grid;
  gap: 5px;
  padding: 13px;
  border-radius: 8px;
  background: #edf6ef;
  border: 1px solid #c9decf;
}

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

.mini-command .command-main {
  min-height: 210px;
}

.mini-command .command-main h2 {
  font-size: 30px;
}

.cell-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 10px;
}

.process-step {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  box-shadow: var(--soft-shadow);
}

.process-step strong {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--green);
  grid-row: span 2;
}

.process-step span {
  font-weight: 700;
}

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

.process-step.attention strong {
  background: var(--amber);
}

.process-step.critical strong {
  background: var(--red);
}

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

.kpi {
  min-height: 104px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 14px 12px;
  display: grid;
  align-content: space-between;
  box-shadow: var(--soft-shadow);
  position: relative;
  overflow: hidden;
}

.kpi-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.kpi-button:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.kpi.is-critical::before {
  background: var(--red);
}

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

.kpi strong {
  font-size: 21px;
  letter-spacing: 0;
}

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

.status-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.status-board > div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.status-board strong {
  font-size: 18px;
}

.status-board-five {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.operation-lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.lane-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  display: grid;
  align-content: space-between;
  gap: 6px;
}

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

.lane-card strong {
  font-size: 22px;
}

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

.lane-card.is-financial {
  border-left-color: var(--green);
}

.lane-card.is-operational {
  border-left-color: var(--amber);
}

.lane-card.is-organization {
  border-left-color: var(--navy);
}

.lane-card.is-legal {
  border-left-color: var(--blue);
}

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

.dashboard-kpis {
  grid-template-columns: repeat(6, minmax(132px, 1fr));
}

.dashboard-kpis .kpi {
  min-height: 84px;
  padding: 12px 12px 10px;
}

.dashboard-kpis .kpi strong {
  font-size: 18px;
}

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

.model-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
  align-content: start;
  background: var(--surface-muted);
}

.model-card strong,
.model-card span,
.model-card small,
.model-card p {
  min-width: 0;
}

.model-card strong {
  color: var(--text);
}

.model-card span {
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 700;
}

.model-card small {
  color: var(--muted);
  line-height: 1.35;
}

.model-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.report-card {
  align-content: space-between;
}

.report-card .button {
  justify-self: start;
}

.admin-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-home {
  display: grid;
  gap: 16px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 420px) auto;
  gap: 18px;
  align-items: start;
}

.summary-list.compact {
  margin: 0;
}

.admin-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

button.model-card.admin-card {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button.model-card.admin-card:hover:not(:disabled),
button.model-card.admin-card:focus-visible:not(:disabled) {
  border-color: var(--green);
  box-shadow: 0 12px 28px rgba(28, 94, 57, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.admin-card span[data-icon] {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--green-strong);
  background: rgba(28, 94, 57, 0.08);
}

.admin-card em {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--green-strong);
  background: var(--green-soft);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.admin-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.admin-section-preview {
  min-height: 190px;
}

.admin-users-panel {
  display: grid;
  gap: 16px;
}

.permissions-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.permission-user-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 8px;
  display: grid;
  gap: 6px;
  max-height: 640px;
  overflow: auto;
}

.user-row {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px;
  text-align: left;
}

.user-row:hover,
.user-row.is-selected {
  border-color: var(--line-strong);
  background: var(--surface);
}

.user-row span {
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.permission-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  display: grid;
  gap: 14px;
}

.permission-editor-head,
.permission-box-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.permission-editor-head h3,
.permission-box-head h3 {
  margin: 0;
}

.permission-editor-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.switch-field {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.permissions-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.4fr);
  gap: 12px;
}

.permission-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.permission-check-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.permission-check-list.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-check {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 12px;
}

.permission-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.routine-hero,
.report-builder,
.esocial-header {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.routine-hero h2,
.routine-hero p,
.report-builder h2,
.report-builder p,
.esocial-header h2,
.esocial-header p {
  margin-bottom: 0;
}

.routine-hero-metrics {
  min-width: 220px;
  min-height: 82px;
  border: 1px solid #cfe0d2;
  border-radius: 8px;
  background: #eef7f0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
}

.routine-hero-metrics strong {
  font-size: 24px;
  color: var(--green-strong);
}

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

.routine-card {
  min-height: 184px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--soft-shadow);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.routine-card.ok {
  border-top-color: var(--green);
}

.routine-card.critical {
  border-top-color: var(--red);
}

.routine-card .button {
  grid-column: 1 / -1;
  justify-self: start;
}

.routine-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.routine-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef5ed;
  color: var(--green);
}

.operation-readiness {
  display: grid;
  gap: 14px;
}

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

.readiness-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.readiness-card.ok {
  border-left-color: var(--green);
}

.readiness-card.soft {
  border-left-color: var(--amber);
}

.readiness-card span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.readiness-card strong {
  font-size: 18px;
  color: var(--ink);
}

.readiness-card small {
  color: var(--muted);
  line-height: 1.35;
}

.report-options {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(160px, 220px) auto auto;
  gap: 10px;
  align-items: end;
}

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

.panel-heading h2 {
  margin: 0 auto 0 0;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.action-panel {
  grid-row: span 2;
}

.action-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.action-list li {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.action-list strong,
.action-list small {
  display: block;
  min-width: 0;
}

.action-list small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.conference-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.case-list {
  display: grid;
  gap: 8px;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding-right: 4px;
}

.case-row {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px;
  color: var(--text);
}

.case-row strong,
.case-row small {
  display: block;
}

.case-row small,
.case-meta small {
  color: var(--muted);
  margin-top: 4px;
}

.case-observation {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-row.is-selected {
  border-color: var(--green);
  background: #eef5ed;
  box-shadow: inset 3px 0 0 var(--green);
}

.case-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

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

.conference-detail-heading,
.conference-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

.compare-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.compare-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.variance-box {
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
}

.variance-box.is-critical {
  border-left-color: var(--red);
  background: #fff6f5;
}

.variance-box strong,
.variance-box span {
  display: block;
}

.mini-table {
  display: grid;
  gap: 8px;
}

.mini-table > div {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}

.mini-table > div:last-child {
  border-bottom: 0;
}

.source-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.observation-full-card {
  background: #fbfcfa;
}

.observation-full-text {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.summary-list,
.check-list,
.schema-list,
.timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-list li,
.check-list li,
.schema-list li,
.timeline li {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.timeline li {
  grid-template-columns: 120px minmax(0, 1fr);
}

.summary-list li:last-child,
.check-list li:last-child,
.schema-list li:last-child,
.timeline li:last-child {
  border-bottom: 0;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  max-height: min(66vh, 720px);
  overscroll-behavior: contain;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef1ec;
  color: #39453e;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  background: var(--surface);
}

tbody tr:nth-child(even) td {
  background: #fcfdfb;
}

tr:hover td {
  background: #f3f7f1;
}

tr.is-selected td {
  background: #eef5ed;
  box-shadow: inset 3px 0 0 var(--green);
}

.money {
  text-align: right;
  white-space: nowrap;
}

.name-cell {
  min-width: 240px;
}

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

.pill {
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  display: inline-grid;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.ok {
  color: var(--green-strong);
  background: #dff1e4;
}

.pill.exception {
  color: var(--blue);
  background: #e3eef9;
}

.pill.attention {
  color: var(--amber);
  background: #fff1d6;
}

.pill.critical {
  color: var(--red);
  background: #f9dedb;
}

.pill.draft,
.pill.pending {
  color: var(--navy);
  background: #eef2f7;
}

.pill.approved {
  color: var(--green-strong);
  background: #dff1e4;
}

.pill.rejected {
  color: var(--red);
  background: #f9dedb;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
}

.dashboard-bars .bar-row {
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr) minmax(96px, 130px);
}

.dashboard-bars .bar-row small {
  grid-column: 1 / -1;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8eee6;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--green);
}

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

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

.form-hint {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d8dfd4;
  border-radius: 8px;
  background: #f5f8f2;
  color: var(--text);
}

.form-hint span {
  color: var(--muted);
  line-height: 1.4;
}

.span-2 {
  grid-column: span 2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 16, 0.62);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid #c7cec4;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(10, 18, 15, 0.34);
}

.employee-modal {
  width: min(1180px, calc(100vw - 32px));
}

.action-modal {
  width: min(1120px, calc(100vw - 32px));
}

.action-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: start;
  padding: 16px;
}

.action-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.action-side h3 {
  margin: 0;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #f8faf6;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e9f2e8;
  color: var(--green);
}

.modal-title h2 {
  margin: 0;
}

.modal-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.modal-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.form-section {
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
}

.form-section:first-of-type {
  padding-top: 2px;
  border-top: 0;
}

.form-section h3 {
  margin: 0;
  color: #35433b;
  text-transform: uppercase;
  font-size: 12px;
}

.form-section p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.summary-list.compact li {
  min-height: 32px;
  padding: 6px 0;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 -16px -16px;
  padding: 12px 16px 16px;
  background: #f8faf6;
  border-top: 1px solid var(--line);
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 230px;
  max-width: 360px;
  min-height: 42px;
  border-radius: 8px;
  background: #17231d;
  color: #ffffff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transform: translateY(90px);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

button:disabled,
.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.closing-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.closing-flow .process-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  min-height: 74px;
  padding: 10px;
  text-align: left;
}

.closing-flow .process-step.ok {
  border-color: #b9d6c3;
  background: #edf7f0;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  background: var(--surface-muted);
}

svg.icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1100px) {
  .module-login-screen {
    grid-template-columns: 1fr;
  }

  .module-login-hero {
    min-height: auto;
    padding: 40px 24px;
  }

  .module-login-panel {
    min-height: auto;
    padding: 32px 20px 48px;
  }

  .module-login-hero-content {
    gap: 28px;
  }

  .hero-float,
  .hero-grid-line {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

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

  .sidebar-foot {
    display: none;
  }

  .split,
  .decision-panel,
  .command-center,
  .workbench-grid,
  .dashboard-grid,
  .conference-layout,
  .compare-grid,
  .toolbar,
  .status-board,
  .status-board-five,
  .operation-lanes,
  .report-options {
    grid-template-columns: 1fr;
  }

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

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

  .routine-hero,
  .report-builder,
  .esocial-header {
    align-items: stretch;
    flex-direction: column;
  }

  .routine-hero-metrics {
    width: 100%;
  }

  .command-main {
    min-height: 220px;
  }

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

  .action-layout {
    grid-template-columns: 1fr;
  }

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

  .decision-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

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

  .admin-hero,
  .permissions-layout,
  .permissions-grid {
    grid-template-columns: 1fr;
  }

  .permission-user-list {
    max-height: 280px;
  }
}

@media (max-width: 640px) {
  .module-login-hero {
    display: none;
  }

  .module-login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
  }

  .module-login-panel {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
  }

  .module-login-card {
    padding: 26px;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

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

  .nav-item {
    min-height: 38px;
    padding: 0 9px;
    font-size: 12px;
  }

  .process-strip,
  .decision-panel,
  .decision-metrics,
  .closing-flow,
  .command-center,
  .workbench-grid,
  .kpi-grid,
  .dashboard-kpis,
  .model-grid,
  .admin-card-grid,
  .routine-grid,
  .readiness-grid,
  .operation-lanes,
  .status-board-five,
  .status-board,
  .conference-layout,
  .compare-grid,
  .variance-box,
  .detail-form,
  .modal-form {
    grid-template-columns: 1fr;
  }

  .action-layout {
    grid-template-columns: 1fr;
  }

  .permission-editor-head,
  .permission-box-head,
  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .permission-check-list.two-columns {
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-height: 34vh;
    overflow: auto;
  }

  .command-main,
  .command-status {
    border-radius: 8px;
  }

  .command-main {
    min-height: auto;
    padding: 18px;
  }

  .command-title-row {
    display: grid;
  }

  .command-main h2 {
    font-size: 30px;
  }

  .command-actions {
    display: grid;
  }

  .command-actions .button {
    width: 100%;
  }

  .brand {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .filter-summary,
  .filter-chip-list {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .filter-summary {
    flex-direction: column;
  }

  .routine-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .routine-card .pill {
    justify-self: start;
  }

  .bar-row,
  .dashboard-bars .bar-row {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: 1 / -1;
  }

  .modal-backdrop {
    align-items: start;
    padding: 10px;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .modal-header {
    align-items: flex-start;
    padding: 14px;
  }

  .modal-title {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .modal-icon {
    width: 36px;
    height: 36px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  h1 {
    font-size: 22px;
  }

  .button,
  .icon-button {
    min-height: 42px;
  }
}
