/* ============================================================
   PEAK OPERATOR — KPI TRACKER DESIGN SYSTEM
   ============================================================ */

/* ── Self-hosted fonts (eliminates Google Fonts round-trips) ── */
@font-face {
  font-family: 'Bebas Neue';
  src: url('/fonts/bebasneu-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dmsans-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dmsans-600-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrainsmono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrainsmono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/playfair-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/playfair-400i-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --navy:   #07101F;
  --navy2:  #0D1B2E;
  --navy3:  #142338;
  --gold:   #C9A84C;
  --gold2:  #E8C96A;
  --gold3:  #F5E6C5;
  --white:  #EDF2FA;
  --muted:  #5A7094;
  --muted2: #8AA0BC;
  --red:    #E63946;
  --green:  #27AE60;
  --orange: #E67E22;
  --blue:   #2980B9;
  --nav-h:  60px;
  --targets-h: 88px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Prevent 300ms tap delay and remove tap highlight flash on mobile */
a, button, input, textarea, select, [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  background-color: var(--navy);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  background-image:
    linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

#app { position: relative; z-index: 1; }

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

/* Safari autofill dark theme override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0 9999px #0D1B2E inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--navy2);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.nav-brand a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.1;
}
.nav-logo-img {
  height: 40px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.nav-logo-text {
  display: flex;
  flex-direction: column;
}
.nav-logo {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.2rem;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.nav-module {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  overflow: visible;
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted2);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--gold); background: rgba(201,168,76,0.1); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.nav-name {
  font-size: 0.8rem;
  color: var(--muted2);
}

/* ── Nav Dropdowns ───────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted2);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown-trigger::after {
  content: '▾';
  font-size: 0.55rem;
  opacity: 0.6;
  margin-left: 0.15rem;
}
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown-trigger:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}
.nav-dropdown-trigger.active {
  color: var(--gold);
  background: rgba(201,168,76,0.1);
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0.35rem 0;
  min-width: 200px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
/* Invisible bridge fills the margin-top gap so hover doesn't break */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.nav-dropdown-menu--roles {
  min-width: 230px;
  max-height: 360px;
  overflow-y: auto;
}
.nav-dropdown-section {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.65rem 1rem 0.2rem;
  pointer-events: none;
}
.nav-dropdown-section:first-child { padding-top: 0.35rem; }
.nav-dropdown-divider {
  height: 1px;
  background: rgba(201,168,76,0.2);
  margin: 0.3rem 0;
}
.mobile-nav-role-section {
  font-size: 0.6rem;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  padding: 0.55rem 1.5rem 0.1rem 2.25rem;
}
.mobile-nav-role-divider {
  height: 1px;
  background: rgba(201,168,76,0.15);
  margin: 0.3rem 1.25rem;
}
.nav-dropdown-item {
  display: block;
  padding: 0.45rem 1rem;
  color: var(--muted2);
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  text-decoration: none;
  line-height: 1.2;
}
.nav-dropdown-item:hover,
.nav-dropdown-item.active {
  color: var(--gold);
  background: rgba(201,168,76,0.07);
}
.nav-dropdown-item.active { color: var(--gold); }
.dropdown-sub {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.1rem;
  font-weight: 400;
}
.nav-dropdown-item.active .dropdown-sub { color: var(--gold2); }

/* Mobile drawer section headers */
.mobile-nav-section {
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0.7rem 1.5rem 0.15rem;
}
.mobile-nav-sublink {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.5rem 0 2.25rem;
  color: var(--muted2);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.mobile-nav-sublink:hover,
.mobile-nav-sublink.active {
  color: var(--gold);
  background: rgba(201,168,76,0.07);
  border-left-color: var(--gold);
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  min-height: 44px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
}
.btn-primary:hover { background: var(--gold2); }
.btn-primary:disabled { background: var(--muted); color: var(--navy2); cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted2);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,0.25); }

.btn-logout {
  padding: 0.4rem 0.85rem;
  min-height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(90,112,148,0.4);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  transition: all 0.15s;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); }
.btn-profile {
  padding: 0.4rem 0.85rem;
  min-height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(201,168,76,0.3);
  background: transparent;
  color: var(--gold2);
  font-size: 0.75rem;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-profile:hover { color: var(--gold); border-color: var(--gold); background: rgba(201,168,76,0.08); }

/* ── ANNUAL TARGETS HEADER ──────────────────────────────────── */
.targets-header {
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  background: var(--navy2);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  padding: 0.65rem 1.5rem;
}

.targets-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.targets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.target-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.target-values {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--white);
}
.target-current { color: var(--gold2); }
.target-sep, .target-total { color: var(--muted); font-size: 0.9rem; }

.target-name {
  font-size: 0.68rem;
  color: var(--white);
  margin: 0.2rem 0 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.target-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 2px;
  transition: width 0.6s ease;
  min-width: 2px;
}

/* ── PAGE LAYOUT ─────────────────────────────────────────────── */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 2rem;
  color: var(--white);
  letter-spacing: 0.04em;
  line-height: 1;
}

.page-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted2);
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}

/* Gold divider */
.gold-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin: 0.5rem 0 1rem;
  border-radius: 2px;
}

/* ── DATE RANGE TOGGLE ──────────────────────────────────────── */
.range-toggle {
  display: flex;
  gap: 0.25rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px;
}

.range-btn {
  padding: 0.4rem 0.75rem;
  min-height: 36px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--muted2);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s;
}
.range-btn:hover { color: var(--white); }
.range-btn.active {
  background: rgba(201,168,76,0.18);
  color: var(--gold);
}

