/* EB — Executive Board: shared design system for every page.
   Type: IBM Plex Sans (text + headings), IBM Plex Mono (figures). Palette: white, slate, EB orange as accent only. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f3f6;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #5b6576;
  --faint: #94a3b8;
  --line: #e2e6ec;
  --line-2: #edf0f4;
  --orange: #fc4c00;
  --orange-hover: #e04400;
  --orange-ink: #c23b00;
  --orange-soft: #fff1ea;
  --dark: #0b1220;
  --dark-2: #121b2d;
  --dark-line: rgba(255, 255, 255, 0.09);
  --green: #1f6e43;
  --green-soft: #e9f5ee;
  --red: #b42318;
  --red-soft: #fef1f0;
  --amber: #9a531f;
  --amber-soft: #fff5ec;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(22, 21, 20, 0.04);
  --shadow: 0 1px 2px rgba(22, 21, 20, 0.04), 0 8px 28px rgba(22, 21, 20, 0.04);
  --shadow-lg: 0 2px 6px rgba(22, 21, 20, 0.06), 0 24px 60px rgba(22, 21, 20, 0.1);
  --sidebar: 268px;

  --display: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;

  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(252, 76, 0, 0.18); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 200; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; transition: top 160ms var(--ease-out); }
.skip-link:focus { top: 12px; }

/* ---------- App shell ---------- */

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar);
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--dark); color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 280ms var(--ease-drawer);
}
.brand { display: block; padding: 30px 26px 24px; border-bottom: 1px solid var(--dark-line); text-decoration: none; }
.brand-mark { font-family: var(--sans); font-size: 36px; font-weight: 800; letter-spacing: -0.07em; line-height: 1; }
.brand-mark span, .accent { color: var(--orange); }
.brand-sub { margin-top: 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: #8b8680; }
.side-section { padding: 20px 14px 0; }
.side-label { display: block; margin: 0 12px 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #6f6a64; }
.side-select {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--dark-line); background: #211f1d; color: #fff; font-weight: 600;
  transition: border-color 150ms ease;
}
.side-select:focus { outline: none; border-color: var(--orange); }
.nav { display: grid; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: #a39e97; text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
}
.nav a[aria-current="page"] { background: rgba(252, 76, 0, 0.12); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav a[aria-current="page"] svg { color: var(--orange); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 20px 14px 18px; }
.side-user { padding: 12px; border-radius: 12px; border: 1px solid var(--dark-line); background: rgba(255, 255, 255, 0.03); }
.side-user p { font-size: 12px; color: #e7e3de; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { display: block; margin-top: 2px; font-size: 11px; color: #7a756f; text-transform: capitalize; }
.side-user button { margin-top: 10px; width: 100%; padding: 8px; border-radius: 9px; border: 1px solid var(--dark-line); background: transparent; color: #cfcac4; cursor: pointer; font-size: 12px; font-weight: 600; transition: border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }
.side-user button:active { transform: scale(0.97); }
.side-copy { margin: 14px 4px 0; font-size: 10px; line-height: 1.5; color: #5f5a54; }
.side-copy a { color: #8b8680; text-decoration: none; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.5); border: 0; animation: fade-in 200ms ease both; }

.content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(247, 246, 243, 0.82); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.crumb .tag { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; color: var(--orange-ink); }
.menu-btn { display: none; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: transform 160ms var(--ease-out); }
.menu-btn:active { transform: scale(0.95); }
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 46vw; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--orange); }

.page { max-width: 1240px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 96px; }

/* Page entrance: short, staggered, once per load. */
.page > *, .page [data-view]:not(.hidden) > * { animation: rise 420ms var(--ease-out) both; }
.page > *:nth-child(2), .page [data-view] > *:nth-child(2) { animation-delay: 40ms; }
.page > *:nth-child(3), .page [data-view] > *:nth-child(3) { animation-delay: 80ms; }
.page > *:nth-child(4), .page [data-view] > *:nth-child(4) { animation-delay: 120ms; }
.page > *:nth-child(5), .page [data-view] > *:nth-child(5) { animation-delay: 160ms; }
.page > *:nth-child(n + 6), .page [data-view] > *:nth-child(n + 6) { animation-delay: 200ms; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 24px 0 60px rgba(0, 0, 0, 0.3); }
  .content { margin-left: 0; }
  .menu-btn { display: inline-flex; }
}

/* ---------- Typography ---------- */

.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--orange-ink); }
.title {
  margin-top: 12px; font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(34px, 4.6vw, 52px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.04;
  font-variation-settings: "SOFT" 30, "WONK" 0;
}
.title em, .display em { font-style: italic; font-weight: 400; color: var(--orange-ink); }
.lede { margin-top: 12px; max-width: 640px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.h3 { font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }

/* ---------- Layout helpers ---------- */

.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.25fr); align-items: start; } }
.profile-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .profile-layout { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }

