:root {
  color-scheme: light;
  --canvas: #f5f2ea;
  --paper: #fffefa;
  --paper-soft: #fbfaf5;
  --ink: #1c2925;
  --muted: #69736f;
  --line: #e2ded3;
  --line-dark: #a7aeaa;
  --terracotta: #c65338;
  --terracotta-dark: #a33c27;
  --sand: #ead9ba;
  --sage: #5e806d;
  --sage-dark: #3e6551;
  --sage-pale: #e2ece5;
  --amber: #9d6d22;
  --amber-pale: #f5ead3;
  --blue: #3e6671;
  --blue-pale: #e2edef;
  --rose-pale: #f1ddd7;
  --danger: #a13b32;
  --shadow: 0 24px 70px rgba(23, 32, 29, 0.12);
  --shadow-soft: 0 12px 34px rgba(23, 32, 29, 0.07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(500px, 1.45fr);
}

body.dashboard-active .app-shell {
  grid-template-columns: minmax(270px, 0.55fr) minmax(720px, 2fr);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: max(38px, env(safe-area-inset-top)) 54px max(38px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 88%, rgba(234, 217, 186, 0.14) 0 2px, transparent 3px) 0 0 / 27px 27px,
    radial-gradient(circle at 86% 17%, rgba(94, 128, 109, 0.32), transparent 31%),
    linear-gradient(145deg, #182520 0%, #1c2d27 55%, #243a31 100%);
  color: var(--paper);
}

.brand-panel::after {
  position: absolute;
  right: -150px;
  bottom: -190px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(234, 217, 186, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 54px rgba(234, 217, 186, 0.035),
    0 0 0 108px rgba(234, 217, 186, 0.025);
  content: "";
  pointer-events: none;
}

.brand-lockup,
.brand-message,
.security-points,
.service-chip {
  position: relative;
  z-index: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234, 217, 186, 0.46);
  border-radius: 15px;
  background: rgba(255, 254, 250, 0.08);
  color: var(--sand);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-name,
.brand-product {
  margin: 0;
}

.brand-name {
  color: var(--paper);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-product {
  margin-top: 2px;
  color: rgba(255, 254, 250, 0.58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-message {
  max-width: 510px;
  margin: auto 0 42px;
  padding-top: 72px;
}

.eyebrow {
  margin: 0;
  color: var(--terracotta);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.eyebrow-light {
  color: var(--sand);
}

.brand-message h1 {
  max-width: 500px;
  margin: 15px 0 18px;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 4.5vw, 62px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

body.dashboard-active .brand-message h1 {
  font-size: clamp(34px, 3.5vw, 49px);
}

.brand-message > p:last-child {
  max-width: 460px;
  margin: 0;
  color: rgba(255, 254, 250, 0.68);
  font-size: 14px;
  line-height: 1.7;
}

.security-points {
  display: grid;
  gap: 18px;
  margin-bottom: 42px;
}

.security-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.security-icon {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(94, 128, 109, 0.34);
  color: #c8decf;
  font-size: 12px;
  font-weight: 900;
}

.security-point strong,
.security-point span:last-child {
  display: block;
}

.security-point strong {
  color: rgba(255, 254, 250, 0.92);
  font-size: 12px;
  font-weight: 800;
}

.security-point span:last-child {
  margin-top: 3px;
  color: rgba(255, 254, 250, 0.52);
  font-size: 10px;
  line-height: 1.45;
}

.service-chip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 254, 250, 0.1);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.06);
  color: rgba(255, 254, 250, 0.68);
  font-size: 10px;
  font-weight: 700;
}

.service-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8dbc9e;
  box-shadow: 0 0 0 4px rgba(141, 188, 158, 0.12);
}

.access-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 100%;
  padding: max(40px, env(safe-area-inset-top)) 42px max(30px, env(safe-area-inset-bottom));
  background:
    linear-gradient(rgba(226, 222, 211, 0.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 222, 211, 0.32) 1px, transparent 1px),
    var(--canvas);
  background-size: 48px 48px;
}

.access-frame {
  width: min(100%, 560px);
}

body.dashboard-active .access-frame {
  width: min(100%, 1180px);
}

.employee-benefits-workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(500px, 1.45fr);
  gap: 18px;
  align-items: start;
}

.employee-benefit-list-panel,
.employee-benefit-admin-panel {
  min-width: 0;
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.employee-benefit-search {
  margin: 22px 0 18px;
}

.search-control {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.search-control input,
.employee-benefit-form input,
.employee-benefit-form select,
.benefit-commit-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--paper-soft);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.search-control input:focus,
.employee-benefit-form input:focus,
.employee-benefit-form select:focus,
.benefit-commit-form input:focus {
  border-color: var(--sage);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(94, 128, 109, 0.1);
}

.search-control input {
  min-width: 0;
  flex: 1;
}

.search-control .compact-button {
  flex: 0 0 auto;
  padding: 0 16px;
}

.employee-benefit-list {
  display: grid;
  gap: 9px;
  max-height: 720px;
  overflow: auto;
  padding-right: 3px;
}

.employee-benefit-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper-soft);
}

.employee-benefit-card strong,
.employee-benefit-card span,
.employee-benefit-card small {
  display: block;
}

.employee-benefit-card strong {
  color: var(--ink);
  font-size: 13px;
}

.employee-benefit-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.employee-benefit-code {
  color: var(--sage-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.employee-benefit-balance {
  text-align: right;
}

.employee-benefit-balance strong {
  color: var(--terracotta-dark);
  font-size: 15px;
}

.balance-state {
  align-self: end;
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.balance-state.low {
  background: var(--amber-pale);
  color: var(--amber);
}

.balance-state.exhausted {
  background: var(--rose-pale);
  color: var(--danger);
}

.template-download {
  padding: 0 14px;
  background: var(--sage-dark);
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.benefit-policy-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 20px 0;
}

.benefit-policy-strip > div {
  padding: 13px;
  border-radius: 14px;
  background: var(--sage-pale);
}

.benefit-policy-strip strong,
.benefit-policy-strip span {
  display: block;
}

.benefit-policy-strip strong {
  color: var(--sage-dark);
  font-size: 14px;
}

.benefit-policy-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.benefit-entry-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
}

.benefit-entry-section summary {
  padding: 15px 17px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.employee-benefit-form {
  padding: 0 17px 18px;
}

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

.form-grid .wide-field {
  grid-column: span 2;
}

.employee-benefit-form .field-label,
.benefit-commit-form .field-label {
  display: block;
  margin-bottom: 7px;
}

.benefit-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.benefit-check input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

.benefit-preview-button {
  width: auto;
  min-height: 48px;
  margin-top: 16px;
  gap: 22px;
}

.form-explanation {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.file-drop {
  min-height: 118px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 17px;
  border: 1px dashed var(--sage);
  border-radius: 15px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  cursor: pointer;
  text-align: center;
}

.file-drop > span {
  font-size: 24px;
  font-weight: 500;
}

.file-drop strong {
  font-size: 12px;
}

.file-drop small {
  color: var(--muted);
  font-size: 9px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.benefit-preview {
  margin-top: 17px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper-soft);
}

.benefit-preview h3,
.benefit-preview p {
  margin: 0;
}

.benefit-preview p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.benefit-preview-rows,
.benefit-preview-errors {
  display: grid;
  gap: 6px;
  margin-top: 13px;
}

.benefit-preview-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  font-size: 9px;
}

.benefit-preview-row strong,
.benefit-preview-row span {
  min-width: 0;
}

.benefit-preview-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.benefit-preview-error {
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--rose-pale);
  color: var(--danger);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
}

.benefit-commit-form {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(120px, 0.7fr);
  gap: 12px;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.benefit-commit-button {
  grid-column: span 2;
  margin-top: 0;
}

@media (max-width: 1100px) {
  .employee-benefits-workspace {
    grid-template-columns: 1fr;
  }

  .employee-benefit-list {
    max-height: 420px;
  }
}

@media (max-width: 620px) {
  .benefit-policy-strip,
  .form-grid,
  .benefit-commit-form {
    grid-template-columns: 1fr;
  }

  .form-grid .wide-field,
  .benefit-commit-button {
    grid-column: span 1;
  }

  .benefit-preview-row {
    grid-template-columns: 1fr;
  }
}

.card {
  width: 100%;
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid rgba(226, 222, 211, 0.9);
  border-radius: 26px;
  background: rgba(255, 254, 250, 0.97);
  box-shadow: var(--shadow);
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 180px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-card p,
.inline-status span:last-child {
  margin: 0;
}

.loader {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-small {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

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

.card-header h2,
.dashboard-header h2,
.panel-heading h2,
.detail-header h2,
.provision-copy h2,
.permission-card h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: clamp(27px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.card-header > p:last-child {
  max-width: 420px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

#login-form {
  margin-top: 30px;
}

.field-label,
.label-row > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
}

.label-row > span {
  color: var(--line-dark);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.input-shell {
  display: flex;
  align-items: center;
  min-height: 56px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--sage);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(94, 128, 109, 0.11);
}

.input-prefix {
  width: 47px;
  flex: 0 0 auto;
  color: var(--sage-dark);
  text-align: center;
  font-size: 16px;
  font-weight: 900;
}

.pin-prefix {
  color: var(--terracotta);
  font-size: 11px;
  letter-spacing: -0.05em;
}

.input-shell input {
  min-width: 0;
  flex: 1;
  height: 54px;
  padding: 0 14px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

.input-shell input::placeholder,
.provision-form input::placeholder {
  color: var(--line-dark);
  font-weight: 600;
}

#pin {
  letter-spacing: 0.2em;
}

.input-action {
  height: 38px;
  margin-right: 8px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.input-action:hover {
  filter: brightness(0.98);
}

.field-help {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.field-help strong {
  color: var(--sage-dark);
}

.error-message,
.form-message {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--rose-pale);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.form-message.success {
  background: var(--sage-pale);
  color: var(--sage-dark);
}

.primary-button,
.compact-button,
.icon-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 130ms ease, filter 130ms ease, opacity 130ms ease;
}

.primary-button {
  width: 100%;
  min-height: 55px;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 19px 0 22px;
  background: var(--terracotta);
  color: var(--paper);
  box-shadow: 0 11px 26px rgba(198, 83, 56, 0.22);
  font-size: 12px;
}

.primary-button:hover,
.compact-button:hover,
.icon-button:hover,
.branch-card:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.primary-button:active,
.compact-button:active,
.icon-button:active,
.branch-card:active {
  transform: translateY(0);
}

.primary-button:disabled,
.compact-button:disabled,
.icon-button:disabled,
.input-action:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.5;
  transform: none;
}

.button-arrow {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 16px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.privacy-note > span {
  color: var(--sage-dark);
  font-size: 17px;
  font-weight: 900;
}

.privacy-note p {
  margin: 1px 0 0;
  font-size: 9px;
  line-height: 1.55;
}

.dashboard-view {
  width: 100%;
}

.dashboard-header {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(360px, 1.45fr) auto;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.session-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.session-identity {
  min-width: 0;
}

.dashboard-header h2 {
  overflow: hidden;
  margin-top: 4px;
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.role-chip,
.active-chip,
.setup-chip,
.mini-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-chip {
  padding: 5px 8px;
  background: var(--rose-pale);
  color: var(--terracotta-dark);
}

.active-chip {
  gap: 6px;
  padding: 5px 8px;
  background: var(--sage-pale);
  color: var(--sage-dark);
}

.active-chip > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
}

.session-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding: 0 18px;
  border-inline: 1px solid var(--line);
}

.session-context div {
  min-width: 0;
}

.session-context dt {
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-context dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 10px;
}

.dashboard-message {
  margin-top: 14px;
}

.permission-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.permission-card h2 {
  margin: 0;
  font-size: 22px;
}

.permission-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.permission-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--amber-pale);
  color: var(--amber);
  font-family: Georgia, serif;
  font-weight: 900;
}

.branches-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(430px, 1.22fr);
  gap: 16px;
  margin-top: 16px;
}

.branches-panel,
.detail-panel,
.provision-panel {
  padding: 26px;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.panel-heading,
.detail-header,
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading h2,
.detail-header h2,
.provision-copy h2 {
  font-size: 25px;
}

.panel-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.icon-button {
  width: 42px;
  min-height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--sage-dark);
  font-size: 19px;
}

.inline-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.branch-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.branch-card {
  width: 100%;
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 130ms ease, filter 130ms ease;
}

.branch-card[aria-current="true"] {
  border-color: var(--sage);
  background: #f2f7f3;
  box-shadow: inset 4px 0 0 var(--sage);
}

.branch-card-heading,
.branch-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.branch-card-name {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
}

.branch-card-arrow {
  color: var(--line-dark);
  font-size: 15px;
}

.branch-card-meta {
  align-items: flex-end;
  margin-top: 11px;
}

.branch-card-facts {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
}

.mini-status,
.setup-chip {
  flex: 0 0 auto;
  padding: 6px 8px;
}

.status-pending-equipment,
.status-pending-catalog {
  background: var(--amber-pale);
  color: var(--amber);
}

.status-core-configured {
  background: var(--sage-pale);
  color: var(--sage-dark);
}

.status-inactive,
.status-not-operational,
.status-unknown {
  background: #eceae4;
  color: var(--muted);
}

.empty-state,
.detail-placeholder {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.detail-placeholder h2 {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.empty-state p,
.detail-placeholder p {
  margin: 7px auto 0;
  font-size: 10px;
  line-height: 1.6;
}

.detail-placeholder > span {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-size: 21px;
}

.detail-loading {
  margin-top: 0;
}

.detail-header {
  align-items: center;
}

.technical-id {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  overflow-wrap: anywhere;
}

.status-note {
  margin: 15px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--sage);
  border-radius: 0 9px 9px 0;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

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

.metrics-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
}

.metrics-grid dt {
  min-height: 24px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-transform: uppercase;
}

.metrics-grid dd {
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.detail-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-heading-row {
  align-items: center;
}

.section-heading-row h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
}

.section-heading-row > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.terminal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.terminal-item {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border-radius: 11px;
  background: var(--paper-soft);
}

.terminal-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}

.terminal-copy {
  min-width: 0;
}

.terminal-copy strong,
.terminal-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-copy strong {
  font-size: 9px;
}

.terminal-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.terminal-item.inactive {
  opacity: 0.55;
}

.section-empty {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 9px;
}

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

.check-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--paper-soft);
}

.check-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eceae4;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.check-item.complete .check-icon {
  background: var(--sage-pale);
  color: var(--sage-dark);
}

.check-item.manual .check-icon {
  background: var(--amber-pale);
  color: var(--amber);
}

.check-label {
  min-width: 0;
  font-size: 9px;
  font-weight: 800;
}

.check-state {
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.manual-warning {
  margin: 12px 0 0;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--amber-pale);
  color: #73501c;
  font-size: 8px;
  line-height: 1.55;
}

.provision-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(420px, 1.25fr);
  gap: 34px;
  margin-top: 16px;
}

.provision-copy p:last-child {
  max-width: 400px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

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

.provision-form input {
  width: 100%;
  height: 48px;
  margin-top: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.provision-form input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(94, 128, 109, 0.11);
}

.provision-form .form-message {
  grid-column: 1 / -1;
  margin-top: 0;
}

.provision-button {
  grid-column: 1 / -1;
  margin-top: 0;
}

.auditor-note {
  margin: 14px 0 0;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.82);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 8px;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.dashboard-tab {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.dashboard-tab[aria-current="page"] {
  border-color: var(--line);
  background: var(--paper-soft);
  color: var(--ink);
  box-shadow: 0 5px 16px rgba(23, 32, 29, 0.06);
}

.dashboard-tab > span:nth-child(2) {
  min-width: 0;
}

.dashboard-tab strong,
.dashboard-tab small {
  display: block;
}

.dashboard-tab strong {
  font-size: 11px;
  font-weight: 900;
}

.dashboard-tab small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-size: 13px;
  font-weight: 900;
}

.tab-badge {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--terracotta);
  color: var(--paper);
  font-size: 9px;
  font-weight: 900;
}

.tab-badge.empty {
  background: #e9e6de;
  color: var(--muted);
}

.authorization-workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.76fr) minmax(450px, 1.24fr);
  gap: 16px;
  margin-top: 16px;
}

