:root {
  color-scheme: light;
  --navy-950: #071b35;
  --navy-900: #0b2d5c;
  --navy-800: #123f79;
  --blue-700: #1557a6;
  --blue-600: #1769c2;
  --blue-100: #dcecff;
  --blue-50: #f2f7ff;
  --slate-950: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --green-700: #047857;
  --green-100: #d1fae5;
  --amber-700: #b45309;
  --amber-100: #fef3c7;
  --red-700: #b91c1c;
  --red-100: #fee2e2;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 40px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 30px 80px rgba(2, 15, 38, 0.24);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--slate-50);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--slate-950);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy-900);
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  transform: translateY(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--navy-950);
}

.brand-link {
  text-decoration: none;
}

.brand-light {
  color: var(--white);
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 13px);
  grid-template-rows: repeat(2, 13px);
  gap: 3px;
  padding: 7px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.brand:not(.brand-light) .brand-mark {
  background: var(--navy-900);
}

.brand-mark i {
  display: block;
  border-radius: 2px;
}

.mark-red { background: #ef3340; }
.mark-white { background: #ffffff; }
.mark-green { background: #009739; }
.mark-black { background: #101820; }

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-light .brand-copy small {
  color: rgba(255, 255, 255, 0.68);
}

.eyebrow {
  display: inline-block;
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #91c9ff;
}

.spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner-blue {
  border-color: var(--blue-100);
  border-top-color: var(--blue-700);
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--navy-800), var(--blue-600));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(21, 87, 166, 0.22);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(21, 87, 166, 0.28);
}

.secondary-button {
  border-color: var(--slate-300);
  background: var(--white);
  color: var(--slate-700);
}

.secondary-button:hover:not(:disabled) {
  border-color: #9fb3ca;
  background: var(--slate-50);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.button-link {
  text-decoration: none;
}

/* Login */

.login-page {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(40, 119, 205, 0.12), transparent 31%),
    linear-gradient(135deg, #eef4fb 0%, #f8fafc 44%, #e7eff8 100%);
}

.login-shell {
  display: grid;
  width: min(1180px, calc(100% - 40px));
  min-height: 720px;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  margin: max(24px, 4vh) auto;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.login-brand-panel {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 52px;
  background:
    radial-gradient(circle at 12% 86%, rgba(43, 127, 209, 0.42), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(0, 151, 57, 0.18), transparent 26%),
    linear-gradient(145deg, #071b35 0%, #0b2d5c 55%, #123f79 100%);
  color: var(--white);
}

.login-brand-panel::before,
.login-brand-panel::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.login-brand-panel::before {
  width: 430px;
  height: 430px;
  right: -230px;
  bottom: -130px;
}

.login-brand-panel::after {
  width: 220px;
  height: 220px;
  right: -86px;
  bottom: -24px;
}

.login-brand-panel > * {
  position: relative;
  z-index: 1;
}

.login-intro {
  max-width: 490px;
  margin: auto 0;
  padding: 70px 0;
}

.login-intro h1 {
  max-width: 470px;
  margin: 15px 0 20px;
  font-size: clamp(38px, 4.6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.login-intro p {
  max-width: 470px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.75;
}

.login-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.80);
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}

.login-benefits li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.login-benefits li span {
  color: #7ee7ad;
}

.login-form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px clamp(34px, 5vw, 76px) 28px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  margin: auto 0;
}

.login-brand-emblem {
  position: relative;
  isolation: isolate;
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.login-brand-logo {
  position: relative;
  z-index: 1;
  display: block;
}

.login-logo-orbit {
  display: none;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .login-brand-logo use {
    animation: login-logo-pulse 1.2s ease-in-out infinite;
  }

  /* SVG order is red, white, green, black. Match the Apps Script startup sequence. */
  .login-brand-logo use:nth-of-type(1) { animation-delay: -0.3s; }
  .login-brand-logo use:nth-of-type(2) { animation-delay: -0.9s; }
  .login-brand-logo use:nth-of-type(4) { animation-delay: -0.6s; }

  .login-logo-orbit {
    --orbit-period: 2s;
    --orbit-phase: 0s;
    --star-halo: #c7ced8;
    --star-color: #d7dde5;
    --star-edge: #98a4b3;
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 6px;
    height: 6px;
    visibility: hidden;
    offset-path: path("M -26 0 A 26 10 0 0 1 26 0 A 26 10 0 0 1 -26 0 Z");
    offset-rotate: 0deg;
    filter: drop-shadow(0 0 1px var(--star-halo));
    animation: login-star-orbit var(--orbit-period) linear var(--orbit-phase) infinite,
      login-star-depth var(--orbit-period) steps(1, end) var(--orbit-phase) infinite,
      login-star-perspective var(--orbit-period) ease-in-out var(--orbit-phase) infinite;
  }

  .mobile-brand .login-logo-orbit {
    --star-halo: #d49a33;
    --star-color: #c08321;
    --star-edge: #925909;
  }

  .login-logo-orbit-secondary {
    --orbit-phase: -0.5s;
    width: 5px;
    height: 5px;
    offset-path: path("M 0 -26 A 8 26 0 0 1 0 26 A 8 26 0 0 1 0 -26 Z");
  }

  .login-logo-orbit-reverse-horizontal,
  .login-logo-orbit-reverse-vertical {
    width: 4px;
    height: 4px;
  }

  .login-logo-orbit-reverse-horizontal {
    --orbit-phase: -1s;
    offset-path: path("M -28 0 A 28 13 0 0 0 28 0 A 28 13 0 0 0 -28 0 Z");
  }

  .login-logo-orbit-reverse-vertical {
    --orbit-phase: -1.5s;
    offset-path: path("M 0 -28 A 15 28 0 0 0 0 28 A 15 28 0 0 0 0 -28 Z");
  }

  .login-logo-orbit::before,
  .login-logo-orbit::after {
    position: absolute;
    inset: 0;
    content: "";
    clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 63%, 50% 100%, 38% 63%, 0 50%, 38% 37%);
  }

  .login-logo-orbit::before {
    background: radial-gradient(circle, #fff 8%, var(--star-color) 42%, var(--star-edge) 100%);
  }

  .login-logo-orbit::after {
    opacity: 0;
    background: radial-gradient(circle, #fff 45%, var(--star-color) 78%, transparent 100%);
    animation: login-star-twinkle var(--orbit-period) ease-in-out var(--orbit-phase) infinite;
  }
}

@keyframes login-star-orbit {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}

@keyframes login-star-perspective {
  0%, 50%, 100% { opacity: 0.32; scale: 0.8; }
  56%, 94% { opacity: 1; }
  75% { scale: 1.08; }
}

@keyframes login-star-depth {
  0% { z-index: 0; visibility: hidden; }
  50%, 100% { z-index: 2; visibility: visible; }
}

@keyframes login-logo-pulse {
  0%, 32%, 100% { fill-opacity: 0.72; }
  12% { fill-opacity: 1; }
}

@keyframes login-star-twinkle {
  0%, 51%, 60%, 100% { opacity: 0; }
  54% { opacity: 0.86; }
}

.mobile-brand {
  display: none;
  margin-bottom: 42px;
}

.session-check {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--slate-500);
  font-size: 14px;
  font-weight: 700;
}

.session-check .spinner {
  border-color: var(--blue-100);
  border-top-color: var(--blue-700);
}

.login-card h2 {
  margin: 10px 0 10px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.form-lead {
  margin: 0 0 28px;
  color: var(--slate-500);
  font-size: 14px;
  line-height: 1.65;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 850;
}

.field-input {
  width: 100%;
  height: 50px;
  margin: 0 0 20px;
  padding: 0 14px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--slate-50);
  color: var(--slate-950);
  font-size: 16px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.field-input:focus {
  border-color: var(--blue-600);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(23, 105, 194, 0.12);
}

.field-input[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.09);
}

.password-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-button {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue-700);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.login-card .primary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
}

.notice {
  margin: 0 0 20px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.notice-error {
  border-color: #fecaca;
  background: #fff5f5;
  color: var(--red-700);
}

.notice-info {
  border-color: #bfdbfe;
  background: var(--blue-50);
  color: #1e40af;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 24px;
  border-top: 1px solid var(--slate-200);
  padding-top: 20px;
  color: var(--slate-500);
}

.security-note p {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.security-note strong {
  color: var(--slate-700);
}

.security-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 18px;
  font-weight: 900;
}

.supplier-access {
  margin-top: 24px;
  border-top: 1px solid var(--slate-200);
  padding-top: 20px;
}

.supplier-access h3 {
  margin: 0;
  font-size: 16px;
}

.supplier-access p {
  margin: 5px 0 12px;
  color: var(--slate-600);
  font-size: 13px;
}

.supplier-access-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supplier-access-links a {
  padding-inline: 12px;
  font-size: 13px;
}

.login-footer {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  margin: 0;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

@media (min-width: 841px) {
  .login-card:has(.supplier-access) + .login-footer {
    position: static;
    margin-top: 16px;
  }
}

/* Portal */

.portal-page {
  background:
    radial-gradient(circle at 88% 4%, rgba(23, 105, 194, 0.08), transparent 23%),
    var(--slate-50);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--slate-200);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(14px);
}

.portal-header-inner {
  display: flex;
  width: min(1280px, calc(100% - 40px));
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.environment-badge,
.read-only-badge,
.roadmap-count {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.environment-badge {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: var(--amber-700);
}

.read-only-badge {
  border: 1px solid #bfdbfe;
  background: var(--blue-50);
  color: #1e40af;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-800), var(--blue-600));
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.header-user-copy {
  display: flex;
  max-width: 210px;
  flex-direction: column;
  line-height: 1.15;
}

.header-user-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-copy small {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 10px;
}

.portal-main {
  width: min(1280px, calc(100% - 40px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 28px 0 46px;
}

.portal-loading {
  display: flex;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--slate-500);
  font-size: 14px;
  font-weight: 800;
}

.fatal-card {
  max-width: 560px;
  margin: 100px auto;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 38px;
  background: var(--white);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.fatal-card h1 {
  margin: 0 0 10px;
  font-size: 26px;
}

.fatal-card p {
  margin: 0 0 24px;
  color: var(--slate-500);
  line-height: 1.6;
}

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  background: linear-gradient(90deg, #eff6ff, #f8fbff);
  color: #1e3a5f;
}

.preview-banner div {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}

.preview-banner p {
  margin: 0;
  color: #3b5d7f;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
  text-align: right;
}

.preview-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 26px;
}

.welcome-row h1 {
  margin: 6px 0 5px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.welcome-row p {
  margin: 0;
  color: var(--slate-500);
  font-size: 13px;
}

.session-card {
  display: flex;
  min-width: 195px;
  flex-direction: column;
  align-items: flex-end;
  border-left: 1px solid var(--slate-200);
  padding-left: 24px;
}

.session-card span {
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.session-card strong {
  margin-top: 5px;
  color: var(--green-700);
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.65fr);
  gap: 20px;
}

.panel {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.profile-panel,
.balance-panel,
.admin-panel {
  padding: 23px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading h2,
.section-heading h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.status-badge {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 0 11px;
  background: #ecfdf5;
  color: var(--green-700);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 20px 0 0;
  border-top: 1px solid var(--slate-200);
}

.profile-grid div {
  min-width: 0;
  border-bottom: 1px solid var(--slate-200);
  padding: 15px 14px 15px 0;
}

.profile-grid div:nth-child(even) {
  padding-right: 0;
  padding-left: 14px;
}

.profile-grid dt {
  margin: 0 0 5px;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-grid dd {
  overflow: hidden;
  margin: 0;
  color: var(--slate-700);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.role-chip {
  border-radius: 7px;
  padding: 6px 9px;
  background: var(--navy-900);
  color: var(--white);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.balance-list {
  margin-top: 18px;
}

.balance-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--slate-200);
  padding: 13px 0;
}

.balance-list span {
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 750;
}

.balance-list strong {
  color: var(--navy-900);
  font-size: 17px;
}

.snapshot-note {
  margin: 15px 0 0;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.55;
}

.admin-panel {
  margin-top: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 16px;
  background: var(--slate-50);
}

.metric span {
  display: block;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--navy-900);
  font-size: 27px;
  letter-spacing: -0.04em;
}

.sync-divider {
  height: 1px;
  margin: 24px 0 20px;
  background: var(--slate-200);
}

.sync-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sync-heading h3 {
  margin: 5px 0 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.sync-state {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sync-state-healthy {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: var(--green-700);
}

.sync-state-running {
  border-color: #bfdbfe;
  background: var(--blue-50);
  color: #1e40af;
}

.sync-state-pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: var(--amber-700);
}

.sync-state-failed {
  border-color: #fecaca;
  background: #fff5f5;
  color: var(--red-700);
}

.live-read-section {
  margin-top: 34px;
}

.workflow-section {
  margin-top: 34px;
}

.leave-read-section {
  margin-top: 34px;
}

.employee-services-section {
  margin-top: 34px;
}

.documents-section {
  margin-top: 34px;
}

.employee-services-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.employee-services-panel {
  margin-top: 18px;
  min-width: 0;
  padding: 22px;
}

.employee-services-table {
  min-width: 760px;
}

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

.documents-panel {
  margin-top: 18px;
  min-width: 0;
  padding: 22px;
}

.documents-table {
  min-width: 860px;
}

.repeatable-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.repeatable-list,
.signature-list {
  display: grid;
  gap: 10px;
}

.repeatable-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(76px, .6fr)) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #f8fafc;
}

.phase12-document-signer {
  grid-template-columns: minmax(220px, 2fr) repeat(7, minmax(62px, .55fr)) auto;
  overflow-x: auto;
}

.signature-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
}

.optional-fields {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 12px;
}

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

.leave-read-panel {
  min-width: 0;
  padding: 22px;
}

.leave-applications-panel {
  grid-column: 1 / -1;
}

.leave-manager-panel,
.leave-admin-panel {
  margin-top: 18px;
}

.phase7-table {
  min-width: 720px;
}

.document-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.document-link:hover,
.document-link:focus-visible {
  border-color: var(--blue-700);
  outline: none;
  background: #dbeafe;
}

.workflow-heading {
  margin-bottom: 18px;
}

.workflow-policy {
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 13px 15px;
  background: var(--blue-50);
  color: #27496d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.65;
}

.workflow-policy strong {
  color: var(--navy-900);
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
}

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

.workflow-form {
  margin-top: 18px;
}

.workflow-form > label,
.workflow-form-row label,
.workflow-field > label {
  display: block;
  min-width: 0;
  color: var(--slate-700);
  font-size: 11px;
  font-weight: 800;
}

.workflow-form label > span,
.workflow-field > label {
  display: block;
  margin-bottom: 7px;
}

.workflow-form .field-input {
  margin-bottom: 15px;
  background: var(--white);
  font-size: 13px;
}

.workflow-form .field-input:disabled {
  cursor: not-allowed;
  background: var(--slate-100);
  color: var(--slate-500);
}

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

.workflow-field {
  min-width: 0;
}

.picker-field {
  position: relative;
}

.workflow-form .picker-input {
  padding-right: 52px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.035em;
}

.workflow-form .picker-input:read-only:not(:disabled) {
  background: var(--white);
}

.picker-trigger {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  display: inline-flex;
  width: 46px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid var(--slate-200);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.picker-trigger:hover:not(:disabled),
.picker-trigger[aria-expanded="true"] {
  background: var(--blue-50);
  color: var(--navy-900);
}

.picker-trigger:focus-visible {
  outline: 3px solid rgba(23, 105, 194, 0.20);
  outline-offset: -3px;
}

.picker-trigger:disabled {
  color: var(--slate-500);
  cursor: not-allowed;
}

.picker-trigger svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.picker-popover {
  position: absolute;
  z-index: 50;
  top: 58px;
  left: 0;
  width: min(320px, calc(100vw - 64px));
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 24px 64px rgba(7, 27, 53, 0.22), 0 4px 14px rgba(15, 23, 42, 0.08);
  color: var(--slate-950);
}

.picker-field-end .picker-popover {
  right: 0;
  left: auto;
}

.picker-popover button,
.picker-popover select {
  font: inherit;
}

.picker-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px;
}

.picker-month-title {
  color: var(--navy-950);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.picker-icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: var(--white);
  color: var(--slate-700);
  cursor: pointer;
}

.picker-icon-button:hover,
.picker-icon-button:focus-visible {
  border-color: #9fb3ca;
  background: var(--blue-50);
  color: var(--blue-700);
  outline: none;
}

.picker-icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  padding: 0 14px;
}

.calendar-weekdays {
  margin: 3px 0 6px;
}

.calendar-weekdays span {
  color: var(--slate-500);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day,
.calendar-day-spacer {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
}

.calendar-day {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--slate-700);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.calendar-day:hover,
.calendar-day:focus-visible {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-700);
  outline: none;
}

.calendar-day-today {
  border-color: var(--slate-300);
  color: var(--blue-700);
}

.calendar-day-selected,
.calendar-day-selected:hover,
.calendar-day-selected:focus-visible {
  border-color: var(--blue-600);
  background: linear-gradient(135deg, var(--navy-800), var(--blue-600));
  color: var(--white);
  box-shadow: 0 5px 12px rgba(21, 87, 166, 0.24);
}

.picker-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--slate-100);
  background: var(--slate-50);
}

.picker-action {
  min-height: 35px;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  padding: 0 12px;
  background: var(--white);
  color: var(--slate-700);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.picker-action:hover,
.picker-action:focus-visible {
  border-color: #9fb3ca;
  background: var(--blue-50);
  color: var(--navy-900);
  outline: none;
}

.picker-action-primary {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: var(--white);
}

.picker-action-primary:hover,
.picker-action-primary:focus-visible {
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: var(--white);
}

.picker-action:disabled {
  border-color: var(--slate-200);
  background: var(--slate-100);
  color: var(--slate-500);
  cursor: not-allowed;
}

.picker-action-start {
  margin-right: auto;
}

.time-picker-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  background:
    radial-gradient(circle at 15% 85%, rgba(43, 127, 209, 0.42), transparent 42%),
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
  color: var(--white);
}

.watch-face {
  position: relative;
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: radial-gradient(circle, #164982 0%, var(--navy-800) 64%, var(--navy-950) 100%);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.05), 0 8px 22px rgba(0, 0, 0, 0.18);
}

.watch-face::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.82) 0 2px, transparent 2.5px),
    radial-gradient(circle at 100% 50%, rgba(255, 255, 255, 0.82) 0 2px, transparent 2.5px),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.82) 0 2px, transparent 2.5px),
    radial-gradient(circle at 0% 50%, rgba(255, 255, 255, 0.82) 0 2px, transparent 2.5px);
  content: "";
}

.watch-hand {
  position: absolute;
  z-index: 2;
  left: calc(50% - 1px);
  bottom: 50%;
  width: 2px;
  border-radius: 999px;
  background: var(--white);
  transform-origin: 50% 100%;
}

.watch-hand-hour {
  height: 19px;
  transform: rotate(var(--watch-hour, 0deg));
}

.watch-hand-minute {
  height: 26px;
  background: #7dd3fc;
  transform: rotate(var(--watch-minute, 0deg));
}

.watch-center {
  position: absolute;
  z-index: 3;
  top: calc(50% - 4px);
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--blue-600);
}

.time-picker-copy {
  min-width: 0;
}

.picker-kicker {
  display: block;
  margin-bottom: 4px;
  color: #bae6fd;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.time-picker-preview {
  display: block;
  color: var(--white);
  font-size: 29px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.045em;
  line-height: 1.1;
}

.time-picker-copy small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.70);
  font-size: 10px;
  font-weight: 700;
}

