:root {
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: #f7fafc;
  --ink: #151821;
  --muted: #647083;
  --line: rgba(29, 38, 54, 0.11);
  --gold: #d8872b;
  --forest: #0f766e;
  --coral: #dc5a3b;
  --accent: #2563eb;
  --violet: #7c3aed;
  --shadow: 0 18px 42px rgba(22, 31, 49, 0.09);
  --shadow-soft: 0 10px 24px rgba(22, 31, 49, 0.06);
  --radius: 8px;
  --topbar-height: 76px;
  --sidebar-rail-width: 82px;
  --sidebar-open-width: 300px;
  --sidebar-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.08), transparent 36%),
    linear-gradient(240deg, rgba(15, 118, 110, 0.09), transparent 42%),
    linear-gradient(180deg, #f8fafc 0%, #edf3f7 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(29, 38, 54, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 38, 54, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 78%);
}

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

button,
a,
input,
select,
textarea {
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
}

.hidden,
.hidden-force {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-auth-shell {
  position: relative;
  place-items: center;
  padding: clamp(26px, 7vh, 78px) clamp(18px, 4vw, 48px) 24px;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.08), transparent 36%),
    linear-gradient(240deg, rgba(15, 118, 110, 0.09), transparent 42%),
    linear-gradient(180deg, #f8fafc 0%, #edf3f7 100%);
  isolation: isolate;
}

.login-auth-shell::before {
  content: none;
}

.auth-card,
.sidebar-card,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), rgba(255, 255, 255, 0.76));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(460px, 100%);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.login-auth-shell .auth-card {
  width: min(390px, 100%);
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(29, 38, 54, 0.12);
  backdrop-filter: blur(20px);
  box-shadow: 0 22px 54px rgba(22, 31, 49, 0.12);
}

.login-auth-shell .auth-card::before {
  background: linear-gradient(90deg, var(--forest), var(--accent), var(--gold));
}

.login-auth-shell .auth-brand {
  color: var(--ink);
}

.login-brand-text {
  margin: 4px 0 18px;
  color: var(--ink);
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.login-card-head .eyebrow {
  margin-bottom: 4px;
  color: var(--forest);
}

.login-card-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1.1;
}

.login-lock {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: var(--radius);
  color: var(--accent);
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.login-lock svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-auth-shell .login-form {
  gap: 16px;
  margin-top: 20px;
}

.login-auth-shell label > span:not(.field-error) {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.1;
}

.login-auth-shell .login-form input {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.login-auth-shell .login-form input.input-error {
  border-color: rgba(220, 90, 59, 0.62);
  background: rgba(255, 248, 246, 0.94);
  box-shadow: 0 0 0 4px rgba(220, 90, 59, 0.1);
}

.login-auth-shell .login-form input::placeholder {
  color: rgba(100, 112, 131, 0.68);
}

.field-error {
  display: none;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: none;
}

.field-error.has-error {
  display: inline-flex;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(220, 90, 59, 0.22);
  background: rgba(255, 241, 238, 0.92);
  box-shadow: 0 8px 18px rgba(220, 90, 59, 0.08);
}

.field-error.has-error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
}

.login-auth-shell .primary-button {
  background: linear-gradient(135deg, var(--forest), var(--accent));
  color: #ffffff;
  width: 100%;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.login-auth-shell .auth-error {
  color: var(--accent);
}

.login-auth-shell .auth-error:not(:empty) {
  display: block;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius);
  background: rgba(239, 246, 255, 0.9);
  color: var(--accent);
  font-weight: 700;
  line-height: 1.35;
}

.resend-otp-button {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.15;
}

.resend-otp-button:hover {
  background: rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--forest), var(--accent), var(--gold));
}

.auth-brand {
  text-align: center;
}

.auth-card h1,
.hero h2,
.panel h3,
.sidebar h1 {
  margin: 0;
}

.auth-copy,
.auth-hint,
.auth-error,
.sidebar-card span,
.allocation-meta,
.activity-meta,
.spotlight-item p,
th,
td {
  color: var(--muted);
}

.auth-error {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--coral);
}