/* ── KPI GRID ────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 220px;
  gap: 1rem;
}

/* ── KPI TILE ────────────────────────────────────────────────── */
/* ── KPI FLIP CARD WRAPPER ───────────────────────────────────── */
.kpi-flip-wrap {
  perspective: 1000px;
  transition: transform 0.15s ease;
}

.kpi-flip-wrap:hover:not(.is-flipped) {
  transform: translateY(-1px);
}

.kpi-flip-inner {
  display: grid;
  grid-template-areas: 'tile';
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.kpi-flip-inner.flipped {
  transform: rotateY(180deg);
}

/* ── KPI TILE (shared by front and back) ─────────────────────── */
.kpi-tile {
  grid-area: tile;
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  transition: border-color 0.2s;
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  min-height: 220px;
  height: 220px;
}

/* Front clips overflow so long names don't stretch the grid row */
.kpi-flip-front.kpi-tile {
  overflow: hidden;
}

/* Front face */
.kpi-flip-front.kpi-tile:hover {
  border-color: rgba(201,168,76,0.25);
}
.kpi-flip-front.kpi-tile--clickable {
  cursor: pointer;
}
.kpi-flip-front.kpi-tile--clickable:hover {
  border-color: rgba(201,168,76,0.45);
}
.kpi-flip-front.kpi-tile--clickable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Back face */
.kpi-flip-back.kpi-tile {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.3) transparent;
}
.kpi-flip-back.kpi-tile::-webkit-scrollbar { width: 4px; }
.kpi-flip-back.kpi-tile::-webkit-scrollbar-track { background: transparent; }
.kpi-flip-back.kpi-tile::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 2px; }

/* Back controls */
.kpi-back-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.kpi-back-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.15s;
}
.kpi-back-close:hover { color: var(--white); }

.kpi-back-detail {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.15s;
}
.kpi-back-detail:hover { opacity: 0.75; }

/* Back sections */
.kpi-back-section {
  margin-bottom: 10px;
  flex-shrink: 0;
}
.kpi-back-section:last-child { margin-bottom: 0; }

.kpi-back-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.kpi-back-text {
  font-size: 11px;
  color: var(--muted2);
  line-height: 1.5;
}

.kpi-back-empty {
  font-size: 11px;
  color: var(--muted);
}

/* Recent trend list */
.kpi-back-trend-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kpi-back-trend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 0;
  line-height: 1.3;
}

.kpi-back-trend-wk {
  color: var(--muted);
  flex: 1;
}

.kpi-back-trend-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--white);
}

.trend-on  { color: var(--green); font-size: 11px; }
.trend-off { color: var(--red);   font-size: 11px; }
.trend-nd  { color: var(--muted); font-size: 11px; }

.tile-status-bar {
  height: 3px;
  width: 100%;
  border-radius: 8px 8px 0 0;
}
.kpi-tile.on-target .tile-status-bar { background: var(--green); }
.kpi-tile.behind .tile-status-bar    { background: var(--red); }
.kpi-tile.no-data .tile-status-bar   { background: rgba(255,255,255,0.1); }

.tile-body {
  padding: 0.9rem 1rem 0.75rem;
}

.tile-value {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--white);
}
.kpi-tile.on-target .tile-value { color: var(--white); }
.kpi-tile.behind .tile-value    { color: var(--red); }
.kpi-tile.no-data .tile-value   { color: var(--muted); }

.tile-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--white);
  letter-spacing: 0.08em;
  margin: 0.3rem 0 0.2rem;
  line-height: 1.35;
}

.tile-target {
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  color: var(--gold3);
}
.tile-target.on_target { color: var(--green); }
.tile-target.behind    { color: var(--red); }
.tile-target.no_data   { color: var(--gold2); }

.tile-sparkline {
  opacity: 0.8;
}
.tile-sparkline svg { display: block; }
.tile-note {
  font-size: 0.7rem;
  color: var(--muted2);
  font-style: italic;
  margin-top: 0.4rem;
  line-height: 1.4;
  opacity: 0.85;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── SECTION HEADERS ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 1rem;
}
.section-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(201,168,76,0.3), transparent);
}

/* ── TREND CHART ─────────────────────────────────────────────── */
.trend-chart-wrap {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.trend-chart-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* ── SUBMIT FORM ─────────────────────────────────────────────── */
.submit-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.submit-card {
  background: var(--navy2);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 12px;
  padding: 2rem;
}

.submit-week-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.kpi-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.kpi-input-row:last-of-type { border-bottom: none; }

.kpi-input-label {
  flex: 1;
  min-width: 0;
}
.kpi-input-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.2;
}
.kpi-input-target {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--gold3);
  margin-top: 0.15rem;
}

.kpi-input-field {
  width: 110px;
  flex-shrink: 0;
}
.kpi-input-field input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  min-height: 44px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  outline: none;
  transition: border-color 0.15s;
}
.kpi-input-field input:focus {
  border-color: rgba(201,168,76,0.4);
}
.kpi-input-field input.ok    { border-color: var(--green); }
.kpi-input-field input.warn  { border-color: var(--red); }

.kpi-input-status {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-size: 1rem;
}

.note-section {
  margin-top: 1.25rem;
}
.note-label {
  font-size: 0.8rem;
  color: var(--muted2);
  margin-bottom: 0.4rem;
}
.note-section textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: border-color 0.15s;
}
.note-section textarea:focus { border-color: rgba(201,168,76,0.3); }

.submit-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.submit-banner {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}
.submit-banner.editing {
  background: rgba(41,128,185,0.12);
  border: 1px solid rgba(41,128,185,0.3);
  color: var(--blue);
}
.submit-banner.readonly {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.25);
  color: var(--red);
}