.authorization-list-panel,
.authorization-detail-panel {
  padding: 26px;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.authorization-filters {
  display: flex;
  gap: 7px;
  margin-top: 18px;
}

.filter-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  font-size: 8px;
  font-weight: 900;
}

.filter-button[aria-pressed="true"] {
  border-color: var(--sage);
  background: var(--sage-pale);
  color: var(--sage-dark);
}

.authorization-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.authorization-card {
  width: 100%;
  display: block;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.authorization-card[aria-current="true"] {
  border-color: var(--terracotta);
  background: #fff8f4;
  box-shadow: inset 4px 0 0 var(--terracotta);
}

.authorization-card-top,
.authorization-card-meta,
.authorization-card-operation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.authorization-card-branch {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.authorization-card-operation {
  align-items: flex-start;
  margin-top: 8px;
}

.authorization-card-operation strong {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.authorization-card-value {
  color: var(--terracotta-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.authorization-card-meta {
  align-items: flex-start;
  margin-top: 9px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.45;
}

.authorization-status {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--amber-pale);
  color: var(--amber);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.authorization-status.applied {
  background: var(--sage-pale);
  color: var(--sage-dark);
}

.authorization-status.rejected,
.authorization-status.expired,
.authorization-status.stale {
  background: #eceae4;
  color: var(--muted);
}

.live-update-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 15px 2px 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.live-update-note > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(94, 128, 109, 0.12);
}

.authorization-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.authorization-detail-header h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.authorization-metrics,
.authorization-timestamps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
}

.authorization-metrics div,
.authorization-timestamps div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-soft);
}

.authorization-metrics dt,
.authorization-timestamps dt {
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.authorization-metrics dd,
.authorization-timestamps dd {
  overflow-wrap: anywhere;
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
}

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

.authorization-evidence {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.authorization-evidence h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 900;
}

.authorization-evidence > p {
  margin: 8px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

#authorization-percentage {
  color: var(--terracotta-dark);
  font-size: 18px;
  font-weight: 900;
}

.authorization-items {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.authorization-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--paper-soft);
}

.authorization-item-quantity {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--rose-pale);
  color: var(--terracotta-dark);
  font-size: 9px;
  font-weight: 900;
}