/* ---------- Cards ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.card-foot { padding: 14px 24px; border-top: 1px solid var(--line-2); background: #fcfbf9; font-size: 12px; color: var(--muted); border-radius: 0 0 var(--radius) var(--radius); }
.stat { position: relative; padding: 22px; overflow: hidden; container-type: inline-size; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-value { margin-top: 12px; font-size: clamp(17px, 12cqi, 31px); font-weight: 700; letter-spacing: -0.035em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-note { margin-top: 6px; font-size: 11px; color: var(--faint); }
.dark-card { position: relative; overflow: hidden; border-radius: 22px; background: #151413; color: #fff; padding: clamp(28px, 4vw, 48px); box-shadow: var(--shadow-lg); }
.dark-card::after { content: ""; position: absolute; inset: auto -20% -60% auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(252, 76, 0, 0.22), transparent); pointer-events: none; }
.dark-card .lede { color: #a9a39c; }
.dark-card .eyebrow { color: var(--orange); }
.dark-card .title em { color: var(--orange); }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.07); pointer-events: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #1a0d05; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 6px 18px rgba(252, 76, 0, 0.22); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-danger { color: var(--red); border-color: #f1d5d5; background: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.btn-lg { padding: 14px 22px; border-radius: 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform 200ms var(--ease-out); }
.link { background: none; border: 0; padding: 0; color: var(--orange-ink); font-weight: 700; font-size: 12px; cursor: pointer; text-decoration: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: #d9d4cd; box-shadow: var(--shadow-sm); }
  .btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
  .btn-dark:hover { background: #2e2c29; border-color: #2e2c29; }
  .btn-danger:hover { background: var(--red-soft); border-color: #e7b4b0; }
  .btn:hover .arrow { transform: translateX(3px); }
  .link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
  .side-user button:hover { border-color: var(--orange); color: #fff; }
  .card-hover { transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms ease; }
  .card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #dcd7d0; }
}

/* ---------- Forms ---------- */

.field { display: grid; gap: 7px; }
.field > span, .label { font-size: 12px; font-weight: 700; color: #4a4743; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid #e3e0da; background: var(--surface-2); color: #242220; font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.textarea { resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 4px rgba(252, 76, 0, 0.12); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; }
.input::placeholder, .textarea::placeholder { color: #b3ada6; }
.hint { font-size: 11px; line-height: 1.5; color: var(--faint); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.full { grid-column: 1 / -1; }

/* ---------- Alerts ---------- */

.alert {
  padding: 12px 16px; border-radius: 12px; font-size: 13px; border: 1px solid;
  animation: alert-in 260ms var(--ease-out) both;
}
.alert-error { background: var(--red-soft); border-color: #f5c9c4; color: var(--red); }
.alert-success { background: var(--green-soft); border-color: #bfe3cb; color: #17633b; }
.alert-info { background: var(--amber-soft); border-color: #f2d6bf; color: var(--amber); }

/* ---------- Tables & lists ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; font-size: 13px; }
.table th { padding: 11px 16px; background: #fbfaf8; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 120ms ease; }
.table tbody tr:hover { background: #fcfbf9; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; background: var(--surface-3); color: var(--muted); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-orange { background: var(--orange-soft); color: var(--orange-ink); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #efede9 0%, #f8f7f4 50%, #efede9 100%); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }

.list-item { padding: 16px; border: 1px solid var(--line-2); border-radius: 12px; background: #fdfcfb; }
.list-item + .list-item { margin-top: 10px; }
details > summary { cursor: pointer; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-3); }
.tab { padding: 7px 14px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.progress { height: 8px; border-radius: 999px; background: #ece9e4; overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--orange), #fd7033); transform-origin: left; animation: grow-x 700ms var(--ease-out) both; }

/* ---------- Modal ---------- */

.modal-backdrop { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(18, 17, 16, 0.55); backdrop-filter: blur(4px); animation: fade-in 200ms ease both; }
.modal { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; padding: 28px; border-radius: 20px; background: var(--bg); box-shadow: var(--shadow-lg); animation: modal-in 240ms var(--ease-out) both; }

/* ---------- Login ---------- */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .auth-page { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.auth-aside { position: relative; display: none; overflow: hidden; padding: 48px; background: var(--dark); color: #fff; }
@media (min-width: 960px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside .display { font-family: var(--display); font-size: clamp(36px, 3.6vw, 52px); font-weight: 400; line-height: 1.06; letter-spacing: -0.025em; }
.auth-aside .display em { color: var(--orange); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-brand { margin-bottom: 28px; text-decoration: none; display: inline-block; }
.auth-brand .brand-mark { color: var(--dark); font-size: 40px; }

/* ---------- Keyframes ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes alert-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0.1); } to { transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* Company setup: optional "use my current location" row */
.loc-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 2px 0 14px; }
.loc-share .btn { flex: none; }