/* Confirmation screen */
.submit-confirm {
  text-align: center;
  padding: 2.5rem 1rem;
}
.submit-confirm-icon { font-size: 3rem; margin-bottom: 1rem; }
.submit-confirm h2 {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.8rem;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.submit-confirm p { color: var(--muted2); font-size: 0.9rem; }
.submit-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ── HISTORY TABLE ───────────────────────────────────────────── */
.history-note {
  font-size: 0.72rem;
  color: var(--muted2);
  font-style: italic;
  margin-top: 0.2rem;
  opacity: 0.85;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
}
.history-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.history-table td {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.history-table tr:hover td { background: rgba(255,255,255,0.02); }

.val-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.4rem;
}
.status-dot.on-target { background: var(--green); }
.status-dot.behind    { background: var(--red); }

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Hero — above the card */
.login-hero {
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 9vw, 90px);
  letter-spacing: 10px;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(135deg, #E8C96A 0%, #C9A84C 40%, #F5E6C5 70%, #C9A84C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}
.brand-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(11px, 1.6vw, 14px);
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #FFFFFF;
  text-align: center;
  margin-top: 12px;
}
.brand-divider {
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, #C9A84C, #E8C96A);
  margin: 28px auto;
  border-radius: 2px;
}

/* Card */
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--navy2);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 14px;
  padding: 2.5rem;
  text-align: center;
}

/* Footer — below the card (setup/forgot/reset pages use .login-brand instead) */
.login-footer {
  width: 100%;
  max-width: 400px;
  text-align: center;
  margin-top: 1.75rem;
}
.login-powered-by {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 10px;
  margin-bottom: 8px;
}
.login-peak-mf {
  font-family: 'Bebas Neue', cursive;
  color: var(--gold);
  letter-spacing: 4px;
  font-size: 20px;
}

/* Brand block — used by setup/forgot/reset pages (inside the card) */
.login-brand {
  margin-bottom: 2rem;
}
.login-brand-name {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.8rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  line-height: 1;
}
.login-brand-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}
.login-tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted2);
  margin-bottom: 1.75rem;
  line-height: 1.4;
}
.login-input-wrap {
  margin-bottom: 1rem;
}
.login-input {
  width: 100%;
  padding: 0.7rem 1rem;
  min-height: 44px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.9rem;
  outline: none;
  text-align: center;
  transition: border-color 0.15s;
}
.login-input:focus { border-color: rgba(201,168,76,0.5); }
.login-btn {
  width: 100%;
  padding: 0.75rem;
  min-height: 48px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--gold2); }
.login-btn:disabled { background: var(--muted); cursor: not-allowed; }
.login-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1rem;
}
.login-sent {
  padding: 1rem;
  background: rgba(39,174,96,0.1);
  border: 1px solid rgba(39,174,96,0.25);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

/* ── LOADING & EMPTY STATES ─────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  gap: 0.75rem;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(201,168,76,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }

.error-msg {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.25);
  border-radius: 8px;
  color: var(--red);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin: 1rem 0;
}

/* ── DIRECTORY TABLE ─────────────────────────────────────────── */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.dir-card {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.dir-card:hover { border-color: rgba(201,168,76,0.3); }
.dir-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', cursive;
  font-size: 1rem;
  color: var(--gold);
  flex-shrink: 0;
}
.dir-info { min-width: 0; }
.dir-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-role {
  font-size: 0.72rem;
  color: var(--muted2);
  margin-top: 0.15rem;
}
.dir-dept {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--gold);
  margin-top: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── HISTORY TABLE WRAPPER ───────────────────────────────────── */
.history-table-wrap {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.history-table-wrap .history-table {
  min-width: 480px;
}

/* ── HAMBURGER BUTTON ────────────────────────────────────────── */
.hamburger-btn {
  display: none; /* shown only at ≤640px via media query */
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  padding: 13px 10px;
  background: transparent;
  border: none;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── MOBILE DRAWER ───────────────────────────────────────────── */
.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 16, 31, 0.7);
  z-index: 98;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.mobile-drawer.open { display: block; }

.mobile-drawer-inner {
  background: var(--navy2);
  border-bottom: 2px solid rgba(201, 168, 76, 0.25);
  padding: 0.25rem 0 0.75rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 1.5rem;
  color: var(--muted2);
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.07);
  border-left-color: var(--gold);
}

.mobile-nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0.5rem 1.25rem;
}

.mobile-nav-logout {
  display: flex;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 0 1.5rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}
.mobile-nav-logout:hover { color: var(--red); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .targets-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 640px) {
  .brand-name { letter-spacing: 5px; font-size: clamp(28px, 10vw, 52px); }
  .brand-tagline { letter-spacing: 4px; }
  .navbar { padding: 0 1rem; gap: 0.75rem; }
  .nav-links { display: none; }          /* horizontal links → hidden; drawer takes over */
  .nav-name { display: none; }           /* user name → hidden on mobile */
  .btn-logout { display: none; }         /* desktop logout → hidden; drawer has its own */
  .btn-profile { display: none; }        /* desktop profile → hidden; drawer has its own */
  .hamburger-btn { display: flex; }      /* show hamburger on mobile */
  .nav-logo-img { height: 32px; }
  .targets-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .targets-header { padding: 0.5rem 1rem; }
  .main-content { padding: 1.25rem 1rem 2.5rem; }
  .page-header { flex-direction: column; gap: 0.75rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .tile-value { font-size: 1.9rem; }
  .submit-card { padding: 1.25rem; }
  .kpi-input-field { width: 90px; }

  /* iOS: prevent viewport zoom on input focus — all form inputs must be ≥16px */
  .login-input,
  .kpi-input-field input,
  .note-section textarea { font-size: 16px; }

  /* History — card layout (replaces horizontal-scroll table) */
  .history-table-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-x: visible;
  }
  .history-table-wrap .history-table { min-width: 0; }
  .history-table,
  .history-table tbody { display: block; width: 100%; }
  .history-table thead { display: none; }
  .history-table tr {
    display: block;
    background: var(--navy2);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
  }
  .history-table tr:hover td { background: transparent; }
  .history-table td {
    display: block;
    padding: 0.15rem 0;
    border-bottom: none;
    font-size: 0.85rem;
  }
  /* Week — small muted label at top of card */
  .history-table td:nth-child(1) {
    font-size: 0.72rem;
    color: var(--muted2);
    margin-bottom: 0.2rem;
  }
  /* KPI name — already has editMeta inside */
  .history-table td:nth-child(2) { font-weight: 500; }
  /* Submitted — hidden */
  .history-table td:nth-child(4) { display: none; }
  /* Action (Edit/Locked) — right-aligned, separated by a hairline */
  .history-table td:nth-child(5) {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: right;
  }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .targets-grid { grid-template-columns: 1fr 1fr; }
}