.auth-hint {
  margin: 10px 0 0;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

.login-form,
.search,
.data-form label {
  display: grid;
  gap: 8px;
}

.login-form {
  margin-top: 20px;
}

.auth-button {
  margin-top: 10px;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-rail-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 340ms var(--sidebar-ease);
  overflow-x: hidden;
  will-change: grid-template-columns;
}

body.sidebar-open .shell {
  grid-template-columns: var(--sidebar-open-width) minmax(0, 1fr);
}

.topbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin: -28px -28px 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.topbar-left,
.topbar-actions,
.topbar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-left {
  gap: 14px;
}

.topbar-actions {
  gap: 10px;
}

.topbar-brand {
  gap: 10px;
  align-items: center;
}

.topbar-brand > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.topbar-brand strong {
  line-height: 1.1;
}

.topbar-brand span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.2;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a4480, #2563eb);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.sidebar-toggle-bars {
  width: 18px;
  height: 12px;
  display: inline-block;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 2px no-repeat;
  opacity: 0.75;
}

.sidebar-backdrop {
  display: none;
}

body.no-scroll {
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 250, 0.9)),
    var(--surface-strong);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.sidebar h1 {
  font-size: 1.8rem;
  line-height: 1;
}

.sidebar .eyebrow,
.sidebar-card .sidebar-label,
.sidebar-card span,
.sidebar-card .credential-line {
  color: var(--muted);
}

@media (min-width: 1121px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    align-self: start;
  }
}

.nav {
  display: grid;
  gap: 10px;
  margin: 32px 0 24px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
}

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

.nav-text {
  min-width: 0;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(15, 118, 110, 0.09);
  color: var(--forest);
  box-shadow: inset 3px 0 0 var(--forest);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  color: var(--forest);
  background: rgba(15, 118, 110, 0.1);
}

.sidebar-card {
  padding: 18px;
  min-width: 0;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.sidebar-card > strong,
.stat-card strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.12;
  margin-bottom: 8px;
}

.sidebar-card > strong {
  overflow-wrap: anywhere;
}

.credential-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.credential-line {
  display: grid;
  gap: 3px;
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.35;
}

.credential-line strong {
  display: block;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.2;
  color: var(--ink);
}

.credential-line span {
  overflow-wrap: anywhere;
}

/* Compact ERP-style sidebar rail */
.topbar .sidebar-toggle {
  display: none;
}

