/* ============================================================
   Homeowners Portal — Design System
   ============================================================ */

:root {
  /* Brand */
  --navy-real: #0C5A89;
  --navy-900: #0a2540;
  --navy-800: #0e3a5f;     /* logo */
  --navy-700: #1f4e7a;
  --navy-600: #2d6296;
  --navy-500: #4a7fb8;
  --navy-400: #7da5cc;
  --navy-300: #b3cce0;
  --navy-200: #d6e4ef;
  --navy-100: #ecf2f7;
  --navy-50:  #f5f8fb;

  /* Neutrals (very subtly cool) */
  --ink-900: #0c1722;
  --ink-700: #2a3744;
  --ink-500: #5b6878;
  --ink-400: #8593a2;
  --ink-300: #b6bfc9;
  --ink-200: #dde2e8;
  --ink-100: #eef1f4;
  --paper:   #fbfcfd;
  --white:   #ffffff;

  /* Accents (used sparingly) */
  --accent-amber: #c98a2b;
  --accent-green: #2f7d5b;
  --accent-rose:  #b04848;

  /* Glass */
  --glass-fill: rgba(255, 255, 255, 0.55);
  --glass-stroke: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 30px 80px -20px rgba(10, 37, 64, 0.45),
                  0 8px 24px -8px rgba(10, 37, 64, 0.25),
                  inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Type */
  --font-sans: "dunbartext", sans-serif;
  --font-mono: "dunbartext", sans-serif;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.06), 0 1px 1px rgba(10, 37, 64, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(10, 37, 64, 0.10), 0 2px 4px rgba(10, 37, 64, 0.06);
  --shadow-lg: 0 20px 40px -12px rgba(10, 37, 64, 0.18), 0 4px 12px rgba(10, 37, 64, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   LOGIN
   ============================================================ */

.login-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #0a2540 0%, #1f4e7a 50%, #4a7fb8 100%);
  display: grid;
  place-items: center;
  z-index: 100;
}

/* Layered ambient scene */
.scene-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.7;
  pointer-events: none;
}
.scene-blob.b1 {
  width: 760px; height: 760px;
  background: radial-gradient(circle, #4a7fb8 0%, transparent 70%);
  top: -200px; left: -200px;
  animation: float1 22s ease-in-out infinite;
}
.scene-blob.b2 {
  width: 620px; height: 620px;
  background: radial-gradient(circle, #7da5cc 0%, transparent 70%);
  bottom: -180px; right: -120px;
  animation: float2 28s ease-in-out infinite;
}
.scene-blob.b3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #b3cce0 0%, transparent 70%);
  top: 40%; left: 50%;
  opacity: 0.45;
  animation: float3 35s ease-in-out infinite;
}

@keyframes float1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.1); }
}
@keyframes float2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-100px, -40px) scale(1.05); }
}
@keyframes float3 {
  0%,100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-40%, -55%) scale(1.15); }
}

/* Subtle grid texture */
.scene-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}

/* ============================================================
   Mock dashboard cards floating behind login
   ============================================================ */
.mock-dashboards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.mock-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  box-shadow: 0 24px 60px -16px rgba(10, 37, 64, 0.45),
              0 8px 20px -8px rgba(10, 37, 64, 0.25);
  padding: 16px;
  font-size: 12px;
  color: var(--ink-700);
  opacity: 0.78;
  filter: blur(0.4px);
  transform-origin: center;
  will-change: transform;
}
.mock-card .mc-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.mock-card .mc-title {
  font-size: 12px; font-weight: 600; color: var(--navy-900);
  letter-spacing: -0.005em;
}
.mock-card .mc-sub {
  font-size: 10.5px; color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

/* Positions + animations */
.mc-pricing { top: 12%; left: 10%; width: 280px; animation: drift1 20s ease-in-out infinite; }
.mc-pipeline { top: 12%; right: 10%; width: 280px; animation: drift2 24s ease-in-out infinite; }
.mc-announce { bottom: 18%; left: 10%; width: 280px; animation: drift3 19s ease-in-out infinite; }
.mc-finops { bottom: 12%; right: 10%; width: 290px; animation: drift4 22s ease-in-out infinite; }
.mc-homieiq { bottom: 12%; right: 10%; width: 290px; animation: drift4 22s ease-in-out infinite; }
.mc-seworksheet { top: 50%; left: 22%; width: 240px; animation: drift5 18s ease-in-out infinite; }
.mc-calendar { top: 52%; right: 20%; width: 230px; animation: drift6 21s ease-in-out infinite; }

@keyframes drift1 {
  0%,100% { transform: translate(0,0) rotate(-2deg); }
  50% { transform: translate(20px, -16px) rotate(-1deg); }
}
@keyframes drift2 {
  0%,100% { transform: translate(0,0) rotate(1.5deg); }
  50% { transform: translate(-24px, 18px) rotate(2.5deg); }
}
@keyframes drift3 {
  0%,100% { transform: translate(0,0) rotate(2deg); }
  50% { transform: translate(18px, -12px) rotate(1deg); }
}
@keyframes drift4 {
  0%,100% { transform: translate(0,0) rotate(-1.5deg); }
  50% { transform: translate(-20px, -14px) rotate(-2.5deg); }
}
@keyframes drift5 {
  0%,100% { transform: translate(0,0) rotate(-3deg); }
  50% { transform: translate(14px, 22px) rotate(-2deg); }
}
@keyframes drift6 {
  0%,100% { transform: translate(0,0) rotate(2.5deg); }
  50% { transform: translate(-16px, -18px) rotate(1.5deg); }
}

/* Chart card */
.mc-chart { width: 100%; height: 60px; display: block; }
.mc-row {
  display: flex; gap: 14px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--ink-100);
}
.mc-stat { display: flex; flex-direction: column; }
.mc-stat-lbl { font-size: 9.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.06em; }
.mc-stat-val { font-size: 13px; font-weight: 600; color: var(--navy-900); font-variant-numeric: tabular-nums; }