/* ── ORG CHART ────────────────────────────────────────────────── */
.org-page {
  max-width: 1060px;
  margin: 0 auto;
}

.org-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.org-title-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.org-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.35rem;
}

/* ── Tree container ── */
.org-tree {
  position: relative;
}

/* ── CEO row ── */
.org-ceo-row {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}

/* ── Columns ── */
.org-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.org-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Department header ── */
.org-col-header {
  text-align: center;
  padding-bottom: 10px;
}

.org-dept-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
}

.org-dept-line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 6px auto 0;
  opacity: 0.6;
}

/* ── Flip wrapper (perspective container, handles lift & indent) ── */
.org-flip-wrap {
  perspective: 1000px;
  transition: transform 0.15s ease;
}

.org-flip-wrap:hover:not(.is-flipped) {
  transform: translateY(-2px);
}

.org-flip-wrap--ceo {
  max-width: 280px;
}

.org-flip-wrap--report {
  margin-left: 12px;
}

/* ── Flip inner (the rotating element) ── */
.org-flip-inner {
  display: grid;
  grid-template-areas: 'card';
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  height: 300px;
}

/* CEO card inner is taller to accommodate larger avatar */
.org-flip-wrap--ceo .org-flip-inner {
  height: 345px;
}

/* In expanded state let content determine height (back face max-height caps it) */
.org-flip-wrap.is-expanded .org-flip-inner {
  height: auto;
}

.org-flip-inner.flipped {
  transform: rotateY(180deg);
}

/* ── Card faces (shared base) ── */
.org-card {
  grid-area: card;
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Front face ── */
.org-flip-front {
  cursor: pointer;
  overflow: hidden;
}

.org-flip-front:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.org-flip-front:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Back face ── */
.org-flip-back {
  transform: rotateY(180deg);
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.3) transparent;
}

.org-flip-back::-webkit-scrollbar { width: 4px; }
.org-flip-back::-webkit-scrollbar-track { background: transparent; }
.org-flip-back::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 2px; }

/* ── Card variants ── */
.org-card--ceo {
  border-color: var(--gold);
  padding: 16px;
  min-height: 345px;
}

.org-card--president {
  border-left: 4px solid var(--gold);
}

/* ── Avatar ── */
.org-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.org-avatar--ceo {
  width: 200px;
  height: 200px;
}

.org-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.org-avatar-initials {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  color: var(--navy);
  letter-spacing: 1px;
  line-height: 1;
  user-select: none;
}

.org-avatar--ceo .org-avatar-initials {
  font-size: 52px;
}

/* ── CEO badge ── */
.org-ceo-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── Name / role text (front face) ── */
.org-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--white);
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.org-card--ceo .org-name {
  font-size: 28px;
}

.org-role {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--gold);
  margin-top: 6px;
  line-height: 1.3;
}

.org-card--ceo .org-role {
  font-size: 16px;
}

/* ── Back face controls (✕ + profile link) ── */
.org-back-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.org-back-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}
.org-back-close:hover { color: var(--white); }

.org-back-profile {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.15s;
}
.org-back-profile:hover { opacity: 0.75; }

/* ── Back face content sections ── */
.org-back-section {
  width: 100%;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.org-back-section:last-child { margin-bottom: 0; }

.org-back-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.org-back-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.5;
}

.org-back-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.org-back-li {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
  line-height: 1.45;
  padding: 1.5px 0;
  color: var(--muted2);
}
.org-back-li::before {
  content: '•';
  color: var(--gold);
  flex-shrink: 0;
  font-size: 10px;
}

.org-back-val {
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  flex-shrink: 0;
}

/* ── SVG connector lines ── */
.org-lines-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) and (min-width: 641px) {
  .org-columns { gap: 16px; }
  .org-flip-wrap--report { margin-left: 8px; }
}

@media (max-width: 640px) {
  .org-ceo-row { margin-bottom: 1.5rem; }
  .org-flip-wrap--ceo { max-width: 100%; }

  .org-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .org-col { margin-bottom: 1.75rem; }
  .org-flip-wrap--report { margin-left: 0; }
  .org-dept-name { font-size: 14px; }
  .org-avatar { width: 150px; height: 150px; }
  .org-avatar--ceo { width: 180px; height: 180px; }
  .org-avatar-initials { font-size: 38px; }
  .org-avatar--ceo .org-avatar-initials { font-size: 48px; }
  .org-name { font-size: 20px; }
  .org-card--ceo .org-name { font-size: 26px; }
}

/* ── Org card title block (two-line treatment) ─────────────────── */
.org-title-block {
  text-align: center;
  line-height: 1;
  margin-top: 4px;
}