.time-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 16px 10px;
}

.time-select-grid label {
  color: var(--slate-600);
  font-size: 10px;
  font-weight: 850;
}

.time-select-grid select {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  padding: 0 11px;
  outline: none;
  background: var(--white);
  color: var(--navy-950);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.time-select-grid select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(23, 105, 194, 0.12);
}

.time-quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 0 16px 4px;
}

.time-quick-button {
  min-height: 32px;
  border: 1px solid var(--slate-200);
  border-radius: 9px;
  background: var(--slate-50);
  color: var(--slate-600);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.time-quick-button:hover,
.time-quick-button:focus-visible,
.time-quick-button-active {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-700);
  outline: none;
}

.workflow-textarea {
  min-height: 96px;
  height: auto;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.5;
}

.workflow-form .primary-button {
  width: 100%;
}

.manual-table {
  min-width: 800px;
}

.manager-workflow-panel {
  margin-top: 18px;
}

.manager-manual-table {
  min-width: 1120px;
}

.workflow-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.workflow-status-approved {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: var(--green-700);
}

.workflow-status-rejected {
  border-color: #fecaca;
  background: #fff5f5;
  color: var(--red-700);
}

.workflow-status-processing {
  border-color: #bfdbfe;
  background: var(--blue-50);
  color: #1e40af;
}