/* Files list */
.mc-list { display: flex; flex-direction: column; gap: 8px; }
.mc-list-row { display: flex; align-items: center; gap: 8px; }
.mc-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.mc-list-body { flex: 1; min-width: 0; }
.mc-list-nm { font-size: 11.5px; font-weight: 500; color: var(--navy-900); }
.mc-list-sub { font-size: 10px; color: var(--ink-500); }
.mc-pill {
  font-size: 9.5px; font-weight: 600; padding: 2px 7px;
  border-radius: 999px; letter-spacing: 0.04em;
}
.mc-pill-amber { background: rgba(201, 138, 43, 0.15); color: var(--accent-amber); }
.mc-pill-green { background: rgba(47, 125, 91, 0.15); color: var(--accent-green); }
.mc-pill-blue { background: var(--navy-100); color: var(--navy-800); }

/* Pricing */
.mc-pricing-grid { display: flex; flex-direction: column; gap: 6px; }
.mc-px-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  font-size: 11px; align-items: center;
  padding: 4px 0;
  border-bottom: 1px dashed var(--ink-100);
}
.mc-px-row:last-child { border-bottom: none; }
.mc-px-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy-900); }
.mc-px-delta { font-size: 10px; font-variant-numeric: tabular-nums; }
.mc-px-delta.down { color: var(--accent-green); }
.mc-px-delta.up { color: var(--accent-rose); }

/* Calendar */
.mc-cal-list { display: flex; flex-direction: column; gap: 6px; }
.mc-cal-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
}
.mc-cal-time {
  width: 36px; font-variant-numeric: tabular-nums;
  color: var(--ink-500); font-size: 10.5px; flex-shrink: 0;
}
.mc-cal-bar { width: 3px; height: 14px; background: var(--navy-400); border-radius: 2px; flex-shrink: 0; }
.mc-cal-row.priority .mc-cal-bar { background: var(--accent-amber); }
.mc-cal-ttl { color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* KPI tile */
.mc-kpi-lbl { font-size: 10px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.mc-kpi-val { font-size: 28px; font-weight: 700; color: var(--navy-900); letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mc-kpi-delta { font-size: 11px; color: var(--accent-green); font-weight: 500; margin-top: 2px; }
.mc-bars {
  display: flex; gap: 3px; align-items: flex-end;
  height: 36px; margin-top: 10px;
}
.mc-bars span {
  flex: 1; background: linear-gradient(to top, var(--navy-400), var(--navy-300));
  border-radius: 2px 2px 0 0;
}

/* Disclosure progress */
.mc-progress { display: flex; flex-direction: column; gap: 8px; }
.mc-progress-row { display: flex; flex-direction: column; gap: 4px; }
.mc-progress-lbl { font-size: 10.5px; color: var(--ink-700); }
.mc-progress-bar {
  height: 5px; background: var(--ink-100); border-radius: 3px; overflow: hidden;
}
.mc-progress-bar > div {
  height: 100%; background: linear-gradient(to right, var(--navy-600), var(--navy-400));
  border-radius: 3px;
}

/* Announcements card */
.mc-ann-list { display: flex; flex-direction: column; gap: 8px; }
.mc-ann-row { display: flex; gap: 8px; align-items: flex-start; }
.mc-ann-dot {
  width: 7px; height: 7px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
}
.mc-ann-body { flex: 1; min-width: 0; }
.mc-ann-ttl {
  font-size: 11.5px; font-weight: 500; color: var(--navy-900);
  line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-ann-meta { font-size: 10px; color: var(--ink-500); margin-top: 2px; }

/* FinOps card */
.mc-finops-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--ink-100);
  border-radius: 6px; overflow: hidden;
}
.mc-fo-cell { background: white; padding: 8px 10px; }
.mc-fo-lbl { font-size: 9.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.mc-fo-val { font-size: 15px; font-weight: 700; color: var(--navy-900); margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mc-fo-delta { font-size: 10px; font-weight: 500; margin-top: 1px; font-variant-numeric: tabular-nums; }
.mc-fo-delta.up { color: var(--accent-green); }
.mc-fo-delta.down { color: var(--accent-rose); }

/* Self-employment worksheet */
.mc-se-list { display: flex; flex-direction: column; gap: 5px; }
.mc-se-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--ink-100);
}
.mc-se-row:last-child { border-bottom: none; }
.mc-se-lbl { color: var(--ink-700); }
.mc-se-val { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--navy-900); }
.mc-se-row.mc-se-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1.5px solid var(--navy-300);
  border-bottom: none;
}
.mc-se-row.mc-se-total .mc-se-lbl { color: var(--navy-900); font-weight: 600; }
.mc-se-row.mc-se-total .mc-se-val { color: var(--navy-900); font-weight: 700; font-size: 12.5px; }