.org-title-type {
  font-family: 'Bebas Neue', cursive;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.org-card--ceo .org-title-type {
  font-size: 22px;
}

.org-title-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(237, 242, 250, 0.7);
  margin-top: 4px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.org-card--ceo .org-title-desc {
  font-size: 14px;
}

/* ── Flip-and-expand backdrop ──────────────────────────────────── */
.flip-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 31, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.flip-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Expanded back face: max-height, scroll, bigger text ──────── */
.org-flip-wrap.is-expanded  .org-flip-back {
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
}
.kpi-flip-wrap.is-expanded  .kpi-flip-back {
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
}

/* Sticky controls bar stays visible while scrolling */
.org-flip-wrap.is-expanded  .org-back-controls,
.kpi-flip-wrap.is-expanded  .kpi-back-controls {
  position: sticky;
  top: 0;
  background: var(--navy2);
  z-index: 1;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.org-flip-wrap.is-expanded  .org-back-section  { margin-bottom: 20px; }
.org-flip-wrap.is-expanded  .org-back-label    { font-size: 13px; margin-bottom: 6px; }
.org-flip-wrap.is-expanded  .org-back-text     { font-size: 15px; line-height: 1.6; }
.org-flip-wrap.is-expanded  .org-back-li       { font-size: 14px; padding: 2px 0; line-height: 1.5; }
.org-flip-wrap.is-expanded  .org-back-val      { font-size: 13px; }
.org-flip-wrap.is-expanded  .org-back-profile  { font-size: 13px; }

.kpi-flip-wrap.is-expanded  .kpi-back-section    { margin-bottom: 20px; }
.kpi-flip-wrap.is-expanded  .kpi-back-label      { font-size: 13px; margin-bottom: 6px; }
.kpi-flip-wrap.is-expanded  .kpi-back-text       { font-size: 15px; line-height: 1.6; }
.kpi-flip-wrap.is-expanded  .kpi-back-detail     { font-size: 13px; }
.kpi-flip-wrap.is-expanded  .kpi-back-trend-row  { font-size: 14px; padding: 3px 0; }
.kpi-flip-wrap.is-expanded  .kpi-back-trend-wk   { font-size: 13px; }
.kpi-flip-wrap.is-expanded  .kpi-back-trend-val  { font-size: 12px; }
.kpi-flip-wrap.is-expanded  .kpi-back-empty      { font-size: 14px; }

/* ── Fix 1: CEO card expanded — override 280px max-width cap ──── */
.org-flip-wrap--ceo.is-expanded {
  max-width: 600px !important;
  margin: 0 !important;
}
@media (max-width: 900px) and (min-width: 641px) {
  .org-flip-wrap--ceo.is-expanded {
    max-width: 500px !important;
  }
}
@media (max-width: 640px) {
  .org-flip-wrap--ceo.is-expanded {
    max-width: 92vw !important;
  }
}

/* ── Fix 2: KPI cards expanded — override fixed 220px height ──── */
.kpi-flip-wrap.is-expanded {
  height: auto !important;
  max-height: 80vh !important;
}
.kpi-flip-wrap.is-expanded .kpi-flip-inner {
  height: auto !important;
}
.kpi-flip-wrap.is-expanded .kpi-tile {
  height: auto !important;
  min-height: 400px !important;
  max-height: none !important;
}
.kpi-flip-wrap.is-expanded .kpi-flip-back {
  min-height: 400px !important;
  padding: 32px !important;
}

/* ── HOME PAGE ───────────────────────────────────────────────── */
.home-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 0;
}

.home-hero { text-align: center; margin-bottom: 0.5rem; }

.home-greeting {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #E8C96A 0%, #C9A84C 40%, #F5E6C5 70%, #C9A84C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-subhead {
  font-size: 0.88rem;
  color: var(--muted2);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.home-tiles {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.home-tile {
  width: 280px;
  height: 200px;
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.home-tile:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.15);
}

.home-tile-icon {
  font-size: 2.2rem;
  line-height: 1;
}
.home-tile-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--white);
}
.home-tile-sub {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 0 1rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .home-tiles { flex-direction: column; align-items: center; }
  .home-tile  { width: 100%; max-width: 340px; height: 140px; }
}

/* ============================================================
   Peak Operator Agent — floating chat widget  (Phase 3A.2)
   ============================================================ */

/* ── FAB (floating action button) ─────────────────────────── */
.peak-agent-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: none;
  cursor: pointer;
  z-index: 800;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.peak-agent-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(201, 168, 76, 0.6);
}
.peak-agent-fab:hover::before {
  opacity: 1;
}
.peak-agent-fab::before {
  content: 'Ask Peak Operator';
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(7, 16, 31, 0.95);
  color: var(--white);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  border: 1px solid rgba(201, 168, 76, 0.25);
}
.peak-agent-fab svg {
  width: 24px;
  height: 24px;
  fill: var(--navy);
  display: block;
  flex-shrink: 0;
}

/* ── Slide-out panel ──────────────────────────────────────── */
.peak-agent-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  background: var(--navy2);
  border-left: 1px solid rgba(201, 168, 76, 0.2);
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.peak-agent-panel.is-open {
  transform: translateX(0);
}

/* ── Mobile backdrop ──────────────────────────────────────── */
.peak-agent-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 850;
}
@media (max-width: 640px) {
  .peak-agent-backdrop.is-visible {
    display: block;
  }
}

/* ── Header ───────────────────────────────────────────────── */
.poa-header {
  height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  gap: 10px;
}
.poa-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.poa-brand-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.poa-brand-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(237, 242, 250, 0.55);
  line-height: 1;
}
.poa-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.poa-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--muted2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}
.poa-icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}
.poa-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}
.poa-new-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(201, 168, 76, 0.45);
  background: transparent;
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.poa-new-btn:hover {
  background: rgba(201, 168, 76, 0.1);
}