.authorization-item strong {
  min-width: 0;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.4;
}

.authorization-item small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.stale-note,
.decision-summary {
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--amber-pale);
  color: #73501c;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.55;
}

.decision-summary {
  background: var(--sage-pale);
  color: var(--sage-dark);
}

.decision-summary.not-applied {
  background: var(--amber-pale);
  color: #73501c;
}

.authorization-actions {
  display: grid;
  grid-template-columns: minmax(120px, 0.72fr) minmax(190px, 1.28fr);
  gap: 9px;
  margin-top: 18px;
}

.authorization-approve-button {
  margin-top: 0;
}

.secondary-danger-button {
  min-height: 55px;
  padding: 0 16px;
  border: 1px solid #d7aaa2;
  border-radius: 14px;
  background: var(--paper);
  color: var(--danger);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 25, 22, 0.64);
  backdrop-filter: blur(7px);
}

.authorization-modal-card {
  width: min(100%, 510px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 30px;
  border-radius: 22px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-header h2 {
  margin: 7px 0 0;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.modal-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-copy {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

#authorization-decision-form textarea {
  width: 100%;
  min-height: 92px;
  margin-top: 8px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

#authorization-decision-form textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(94, 128, 109, 0.11);
}

.modal-actions {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 9px;
  margin-top: 20px;
}

.modal-submit {
  margin-top: 0;
}

.noscript-card {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.access-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

:focus-visible {
  outline: 3px solid rgba(198, 83, 56, 0.34);
  outline-offset: 3px;
}

@media (max-width: 1280px) {
  body.dashboard-active .app-shell {
    grid-template-columns: 250px minmax(680px, 1fr);
  }

  body.dashboard-active .brand-panel {
    padding-inline: 34px;
  }

  .branches-workspace {
    grid-template-columns: minmax(275px, 0.72fr) minmax(400px, 1.28fr);
  }

  .authorization-workspace {
    grid-template-columns: minmax(285px, 0.7fr) minmax(420px, 1.3fr);
  }

  .dashboard-header {
    grid-template-columns: auto minmax(150px, 1fr) auto;
  }

  .session-context {
    display: none;
  }

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

@media (max-width: 1040px) {
  .app-shell,
  body.dashboard-active .app-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel,
  body.dashboard-active .brand-panel {
    min-height: auto;
    padding: max(24px, env(safe-area-inset-top)) 28px 30px;
  }

  .brand-message {
    margin: 58px 0 0;
    padding: 0;
  }

  .brand-message h1,
  body.dashboard-active .brand-message h1 {
    max-width: 680px;
    font-size: clamp(36px, 7vw, 54px);
  }

  .security-points {
    grid-template-columns: repeat(3, 1fr);
    margin: 32px 0;
  }

  .access-panel {
    min-height: auto;
    padding: 48px 24px max(32px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 800px) {
  .branches-workspace,
  .provision-panel,
  .authorization-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    grid-template-columns: auto 1fr auto;
  }

  .terminal-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand-panel,
  body.dashboard-active .brand-panel {
    padding-inline: 21px;
  }

  .brand-message {
    margin-top: 46px;
  }

  .brand-message > p:last-child {
    font-size: 12px;
  }

  .security-points {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .service-chip {
    display: none;
  }

  .access-panel {
    padding: 30px 14px max(24px, env(safe-area-inset-bottom));
  }

  .card {
    padding: 27px 20px;
    border-radius: 21px;
  }

  .dashboard-header {
    grid-template-columns: auto 1fr;
    padding: 18px;
  }

  .dashboard-header .compact-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .branches-panel,
  .detail-panel,
  .provision-panel,
  .authorization-list-panel,
  .authorization-detail-panel {
    padding: 20px;
  }

  .dashboard-tabs {
    flex-direction: column;
  }

  .authorization-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .authorization-actions,
  .modal-actions {
    grid-template-columns: 1fr;
  }

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

  .metrics-grid,
  .provision-form {
    grid-template-columns: 1fr;
  }

  .provision-form .form-message,
  .provision-button {
    grid-column: 1;
  }

  .branch-card-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

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