/* HomieIQ chat card */
.mc-hiq-mark {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  color: white; border-radius: 4px;
  font-size: 10px; margin-right: 6px;
  vertical-align: -2px;
}
.mc-chat {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 8px;
}
.mc-chat-msg { display: flex; gap: 6px; align-items: flex-start; }
.mc-chat-msg.user { justify-content: flex-end; }
.mc-chat-bubble {
  font-size: 10.5px; line-height: 1.4;
  padding: 6px 10px;
  border-radius: 10px;
  max-width: 85%;
}
.mc-chat-msg.user .mc-chat-bubble {
  background: var(--navy-800);
  color: white;
  border-bottom-right-radius: 3px;
}
.mc-chat-msg.ai .mc-chat-bubble {
  background: var(--navy-100);
  color: var(--ink-900);
  border-bottom-left-radius: 3px;
}
.mc-chat-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  color: white;
  display: grid; place-items: center;
  font-size: 9px; flex-shrink: 0;
  margin-top: 2px;
}
.mc-chat-typing {
  display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle;
}
.mc-chat-typing i {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--navy-600);
  animation: hiq-blink 1.2s ease-in-out infinite;
}
.mc-chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.mc-chat-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes hiq-blink {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}
.mc-chat-input {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  font-size: 10px;
  color: var(--ink-400);
}
.mc-chat-send {
  background: var(--navy-800); color: white;
  width: 18px; height: 18px;
  border-radius: 4px;
  display: grid; place-items: center;
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  .mock-card { animation: none !important; }
}


/* Chrome bar at top of login */
.login-chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  z-index: 2;
}
.login-chrome .brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-chrome img { height: 48px; }
.login-chrome .meta { display: flex; gap: 28px; align-items: center; font-variant-numeric: tabular-nums; }
.login-chrome .meta .dot { width: 6px; height: 6px; border-radius: 50%; background: #6fdc8c; box-shadow: 0 0 10px #6fdc8c; }
.login-chrome .status { display: flex; align-items: center; gap: 8px; }

/* Footer */
/* Login user selector */
.login-user-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.login-user-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.login-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.45);
  border: 1.5px solid rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.15s ease;
}
.login-user-card:hover { background: rgba(255,255,255,0.65); }
.login-user-card.active {
  background: rgba(255,255,255,0.75);
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(30,80,140,0.08);
}
.login-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy-800);
  color: white;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.login-user-name  { font-size: 13px; font-weight: 600; color: var(--navy-900); }
.login-user-title { font-size: 11px; color: var(--ink-500); margin-top: 1px; }

.login-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  z-index: 2;
  letter-spacing: 0.02em;
}
.login-footer a { color: rgba(255,255,255,0.85); text-decoration: none; transition: color 0.15s ease; cursor: pointer; }
.login-footer a:hover { color: rgba(255,255,255,1); text-decoration: underline; }
.login-footer .links { display: flex; gap: 24px; }