.sidebar {
  align-items: center;
  width: var(--sidebar-rail-width);
  padding: 22px 8px;
  border-right: none;
  background: linear-gradient(180deg, #071327 0%, #071226 100%);
  color: #d8e2f2;
  box-shadow: 18px 0 48px rgba(7, 18, 38, 0.14);
  transition:
    width 340ms var(--sidebar-ease),
    padding 340ms var(--sidebar-ease),
    box-shadow 340ms var(--sidebar-ease);
  overflow-x: clip;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  will-change: width, padding;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-rail-toggle {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #16273d;
  color: #d8e2f2;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition:
    width 340ms var(--sidebar-ease),
    height 340ms var(--sidebar-ease),
    min-height 340ms var(--sidebar-ease),
    padding 340ms var(--sidebar-ease),
    gap 340ms var(--sidebar-ease),
    border-radius 260ms ease,
    background 260ms ease,
    box-shadow 260ms ease;
}

.sidebar-rail-toggle .eyebrow,
.sidebar-rail-toggle h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 180ms ease,
    transform 260ms var(--sidebar-ease);
}

.sidebar-rail-toggle::before {
  content: "";
  width: 28px;
  height: 20px;
  background:
    linear-gradient(#d8e2f2, #d8e2f2) 0 0 / 100% 3px no-repeat,
    linear-gradient(#d8e2f2, #d8e2f2) 0 50% / 100% 3px no-repeat,
    linear-gradient(#d8e2f2, #d8e2f2) 0 100% / 100% 3px no-repeat;
  opacity: 0.9;
  transition:
    width 340ms var(--sidebar-ease),
    height 340ms var(--sidebar-ease),
    opacity 200ms ease;
}

body.sidebar-open .sidebar {
  align-items: stretch;
  width: var(--sidebar-open-width);
  padding: 28px 20px;
}

body.sidebar-open .sidebar-rail-toggle {
  width: 100%;
  height: auto;
  min-height: 74px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  justify-items: start;
  padding: 14px 16px;
}

body.sidebar-open .sidebar-rail-toggle::before {
  width: 30px;
  height: 22px;
  grid-row: 1 / 3;
  align-self: center;
}

body.sidebar-open .sidebar-rail-toggle .eyebrow,
body.sidebar-open .sidebar-rail-toggle h1 {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  opacity: 1;
  transform: translateX(0);
  transition-delay: 100ms;
}

body.sidebar-open .sidebar-rail-toggle .eyebrow {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 2px;
  color: rgba(216, 226, 242, 0.62);
  font-size: 0.68rem;
}

body.sidebar-open .sidebar-rail-toggle h1 {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1.05;
}

.nav {
  width: 100%;
  justify-items: center;
  gap: 16px;
  margin: 42px 0 20px;
  transition:
    gap 300ms var(--sidebar-ease),
    margin 300ms var(--sidebar-ease);
}

body.sidebar-open .nav {
  justify-items: stretch;
  gap: 10px;
  margin-top: 28px;
}

.nav-link {
  position: relative;
  width: 56px;
  height: 56px;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-radius: 18px;
  color: #bac7da;
  overflow: visible;
  transition:
    width 340ms var(--sidebar-ease),
    height 340ms var(--sidebar-ease),
    padding 340ms var(--sidebar-ease),
    gap 340ms var(--sidebar-ease),
    border-radius 260ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 220ms ease,
    transform 180ms ease;
}

body.sidebar-open .nav-link {
  width: 100%;
  height: 58px;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 16px;
  border-radius: 16px;
}

.nav-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  color: currentColor;
  transition:
    width 300ms var(--sidebar-ease),
    height 300ms var(--sidebar-ease),
    flex-basis 300ms var(--sidebar-ease),
    color 180ms ease,
    background 180ms ease;
}

.nav-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.9;
}

.nav-text {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  z-index: 70;
  width: max-content;
  max-width: 220px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: #0b172b;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 14px 28px rgba(7, 18, 38, 0.2);
  opacity: 0;
  transform: translate(8px, -50%);
  pointer-events: none;
  white-space: nowrap;
  transition:
    opacity 180ms ease,
    transform 260ms var(--sidebar-ease);
}

body.sidebar-open .nav-text {
  position: static;
  z-index: auto;
  width: auto;
  max-width: none;
  padding: 0;
  background: transparent;
  color: currentColor;
  font-size: 0.96rem;
  box-shadow: none;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  transition-delay: 90ms;
}

.nav-link:hover,
.nav-link.active {
  background: #0877ff;
  color: #ffffff;
  box-shadow: 0 18px 34px rgba(8, 119, 255, 0.32);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  color: #ffffff;
  background: transparent;
}

body.sidebar-collapsed .nav-link:hover .nav-text,
body.sidebar-collapsed .nav-link:focus-visible .nav-text {
  opacity: 1;
  transform: translate(0, -50%);
}

.sidebar-card {
  width: 56px;
  min-height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  transition:
    width 340ms var(--sidebar-ease),
    min-height 340ms var(--sidebar-ease),
    padding 340ms var(--sidebar-ease),
    border-color 220ms ease,
    background 220ms ease;
}

body.sidebar-open .sidebar-card {
  width: 100%;
  min-height: 0;
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(216, 226, 242, 0.14);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.sidebar-card > .sidebar-label,
.sidebar-card > strong,
.sidebar-card > span,
.credential-box {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-8px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    max-height 260ms var(--sidebar-ease),
    transform 260ms var(--sidebar-ease);
}

body.sidebar-open .sidebar-card > .sidebar-label,
body.sidebar-open .sidebar-card > strong,
body.sidebar-open .sidebar-card > span,
body.sidebar-open .credential-box {
  max-height: 160px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 120ms;
}

body.sidebar-open .credential-box {
  max-height: 260px;
}

body.sidebar-open .sidebar-card > strong,
body.sidebar-open .credential-line strong {
  color: #ffffff;
}

body.sidebar-open .sidebar-card > span,
body.sidebar-open .credential-line,
body.sidebar-open .credential-line span {
  color: rgba(216, 226, 242, 0.72);
}

.sidebar-actions {
  justify-content: center;
  margin: 0;
  transition:
    margin 300ms var(--sidebar-ease),
    justify-content 300ms var(--sidebar-ease);
}

body.sidebar-open .sidebar-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

#logoutButton {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #16273d;
  color: #d8e2f2;
  font-size: 0;
  overflow: hidden;
  white-space: nowrap;
  transition:
    width 340ms var(--sidebar-ease),
    height 340ms var(--sidebar-ease),
    min-height 340ms var(--sidebar-ease),
    padding 340ms var(--sidebar-ease),
    border-color 220ms ease,
    background 220ms ease,
    color 180ms ease,
    font-size 160ms ease 80ms;
}

body.sidebar-open #logoutButton {
  width: auto;
  height: auto;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(216, 226, 242, 0.16);
  font-size: 0.9rem;
  color: #ffffff;
}

body.sidebar-open #logoutButton::before,
body.sidebar-open #logoutButton::after {
  content: none;
}