/* ── Body layout ──────────────────────────────────────────── */
.poa-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Conversation sidebar ─────────────────────────────────── */
.poa-sidebar {
  width: 0;
  max-width: 0;
  overflow: hidden;
  transition: max-width 0.22s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.poa-sidebar.is-visible {
  max-width: 200px;
  width: 200px;
  overflow-y: auto;
}
.poa-conv-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.poa-sidebar-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.poa-conv-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s ease;
}
.poa-conv-item:hover {
  background: rgba(201, 168, 76, 0.05);
}
.poa-conv-item.is-active {
  background: rgba(201, 168, 76, 0.09);
  border-left-color: var(--gold);
}
.poa-conv-title {
  font-size: 12px;
  color: var(--white);
  line-height: 1.4;
  word-break: break-word;
  margin-bottom: 4px;
}
.poa-conv-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.poa-conv-time {
  font-size: 10px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
.poa-conv-del {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.12s ease, opacity 0.12s ease;
}
.poa-conv-item:hover .poa-conv-del {
  opacity: 1;
}
.poa-conv-del:hover {
  color: var(--red);
}

/* ── Main chat area ───────────────────────────────────────── */
.poa-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.poa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  scroll-behavior: smooth;
  min-height: 0;
}
.poa-messages::-webkit-scrollbar { width: 4px; }
.poa-messages::-webkit-scrollbar-track { background: transparent; }
.poa-messages::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.2); border-radius: 2px; }

/* ── Message bubbles ──────────────────────────────────────── */
.chat-msg {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  max-width: 90%;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.chat-msg.user {
  background: var(--navy3);
  color: var(--white);
  margin-left: auto;
  border-radius: 8px 8px 2px 8px;
}
.chat-msg.ai {
  background: rgba(201, 168, 76, 0.07);
  border-left: 3px solid var(--gold);
  color: var(--white);
  margin-right: auto;
  border-radius: 2px 8px 8px 8px;
}
.chat-msg-content p  { margin: 0 0 8px 0; }
.chat-msg-content p:last-child { margin-bottom: 0; }
.chat-msg-content ul,
.chat-msg-content ol { margin: 6px 0 8px 18px; }
.chat-msg-content li { margin-bottom: 3px; }
.chat-msg-content h2,
.chat-msg-content h3,
.chat-msg-content h4 { margin: 10px 0 4px 0; font-size: 13px; color: var(--gold2); }
.chat-msg-content code {
  background: rgba(255,255,255,0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.chat-msg-content hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 8px 0; }
.chat-msg-content strong { color: var(--gold3); }
.agent-md-table { border-collapse: collapse; width: 100%; font-size: 12px; margin: 6px 0; }
.agent-md-table th,
.agent-md-table td { border: 1px solid rgba(255,255,255,0.1); padding: 4px 8px; text-align: left; }
.agent-md-table th { background: rgba(201,168,76,0.1); color: var(--gold2); }
.chat-msg-tools {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.3px;
  opacity: 0.8;
}

/* ── Typing indicator ─────────────────────────────────────── */
.poa-typing {
  padding: 14px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.poa-typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: poa-bounce 1.3s infinite ease-in-out;
}
.poa-typing span:nth-child(1) { animation-delay: 0s; }
.poa-typing span:nth-child(2) { animation-delay: 0.2s; }
.poa-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes poa-bounce {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.75); }
  40%            { opacity: 1;    transform: scale(1); }
}

/* ── Input area ───────────────────────────────────────────── */
.poa-input-area {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 12px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.poa-textarea {
  flex: 1;
  background: var(--navy3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 12px;
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.15s ease;
}
.poa-textarea:focus {
  border-color: rgba(201, 168, 76, 0.5);
}
.poa-textarea::placeholder {
  color: var(--muted);
}
.poa-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
}
.poa-send-btn:hover:not(:disabled) {
  background: var(--gold2);
}
.poa-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.poa-send-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--navy);
  display: block;
}
.poa-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(7, 16, 31, 0.3);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: poa-spin 0.65s linear infinite;
}
@keyframes poa-spin { to { transform: rotate(360deg); } }

/* ── Empty state ──────────────────────────────────────────── */
.poa-empty {
  padding: 36px 20px 20px;
  text-align: center;
}
.poa-empty-hero {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  line-height: 1.1;
}
.poa-empty-sub {
  color: rgba(237, 242, 250, 0.65);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 24px;
}
.poa-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.poa-chip {
  padding: 9px 14px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 20px;
  background: transparent;
  color: rgba(237, 242, 250, 0.85);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1.35;
}
.poa-chip:hover {
  background: rgba(201, 168, 76, 0.09);
  border-color: var(--gold);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) and (min-width: 641px) {
  .peak-agent-panel { width: 420px; }
}
@media (max-width: 640px) {
  .peak-agent-fab   { width: 52px; height: 52px; bottom: 16px; right: 16px; }
  .peak-agent-fab::before { display: none; }
  .peak-agent-panel { width: 100vw; border-left: none; }
  .poa-sidebar { display: none !important; }
  .poa-sidebar.is-visible {
    display: flex !important;
    max-width: 100% !important;
    width: 100% !important;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    background: var(--navy2);
  }
}

/* ── Underwriter agent additions ──────────────────────────── */
.uw-agent-fab::before { content: 'Ask Axxis Underwriter'; }

.uw-conv-section-header {
  padding: 10px 12px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
}
.uw-conv-section { display: flex; flex-direction: column; }
.uw-conv-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.uw-msg-author {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--gold);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  opacity: 0.8;
}

/* ── IR-SPECIFIC STYLES ─────────────────────────────── */
/* ============================================================
   AXXIS IR — Additional Styles
   Extends the base Peak Operator design system
   ============================================================ */

