:root {
  --ink: #17211e;
  --muted: #5a6861;
  --line: #dfe6e2;
  --surface: #ffffff;
  --surface-soft: #f6f8f7;
  --page: #eef2f0;
  --brand: #123f36;
  --brand-deep: #0b2f29;
  --brand-soft: #dcece7;
  --gold: #c9a35b;
  --gold-soft: #f5ead4;
  --success: #1f7a55;
  --success-soft: #e0f3ea;
  --danger: #b13a3a;
  --danger-soft: #fbe7e7;
  --warning: #a76512;
  --warning-soft: #fff0d7;
  --info: #21699a;
  --info-soft: #e5f1f8;
  --shadow-sm: 0 5px 18px rgb(24 58 48 / 7%);
  --shadow-lg: 0 24px 70px rgb(7 40 32 / 22%);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(201 163 91 / 35%);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .62;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.is-hidden {
  display: none !important;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
  min-height: 100vh;
  background: var(--surface);
}

.login-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 112px);
  color: #fff;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 12% 18%, rgb(201 163 91 / 28%), transparent 25%),
    radial-gradient(circle at 88% 84%, rgb(255 255 255 / 11%), transparent 28%),
    linear-gradient(145deg, var(--brand-deep), #165548);
}

.login-aside::before,
.login-aside::after {
  content: "";
  position: absolute;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 50%;
}

.login-aside::before {
  width: 440px;
  height: 440px;
  inset: -180px auto auto -160px;
}

.login-aside::after {
  width: 320px;
  height: 320px;
  inset: auto -120px -150px auto;
}

.login-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 34px;
  color: var(--brand-deep);
  background: var(--gold);
  border-radius: 22px 8px 22px 8px;
  font-size: 42px;
  font-weight: 800;
  box-shadow: 0 15px 35px rgb(0 0 0 / 20%);
}

.login-aside > p {
  max-width: 540px;
  margin-bottom: 32px;
  font-size: clamp(28px, 3.1vw, 48px);
  font-weight: 800;
  line-height: 1.35;
}

.login-aside ul {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: #deebe7;
}

.login-aside li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-left: 10px;
  color: var(--brand-deep);
  background: var(--gold);
  border-radius: 50%;
  font-weight: 800;
}

.login-main {
  display: grid;
  place-items: center;
  padding: 40px 28px;
}

.login-card {
  width: min(440px, 100%);
}

.login-stack {
  width: min(520px, 100%);
}

.login-stack .login-card {
  width: 100%;
}

.auth-panel {
  min-width: 0;
}

.mfa-steps {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
}

.mfa-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mfa-steps li span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-weight: 800;
}

.mfa-secret-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--gold);
  border-radius: 12px;
}

.mfa-secret-card > div {
  min-width: 0;
}

.mfa-secret-card small,
.mfa-secret-card code {
  display: block;
}

.mfa-secret-card small {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.mfa-secret-card code {
  color: var(--brand-deep);
  overflow-wrap: anywhere;
  user-select: all;
  font: 700 14px/1.7 Consolas, "Courier New", monospace;
  letter-spacing: .08em;
}

.mfa-privacy-note,
.mfa-expiry {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.mfa-expiry {
  min-height: 18px;
  color: var(--warning);
  text-align: center;
  font-weight: 700;
}

.mfa-code-input {
  min-height: 54px;
  text-align: center;
  font: 700 22px/1 Consolas, "Courier New", monospace;
  letter-spacing: .28em;
}

.mfa-method-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  margin-bottom: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mfa-method-switch button {
  min-height: 40px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.mfa-method-switch button:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.mfa-method-switch button.is-active {
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow-sm);
}

.mfa-warning {
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #754b0c;
  background: var(--warning-soft);
  border: 1px solid rgb(167 101 18 / 20%);
  border-radius: 10px;
  font-size: 11px;
}

.mfa-recovery-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 14px;
  margin: 0;
  counter-reset: recovery-code;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  list-style: none;
}

.mfa-recovery-code-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  counter-increment: recovery-code;
}