#logoutButton::before {
  content: "";
  position: absolute;
  inset: 15px 15px 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
}

#logoutButton::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 13px;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: currentColor;
  transform: translateX(-50%);
}

.main {
  padding: 28px;
  display: grid;
  gap: 24px;
  align-content: start;
  grid-auto-rows: max-content;
  min-width: 0;
  overflow-x: hidden;
  transition:
    padding 300ms var(--sidebar-ease),
    gap 300ms var(--sidebar-ease);
}

.main > * {
  min-width: 0;
}

.hero,
.panel-head,
.toolbar,
.spotlight-item,
.activity-item,
.table-client,
.form-actions,
.item-actions,
.inline-item {
  display: flex;
  align-items: center;
}

.hero,
.panel-head,
.toolbar,
.inline-item {
  justify-content: space-between;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px 32px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 247, 0.92) 48%, rgba(239, 246, 255, 0.92));
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(110deg, transparent 0 18%, rgba(15, 118, 110, 0.1) 18% 18.35%, transparent 18.35% 100%),
    repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.06) 0 1px, transparent 1px 72px);
  opacity: 0.9;
}

.dashboard-hero {
  min-height: 245px;
  align-items: stretch;
  gap: 24px;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 14px;
}

.hero-subtitle {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero .eyebrow {
  color: var(--forest);
}

.hero-metrics {
  display: grid;
  width: min(360px, 100%);
  min-width: 280px;
  gap: 12px;
  align-self: center;
}

.hero-metric {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.hero-metric strong {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

.hero-metric span {
  color: var(--muted);
}

.hero-metric.primary {
  box-shadow: inset 4px 0 0 var(--gold);
}

.hero-metric.accent {
  box-shadow: inset 4px 0 0 #7dd3fc;
}

.hero.page-hero {
  padding: 18px 24px;
}

.hero.page-hero h2 {
  max-width: 28ch;
  font-size: clamp(1.6rem, 2.2vw, 2.3rem);
  line-height: 1.12;
}

.hero h2 {
  max-width: 17ch;
  font-size: clamp(2rem, 3.4vw, 3.7rem);
  line-height: 1.04;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.hero-actions,
.item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.item-actions span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.primary-button,
.ghost-button,
.mini-button,
.action-button,
.icon-button {
  padding: 12px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.15;
  white-space: normal;
}

.primary-button {
  background: linear-gradient(135deg, var(--forest), var(--accent));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button.dark {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.mini-button,
.action-button {
  padding: 8px 12px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--ink);
  border-color: rgba(37, 99, 235, 0.1);
}

.action-button.danger {
  color: var(--coral);
  background: rgba(185, 79, 60, 0.08);
}

.compact {
  padding: 10px 14px;
}

.primary-button.is-loading,
.ghost-button.is-loading,
.mini-button.is-loading,
.action-button.is-loading,
.resend-otp-button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: progress;
  opacity: 0.84;
}

.primary-button.is-loading::before,
.ghost-button.is-loading::before,
.mini-button.is-loading::before,
.action-button.is-loading::before,
.resend-otp-button.is-loading::before,
.loader-spinner {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 420ms linear infinite;
}

.is-busy {
  position: relative;
  opacity: 0.86;
}

.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.34);
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(10px);
}

.page-loader-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.table-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 76px;
  color: var(--muted);
  font-weight: 700;
}

.primary-button:hover,
.ghost-button:hover,
.mini-button:hover,
.action-button:hover,
.icon-button:hover,
.sidebar-toggle:hover {
  transform: translateY(-1px);
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.icon-button.is-loading {
  cursor: progress;
}

.icon-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: max-content;
  max-width: 160px;
  padding: 7px 9px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.icon-button[data-tooltip]:hover::after,
.icon-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.refresh-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  position: relative;
}

.refresh-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 0;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(20deg);
}