/* ── IR Agent FAB ── */
#ir-agent-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  border: none; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(201,168,76,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#ir-agent-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(201,168,76,0.5); }
#ir-agent-fab.active { background: var(--navy3); color: var(--gold); }

#ir-agent-panel {
  position: fixed; bottom: 88px; right: 24px; z-index: 999;
  width: 380px; max-height: 560px;
  background: var(--navy2); border: 1px solid var(--navy3);
  border-radius: 16px; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(20px) scale(0.95); opacity: 0;
  pointer-events: none; transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
#ir-agent-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }

.agent-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--navy3);
}
.agent-header-info { display: flex; align-items: center; gap: 10px; }
.agent-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.agent-name { font-weight: 600; font-size: 14px; }
.agent-status { font-size: 11px; color: var(--muted); }
.agent-close { background: none; border: none; color: var(--muted); font-size: 16px; padding: 4px; }
.agent-close:hover { color: var(--white); }

.agent-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--navy3) transparent;
}
.agent-msg { display: flex; }
.agent-msg-user { justify-content: flex-end; }
.agent-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.5;
}
.agent-msg-bot .agent-bubble { background: var(--navy3); color: var(--white); border-bottom-left-radius: 4px; }
.agent-msg-user .agent-bubble { background: var(--gold); color: var(--navy); border-bottom-right-radius: 4px; font-weight: 500; }
.agent-bubble code { background: rgba(0,0,0,0.2); padding: 1px 4px; border-radius: 3px; font-size: 12px; }

.agent-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.agent-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: bounce 1.2s infinite;
}
.agent-typing span:nth-child(2) { animation-delay: 0.2s; }
.agent-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

.agent-input-row {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--navy3);
}
.agent-input {
  flex: 1; background: var(--navy3); border: 1px solid transparent;
  border-radius: 8px; padding: 8px 12px; color: var(--white);
  font-size: 13px; outline: none;
}
.agent-input:focus { border-color: var(--gold); }
.agent-send {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--gold); color: var(--navy); border: none;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.agent-send:hover { background: var(--gold2); }

/* ── Score bar ── */
.score-bar-wrap {
  display: flex; align-items: center; gap: 8px;
  width: 100px; justify-content: flex-end;
}
.score-bar {
  height: 4px; background: var(--gold); border-radius: 2px;
  flex: 1; max-width: 60px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
}
.score-label { font-size: 12px; color: var(--muted2); width: 24px; text-align: right; }

/* ── Profile ── */
.profile-header {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 24px; margin-bottom: 20px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy); font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; display: flex; align-items: center; justify-content: center;
}
.profile-info { flex: 1; }
.profile-name { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 1px; }
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0; color: var(--muted); font-size: 13px; }
.profile-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.profile-score { text-align: center; flex-shrink: 0; }
.score-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--score) * 1%), var(--navy3) 0);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; margin-bottom: 4px;
}

/* ── Activity feed ── */
.activity-feed { padding: 8px 0; }
.activity-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--navy3);
}
.activity-row:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-body { flex: 1; }
.activity-time { white-space: nowrap; }
.empty-state-sm { padding: 24px 16px; color: var(--muted); font-size: 13px; text-align: center; }

/* ── Notes textarea ── */
.notes-textarea {
  width: 100%; min-height: 80px; background: var(--navy3);
  border: 1px solid transparent; border-radius: 8px;
  padding: 10px 12px; color: var(--white); font-size: 13px;
  resize: vertical; outline: none;
}
.notes-textarea:focus { border-color: var(--gold); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(7,16,31,0.8);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: var(--navy2); border: 1px solid var(--navy3);
  border-radius: 16px; padding: 28px; width: 440px; max-width: 95vw;
}
.modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 22px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--navy3); color: var(--white); padding: 10px 20px;
  border-radius: 8px; font-size: 13px; z-index: 3000;
  animation: fadeInOut 3s ease forwards;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Navigation ── */
.ir-nav {
  height: var(--nav-h); background: var(--navy2);
  border-bottom: 1px solid var(--navy3);
  display: flex; align-items: center; padding: 0 24px; gap: 0;
  position: sticky; top: 0; z-index: 100;
}
.ir-nav-logo {
  font-family: 'Bebas Neue', sans-serif; font-size: 20px;
  letter-spacing: 2px; color: var(--gold); margin-right: 32px;
}
.ir-nav-link {
  padding: 0 16px; height: var(--nav-h); display: flex; align-items: center;
  font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s; cursor: pointer;
}
.ir-nav-link:hover { color: var(--white); }
.ir-nav-link.active { color: var(--gold); border-bottom-color: var(--gold); }
.ir-nav-spacer { flex: 1; }
.ir-nav-user { font-size: 13px; color: var(--muted); cursor: pointer; }
.ir-nav-user:hover { color: var(--white); }

/* ── Filter bar ── */
.filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-input {
  background: var(--navy2); border: 1px solid var(--navy3);
  border-radius: 8px; padding: 8px 14px; color: var(--white);
  font-size: 13px; outline: none; width: 240px;
}
.filter-input:focus { border-color: var(--gold); }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px; border-radius: 6px; font-size: 12px;
  background: var(--navy2); border: 1px solid var(--navy3);
  color: var(--muted); transition: all 0.15s;
}
.filter-tab:hover { color: var(--white); border-color: var(--muted); }
.filter-tab.active { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 600; }

/* ── Stats grids ── */
.stats-grid-7 { grid-template-columns: repeat(7, 1fr); }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .stats-grid-7 { grid-template-columns: repeat(4, 1fr); }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .profile-header { flex-direction: column; }
  #ir-agent-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; }
}
@media (max-width: 600px) {
  .stats-grid-7 { grid-template-columns: repeat(2, 1fr); }
  .two-col-grid { grid-template-columns: 1fr; }
}