/* The card */
.login-card {
  position: relative;
  z-index: 3;
  width: 460px;
  padding: 44px 44px 36px;
  border-radius: var(--r-xl);
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  animation: cardIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card .logo-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.login-card .logo-mark img {
  height: 88px;
  filter: drop-shadow(0 4px 12px rgba(10, 37, 64, 0.15));
}

.login-card h1 {
  font-family: "dunbartall-hairline", sans-serif;
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 6px;
  color: var(--navy-900);
  text-align: center;
  letter-spacing: -0.01em;
}
.login-card .sub {
  font-size: 14px;
  color: var(--ink-500);
  text-align: center;
  margin: 0 0 28px;
}

/* SSO button */
.sso-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--navy-900);
  color: white;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.25);
}
.sso-btn:hover {
  background: #061a2e;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(10, 37, 64, 0.35);
}
.sso-btn:active { transform: translateY(0); }
.sso-btn.loading { pointer-events: none; opacity: 0.85; }
.sso-btn .ms-icon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 16px; height: 16px;
}
.sso-btn .ms-icon span { display: block; }
.sso-btn .ms-icon span:nth-child(1) { background: #f25022; }
.sso-btn .ms-icon span:nth-child(2) { background: #7fba00; }
.sso-btn .ms-icon span:nth-child(3) { background: #00a4ef; }
.sso-btn .ms-icon span:nth-child(4) { background: #ffb900; }

.sso-btn .spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alt SSO row */
.sso-alt {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.sso-alt button {
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.sso-alt button:hover {
  background: rgba(255,255,255,0.8);
  transform: translateY(-1px);
}

/* Divider */
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 20px;
  color: var(--ink-400);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(10,37,64,0.15), transparent);
}

/* Tenant identifier readout */
.tenant-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.6);
  font-size: 12px;
  color: var(--ink-700);
  margin-bottom: 18px;
}
.tenant-row .label { color: var(--ink-500); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.tenant-row .val { font-family: var(--font-mono); color: var(--navy-900); font-weight: 500; }

/* Help row */
.login-help {
  margin-top: 22px;
  display: flex; justify-content: center; align-items: center;
  font-size: 12px;
  color: var(--ink-500);
}
.login-help a { color: var(--navy-700); font-weight: 500; }
.login-help a:hover { color: var(--navy-900); text-decoration: underline; }

/* Loading takeover during sign-in */
.login-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 64, 0.5);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  z-index: 4;
  animation: fadeIn 0.3s ease both;
}
.login-loading-overlay .pulse {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: grid; place-items: center;
  animation: pulse 1.4s ease-in-out infinite;
}
.login-loading-overlay .pulse::before {
  content: '';
  position: absolute;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: spin 0.9s linear infinite;
}
.login-loading-overlay .label {
  margin-top: 24px;
  color: white;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-align: center;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ============================================================
   PORTAL SHELL
   ============================================================ */

.portal {
  min-height: 100vh;
  background: var(--navy-50);
  display: grid;
  grid-template-columns: 240px 1fr;
}

/* Sidebar */
.sidebar {
  /* background: var(--navy-900); */
  background: var(--navy-900);
  color: white;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  padding: 6px 10px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
}
.sidebar .brand img { height: 28px; }
.sidebar .brand .wm {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar .brand-text { display: flex; flex-direction: column; }
.sidebar .brand-text .nm { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }

.nav-section { margin-bottom: 22px; }
.nav-section .label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 0 10px 8px;
  font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active {
  background: rgba(255,255,255,0.10);
  color: white;
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 8px; bottom: 8px;
  width: 3px;
  background: white;
  border-radius: 0 3px 3px 0;
}
.nav-item .ico { width: 16px; height: 16px; opacity: 0.9; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--navy-600);
  color: white;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-weight: 500;
}

/* User chip in sidebar */
.user-chip-wrap { margin-top: auto; }
.user-chip {
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.user-chip:hover { background: rgba(255,255,255,0.10); }
.user-chip .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a7fb8, #1f4e7a);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.user-chip .info { flex: 1; min-width: 0; }
.user-chip .info .nm { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .info .role { font-size: 11px; color: rgba(255,255,255,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main */
.main {
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: white;
  border-bottom: 1px solid var(--ink-200);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.search-wrap {
  flex: 1;
  max-width: 560px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: var(--r-md);
  background: var(--navy-50);
  border: 1px solid transparent;
  font-size: 14px;
  color: var(--ink-900);
  transition: all 0.15s ease;
}
.search-input::placeholder { color: var(--ink-400); }
.search-input:focus {
  outline: none;
  background: white;
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(74, 127, 184, 0.15);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--ink-400);
  pointer-events: none;
}
.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-400);
  background: white;
  border: 1px solid var(--ink-200);
  padding: 2px 6px;
  border-radius: 4px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--ink-500);
  position: relative;
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--navy-100); color: var(--navy-900); }
.icon-btn .dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-amber);
  border: 2px solid white;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 20;
}
.search-results .group {
  padding: 6px 0;
  border-bottom: 1px solid var(--ink-100);
}
.search-results .group:last-child { border-bottom: none; }
.search-results .group-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 8px 16px 4px;
  font-weight: 600;
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
}
.search-result-item:hover { background: var(--navy-50); }
.search-result-item .ico {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--navy-100);
  color: var(--navy-800);
  flex-shrink: 0;
}
.search-result-item .body { flex: 1; min-width: 0; }
.search-result-item .nm { font-size: 13.5px; font-weight: 500; }
.search-result-item .desc { font-size: 12px; color: var(--ink-500); }
.search-result-item .restricted {
  font-size: 11px;
  color: var(--ink-400);
  background: var(--ink-100);
  padding: 2px 7px;
  border-radius: var(--r-pill);
}

/* Main content */
.content {
  padding: 32px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

/* Greeting */
.greeting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
}
.greeting h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--navy-900);
}
.greeting custom {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--navy-900);
}
.greeting .meta {
  font-size: 14px;
  color: var(--ink-500);
}
.greeting .day {
  font-size: 13px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.greeting .day strong { color: var(--navy-900); font-weight: 600; }

/* Section header */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 0 14px;
}
.section-head h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 0;
}
.section-head .action {
  font-size: 12.5px;
  color: var(--navy-700);
  font-weight: 500;
  cursor: pointer;
}
.section-head .action:hover { text-decoration: underline; }

