:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --line: #dce2ea;
  --line-strong: #c8d1df;
  --text: #001229;
  --muted: #5f718c;
  --muted-soft: #91a2b8;
  --nav: #0b2545;
  --nav-deep: #081b33;
  --nav-active: #2c5f8a;
  --blue: #2c5f8a;
  --gold: #c89b3c;
  --teal: #1f6f78;
  --slate: #7c8798;
  --green: #1e8a5f;
  --red: #c1272d;
  --shadow: 0 1px 2px rgba(16, 30, 54, 0.08), 0 2px 8px rgba(16, 30, 54, 0.09);

  /* Typography tokens. "Google Sans"/"Google Sans Text" are not publicly
     distributable, so they only render where a user/org already has them
     installed or licensed (e.g. ChromeOS, Google Workspace); everyone else
     falls through to Roboto, which is visually close (same design team). */
  --font-ui: "Google Sans Text", "Roboto", "Noto Sans", Arial, sans-serif;
  --font-heading: "Google Sans", "Google Sans Text", "Roboto", "Noto Sans", Arial, sans-serif;
  --font-mono: "Roboto Mono", "Noto Sans Mono", monospace;

  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
}

button {
  font-family: var(--font-ui);
  font-weight: 500;
}

label, .field span, th {
  font-family: var(--font-ui);
  font-weight: 500;
}

.mono {
  font-family: var(--font-mono);
}

.page-title,
.section-title,
.metric-title,
#page-title,
.login-title,
.brand-title,
.report-heading,
.kpi-label,
.nav-item,
.tab-button,
.tab-strip button,
.admin-role-line {
  font-family: var(--font-heading);
  font-weight: 600;
}

.financial-value,
.currency,
.amount,
.balance,
.percentage,
.table-number,
.kpi-value,
.data-table td,
.breakdown-table td,
.detail-list dd,
.axis-label {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

button,
input,
select {
  font: inherit;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg) 0%, #ffffff 52%, var(--panel-soft) 100%);
  overflow: auto;
}

.login-layout {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(16, 30, 54, 0.14);
  overflow: hidden;
}

.login-brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 48px 32px 34px;
  background: linear-gradient(180deg, var(--text) 0%, var(--nav) 100%);
  color: #ffffff;
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 42%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 18, 41, 0.88) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 32px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 24px);
  opacity: 0.52;
}

.login-brand-logo {
  width: 178px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 24px rgba(0, 18, 41, 0.22);
}

.login-brand-logo img,
.login-card-logo {
  display: block;
  width: 100%;
  height: auto;
}

.login-brand-graphic {
  position: relative;
  display: flex;
  align-items: end;
  gap: 13px;
  height: 190px;
  margin: 64px 0 42px;
  padding: 0 8px;
}

.login-brand-graphic::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 54px;
  height: 2px;
  background: linear-gradient(90deg, rgba(111, 159, 229, 0.12), rgba(111, 159, 229, 0.95), rgba(111, 159, 229, 0.28));
  transform: skewY(-17deg);
  transform-origin: left center;
}

.login-brand-graphic span {
  width: 16px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(111, 159, 229, 0.82), rgba(47, 109, 242, 0.12));
}

.login-brand-graphic span:nth-child(1) {
  height: 78px;
}

.login-brand-graphic span:nth-child(2) {
  height: 118px;
}

.login-brand-graphic span:nth-child(3) {
  height: 94px;
}

.login-brand-graphic span:nth-child(4) {
  height: 58px;
}

.login-brand-graphic span:nth-child(5) {
  height: 88px;
}

.login-brand-graphic span:nth-child(6) {
  height: 132px;
}

.login-brand-graphic span:nth-child(7) {
  height: 108px;
}

.login-brand-message {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  font-size: 15px;
  line-height: 1.45;
}

.login-brand-message p {
  margin: 0;
}

.login-brand-message strong,
.login-brand-message span {
  display: block;
}

.login-shield-icon {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  clip-path: polygon(50% 0, 100% 16%, 88% 74%, 50% 100%, 12% 74%, 0 16%);
}

.login-shield-icon::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 13px;
  width: 9px;
  height: 15px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(42deg);
}

.login-brand-footer {
  margin: 42px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.45;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 56px;
  background: linear-gradient(180deg, #ffffff 0%, var(--panel-soft) 100%);
}

.login-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 72px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(16, 30, 54, 0.12);
  padding: 40px;
  display: grid;
  gap: 22px;
}

.login-header {
  display: grid;
  gap: 24px;
}

.login-card-logo {
  width: 178px;
}

.login-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .field {
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.login-form .field span {
  font-size: 14px;
}

.login-form .field input {
  height: 48px;
  border-color: var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(16, 30, 54, 0.05);
}

.login-form .field input:focus {
  outline: 2px solid rgba(47, 109, 242, 0.2);
  border-color: var(--blue);
}

.login-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.login-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--nav);
}