.mfa-recovery-code-list li::before {
  content: counter(recovery-code) ".";
  color: var(--muted);
  font-size: 10px;
}

.mfa-recovery-code-list code {
  min-width: 0;
  color: var(--brand-deep);
  overflow-wrap: anywhere;
  user-select: all;
  font: 700 11px/1.7 Consolas, "Courier New", monospace;
  letter-spacing: .04em;
}

.mfa-recovery-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.mfa-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  margin-top: 16px;
  background: var(--success-soft);
  border-radius: 10px;
  cursor: pointer;
}

.mfa-confirmation input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
}

.mfa-confirmation span {
  font-size: 12px;
  font-weight: 700;
}

.auth-restart-button {
  display: block;
  padding: 7px;
  margin: 8px auto 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 11px;
}

.auth-restart-button:hover {
  color: var(--brand);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-login {
  margin-bottom: 64px;
  color: var(--brand);
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: var(--brand-deep);
  background: var(--gold);
  border-radius: 14px 5px 14px 5px;
  font-size: 24px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
}

.brand small {
  margin-top: -2px;
  color: var(--muted);
  font-size: 11px;
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading h1 {
  margin-bottom: 8px;
  font-size: 32px;
}

.login-heading p:last-child {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

label,
.field-label {
  display: block;
  margin: 15px 0 7px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cbd5d0;
  border-radius: var(--radius-sm);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9ba5a1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  white-space: nowrap;
}

.button-wide {
  width: 100%;
  min-height: 49px;
  margin-top: 24px;
}

.button-primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 17px rgb(18 63 54 / 18%);
}

.button-primary:hover {
  background: var(--brand-deep);
}

.button-secondary {
  color: var(--brand);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover {
  background: var(--surface-soft);
}

.button-gold {
  color: var(--brand-deep);
  background: var(--gold);
}

.button-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.button-small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 23px;
}

.icon-button:hover {
  background: var(--surface-soft);
}

.form-error {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.form-success {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--success, #087f5b);
  font-size: 13px;
}

.authorization-action-form {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin-top: 18px;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.authorization-action-form h3,
.authorization-action-form p {
  margin: 0;
}

.authorization-action-form .form-field {
  margin: 0;
}

.application {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  color: #e5efec;
  background: linear-gradient(180deg, var(--brand-deep), var(--brand));
  position: sticky;
  top: 0;
  z-index: 20;
}

.sidebar-brand {
  min-height: 86px;
  padding: 18px 22px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.sidebar-brand strong {
  color: #fff;
}

.sidebar-brand small {
  color: #b9cbc5;
}

.navigation {
  flex: 1;
  padding: 14px 13px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group-title {
  margin: 17px 11px 6px;
  color: #91aaa2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  margin: 2px 0;
  color: #d7e5e0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: right;
  font-size: 13px;
}

.nav-button:hover,
.nav-button.is-active {
  color: #fff;
  background: rgb(255 255 255 / 10%);
}

.nav-button.is-active {
  box-shadow: inset -3px 0 var(--gold);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--gold);
  background: rgb(255 255 255 / 7%);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 22px;
  color: #aac1ba;
  border-top: 1px solid rgb(255 255 255 / 10%);
  font-size: 11px;
}

.connection-dot {
  width: 8px;
  height: 8px;
  background: #5fdda9;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(95 221 169 / 12%);
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
  padding: 14px clamp(18px, 3vw, 42px);
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(10px);
}

.topbar-title,
.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  max-width: 460px;
  margin-inline: auto;
}

.global-search input {
  min-width: 0;
  flex: 1;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.global-search input:focus {
  outline: 3px solid var(--brand-soft);
  border-color: var(--brand);
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.breadcrumb {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 11px;
}

.user-copy {
  text-align: left;
}

.user-copy strong,
.user-copy small {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 12px;
}

.user-copy small {
  color: var(--muted);
  font-size: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  color: var(--brand);
  background: var(--gold-soft);
  border-radius: 50%;
  font-weight: 800;
}

.menu-toggle {
  display: none;
}

.content {
  width: min(1540px, 100%);
  min-height: calc(100vh - 86px);
  padding: clamp(20px, 3vw, 42px);
  margin-inline: auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-header h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-actions,
.row-actions,
.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 15px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid rgb(223 230 226 / 85%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  width: 58px;
  height: 58px;
  background: var(--brand-soft);
  border-radius: 50%;
  position: absolute;
  inset: -23px auto auto -18px;
}

.metric-label {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  display: block;
  color: var(--brand);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 800;
  direction: ltr;
  text-align: right;
}

.metric-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr);
  gap: 18px;
}

.budget-kpi-grid,
.budget-variance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(135px, 1fr));
  gap: 12px;
}

.budget-kpi-grid .quick-item {
  min-height: 76px;
}

.budget-inline-state {
  display: grid;
  justify-items: start;
  gap: 7px;
  padding: 15px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.budget-inline-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.budget-inline-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgb(173 49 49 / 24%);
}

.budget-variance-workspace {
  display: grid;
  gap: 16px;
}

.budget-variance-summary .metric-card {
  min-width: 0;
  box-shadow: none;
}

.budget-variance-toolbar {
  margin: 0;
}

.panel {
  padding: 19px;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin: 0;
  font-size: 15px;
}

.panel-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.comparison-list {
  display: grid;
  gap: 16px;
}

.comparison-row {
  display: grid;
  grid-template-columns: 105px minmax(120px, 1fr) 115px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.comparison-row progress {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: #e9efec;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

progress::-moz-progress-bar {
  background: var(--brand);
}

.comparison-row strong {
  direction: ltr;
  text-align: right;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.work-wave-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.work-wave-summary .quick-item {
  border: 1px solid var(--line);
}

.inventory-replenishment-allocation-picker {
  display: grid;
  gap: 9px;
  max-height: 340px;
  padding: 3px;
  overflow-y: auto;
}

.inventory-replenishment-allocation-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, 160px);
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.inventory-replenishment-allocation-row > div:first-child {
  grid-column: 2;
}

.inventory-replenishment-allocation-row:has(input[type="checkbox"]:checked) {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
}

.inventory-replenishment-allocation-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.inventory-replenishment-allocation-row input[type="number"] {
  min-width: 0;
}

.inventory-replenishment-allocation-row strong,
.inventory-replenishment-allocation-row small {
  display: block;
}

.inventory-replenishment-allocation-row small {
  margin-top: 3px;
  color: var(--muted);
}

.inventory-replenishment-scan-progress {
  padding: 4px 0;
  overflow-x: auto;
}

.inventory-replenishment-scan-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(125px, 1fr));
  gap: 8px;
  min-width: 560px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: replenishment-scan-step;
}

.inventory-replenishment-scan-step {
  position: relative;
  min-height: 58px;
  padding: 10px 38px 10px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  counter-increment: replenishment-scan-step;
}

.inventory-replenishment-scan-step::before {
  content: counter(replenishment-scan-step);
  position: absolute;
  inset: 10px 10px auto auto;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.inventory-replenishment-scan-step.is-current {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  font-weight: 800;
}

.inventory-replenishment-scan-step.is-current::before {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

.inventory-replenishment-scan-step.is-complete {
  color: var(--success, #177245);
}

.inventory-replenishment-scan-step.is-complete::before {
  content: "\2713";
  color: white;
  background: var(--success, #177245);
  border-color: var(--success, #177245);
}

.work-wave-builder .section-title {
  margin-top: 8px;
}

.work-wave-candidate-list,
.work-wave-selected-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  padding: 3px;
  overflow-y: auto;
}

.work-wave-candidate,
.work-wave-selected-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.work-wave-candidate {
  cursor: pointer;
}

.work-wave-candidate:has(input:checked) {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
}

.work-wave-candidate input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.work-wave-selected-task {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.work-wave-sequence {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: white;
  background: var(--brand);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.work-wave-task-copy {
  min-width: 0;
}

.work-wave-task-copy strong,
.work-wave-task-copy small {
  display: block;
}

.work-wave-task-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-wave-task-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.work-wave-empty {
  padding: 15px;
  margin: 0;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 11px;
  text-align: center;
}

.work-wave-details {
  display: grid;
  gap: 18px;
}

.work-wave-details > .panel {
  box-shadow: none;
}

.quick-item {
  padding: 13px;
  background: var(--surface-soft);
  border-radius: 10px;
}

.quick-item small,
.quick-item strong {
  display: block;
}

.quick-item small {
  color: var(--muted);
  font-size: 10px;
}

.quick-item strong {
  margin-top: 5px;
}

.activity-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.activity-item {
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border: 0;
}

.activity-bullet {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  background: var(--gold);
  border-radius: 50%;
}

.activity-item strong,
.activity-item small {
  display: block;
}

.activity-item strong {
  font-size: 12px;
  word-break: break-word;
}

.activity-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 11px;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.filters .field-label {
  margin-top: 0;
}

.filter-actions {
  align-self: end;
  min-height: 45px;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 12px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #52605b;
  background: #f7f9f8;
  font-size: 11px;
  font-weight: 800;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfcfb;
}

.cell-wrap {
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
}

.cell-ltr {
  direction: ltr;
  text-align: right;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.status-success {
  color: var(--success);
  background: var(--success-soft);
}

.status-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-info {
  color: var(--info);
  background: var(--info-soft);
}

.status-neutral {
  color: #596761;
  background: #e9eeeb;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 40px 20px;
  text-align: center;
}

.empty-symbol,
.error-symbol {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 18px;
  font-size: 25px;
  font-weight: 800;
}

.empty-symbol {
  color: var(--brand);
  background: var(--brand-soft);
}

.error-symbol {
  color: var(--danger);
  background: var(--danger-soft);
}

.empty-state h3,
.error-state h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.empty-state p,
.error-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border: 4px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.pagination-buttons {
  display: flex;
  gap: 7px;
}

.aging-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.aging-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.aging-card:last-child {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.aging-card span,
.aging-card strong {
  display: block;
}

.aging-card span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.aging-card:last-child span {
  color: #c7d9d3;
}

.aging-card strong {
  font-size: 19px;
  direction: ltr;
  text-align: right;
}

.dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.dialog-wide {
  width: min(1050px, calc(100vw - 28px));
}

.dialog::backdrop {
  background: rgb(5 34 27 / 68%);
  backdrop-filter: blur(3px);
}

.dialog-form {
  margin: 0;
}

.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  font-size: 19px;
}

.dialog-body {
  max-height: calc(100vh - 210px);
  padding: 20px 22px;
  overflow-y: auto;
}

.dialog-footer {
  justify-content: flex-start;
  border-top: 1px solid var(--line);
}

.dialog .form-error {
  padding-inline: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.form-grid > * {
  min-width: 0;
}

.form-field-full {
  grid-column: 1 / -1;
}

/* A value read from the server and shown in a form (a 64-character fingerprint, a GUID) has no break
   opportunity: it must wrap inside its field instead of stretching the grid track, which on a phone
   (one "1fr" column) widened the whole consolidation workspace past the screen. */
.form-grid > .form-field {
  min-width: 0;
}

.form-field .cell-ltr {
  overflow-wrap: anywhere;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 18px;
  margin: 20px 0 4px;
  border-top: 1px solid var(--line);
}

.section-title h3 {
  margin: 0;
  font-size: 14px;
}

.line-items {
  display: grid;
  gap: 10px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(170px, 2fr) repeat(3, minmax(95px, 1fr)) 38px;
  align-items: end;
  gap: 8px;
  padding: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.line-item label {
  margin-top: 0;
}

.adjustment-source-content {
  margin-top: 18px;
}

.adjustment-source-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 150px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
}

.adjustment-source-loading .spinner {
  width: 28px;
  height: 28px;
  margin: 0;
  border-width: 3px;
}

.adjustment-source-card .section-title {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.adjustment-line-list {
  display: grid;
  gap: 11px;
}

.adjustment-line-editor {
  display: grid;
  grid-template-columns: minmax(125px, .75fr) minmax(230px, 2fr) minmax(145px, 1fr) minmax(170px, 1fr);
  align-items: end;
  gap: 11px;
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.adjustment-line-editor:has([name="included"]:checked) {
  background: var(--brand-soft);
  border-color: rgb(18 63 54 / 28%);
}

.adjustment-line-editor label {
  margin-top: 0;
}

.adjustment-line-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
}

.adjustment-line-selector input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.adjustment-line-selector label {
  margin: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.adjustment-line-product strong,
.adjustment-line-product small {
  display: block;
}

.adjustment-line-product strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.adjustment-line-product small {
  color: var(--muted);
  font-size: 10px;
}

.adjustment-effect-note {
  margin-top: 16px;
}

.before-after-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.before-after-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.json-view {
  padding: 13px;
  margin: 0;
  color: #d9eee8;
  background: #102d27;
  border-radius: 10px;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.7 Consolas, monospace;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-item {
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 9px;
}

.detail-item small,
.detail-item strong {
  display: block;
}

.detail-item small {
  color: var(--muted);
  font-size: 10px;
}

.detail-item strong {
  margin-top: 4px;
  font-size: 12px;
  word-break: break-word;
}

.approval-tabs {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  margin-bottom: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.approval-tab {
  padding: 8px 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.approval-tab:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.approval-tab.is-active {
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow-sm);
}

.approval-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  margin-bottom: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.approval-toolbar > div {
  min-width: min(310px, 100%);
}

.approval-policy {
  padding: 13px 15px;
  margin-bottom: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--brand);
  border-radius: 10px;
}

.approval-policy-info {
  background: var(--info-soft);
  border-color: rgb(33 105 154 / 20%);
  border-inline-start-color: var(--info);
}

.approval-policy-warning {
  background: var(--warning-soft);
  border-color: rgb(167 101 18 / 20%);
  border-inline-start-color: var(--warning);
}

.approval-policy strong,
.approval-policy p {
  display: block;
}

.approval-policy strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.approval-policy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.bank-file-field input[type="file"] {
  width: 100%;
  padding: 11px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.bank-import-preview {
  min-height: 92px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow-x: auto;
}

.bank-import-preview.is-loading,
.bank-candidate-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.bank-import-preview.is-error {
  min-height: auto;
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgb(173 49 49 / 24%);
}

.bank-import-preview p,
.bank-preview-placeholder {
  margin: 0;
}

.bank-preview-placeholder {
  color: var(--muted);
}

.bank-reconciliation-workspace {
  display: grid;
  gap: 14px;
}

.bank-reconciliation-workspace .approval-policy {
  margin-bottom: 0;
}

.bank-reconciliation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--brand-soft);
  border: 1px solid rgb(18 63 54 / 18%);
  border-radius: 10px;
}

.bank-reconciliation-progress {
  color: var(--brand);
  font-size: 12px;
}

.bank-reconciliation-line {
  display: grid;
  gap: 14px;
  min-height: 210px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.bank-candidate-picker {
  display: grid;
  gap: 6px;
}

.bank-candidate-picker label {
  font-size: 12px;
  font-weight: 800;
}

.bank-candidate-loading {
  min-height: 100px;
}

.bank-candidate-loading .spinner {
  width: 26px;
  height: 26px;
  margin: 0;
  border-width: 3px;
}

.bank-candidate-details:empty {
  display: none;
}

.user-governance-table .row-actions {
  min-width: 230px;
}

.form-grid > .detail-grid {
  grid-column: 1 / -1;
}

.governance-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.governance-target span,
.field-help {
  color: var(--muted);
  font-size: 11px;
}

.field-help {
  display: block;
  margin-top: 5px;
}

.approval-reason {
  padding: 14px;
  margin: 16px 0;
  background: var(--gold-soft);
  border: 1px solid rgb(201 163 91 / 28%);
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.snapshot-card {
  min-width: 0;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.snapshot-before {
  border-top: 3px solid var(--warning);
}

.snapshot-after {
  border-top: 3px solid var(--success);
}

.snapshot-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.snapshot-card header strong,
.snapshot-card header small {
  display: block;
}

.snapshot-card header strong {
  font-size: 12px;
}

.snapshot-card header small {
  color: var(--muted);
  font-size: 10px;
}

.snapshot-summary {
  display: grid;
  gap: 10px;
}

.snapshot-summary .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.snapshot-raw {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.snapshot-raw summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.snapshot-raw[open] summary {
  margin-bottom: 8px;
}

.approval-timeline {
  display: grid;
  gap: 0;
  padding: 4px 0;
  margin: 8px 0 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: "";
  width: 2px;
  position: absolute;
  inset: 13px 5px -2px auto;
  background: var(--line);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  background: var(--gold);
  border: 3px solid var(--gold-soft);
  border-radius: 50%;
}

.timeline-item strong,
.timeline-item small,
.timeline-item p {
  display: block;
}

.timeline-item strong {
  font-size: 12px;
}

.timeline-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.timeline-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-trace {
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  margin-top: 7px !important;
  color: var(--info) !important;
  background: var(--info-soft);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.timeline-details {
  margin-top: 8px;
}

.timeline-details summary {
  width: fit-content;
  color: var(--brand);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.timeline-details .json-view {
  margin-top: 7px;
}

.audit-timeline-list {
  display: grid;
  gap: 14px;
}

.audit-operation-card {
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.audit-operation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.audit-operation-header strong,
.audit-operation-header small {
  display: block;
}

.audit-operation-header strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.audit-operation-header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.audit-operation-events {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.timeline-dot-change {
  background: var(--info);
  border-color: var(--info-soft);
}

.timeline-dot-terminal {
  background: var(--success);
  border-color: var(--success-soft);
}

.audit-change-details .snapshot-grid {
  margin-bottom: 4px;
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.approval-decision-context {
  padding: 13px 15px;
  margin-bottom: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.approval-decision-context strong {
  display: block;
  font-size: 12px;
}

.approval-decision-context p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.maker-checker-note {
  padding: 11px 13px;
  margin-top: 12px;
  color: var(--info);
  background: var(--info-soft);
  border-radius: 9px;
  font-size: 11px;
}

.fiscal-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.fiscal-metric {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.fiscal-metric small,
.fiscal-metric strong,
.fiscal-metric span {
  display: block;
}

.fiscal-metric small {
  color: var(--muted);
  font-size: 11px;
}

.fiscal-metric strong {
  margin: 4px 0;
  color: var(--brand);
  font-size: 24px;
}

.fiscal-metric span {
  color: var(--muted);
  font-size: 10px;
}

.fiscal-year-list {
  display: grid;
  gap: 14px;
}

.fiscal-year-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.fiscal-year-card[open] {
  border-color: rgb(13 86 68 / 25%);
  box-shadow: var(--shadow);
}

.fiscal-year-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
}

.fiscal-year-summary::-webkit-details-marker {
  display: none;
}

.fiscal-year-summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 20px;
  font-weight: 700;
}

.fiscal-year-card[open] > .fiscal-year-summary::after {
  content: "−";
}

.fiscal-year-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.fiscal-year-code {
  min-width: 62px;
  padding: 8px 10px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgb(13 86 68 / 15%);
  border-radius: 9px;
  direction: ltr;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.fiscal-year-identity strong,
.fiscal-year-identity small,
.fiscal-year-summary-status small {
  display: block;
}

.fiscal-year-identity strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fiscal-year-identity small,
.fiscal-year-summary-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.fiscal-year-summary-status {
  margin-inline-start: auto;
  text-align: end;
}

.fiscal-year-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}

.fiscal-year-audit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 10px;
}

.fiscal-actor strong,
.fiscal-actor small,
.fiscal-actor span {
  display: block;
  max-width: 210px;
}

.fiscal-actor strong {
  font-size: 11px;
}

.fiscal-actor small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.fiscal-actor span {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fiscal-empty-value,
.fiscal-action-note {
  color: var(--muted);
  font-size: 10px;
}

.fiscal-action-note {
  display: inline-block;
  padding: 6px 8px;
  background: var(--surface-soft);
  border-radius: 7px;
  white-space: nowrap;
}

.fiscal-calendar-note {
  padding: 11px 13px;
  margin: 4px 0 0;
  color: var(--info);
  background: var(--info-soft);
  border-radius: 9px;
  font-size: 11px;
}

.fiscal-calendar-preview .section-title {
  margin-top: 14px;
}

.fiscal-calendar-preview .section-title small {
  color: var(--success);
  font-size: 10px;
}

.fiscal-calendar-preview .table-shell {
  max-height: 340px;
  overflow: auto;
}

.fiscal-calendar-preview thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.fiscal-action-guidance,
.fiscal-lock-warning {
  padding: 12px 14px;
  margin: 15px 0;
  background: var(--info-soft);
  border: 1px solid rgb(33 105 154 / 18%);
  border-radius: 10px;
}

.fiscal-lock-warning {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgb(157 52 52 / 20%);
}

.fiscal-action-guidance strong,
.fiscal-lock-warning strong {
  display: block;
  font-size: 12px;
}

.fiscal-action-guidance p,
.fiscal-lock-warning p {
  margin: 4px 0 0;
  font-size: 11px;
}

.einvoice-foundation-notice {
  display: grid;
  gap: 5px;
  padding: 15px 17px;
  margin-bottom: 18px;
  color: #744c12;
  background: #fff7e5;
  border: 1px solid #efd5a1;
  border-inline-start: 5px solid var(--gold);
  border-radius: var(--radius);
}

.einvoice-foundation-notice strong {
  font-size: 13px;
}

.einvoice-foundation-notice p {
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
}

.einvoice-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.einvoice-metric {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid #87958f;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.einvoice-metric-success {
  border-top-color: var(--success);
}

.einvoice-metric-danger {
  border-top-color: var(--danger);
}

.einvoice-metric-warning {
  border-top-color: var(--warning);
}

.einvoice-metric-info {
  border-top-color: var(--info);
}

.einvoice-metric small,
.einvoice-metric span {
  color: var(--muted);
  font-size: 10px;
}

.einvoice-metric strong {
  color: var(--brand-deep);
  font-size: 16px;
}

.einvoice-profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 15px;
}

.einvoice-profile-card {
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-inline-start: 4px solid #84918c;
  border-radius: 12px;
}

.einvoice-profile-active {
  border-inline-start-color: var(--success);
}

.einvoice-profile-pending,
.einvoice-profile-candidate {
  border-inline-start-color: var(--warning);
}

.einvoice-profile-card > header,
.einvoice-readiness-item > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.einvoice-profile-card h4 {
  margin: 3px 0 0;
  color: var(--brand-deep);
  font-size: 14px;
}

.einvoice-profile-card header small,
.einvoice-decision-note small,
.einvoice-readiness-summary small,
.einvoice-readiness-item header small {
  color: var(--muted);
  font-size: 10px;
}

.einvoice-decision-note {
  padding: 11px 13px;
  margin-top: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.einvoice-decision-note p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.7;
}

.einvoice-readiness-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.einvoice-readiness-summary > div {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 78px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.einvoice-readiness-items {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.einvoice-readiness-item {
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--success);
  border-radius: 10px;
}

.einvoice-readiness-item.is-blocking {
  background: #fff9f8;
  border-color: #ebcbc5;
  border-inline-start-color: var(--danger);
}

.einvoice-readiness-item header {
  margin-bottom: 8px;
}

.einvoice-readiness-item header strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.7;
}

.einvoice-readiness-item code {
  display: inline-block;
  padding: 3px 7px;
  color: #35544a;
  background: #eaf2ee;
  border-radius: 6px;
  font-size: 9px;
}

.einvoice-readiness-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.einvoice-candidate-form .section-title {
  margin-top: 22px;
}

@media (max-width: 650px) {
  .einvoice-profile-list,
  .einvoice-overview,
  .einvoice-readiness-summary {
    grid-template-columns: 1fr;
  }

  .einvoice-profile-card > header,
  .einvoice-readiness-item > header {
    align-items: stretch;
    flex-direction: column;
  }
}

.toast-region {
  display: grid;
  gap: 9px;
  width: min(370px, calc(100vw - 28px));
  position: fixed;
  inset: auto 18px 18px auto;
  z-index: 100;
}

.toast {
  padding: 13px 15px;
  color: #fff;
  background: var(--brand-deep);
  border-inline-start: 4px solid var(--gold);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
}

.toast-error {
  background: #722929;
  border-inline-start-color: #f7aaaa;
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .budget-kpi-grid,
  .budget-variance-summary {
    grid-template-columns: repeat(2, minmax(135px, 1fr));
  }

  .aging-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .fiscal-overview {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .application {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(290px, 88vw);
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-grid;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .global-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .work-wave-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adjustment-line-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adjustment-line-product {
    grid-column: 1 / -1;
  }

  .user-copy {
    display: none;
  }
}

@media (max-width: 650px) {
  .topbar {
    min-height: 74px;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .avatar {
    display: none;
  }

  .user-area .button {
    display: inline-flex;
    min-height: 34px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .content {
    padding: 16px 12px 28px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics-grid,
  .work-wave-summary,
  .budget-kpi-grid,
  .budget-variance-summary,
  .aging-grid,
  .fiscal-overview,
  .filters,
  .form-grid,
  .detail-grid,
  .snapshot-grid {
    grid-template-columns: 1fr;
  }

  .approval-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-reconciliation-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-reconciliation-toolbar .page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bank-reconciliation-toolbar .page-actions .button:last-child {
    grid-column: 1 / -1;
  }

  .approval-toolbar > div {
    min-width: 0;
  }

  .approval-tabs,
  .decision-actions {
    width: 100%;
  }

  .approval-tab,
  .decision-actions .button {
    flex: 1;
  }

  .governance-target {
    align-items: stretch;
    flex-direction: column;
  }

  .fiscal-year-summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px;
  }

  .fiscal-year-summary-status {
    width: calc(100% - 34px);
    margin-inline-start: 0;
    text-align: start;
  }

  .fiscal-year-body {
    padding: 0 12px 14px;
  }

  .comparison-row {
    grid-template-columns: 90px 1fr;
  }

  .comparison-row strong {
    grid-column: 2;
  }

  .line-item {
    grid-template-columns: 1fr 1fr;
  }

  .line-item > :first-child {
    grid-column: 1 / -1;
  }

  .work-wave-selected-task {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .inventory-replenishment-allocation-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .inventory-replenishment-allocation-row > div:first-child {
    grid-column: 2;
  }

  .inventory-replenishment-allocation-row input[type="number"] {
    grid-column: 1 / -1;
  }

  .work-wave-selected-task .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .adjustment-line-editor {
    grid-template-columns: 1fr;
  }

  .adjustment-line-product {
    grid-column: auto;
  }

  .adjustment-line-selector {
    min-height: auto;
  }

  .login-main {
    padding: 28px 20px;
  }

  .brand-login {
    margin-bottom: 46px;
  }

  .mfa-secret-card {
    align-items: stretch;
    flex-direction: column;
  }

  .mfa-secret-card .button,
  .mfa-recovery-actions .button {
    width: 100%;
  }

  .mfa-recovery-code-list,
  .mfa-recovery-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