/* Pinned + tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.tools-grid.compact { grid-template-columns: repeat(6, 1fr); }

.tool-card {
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
}
.tool-card:hover {
  border-color: var(--navy-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card .top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.tool-card .ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tool-card .pin-btn {
  opacity: 0;
  transition: opacity 0.15s ease;
  color: var(--ink-400);
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
}
.tool-card:hover .pin-btn { opacity: 1; }
.tool-card .pin-btn:hover { background: var(--navy-100); color: var(--navy-800); }
.tool-card .pin-btn.pinned { opacity: 1; color: var(--accent-amber); }

.tool-card .nm {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy-900);
  letter-spacing: -0.005em;
}
.tool-card .desc {
  font-size: 12.5px;
  color: var(--ink-500);
  line-height: 1.45;
  margin-top: -4px;
}
.tool-card .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--ink-100);
  font-size: 11px;
  color: var(--ink-500);
}
.tool-card .badge-new {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-green);
  background: rgba(47, 125, 91, 0.1);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.tool-card .status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  margin-right: 6px;
}

/* Tool icon backgrounds (rotation of brand-tinted) */
.ico.tone-1 { background: #ecf2f7; color: #0e3a5f; }
.ico.tone-2 { background: #d6e4ef; color: #0a2540; }
.ico.tone-3 { background: #f5f8fb; color: #1f4e7a; }
.ico.tone-4 { background: #e7eef5; color: #0e3a5f; }
.ico.tone-warm { background: rgba(201, 138, 43, 0.1); color: var(--accent-amber); }
.ico.tone-green { background: rgba(47, 125, 91, 0.1); color: var(--accent-green); }

/* Restricted overlay */
.tool-card.restricted {
  background: var(--navy-50);
  border-style: dashed;
  cursor: not-allowed;
}
.tool-card.restricted:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--ink-300);
}
.tool-card.restricted .nm,
.tool-card.restricted .desc { color: var(--ink-400); }
.tool-card.restricted .ico {
  background: var(--ink-100);
  color: var(--ink-400);
}
.tool-card .lock-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-400);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Two-col layout below tools */
.split {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  margin-top: 32px;
}

/* Announcements */
.announcements {
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  overflow: hidden;
}
.announcements-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.announcements-head h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--navy-900);
  letter-spacing: -0.005em;
}
.announcements-head .filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--navy-50);
  padding: 3px;
  border-radius: var(--r-pill);
}
.announcements-head .filter-tabs button {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--r-pill);
  color: var(--ink-500);
  font-weight: 500;
}
.announcements-head .filter-tabs button.active {
  background: white;
  color: var(--navy-900);
  box-shadow: var(--shadow-sm);
}

.announce-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink-100);
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.announce-item:last-child { border-bottom: none; }
.announce-item:hover { background: var(--navy-50); }
.announce-item .dept {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.announce-item .body { flex: 1; min-width: 0; }
.announce-item .meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--ink-500);
}
.announce-item .pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.announce-item .pill.priority { background: rgba(176, 72, 72, 0.1); color: var(--accent-rose); }
.announce-item .pill.policy { background: rgba(201, 138, 43, 0.1); color: var(--accent-amber); }
.announce-item .pill.event { background: rgba(47, 125, 91, 0.1); color: var(--accent-green); }
.announce-item .pill.update { background: var(--navy-100); color: var(--navy-800); }
.announce-item .ttl {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-900);
  margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.announce-item .preview {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Right col cards */
.side-card {
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.side-card .head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-100);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  letter-spacing: -0.005em;
  display: flex; align-items: center; justify-content: space-between;
}
.side-card .body { padding: 14px 18px; }

/* Quick stats */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--ink-100);
}
.kpi {
  background: white;
  padding: 14px 18px;
}
.kpi .lbl {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 6px;
}
.kpi .val {
  font-size: 22px;
  font-weight: 600;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}
.kpi .delta {
  font-size: 11px;
  color: var(--accent-green);
  margin-left: 6px;
  font-weight: 500;
}
.kpi .delta.down { color: var(--accent-rose); }

/* Schedule */
.sched-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink-100);
}
.sched-item:last-child { border-bottom: none; padding-bottom: 0; }
.sched-item:first-child { padding-top: 0; }
.sched-item .time {
  flex-shrink: 0;
  width: 56px;
  font-size: 12px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.sched-item .ttl {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy-900);
  margin: 0 0 2px;
}
.sched-item .sub {
  font-size: 11.5px;
  color: var(--ink-500);
}
.sched-item .marker {
  width: 3px;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--navy-400);
}
.sched-item.priority .marker { background: var(--accent-amber); }

/* Empty state for restricted role */
.empty-restricted {
  text-align: center;
  padding: 40px 24px;
  color: var(--ink-500);
  font-size: 13px;
  border: 1px dashed var(--ink-200);
  border-radius: var(--r-md);
  background: white;
}

/* Sign out button (fixed corner on dashboard for tweak demo) */
.signout-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 50;
  font-size: 12px;
  color: var(--ink-500);
  background: white;
  border: 1px solid var(--ink-200);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}
.signout-fab:hover { color: var(--navy-900); border-color: var(--navy-400); }

/* ============================================================
   Shared view components
   ============================================================ */

/* Standalone filter tabs (outside .announcements-head) */
.view-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--navy-50);
  padding: 3px;
  border-radius: var(--r-pill);
  width: fit-content;
}
.view-filter-tabs button {
  padding: 4px 14px;
  font-size: 12px;
  border-radius: var(--r-pill);
  color: var(--ink-500);
  font-weight: 500;
}
.view-filter-tabs button.active {
  background: white;
  color: var(--navy-900);
  box-shadow: var(--shadow-sm);
}