.workflow-status-pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: var(--amber-700);
}

.manager-decision-controls {
  display: grid;
  min-width: 260px;
  grid-template-columns: 1fr auto auto;
  gap: 7px;
}

.decision-comment {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  padding: 0 10px;
  color: var(--slate-700);
  font-size: 11px;
}

.decision-comment:focus {
  border-color: var(--blue-600);
  outline: 3px solid rgba(23, 105, 194, 0.12);
}

.live-heading {
  margin-bottom: 18px;
}

.source-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--white);
}

.source-strip p {
  margin: 0;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}

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

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

.attendance-panel {
  grid-column: 1 / -1;
}

.live-panel-heading h3 {
  margin: 5px 0 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.month-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.month-control select {
  min-width: 118px;
  height: 36px;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  padding: 0 10px;
  background: var(--white);
  color: var(--navy-900);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0;
}

.month-control select:focus {
  border-color: var(--blue-600);
  outline: 3px solid rgba(23, 105, 194, 0.12);
}

.table-scroll {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--slate-200);
  border-radius: 11px;
}

.compact-table-scroll {
  max-height: 360px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--white);
  font-size: 11px;
}

.leave-panel .data-table {
  min-width: 650px;
}

.tasks-panel .data-table {
  min-width: 560px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid #173e6b;
  background: var(--navy-800);
  color: var(--white);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-weight: 650;
  line-height: 1.4;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:nth-child(even) td {
  background: var(--slate-50);
}

.data-table .status-cell {
  color: var(--navy-800);
  font-weight: 850;
}

.empty-table-cell {
  padding: 28px 16px !important;
  color: var(--slate-500) !important;
  text-align: center;
}

.modules-section {
  margin-top: 34px;
}

.roadmap-count {
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-500);
}