.icon-button.is-loading .refresh-icon {
  animation: spin 420ms linear infinite;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border-radius: var(--radius);
  background: rgba(15, 118, 110, 0.09);
  color: var(--forest);
  border: 1px solid rgba(15, 118, 110, 0.15);
  font-size: 0.84rem;
  font-weight: 700;
}

.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}


.stats-grid,
.insight-grid,
.bottom-grid {
  display: grid;
  gap: 20px;
}

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

.insight-grid {
  grid-template-columns: 1.4fr 1fr;
}

.insight-grid.client-performance-only {
  grid-template-columns: 1fr;
}

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

.stat-card,
.panel {
  padding: 24px;
  min-width: 0;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--forest), var(--accent));
}

.stat-card:nth-child(2)::before {
  background: linear-gradient(180deg, var(--accent), var(--violet));
}

.stat-card:nth-child(3)::before {
  background: linear-gradient(180deg, var(--gold), var(--forest));
}

.stat-card:nth-child(4)::before {
  background: linear-gradient(180deg, var(--violet), var(--coral));
}

.stat-card:nth-child(5)::before {
  background: linear-gradient(180deg, var(--coral), var(--gold));
}

.stat-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  letter-spacing: 0;
  color: var(--ink);
}

.client-panel {
  container-type: inline-size;
}

.pill {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.pill.positive,
.badge.active {
  background: rgba(31, 92, 76, 0.12);
  color: var(--forest);
}

.badge.inactive {
  background: rgba(26, 26, 26, 0.06);
  color: var(--muted);
}

.badge.review {
  background: rgba(183, 121, 47, 0.14);
  color: var(--gold);
}

.badge.alert {
  background: rgba(185, 79, 60, 0.12);
  color: var(--coral);
}

.chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 260px;
  padding: 38px 6px 10px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.055), transparent),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(29, 38, 54, 0.07) 40px);
}

.chart-bar {
  position: relative;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--gold), var(--forest));
  min-height: 48px;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.14);
  animation: bar-rise 460ms ease both;
}

.chart-bar span,
.chart-bar strong {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
}

.chart-bar span {
  bottom: -28px;
  color: var(--muted);
}

.chart-bar strong {
  top: -28px;
}

.allocation-list,
.activity-list,
.spotlight-list,
.inline-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.inline-item {
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.allocation-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.08);
  overflow: hidden;
}

.allocation-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.toolbar {
  gap: 14px;
  flex-wrap: wrap;
}

.search input,
.search select,
.login-form input,
.data-form input,
.data-form select,
.data-form textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.search input:focus,
.search select:focus,
.login-form input:focus,
.data-form input:focus,
.data-form select:focus,
.data-form textarea:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.data-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.64);
}