/* Shared search bar for views */
.view-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  margin-bottom: 20px;
  color: var(--ink-400);
}
.view-search input {
  flex: 1;
  font-size: 13.5px;
  color: var(--navy-900);
  background: transparent;
}
.view-search input::placeholder { color: var(--ink-400); }

/* Shared action buttons */
.btn-primary {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  background: var(--navy-800);
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--navy-900); }

.btn-secondary {
  padding: 7px 14px;
  border-radius: var(--r-sm);
  background: white;
  border: 1px solid var(--ink-200);
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--navy-400); background: var(--navy-50); }

.btn-danger {
  padding: 7px 14px;
  border-radius: var(--r-sm);
  background: white;
  border: 1px solid #f0c0c0;
  color: #b94040;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background: #fdf0f0; border-color: #b94040; }

/* ============================================================
   Projects view
   ============================================================ */
.project-list { display: flex; flex-direction: column; gap: 10px; }
.project-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--ink-200); }
.project-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.project-status-pill {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  width: fit-content;
}
.project-name { font-size: 15px; font-weight: 600; color: var(--navy-900); }
.project-desc { font-size: 13px; color: var(--ink-500); }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.project-tag {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--navy-50);
  color: var(--navy-700);
}
.project-card-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 110px;
  padding-left: 24px;
  border-left: 1px solid var(--ink-100);
}
.project-meta-row { display: flex; flex-direction: column; gap: 2px; }
.project-meta-lbl { font-size: 10.5px; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.project-meta-val { font-size: 13px; font-weight: 500; color: var(--navy-900); }

/* ============================================================
   Documents view
   ============================================================ */
.doc-list {
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.doc-list-header {
  display: grid;
  grid-template-columns: 1fr 90px 80px 110px;
  gap: 16px;
  padding: 10px 18px;
  background: var(--navy-50);
  border-bottom: 1px solid var(--ink-150);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.doc-row {
  display: grid;
  grid-template-columns: 1fr 90px 80px 110px;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--ink-100);
  align-items: center;
  transition: background 0.1s;
  cursor: pointer;
}
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: var(--navy-50); }
.doc-name { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; color: var(--navy-900); min-width: 0; }
.doc-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--navy-100); color: var(--navy-700);
  display: grid; place-items: center; flex-shrink: 0;
}
.doc-tag { font-size: 11.5px; font-weight: 500; color: var(--navy-700); }
.doc-size { font-size: 12.5px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.doc-modified { font-size: 12.5px; color: var(--ink-500); }

/* ============================================================
   Directory / People view
   ============================================================ */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.dir-card {
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
}
.dir-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dir-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700;
  margin-bottom: 4px;
}
.dir-name { font-size: 14px; font-weight: 600; color: var(--navy-900); }
.dir-title { font-size: 12px; color: var(--ink-500); }
.dir-dept {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--navy-50); color: var(--navy-700);
  margin-top: 4px;
}

/* ============================================================
   Knowledge Base view
   ============================================================ */
.kb-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kb-article-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.kb-article-row:hover { box-shadow: var(--shadow-sm); border-color: var(--ink-200); }
.kb-article-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--navy-100); color: var(--navy-700);
  display: grid; place-items: center; flex-shrink: 0;
}
.kb-article-body { flex: 1; min-width: 0; }
.kb-article-title { font-size: 14px; font-weight: 500; color: var(--navy-900); }
.kb-article-meta { font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.kb-tag {
  font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  background: var(--navy-50); color: var(--navy-700);
  flex-shrink: 0;
}

/* ============================================================
   Help & Support view
   ============================================================ */
.help-contacts { display: flex; flex-direction: column; gap: 10px; }
.help-contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.help-contact-body { flex: 1; }
.help-contact-title { font-size: 14px; font-weight: 600; color: var(--navy-900); }
.help-contact-desc { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }
.faq-list { display: flex; flex-direction: column; gap: 6px; }
.faq-item {
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
}
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-900);
  transition: background 0.1s;
}
.faq-item:hover .faq-question { background: var(--navy-50); }
.faq-answer {
  padding: 0 18px 16px;
  font-size: 13.5px;
  color: var(--ink-600);
  line-height: 1.6;
  border-top: 1px solid var(--ink-100);
  margin-top: 0;
  padding-top: 12px;
}

/* ============================================================
   Settings view
   ============================================================ */
.settings-section {
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-400);
  margin-bottom: 16px;
}
.settings-profile { display: flex; align-items: center; gap: 18px; }
.settings-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--navy-800);
  color: white;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}