.roadmap-count strong {
  margin-right: 4px;
  color: var(--navy-900);
}

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

.module-card {
  position: relative;
  min-height: 155px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 17px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.module-card-live {
  border-color: #a7f3d0;
  background: linear-gradient(145deg, #ffffff 0%, #f2fdf7 100%);
}

.module-card-live .module-icon {
  background: var(--green-100);
  color: var(--green-700);
}

.module-status-live {
  color: var(--green-700);
}

.module-card::after {
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 90px;
  height: 90px;
  content: "";
  border-radius: 50%;
  background: var(--slate-50);
}

.module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.module-status {
  color: var(--amber-700);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.module-card h3 {
  position: relative;
  z-index: 1;
  margin: 16px 0 6px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.module-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
}

.portal-footer {
  display: flex;
  width: min(1280px, calc(100% - 40px));
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  border-top: 1px solid var(--slate-200);
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 1040px) {
  .login-shell {
    grid-template-columns: minmax(0, 0.85fr) minmax(400px, 1.15fr);
  }

  .login-brand-panel {
    padding: 40px;
  }

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

@media (max-width: 840px) {
  .login-shell {
    display: block;
    width: min(560px, calc(100% - 28px));
    min-height: 0;
    margin: 20px auto;
  }

  .login-brand-panel {
    display: none;
  }

  .login-form-panel {
    min-height: calc(100vh - 40px);
    padding: 42px 34px 30px;
  }

  .mobile-brand {
    display: block;
  }

  .login-footer {
    position: static;
    align-self: auto;
    margin: 38px 0 0;
    text-align: center;
  }

  .portal-header-inner,
  .portal-main,
  .portal-footer {
    width: min(100% - 28px, 1280px);
  }

  .environment-badge,
  .header-user-copy {
    display: none;
  }

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

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

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

  .leave-read-grid {
    grid-template-columns: 1fr;
  }

  .leave-applications-panel {
    grid-column: auto;
  }

  .attendance-panel {
    grid-column: auto;
  }

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

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

@media (max-width: 580px) {
  .login-form-panel {
    padding: 32px 22px 24px;
  }

  .mobile-brand {
    margin-bottom: 34px;
  }

  .login-card h2 {
    font-size: 30px;
  }

  .portal-header-inner {
    min-height: 70px;
  }

  .portal-header .brand-copy strong {
    max-width: 150px;
    font-size: 12px;
  }

  .portal-header .brand-copy small {
    font-size: 9px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-user {
    display: none;
  }

  .portal-main {
    padding-top: 18px;
  }

  .preview-banner {
    display: block;
  }

  .preview-banner p {
    margin-top: 8px;
    text-align: left;
  }

  .welcome-row {
    display: block;
  }

  .session-card {
    display: none;
  }

  .profile-panel,
  .balance-panel,
  .admin-panel,
  .live-panel,
  .workflow-panel {
    padding: 18px;
  }

  .leave-read-panel {
    padding: 18px;
  }

  .workflow-form-row,
  .manager-decision-controls {
    grid-template-columns: 1fr;
  }

  .picker-popover,
  .picker-field-end .picker-popover {
    right: auto;
    left: 0;
    width: 100%;
  }

  .source-strip {
    display: block;
  }

  .source-strip p {
    margin-top: 8px;
    text-align: left;
  }

  .live-panel-heading {
    align-items: flex-end;
  }

  .month-control {
    display: block;
  }

  .month-control span {
    display: block;
    margin-bottom: 5px;
  }

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

  .profile-grid div,
  .profile-grid div:nth-child(even) {
    padding-right: 0;
    padding-left: 0;
  }

  .metric-grid,
  .employee-services-metrics,
  .documents-metrics,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 140px;
  }

  .section-heading {
    align-items: flex-end;
  }

  .roadmap-count {
    display: none;
  }
}

@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;
  }
}

/* Phase 8 controlled Leave and Duty Joining workflow */
.phase8-write-panel {
  margin: 18px 0;
  border-color: rgba(26, 86, 219, 0.25);
  background: linear-gradient(145deg, #ffffff 0%, #f5f8ff 100%);
}

.phase8-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.phase8-action-card {
  border: 1px solid var(--border, #d9e1ec);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.phase8-action-card > summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 750;
  color: var(--ink, #162133);
}

.phase8-action-card[open] > summary {
  border-bottom: 1px solid var(--border, #d9e1ec);
  background: #f8faff;
}

.phase8-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.phase8-form label {
  display: grid;
  gap: 7px;
  color: var(--muted, #526176);
  font-size: 0.86rem;
  font-weight: 650;
}

.phase8-form input,
.phase8-form select,
.phase8-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.phase8-form textarea {
  min-height: 92px;
  resize: vertical;
}

.phase8-wide { grid-column: 1 / -1; }

.signature-pad-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d9e1ec;
  border-radius: 12px;
  background: #fbfcff;
}

.signature-pad-heading,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signature-pad {
  display: block;
  width: 100%;
  height: 150px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #fff;
  touch-action: none;
}

.phase8-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
  overflow: auto;
}

.phase8-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}

.phase8-action-button { white-space: nowrap; }

@media (max-width: 820px) {
  .phase8-action-grid,
  .phase8-form-grid { grid-template-columns: 1fr; }
  .phase8-wide { grid-column: auto; }
}

.phase10-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.phase10-action-card {
  border: 1px solid var(--border, #d9e1ec);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.phase10-action-card > summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 750;
  color: var(--ink, #162133);
}

.phase10-action-card[open] > summary {
  border-bottom: 1px solid var(--border, #d9e1ec);
  background: #f8faff;
}

.phase10-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.phase10-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.phase10-action-button { white-space: nowrap; }

@media (max-width: 820px) {
  .phase10-action-grid { grid-template-columns: 1fr; }
}
.phase14-actions { display:flex; flex-wrap:wrap; gap:10px; margin:14px 0; }
.phase14-dialog { width:min(980px,calc(100vw - 32px)); max-height:90vh; overflow:auto; }
.phase14-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.phase14-fields .workflow-form-field { display:flex; flex-direction:column; gap:7px; }
.phase14-fields input, .phase14-fields select, .phase14-fields textarea { width:100%; min-height:42px; padding:10px 12px; border:1px solid #cfd7e1; border-radius:8px; color:#172033; background:#fff; font:inherit; }
.phase14-fields select[multiple] { min-height:200px; }
.phase14-group-title, .phase14-project-list, .phase14-signature-box, .phase14-fields > .notice { grid-column:1 / -1; }
.phase14-project-row { display:grid; grid-template-columns:2fr 1.4fr 1fr 1fr auto; gap:10px; padding:12px 0; border-bottom:1px solid #e3e8ef; }
.phase14-project-row label { display:flex; flex-direction:column; gap:6px; }
.phase14-action-row { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:15px 0; border-bottom:1px solid #e3e8ef; }
.phase14-action-row p { margin:5px 0 0; color:#586779; }
.phase14-fields [hidden] { display:none !important; }
@media (max-width:700px) { .phase14-fields {grid-template-columns:1fr;} .phase14-project-row {grid-template-columns:1fr 1fr;} .phase14-action-row {align-items:flex-start;flex-direction:column;} }

.phase14-review-summary { grid-column: 1 / -1; padding: 1rem; border: 1px solid var(--border, #d9e1ec); border-radius: .75rem; }
.phase14-review-summary dl { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: .4rem 1rem; }
.phase14-review-summary dt { font-weight: 600; }
.phase14-review-summary dd { margin: 0; overflow-wrap: anywhere; }

/* Phase 15 module styles */
.surveys-panel { scroll-margin-top: 2rem; }
.survey-actions { display:flex; flex-wrap:wrap; gap:.65rem; align-items:center; }
.survey-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:1rem; }
.survey-card, .survey-editor, .survey-question, .survey-result { border:1px solid var(--border,#dce2eb); border-radius:14px; padding:1.1rem; background:var(--surface,#fff); }
.survey-card h3, .survey-question h4, .survey-result h4 { margin:.1rem 0 .65rem; }
.survey-card p, .survey-help { color:var(--muted,#526075); line-height:1.55; }
.survey-meta { display:flex; flex-wrap:wrap; gap:.45rem 1rem; margin:.7rem 0 1rem; font-size:.9rem; }
.survey-subtitle { margin:1.5rem 0 .8rem; }
.survey-form { display:grid; gap:1rem; }
.survey-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.survey-field { display:grid; gap:.4rem; min-width:0; }
.survey-field > label { font-weight:650; }
.survey-field input, .survey-field select, .survey-field textarea { width:100%; min-height:44px; border:1px solid var(--border,#cad3e2); border-radius:9px; padding:.7rem .8rem; color:inherit; background:#fff; font:inherit; }
.survey-field textarea { min-height:100px; resize:vertical; }
.survey-questions, .survey-targets { display:grid; gap:.9rem; }
.survey-question-head { display:flex; justify-content:space-between; gap:.75rem; align-items:flex-start; }
.survey-target { padding:1rem; background:var(--surface-soft,#f5f7fb); border-radius:14px; }
.survey-target h3 { margin:0 0 1rem; }
.survey-receipt { padding:1rem; margin:1rem 0; border:1px solid #c99730; border-radius:12px; background:#fff8e5; }
.survey-receipt p { margin:0 0 .8rem; overflow-wrap:anywhere; }
.survey-form [aria-invalid="true"] { border-color:#b42318; }
.survey-field input:focus-visible, .survey-field textarea:focus-visible, .survey-field select:focus-visible { outline:3px solid #b6cdfa; outline-offset:2px; }
.survey-result-list { display:grid; gap:1rem; }
.survey-bars { display:grid; gap:.65rem; }
.survey-bar-row { display:grid; grid-template-columns:minmax(80px,1fr) 3fr auto; gap:.8rem; align-items:center; }
.survey-bar-label { overflow-wrap:anywhere; }
.survey-bar-row meter { width:100%; height:1.3rem; }
.survey-empty { color:var(--muted,#526075); padding:1rem 0; }
.survey-participant-count { color:var(--muted,#526075); margin:0; }
.survey-card .survey-actions { margin-top:1rem; }
.survey-editor h3 { margin-top:0; }
.survey-editor form { margin-top:1rem; }
@media(max-width:650px) { .survey-form-grid { grid-template-columns:1fr; } .survey-bar-row { grid-template-columns:minmax(65px,1fr) 2fr auto; gap:.5rem; } }

.organization-panel{position:relative}.organization-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin:16px 0}.organization-select{display:flex;flex-direction:column;gap:5px;font-size:.85rem;font-weight:600;color:var(--text,#24334b)}.organization-select select{min-width:170px;max-width:280px;padding:9px 10px;border:1px solid var(--border,#d5dfeb);border-radius:9px;background:#fff;color:inherit}.organization-select[hidden]{display:none}.organization-message{min-height:1.4em;margin:10px 0;color:var(--muted,#596a82)}.organization-message.error{color:#a4262c}.organization-stage{position:relative;overflow:auto;min-height:480px;max-height:650px;background:#fff;border:1px solid var(--border,#d5dfeb);border-radius:12px;overscroll-behavior:contain}.organization-stage:focus-visible{outline:3px solid #537cd9;outline-offset:2px}.organization-stage svg{display:block;background:#fff}.organization-legend{display:flex;flex-wrap:wrap;gap:14px;font-size:.8rem;color:var(--muted,#596a82);margin:12px 0}.organization-legend span{display:inline-flex;gap:6px;align-items:center}.organization-legend i{width:12px;height:12px;border-radius:3px}.organization-leadership{background:#a43634}.organization-support{background:#177a47}.organization-units{background:#431f4e}.organization-teams{background:#006f83}@media(max-width:650px){.organization-toolbar{align-items:stretch}.organization-select{width:100%}.organization-select select{max-width:none;width:100%}.organization-stage{min-height:360px;max-height:65vh}}@media print{body.organization-print *{visibility:hidden!important}body.organization-print #phase15OrganizationSection,body.organization-print #phase15OrganizationSection *{visibility:visible!important}body.organization-print #phase15OrganizationSection{position:absolute;top:0;left:0;width:100%;margin:0;padding:0;border:0;box-shadow:none}body.organization-print #phase15OrganizationSection .section-heading,body.organization-print #phase15OrganizationSection .organization-toolbar,body.organization-print #phase15OrganizationSection .organization-message,body.organization-print #phase15OrgCheck,body.organization-print #phase15OrganizationSection .organization-legend{display:none!important}body.organization-print .organization-stage{border:0;overflow:visible;min-height:0;max-height:none}body.organization-print .organization-stage svg{width:100%!important;height:auto!important}}

.assessments-section { margin-top: 28px; }
.assessment-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.assessment-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px; }
.assessment-card h3,.assessment-card p { margin: 0; }
.assessment-card button { margin-top: 10px; }
.assessment-dialog { width: min(820px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.assessment-explanation { padding: 18px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius-sm); line-height: 1.65; }
.assessment-acknowledgement { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; line-height: 1.5; }
.assessment-acknowledgement input { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.assessment-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.assessment-stats { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.assessment-timer { font-size: 26px; color: var(--navy-900); font-variant-numeric: tabular-nums; }
#assessmentBody progress { width: 100%; height: 9px; margin-top: 12px; accent-color: var(--blue-700); }
.assessment-question { margin: 24px 0 18px; font-size: 21px; line-height: 1.5; }
.assessment-options { display: grid; gap: 12px; }
.assessment-option { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 2px solid var(--slate-200); border-radius: var(--radius-sm); background: var(--white); color: var(--slate-950); text-align: left; cursor: pointer; }
.assessment-option:hover,.assessment-option:focus-visible { border-color: var(--blue-600); }
.assessment-option.is-selected { border-color: var(--blue-700); background: var(--blue-50); }
.assessment-option-letter { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--slate-100); font-weight: 800; }
.assessment-geometry-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
.assessment-geometry-options .assessment-option { flex-direction: column; }
.assessment-prompt { display: flex; justify-content: center; padding: 18px; background: var(--slate-50); border-radius: var(--radius-sm); }
.assessment-prompt svg { max-width: 100%; max-height: 230px; }
.assessment-option svg { max-width: 100%; height: 140px; }
.assessment-result { padding: 24px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius-md); text-align: center; }
.assessment-result .eyebrow { display: block; }
.assessment-score { display: block; font-size: 58px; color: var(--navy-900); }
.assessment-leaderboard { margin-top: 24px; }
.assessment-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.assessment-table th,.assessment-table td { padding: 12px; border-bottom: 1px solid var(--slate-200); text-align: left; }
.assessment-notice:empty { display: none; }
.assessment-notice { line-height: 1.5; color: var(--slate-700); }
.assessment-pending { padding: 14px; background: var(--amber-100); border: 1px solid #fcd34d; border-radius: var(--radius-sm); }
.assessment-pending-row { padding: 8px 0; overflow-wrap: anywhere; }
.assessment-pending-row p { margin: 0 0 8px; }
@media (max-width: 640px) { .assessment-cards { grid-template-columns: 1fr; } .assessment-dialog { width: calc(100vw - 20px); } .assessment-question { font-size: 18px; } .assessment-option svg { height: 110px; } }