.data-form.wide {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.data-form .form-actions {
  grid-column: 1 / -1;
  gap: 10px;
}

.distribution-history-title {
  margin-top: 28px;
}

.table-wrap {
  overflow: auto;
  margin-top: 18px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

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

th {
  background: rgba(248, 250, 252, 0.86);
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover td {
  background: rgba(37, 99, 235, 0.035);
}

.table-client {
  gap: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(37, 99, 235, 0.16));
  color: var(--forest);
  font-weight: 700;
}

.client-name {
  font-weight: 700;
}

.credential-cell strong {
  font-size: 0.92rem;
}

.badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 700;
}

.positive-text {
  color: var(--forest);
}

.negative-text {
  color: var(--coral);
}

.activity-item,
.spotlight-item {
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child,
.spotlight-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(183, 121, 47, 0.12);
}

.grow {
  flex: 1;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

@keyframes bar-rise {
  from {
    transform: scaleY(0.74);
    transform-origin: bottom;
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
    opacity: 1;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .shell,
  .sidebar,
  .sidebar-rail-toggle,
  .sidebar-rail-toggle::before,
  .sidebar-rail-toggle .eyebrow,
  .sidebar-rail-toggle h1,
  .nav,
  .nav-link,
  .nav-icon,
  .nav-text,
  .sidebar-card,
  .sidebar-card > .sidebar-label,
  .sidebar-card > strong,
  .sidebar-card > span,
  .credential-box,
  #logoutButton,
  .main {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}

@media (max-width: 1120px) {
  :root {
    --sidebar-rail-width: 76px;
    --sidebar-open-width: 280px;
  }

  .insight-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

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

  .shell {
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    bottom: auto;
    height: 100vh;
    z-index: 20;
    transform: none;
    box-shadow: 14px 0 34px rgba(7, 18, 38, 0.13);
    overflow-y: auto;
    padding: 18px 6px;
  }

  body.sidebar-open .sidebar {
    padding: 24px 18px;
  }

  body.sidebar-collapsed .sidebar,
  body.sidebar-open .sidebar {
    transform: none;
    pointer-events: auto;
    visibility: visible;
  }

  .sidebar-backdrop {
    display: none;
  }

  body.sidebar-open .sidebar-backdrop {
    display: none;
  }

  .sidebar-rail-toggle {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 16px;
  }

  .sidebar-rail-toggle::before {
    width: 27px;
    height: 19px;
  }

  .nav {
    gap: 15px;
    margin-top: 38px;
  }

  .nav-link {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .nav-icon svg {
    width: 24px;
    height: 24px;
  }

  .panel-head.stacked-mobile {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .panel-head.stacked-mobile .toolbar {
    width: 100%;
  }

  #referrals table th:nth-child(4),
  #referrals table td:nth-child(4),
  #referrals table th:nth-child(5),
  #referrals table td:nth-child(5),
  #referrals table th:nth-child(6),
  #referrals table td:nth-child(6) {
    display: none;
  }

  /* Hide scrollbars on touch widths (still scrollable) */
  .table-wrap {
    scrollbar-width: none;
  }
  .table-wrap::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

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

  .dashboard-hero {
    min-height: auto;
  }

  .hero-metrics {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1121px) {
  body.sidebar-collapsed .shell {
    grid-template-columns: var(--sidebar-rail-width) minmax(0, 1fr);
  }

  body.sidebar-collapsed .sidebar {
    transform: none;
    pointer-events: auto;
    visibility: visible;
  }

  .sidebar {
    will-change: width, padding;
  }
}

@container (max-width: 1700px) {
  .client-table-wrap {
    overflow: visible;
  }

  .client-table-wrap table,
  .client-table-wrap thead,
  .client-table-wrap tbody,
  .client-table-wrap tr,
  .client-table-wrap th,
  .client-table-wrap td {
    display: block;
  }

  .client-table-wrap table {
    min-width: 0;
  }

  .client-table-wrap thead {
    display: none;
  }

  .client-table-wrap tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
    gap: 14px;
  }

  .client-table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.72);
  }

  .client-table-wrap td {
    display: grid;
    grid-template-columns: minmax(138px, 42%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    text-align: right;
    overflow-wrap: anywhere;
  }

  .client-table-wrap td::before {
    content: attr(data-label);
    color: var(--ink);
    font-weight: 700;
    text-align: left;
  }

  .client-table-wrap td[data-label="Client Name"],
  .client-table-wrap td[data-label="Actions"] {
    grid-column: 1 / -1;
  }

  .client-table-wrap td[data-label="Client Name"] {
    display: block;
    text-align: left;
    padding-top: 0;
  }

  .client-table-wrap td[data-label="Client Name"]::before {
    content: none;
  }

  .client-table-wrap td[data-label="Actions"] {
    border-bottom: none;
    padding-bottom: 0;
  }

  .client-table-wrap .table-client {
    justify-content: flex-start;
  }

  .client-table-wrap .item-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 70px;
    --sidebar-rail-width: 70px;
    --sidebar-open-width: min(260px, 74vw);
  }

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

  .data-form,
  .data-form.wide {
    grid-template-columns: 1fr;
  }

  .main,
  .sidebar,
  .auth-shell {
    padding: 18px;
  }

  .sidebar {
    padding: 16px 6px;
  }

  body.sidebar-open .sidebar {
    padding: 20px 14px;
  }

  .sidebar-rail-toggle {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .nav {
    gap: 14px;
    margin-top: 34px;
  }

  .nav-link {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .nav-icon svg {
    width: 22px;
    height: 22px;
  }

  .login-auth-shell {
    place-items: center;
    padding-top: 24px;
    background-position: center;
  }

  .login-auth-shell .auth-card {
    width: min(100%, 390px);
    padding: 20px;
  }

  .login-brand-text {
    margin-bottom: 14px;
    font-size: 1.85rem;
  }

  .login-card-head h1 {
    font-size: 1.25rem;
  }

  .login-lock {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .topbar {
    margin: -18px -18px 14px;
    padding: 14px 14px;
  }

  .topbar-brand span,
  .status-chip {
    display: none;
  }

  .topbar-left {
    gap: 10px;
  }

  .hero,
  .panel,
  .stat-card,
  .auth-card {
    padding: 20px;
    border-radius: var(--radius);
  }

  .hero h2 {
    max-width: none;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .search {
    width: 100%;
  }

  .toolbar .search input,
  .toolbar .search select {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrap tr {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.72);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    text-align: right;
    overflow-wrap: anywhere;
  }

  .table-wrap td:last-child {
    border-bottom: none;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--ink);
    font-weight: 700;
    text-align: left;
  }

  .table-wrap td[colspan] {
    display: block;
    text-align: center;
  }

  .table-wrap td[colspan]::before {
    content: none;
  }

  .table-wrap .item-actions,
  .table-wrap .table-client {
    justify-content: flex-end;
  }

  .client-table-wrap tbody {
    grid-template-columns: 1fr;
  }

  .client-table-wrap tr {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .client-table-wrap td {
    grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  }

  .client-table-wrap td[data-label="Client Name"] {
    display: block;
    text-align: left;
  }

  .client-table-wrap td[data-label="Client Name"]::before {
    content: none;
  }

  .client-table-wrap .table-client {
    justify-content: flex-start;
  }

  .client-table-wrap .item-actions {
    justify-content: flex-end;
  }

  #referrals table th:nth-child(7),
  #referrals table td:nth-child(7),
  #referrals table th:nth-child(8),
  #referrals table td:nth-child(8),
  #referrals table th:nth-child(9),
  #referrals table td:nth-child(9) {
    display: none;
  }

}

/* -- Toast notifications ------------------------------------ */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(26, 26, 26, 0.16);
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
  cursor: default;
  color: #fff;
}

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

.toast-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
}

.toast-success {
  background: var(--forest, #1f5c4c);
}

.toast-error {
  background: var(--coral, #b94f3c);
}

.toast-warning {
  background: var(--gold, #b7792f);
}

.toast-info {
  background: #2c6d90;
}

@media (max-width: 520px) {
  #toast-container {
    bottom: 16px;
    right: 12px;
    left: 12px;
  }
  .toast {
    max-width: 100%;
  }
}

/* -- Weekly schedule pay modal -- */
.pay-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 35, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.pay-modal-overlay.hidden {
  display: none;
}

.pay-modal-card {
  background: var(--surface-strong);
  border-radius: 14px;
  padding: 28px 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pay-modal-card .data-form,
.pay-modal-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pay-modal-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.pay-modal-card input[type="text"],
.pay-modal-card input[type="file"] {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-soft);
}

/* Paid / Unpaid badge variants */
.badge.paid {
  background: rgba(31, 92, 76, 0.12);
  color: var(--forest);
}

.badge.unpaid {
  background: rgba(185, 79, 60, 0.10);
  color: var(--coral);
}