/* ── Content Production Page ─────────────────────────────────── */
.ir-content-page { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.content-generator-card {
  background: #0D1E33; border: 1px solid #1E3550; border-radius: 12px;
  padding: 24px; margin-bottom: 24px;
}
.content-gen-header { margin-bottom: 20px; }
.content-gen-title { font-size: 16px; font-weight: 600; color: #EDF2FA; margin-bottom: 6px; }
.content-gen-sub { font-size: 13px; color: #5A7094; line-height: 1.5; }
.content-label { display: block; font-size: 12px; font-weight: 600; color: #5A7094; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.content-textarea {
  width: 100%; min-height: 140px; background: #07101F; border: 1px solid #1E3550;
  border-radius: 8px; color: #EDF2FA; font-size: 14px; font-family: inherit;
  padding: 12px 14px; resize: vertical; line-height: 1.6;
  transition: border-color 0.2s;
}
.content-textarea:focus { outline: none; border-color: #C9A84C; }
.content-textarea::placeholder { color: #3A5270; }
.content-options-row { display: flex; gap: 24px; margin: 16px 0; flex-wrap: wrap; }
.content-option-group { flex: 1; min-width: 200px; }
.content-select {
  width: 100%; background: #07101F; border: 1px solid #1E3550; border-radius: 8px;
  color: #EDF2FA; font-size: 14px; padding: 8px 12px; cursor: pointer;
}
.content-format-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.content-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #A8BDD4; cursor: pointer; }
.content-check input[type=checkbox] { accent-color: #C9A84C; }
.btn-generate {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  background: linear-gradient(135deg, #C9A84C, #E8C96A); color: #07101F;
  border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.btn-generate:hover { opacity: 0.9; }
.btn-generate:disabled { opacity: 0.5; cursor: not-allowed; }
.content-output-section { margin-bottom: 32px; }
.content-output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.content-output-title { font-size: 16px; font-weight: 600; color: #EDF2FA; }
.content-output-cards { display: flex; flex-direction: column; gap: 16px; }
.content-output-card {
  background: #0D1E33; border: 1px solid #1E3550; border-radius: 12px; overflow: hidden;
}
.content-output-card-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid #1E3550; background: #0A1828;
}
.content-output-icon { font-size: 16px; }
.content-output-label { font-size: 13px; font-weight: 600; color: #A8BDD4; flex: 1; }
.btn-copy {
  background: transparent; border: 1px solid #1E3550; border-radius: 6px;
  color: #5A7094; font-size: 12px; padding: 4px 10px; cursor: pointer;
  transition: all 0.2s;
}
.btn-copy:hover { border-color: #C9A84C; color: #C9A84C; }
.content-output-body {
  padding: 16px; font-size: 14px; color: #A8BDD4; line-height: 1.7;
  white-space: pre-wrap; max-height: 400px; overflow-y: auto;
}
.content-coming-soon-badge {
  background: rgba(201,168,76,0.1); color: #C9A84C; border: 1px solid rgba(201,168,76,0.3);
  border-radius: 4px; font-size: 11px; padding: 2px 8px;
}
.content-raw-preview {
  margin-top: 12px; padding: 10px; background: #07101F; border-radius: 6px;
  font-size: 12px; color: #3A5270; font-style: italic;
}
.content-history-section { margin-top: 8px; }
.content-history-list { margin-top: 12px; }

/* ── IR Agent FAB + Panel ─────────────────────────────────────── */
#ir-agent-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #C9A84C, #E8C96A);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #07101F; box-shadow: 0 4px 20px rgba(201,168,76,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#ir-agent-fab:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(201,168,76,0.5); }
#ir-agent-fab.active { background: #1E3550; color: #C9A84C; }
#ir-agent-panel {
  position: fixed; bottom: 88px; right: 24px; z-index: 999;
  width: 360px; max-height: 520px; background: #0D1E33;
  border: 1px solid #1E3550; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  transform: scale(0.95) translateY(10px); opacity: 0; pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
}
#ir-agent-panel.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }
.agent-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #1E3550; }
.agent-header-info { display: flex; align-items: center; gap: 10px; }
.agent-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#C9A84C,#E8C96A); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #07101F; }
.agent-name { font-size: 13px; font-weight: 600; color: #EDF2FA; }
.agent-status { font-size: 11px; color: #5A7094; }
.agent-close { background: none; border: none; color: #5A7094; cursor: pointer; font-size: 16px; padding: 2px 6px; }
.agent-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.agent-msg { display: flex; }
.agent-msg-user { justify-content: flex-end; }
.agent-bubble { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.agent-msg-bot .agent-bubble { background: #142338; color: #A8BDD4; border-bottom-left-radius: 4px; }
.agent-msg-user .agent-bubble { background: linear-gradient(135deg,#C9A84C,#E8C96A); color: #07101F; border-bottom-right-radius: 4px; }
.agent-typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px; }
.agent-typing span { width: 6px; height: 6px; border-radius: 50%; background: #5A7094; animation: typing-dot 1.2s infinite; }
.agent-typing span:nth-child(2) { animation-delay: 0.2s; }
.agent-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot { 0%,80%,100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
.agent-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #1E3550; }
.agent-input { flex: 1; background: #07101F; border: 1px solid #1E3550; border-radius: 8px; color: #EDF2FA; font-size: 13px; padding: 8px 12px; }
.agent-input:focus { outline: none; border-color: #C9A84C; }
.agent-send { background: linear-gradient(135deg,#C9A84C,#E8C96A); border: none; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #07101F; flex-shrink: 0; }