.settings-name { font-size: 16px; font-weight: 600; color: var(--navy-900); }
.settings-role { font-size: 13px; color: var(--ink-500); margin-top: 2px; }
.settings-email { font-size: 12.5px; color: var(--navy-700); margin-top: 2px; font-family: var(--font-mono); }
.settings-toggles { display: flex; flex-direction: column; gap: 0; }
.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--ink-100);
}
.settings-toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-toggle-row:first-child { padding-top: 0; }
.settings-toggle-label { font-size: 14px; font-weight: 500; color: var(--navy-900); }
.settings-toggle-sub { font-size: 12.5px; color: var(--ink-400); margin-top: 2px; }
.toggle-btn {
  width: 40px; height: 22px;
  border-radius: 999px;
  background: var(--ink-200);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-btn span {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.toggle-btn.on { background: var(--navy-700); }
.toggle-btn.on span { transform: translateX(18px); }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Notifications view
   ============================================================ */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: box-shadow 0.15s;
  position: relative;
}
.notif-item:hover { box-shadow: var(--shadow-sm); }
.notif-item.read { opacity: 0.65; }
.notif-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--navy-900); }
.notif-text { font-size: 13px; color: var(--ink-500); margin-top: 3px; line-height: 1.45; }
.notif-time { font-size: 11.5px; color: var(--ink-400); margin-top: 6px; }
/* ============================================================
   Role Management view
   ============================================================ */
.role-mgmt-list { display: flex; flex-direction: column; gap: 10px; }
.role-mgmt-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.role-mgmt-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--navy-800);
  color: white;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.role-mgmt-info { flex: 1; }
.role-mgmt-name { font-size: 15px; font-weight: 600; color: var(--navy-900); }
.role-mgmt-role { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }
.role-mgmt-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.role-mgmt-lbl { font-size: 12px; color: var(--ink-400); font-weight: 500; }

/* ============================================================
   Tool Access view
   ============================================================ */
.tool-access-list { display: flex; flex-direction: column; gap: 6px; }
.tool-access-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-sm);
  padding: 12px 18px;
  transition: border-color 0.15s;
}
.tool-access-row:hover { border-color: var(--ink-200); }
.tool-access-body { flex: 1; min-width: 0; }
.tool-access-name { font-size: 14px; font-weight: 500; color: var(--navy-900); }
.tool-access-desc { font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.tool-access-tag {
  font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  background: var(--navy-50); color: var(--navy-700);
  flex-shrink: 0;
}

.notif-unread-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--navy-600);
  flex-shrink: 0;
  margin-top: 5px;
}

/* ============================================================
   Login modals (Privacy, AUP, Status)
   ============================================================ */
.lm-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8, 22, 40, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: lm-fade-in 0.18s ease;
}
@keyframes lm-fade-in { from { opacity: 0; } to { opacity: 1; } }

.lm-sheet {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%; max-width: 640px;
  max-height: 82vh;
  display: flex; flex-direction: column;
  animation: lm-slide-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 40px rgba(8,22,40,0.18);
}
@keyframes lm-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.lm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ink-100);
  flex-shrink: 0;
}
.lm-title { font-family: "dunbartall-hairline", sans-serif; font-size: 18px; font-weight: 400; color: var(--navy-900); }
.lm-close {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--ink-400);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
}
.lm-close:hover { background: var(--ink-100); color: var(--navy-900); }

.lm-content {
  flex: 1; overflow-y: auto;
  padding: 20px 24px;
  overscroll-behavior: contain;
}

.lm-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--ink-100);
  display: flex; justify-content: flex-end;
  flex-shrink: 0;
}
.lm-close-btn {
  background: var(--navy-800); color: white;
  border: none; border-radius: var(--r-sm);
  padding: 8px 22px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.lm-close-btn:hover { background: var(--navy-900); }

/* Modal body shared */
.lm-body { font-size: 13.5px; color: var(--ink-600); line-height: 1.7; }
.lm-body h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--navy-800);
  margin: 20px 0 6px;
}
.lm-body h3:first-of-type { margin-top: 4px; }
.lm-body p { margin: 0 0 4px; }
.lm-body ul { margin: 0 0 4px; padding-left: 20px; }
.lm-body ul li { margin-bottom: 5px; }
.lm-body code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--ink-50); border-radius: 4px;
  padding: 1px 5px; color: var(--navy-700);
}
.lm-effective {
  font-size: 12px; color: var(--ink-400);
  background: var(--navy-50); border-radius: var(--r-sm);
  padding: 7px 12px; margin-bottom: 16px !important;
}