/* Legacy MFA styles are retained but unused while MFA is disabled. */
.login-mfa-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.login-mfa-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
}

.login-mfa-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.login-mfa-icon {
  position: relative;
  justify-self: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #eef3fa;
}

.login-mfa-icon::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 28px;
  width: 20px;
  height: 18px;
  border: 3px solid var(--nav);
  border-radius: 4px;
}

.login-mfa-icon::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 14px;
  width: 16px;
  height: 20px;
  border: 3px solid var(--nav);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.login-code-field input {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.login-button {
  height: 50px;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--text) 0%, var(--nav) 100%);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(24, 62, 100, 0.18);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.login-link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.login-secondary-button {
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
  color: var(--nav);
  font-weight: 700;
  cursor: pointer;
}

.login-secondary-button:hover {
  border-color: var(--nav);
}

.login-secondary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.login-mfa-setup {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.login-mfa-setup[hidden] {
  display: none;
}

.login-mfa-setup img {
  width: 180px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.login-mfa-setup p {
  margin: 0;
}

.login-mfa-secret {
  max-width: 100%;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.login-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.login-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-status.error {
  color: var(--red);
}

.login-status.success {
  color: var(--green);
}

.login-helper {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.login-footer summary {
  color: var(--nav);
  cursor: pointer;
  font-weight: 700;
}

.login-footer p {
  margin: 8px 0 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 100vh;
  min-width: 1180px;
}



.sidebar {
  background: linear-gradient(160deg, var(--nav-deep) 0%, var(--nav) 65%, var(--nav-active) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 310px;
  border-right: 3px solid var(--gold);
}


.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 88px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
}

.brand-logo {
  width: 120px;
  height: 80px;
  border-radius: 6px;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 2px 2px;
  box-shadow: 0 2px 8px rgba(16,30,54,0.16);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 0 0 0;
  flex: 1 1 auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 1.18rem;
  font-weight: 600;
  padding: 0 18px;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, var(--blue) 0%, var(--nav-active) 100%);
  box-shadow: 0 2px 12px 0 rgba(44, 95, 138, 0.18);
  color: #fff;
  position: relative;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 12px 0 0 12px;
  background: var(--gold);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  font-size: 1.5rem;
  margin: 0;
}

/* Icon placeholders - replace with SVGs for production */
.nav-icon-overview { background: var(--blue); }
.nav-icon-pl { background: var(--teal); }
.nav-icon-balance { background: var(--gold); }
.nav-icon-cashflow { background: var(--green); }
.nav-icon-gl { background: #6b4fa0; }
.nav-icon-mapping { background: var(--slate); }
.nav-icon-detailed { background: var(--gold); }
.nav-icon-admin { background: var(--nav); }

.nav-icon-overview::before { content: "\25A4"; color: #fff; font-size: 1.3rem; }
.nav-icon-pl::before { content: "\2197"; color: #fff; font-size: 1.3rem; }
.nav-icon-balance::before { content: "\2696"; color: #fff; font-size: 1.3rem; }
.nav-icon-cashflow::before { content: "$"; color: #fff; font-size: 1.3rem; }
.nav-icon-gl::before { content: "\1F50D"; color: #fff; font-size: 1.3rem; }
.nav-icon-mapping::before { content: "\2387"; color: #fff; font-size: 1.3rem; }
.nav-icon-detailed::before { content: "\1F4C4"; color: #fff; font-size: 1.3rem; }
.nav-icon-admin::before { content: "\1F512"; color: #fff; font-size: 1.3rem; }

.sidebar-footer {
  margin-top: auto;
  padding: 32px 0 18px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #b6d0f7;
  font-size: 1.1rem;
  font-weight: 600;
}
.footer-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--blue) 100%);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-icon::before {
  content: "\1F4C8";
  color: #fff;
  font-size: 1.5rem;
}

.main-panel {
  min-width: 0;
  padding-bottom: 42px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 760;
}

.top-actions {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-width: 94px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.action-button:hover {
  border-color: var(--blue);
}

.filters {
  display: grid;
  grid-template-columns: 98px 168px;
  gap: 14px;
  align-items: end;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.switch-field,
.search-field {
  display: none;
}

.field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field select,
.field input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.status-line {
  min-height: 18px;
  margin: 8px 22px 0;
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px 14px;
  padding: 0 22px 18px;
}

.kpi-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 106px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  border-top: 3px solid var(--accent, var(--blue));
}

.kpi-label {
  color: #48617f;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kpi-value {
  font-size: 27px;
  line-height: 1.1;
  font-weight: 820;
  color: var(--text);
}

.kpi-change {
  color: #395579;
  font-size: 12px;
}

.kpi-change.positive {
  color: var(--green);
}

.kpi-change.negative {
  color: var(--red);
}

.kpi-benchmark {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

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

.panel h2 {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 780;
}

.exec-summary {
  border-top: 3px solid var(--gold);
  background: var(--panel-soft);
}

.exec-summary h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 16px;
}

.exec-summary-asof {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.exec-summary p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.exec-summary p:last-of-type {
  margin-bottom: 0;
}

.exec-summary-watch {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.exec-summary-watch ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.report-heading {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

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

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

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

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

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

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

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

.chart {
  width: 100%;
  min-height: 230px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.axis-label {
  fill: var(--muted-soft);
  font-size: 10px;
  font-weight: 650;
}

.chart-line-1 {
  stroke: var(--blue);
}

.chart-line-2 {
  stroke: var(--gold);
  stroke-dasharray: 7 5;
}

.chart-line-3 {
  stroke: var(--teal);
  stroke-dasharray: 3 5;
}

.chart-line-4 {
  stroke: var(--nav);
}

.legend {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--blue);
}

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

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

.legend span:nth-child(4)::before {
  background: var(--nav);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 3fr) 96px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  font-size: 12px;
}

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

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

.bar-fill.negative {
  background: var(--red);
}

.breakdown-panel {
  display: grid;
  gap: 12px;
}

.breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.breakdown-legend span::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 7px;
  vertical-align: middle;
  background: var(--swatch);
}

.breakdown-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.breakdown-chart {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) minmax(120px, 1.5fr);
  gap: 10px;
  align-items: center;
  min-height: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}

.breakdown-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-track {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1f6;
}

.breakdown-segment {
  display: block;
  height: 100%;
  min-width: 2px;
  opacity: 0.88;
}

.breakdown-total {
  margin-top: 4px;
  border-bottom: 0;
  font-weight: 800;
}

.breakdown-table-wrap {
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.breakdown-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12px;
}

.breakdown-table th,
.breakdown-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.breakdown-table th:first-child,
.breakdown-table td:first-child {
  border-left: 0;
  text-align: left;
}

.breakdown-table th {
  background: #f5f7fa;
  color: #48617f;
  font-weight: 800;
}

.breakdown-total-row td {
  background: #f5f7fa;
  font-weight: 800;
}

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

.insight-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.data-table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e9edf3;
  padding: 7px 12px;
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
  min-width: 250px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 2px solid #d7dfeb;
  background: #f5f7fa;
  color: #48617f;
  font-size: 12px;
  font-weight: 720;
}

.data-table tr[data-type="title"] td,
.data-table tr[data-type="section"] td,
.data-table tr[data-type="total"] td,
.data-table tr[data-type="subtotal"] td {
  background: #f5f7fa;
  font-weight: 800;
}

.data-table tr[data-type="heading"] td {
  font-weight: 760;
}

.entity-summary {
  min-width: 0;
}

.entity-summary th:first-child,
.entity-summary td:first-child {
  min-width: 290px;
}

.gl-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 14px;
}

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

.detail-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 9px 14px;
  font-size: 13px;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  font-weight: 680;
}

.tab-strip {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.tab-strip button {
  min-width: 128px;
  padding: 0 12px;
  height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tab-strip button:last-child {
  border-right: 0;
}

.tab-strip button.active {
  background: #eef4ff;
  font-weight: 760;
}

.error-panel {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: #fff7f7;
  color: var(--red);
}

@media (max-width: 900px) {
  .login-shell {
    padding: 14px;
  }

  .login-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 270px;
    padding: 28px 24px;
  }

  .login-brand-graphic {
    height: 92px;
    margin: 24px 0 18px;
  }

  .login-brand-footer {
    margin-top: 18px;
  }

  .login-panel {
    padding: 24px;
  }

  .login-card {
    max-height: none;
    padding: 24px;
  }

  .login-title {
    font-size: 22px;
  }

  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .sidebar {
    position: static;
  }

  .brand-box {
    height: 58px;
  }

  .brand-logo {
    width: 82px;
    height: 36px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    min-width: 132px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
  }

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

  .kpi-grid,
  .content-grid,
  .gl-layout,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }
}

.admin-shell {
  min-height: 100vh;
  background: var(--bg);
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  background: var(--nav);
  color: #fff;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 18px;
}

.admin-role-line {
  margin: 2px 0 0;
  font-size: 12px;
  color: #cfe0f2;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
}

.tab-button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cfe0f2;
  cursor: pointer;
}

.tab-button.active,
.tab-button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.admin-main {
  padding: 20px 24px;
  display: grid;
  gap: 16px;
}

.admin-panel h2 {
  margin: 0 0 14px;
  font-size: 15px;
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.admin-inline-form .field input,
.admin-inline-form .field select {
  min-width: 180px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 13px;
}

.data-table.admin-table th,
.data-table.admin-table td {
  text-align: left;
  white-space: normal;
}

.data-table.admin-table td .action-button {
  height: 28px;
  min-width: 0;
  padding: 0 10px;
  margin-right: 6px;
  font-size: 12px;
}