/* Status modal */
.lm-status-banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: var(--r-md); padding: 14px 16px;
  margin-bottom: 20px;
}
.lm-status-banner.operational { background: #edfaf3; }
.lm-status-banner.degraded    { background: #fff8e7; }
.lm-status-banner.outage      { background: #fef2f2; }
.lm-status-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.operational .lm-status-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.degraded    .lm-status-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.outage      .lm-status-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.lm-status-banner-ttl { font-size: 14px; font-weight: 700; color: var(--navy-900); }
.lm-status-banner-sub { font-size: 12px; color: var(--ink-400); margin-top: 1px; }

.lm-status-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-400);
  margin-bottom: 6px;
}
.lm-status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--ink-100);
}
.lm-status-row:last-of-type { border-bottom: none; }
.lm-status-name { font-size: 13.5px; color: var(--navy-800); }
.lm-status-badge {
  font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
}
.lm-status-badge.operational { background: #dcfce7; color: #15803d; }
.lm-status-badge.degraded    { background: #fef9c3; color: #92400e; }
.lm-status-badge.outage      { background: #fee2e2; color: #b91c1c; }
.lm-status-badge.maintenance { background: #e0e7ff; color: #3730a3; }
.lm-status-footer {
  font-size: 12px; color: var(--ink-400);
  background: var(--ink-50); border-radius: var(--r-sm);
  padding: 10px 12px; margin-top: 16px; line-height: 1.6;
}

/* ============================================================
   Demo passkey input on login screen
   ============================================================ */
.demo-access-wrap {
  margin-top: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.demo-access-link {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--ink-400);
  text-decoration: underline; text-underline-offset: 2px;
  padding: 2px 0;
  transition: color 0.15s;
}
.demo-access-link:hover { color: var(--navy-700); }
.demo-input-row {
  display: flex; gap: 6px; width: 100%;
}
.demo-input {
  flex: 1;
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px; font-family: var(--font-mono);
  color: var(--navy-900);
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.15s;
}
.demo-input:focus { border-color: var(--navy-600); }
.demo-submit {
  background: var(--navy-800); color: white;
  border: none; border-radius: var(--r-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.demo-submit:hover { background: var(--navy-900); }
.demo-error {
  font-size: 12px; color: #dc2626;
  width: 100%; text-align: left;
}

/* ============================================================
   Demo mode banner (dashboard)
   ============================================================ */
.demo-banner {
  display: flex; align-items: center; gap: 10px;
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
  padding: 9px 24px;
  font-size: 12.5px; color: #92400e;
  flex-shrink: 0;
}
.demo-banner-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b; flex-shrink: 0;
}
.demo-banner-text { font-weight: 500; }
.demo-banner-sep { opacity: 0.4; }
.demo-banner-cta {
  color: #92400e; font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px;
}
.demo-banner-cta:hover { color: #78350f; }

/* ============================================================
   Tool card demo block overlay
   ============================================================ */
.tool-card { position: relative; }
.tool-demo-block {
  position: absolute; inset: 0;
  background: rgba(8, 22, 40, 0.72);
  border-radius: inherit;
  display: flex; align-items: center; justify-content: center;
  gap: 7px;
  color: white; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(2px);
  animation: fade-in-fast 0.15s ease;
  z-index: 2;
}
@keyframes fade-in-fast { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   Demo Passkeys admin view
   ============================================================ */
.dk-create-card {
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.dk-create-title {
  font-size: 13px; font-weight: 700; color: var(--navy-900);
  margin-bottom: 14px;
}
.dk-form-row {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
}
.dk-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.dk-field-sm { flex: 0 0 150px; }
.dk-field label { font-size: 11.5px; font-weight: 600; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.05em; }
.dk-field input, .dk-field select {
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 13px; color: var(--navy-900);
  outline: none; transition: border-color 0.15s;
}
.dk-field input:focus, .dk-field select:focus { border-color: var(--navy-600); }

.dk-new-code {
  margin-top: 16px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: var(--r-sm);
  padding: 14px 16px;
}
.dk-new-code-label { font-size: 12px; color: var(--navy-600); margin-bottom: 10px; font-weight: 500; }
.dk-code-row { display: flex; align-items: center; gap: 12px; }
.dk-code { font-size: 15px; font-weight: 700; color: var(--navy-900); letter-spacing: 0.08em; }

.dk-list { display: flex; flex-direction: column; gap: 6px; }
.dk-row {
  display: flex; align-items: center; gap: 14px;
  background: white;
  border: 1px solid var(--ink-150);
  border-radius: var(--r-sm);
  padding: 13px 18px;
  transition: border-color 0.15s;
}
.dk-row.expired { opacity: 0.55; }
.dk-row-main { flex: 1; min-width: 0; }
.dk-row-label { font-size: 14px; font-weight: 500; color: var(--navy-900); }
.dk-row-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 12px; color: var(--ink-400); flex-wrap: wrap; }
.dk-row-code { font-size: 12px; color: var(--ink-400); }
.dk-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.dk-badge.active  { background: #dcfce7; color: #15803d; }
.dk-badge.expired { background: var(--ink-100); color: var(--ink-500); }
.btn-danger-ghost {
  background: none; border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 5px 12px;
  font-size: 12px; font-weight: 600; color: #dc2626;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn-danger-ghost:hover { background: #fef2f2; border-color: #fecaca; }

/* ============================================================
   User chip popover
   ============================================================ */
.layout-toggle-pill {
  font-size: 11px; font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  padding: 5px 12px; border-radius: 999px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: var(--navy-700);
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.layout-toggle-pill:hover { background: var(--navy-100); color: var(--navy-900); }

.user-chip-wrap { position: relative; }

.user-chip-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--navy-900);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: pop-up 0.15s cubic-bezier(0.16,1,0.3,1);
  z-index: 100;
}
@keyframes pop-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ucp-identity {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px;
}
.ucp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: white; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.ucp-name  { font-size: 13px; font-weight: 600; color: white; }
.ucp-role  { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 1px; }

.ucp-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 0 14px; }

.ucp-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 10px 14px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: rgba(255,255,255,0.75);
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.ucp-item:hover { background: rgba(255,255,255,0.07); color: white; }
.ucp-signout { color: #fca5a5; }
.ucp-signout:hover { background: rgba(239,68,68,0.12); color: #f87171; }
