/* ===== SISTEM DE DESIGN — profesional, inspirat de apple.com =====
   Paleta veche (auriu #e8b64a + verde-menta pe bleumarin) arata a joc pentru copii. Inlocuita cu
   neutre reci si UN SINGUR accent albastru, folosit cu masura — exact tiparul Apple: fundal
   neutru, contrast mare pe text, culoare doar unde chiar comunica ceva (actiune primara, stare
   pozitiva/negativa). `--gold` isi pastreaza NUMELE (e referit in zeci de locuri din CSS si JS)
   dar arata acum spre accentul albastru — evita un refactor masiv si riscant de redenumire. */
:root {
  --bg: #ffffff;
  --bg-elevated: #f5f5f7;
  --card: #f5f5f7;
  --card-border: transparent;
  --accent: #0071e3;
  --gold: var(--accent);
  --gold-dim: #0058b9;
  --teal: #248a3d;
  --red: #d70015;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-bg: rgba(255,255,255,.72);
  --bar-bg-strong: rgba(255,255,255,.8);
  --auth-glow: #ffffff;
  --hairline: rgba(0,0,0,.10);
}

/* Tema intunecata, acum EXPLICITA (inainte era implicita pe :root). apple.com e alb, deci
   alb e acum starea implicita a jocului. */
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --card: #1c1c1e;
  --card-border: transparent;
  --accent: #0a84ff;
  --gold: var(--accent);
  --gold-dim: #0060df;
  --teal: #30d158;
  --red: #ff453a;
  --text: #f5f5f7;
  --text-dim: #86868b;
  --bar-bg: rgba(0,0,0,.72);
  --bar-bg-strong: rgba(0,0,0,.8);
  --auth-glow: #000000;
  --hairline: rgba(255,255,255,.12);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #f5f5f7;
  --card: #f5f5f7;
  --card-border: transparent;
  --accent: #0071e3;
  --gold: var(--accent);
  --gold-dim: #0058b9;
  --teal: #248a3d;
  --red: #d70015;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --bar-bg: rgba(255,255,255,.72);
  --bar-bg-strong: rgba(255,255,255,.86);
  --auth-glow: #f5f5f7;
}

/* Culoare de accent personalizabila (backlog runda 6, #17) — inlocuieste --gold/--gold-dim,
   folosite peste tot (butoane primare, evidentieri). "teal" reutilizeaza --teal, deja definit
   diferit per tema; "violet" nu are un echivalent existent, deci definit explicit per tema
   pentru contrast corect (nuanta mai deschisa pe fundal intunecat, mai inchisa pe fundal deschis). */
:root[data-accent="teal"] {
  --gold: var(--teal);
  --gold-dim: var(--teal);
}
:root[data-theme="dark"][data-accent="violet"] {
  --gold: #a78bfa;
  --gold-dim: #7c5fd6;
}
:root[data-theme="light"][data-accent="violet"] {
  --gold: #7c3aed;
  --gold-dim: #5b21b6;
}

/* Mod de accesibilitate (backlog runda 7, #17): text marit + contrast crescut, un singur
   toggle simplu, la fel ca tema. Foloseste `zoom` (nu transform:scale) ca sa reflow-eze corect
   layout-ul in loc sa suprapuna/taie continut pe ecrane mici — esential pentru "nu iasa nimic
   din ecran". Contrastul creste apropiind --text-dim de --text, pe ambele teme. */
:root[data-a11y="on"] body {
  zoom: 1.15;
}
:root[data-a11y="on"] {
  --text-dim: #c3c9d6;
}
:root[data-theme="light"][data-a11y="on"] {
  --text-dim: #4a4638;
}

/* Miscare redusa (backlog runda 8, #19): "kill switch" global pentru animatii/tranzitii, aplicat
   fie automat cand sistemul de operare cere prefers-reduced-motion, fie manual prin toggle-ul
   din Profil. 0.001ms (nu 0s) ca evenimentele transitionend/animationend sa tot declanseze
   fiabil in codul JS existent care le asculta, in loc sa se piarda silentios la durata zero. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
:root[data-reduced-motion="on"] *, :root[data-reduced-motion="on"] *::before, :root[data-reduced-motion="on"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  /* Stiva de fonturi de sistem — pe Apple rezolva in SF Pro, exact fontul de pe apple.com. */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;              /* dimensiunea de baza Apple, nu 14-15px de "widget" */
  line-height: 1.47059;
  letter-spacing: -0.022em;     /* tracking-ul negativ tipic SF Pro */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  width: 100%;
  overflow-wrap: break-word;
  /* SCROLL REPARAT (raportat: "nu merge scrollul"). Aici era `overflow-x: hidden` pe html SI
     body. Conform specificatiei CSS, daca o axa e diferita de `visible`, cealalta axa calculeaza
     `visible` ca `auto` — deci html si body deveneau AMBELE containere de scroll. E combinatia
     clasica care rupe scroll-ul paginii pe iOS Safari. Clipping-ul orizontal se face acum doar
     pe #app, cu `clip` (vezi mai jos), care NU creeaza container de scroll. */
}

button, input { font-family: inherit; }

img, svg { max-width: 100%; }

/* `overflow-x: clip` taie depasirea orizontala FARA sa creeze un container de scroll (spre
   deosebire de `hidden`, care ar forta si overflow-y: auto si ar rupe scroll-ul paginii).
   `hidden` ramane ca fallback pentru browsere fara suport pentru `clip`. */
#app { min-height: 100vh; width: 100%; overflow-x: hidden; overflow-x: clip; }

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ===== AUTH ===== */
/* BUG REPARAT (raportat de utilizator: fereastra de login nu disparea dupa autentificare).
   Aici era `display: flex` pe selectorul de ID `#auth-screen`. Specificitatea unui ID (1-0-0)
   bate atat `.screen` (0-1-0, display:none) cat si `.screen.active` (0-2-0, display:block),
   deci ecranul de login ramanea VIZIBIL PERMANENT, indiferent de clasa `active` pusa/scoasa de
   showScreen(). Dupa login, shell-ul de joc primea `active` si se randa DEDESUBT, dar cardul de
   login nu disparea niciodata. Solutia: `#auth-screen` nu mai declara deloc `display`, iar
   flex-ul se aplica doar in starea activa (`#auth-screen.active`, 1-1-0) — asa `.screen`
   (display:none) ramane in control cand ecranul nu e activ. */
#auth-screen {
  align-items: center; justify-content: center;
  padding: 24px;
  background: var(--bg);
}
#auth-screen.active { display: flex; }
.auth-card {
  width: 100%; max-width: 380px;
  background: transparent;
  border: none;
  border-radius: 18px;
  padding: 40px 28px;
  text-align: center;
}
.auth-logo { margin-bottom: 14px; display: flex; justify-content: center; }
.auth-card h1 { margin: 0 0 8px; letter-spacing: -0.03em; color: var(--text); font-size: 34px; font-weight: 600; }
.tagline { color: var(--text-dim); font-size: 17px; margin: 0 0 28px; line-height: 1.42; letter-spacing: -0.022em; }
.referral-banner {
  background: rgba(10,132,255,.12); border: 1px solid var(--gold-dim); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.4; margin: -12px 0 20px;
}
.auth-tabs { display: flex; background: var(--card); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tab {
  flex: 1; padding: 9px; border: none; background: transparent; color: var(--text);
  border-radius: 7px; font-weight: 500; font-size: 14px; letter-spacing: -0.01em; cursor: pointer;
  transition: background-color .2s ease;
}
.auth-tab.active { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.16); }
.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }
.auth-form input {
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--hairline);
  background: var(--bg); color: var(--text); font-size: 17px; outline: none;
  transition: border-color .2s ease;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 0; }

/* Butoane in stil Apple: pill, plate (fara gradient), greutate 500-600 (nu 700 "gros"),
   fara efect de "scale" la apasare — doar o schimbare fina de opacitate. */
.btn {
  padding: 12px 22px; border-radius: 980px; border: none; font-size: 15px; font-weight: 500;
  letter-spacing: -0.01em; cursor: pointer; transition: opacity .2s ease, background-color .2s ease;
}
.btn:active { opacity: .82; }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-ghost {
  background: transparent; border: 1px solid var(--hairline); color: var(--text);
  width: 100%; margin-top: 12px;
}
.btn:disabled { opacity: .38; cursor: default; }


/* ===== ICOANE SVG (inlocuiesc emoji-urile din interfata) =====
   Un singur sprite inline in index.php + <use>. Contur, nu umplere: `stroke: currentColor`
   inseamna ca fiecare icoana mosteneste automat culoarea textului parintelui (inclusiv starea
   activa din tab-bar), deci nu e nevoie de variante colorate. Grosime 1.6 si capete rotunjite —
   proportiile din SF Symbols. */
.icon {
  width: 22px; height: 22px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.stat-icon .icon { width: 16px; height: 16px; }
.tab-icon .icon { width: 24px; height: 24px; }
.icon-logo {
  width: 44px; height: 44px; margin: 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; color: var(--text);
}
.stat-icon { display: flex; align-items: center; color: var(--text-dim); }
#theme-toggle .icon { width: 17px; height: 17px; }

/* ===== TOP BAR ===== */
#offline-banner {
  position: sticky; top: 0; z-index: 21;
  background: var(--red); color: #fff; text-align: center;
  font-size: 12px; font-weight: 700; padding: 6px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#top-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 20px; overflow-x: auto;
  padding: 12px 22px; background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  scrollbar-width: none;
}
#top-bar::-webkit-scrollbar { display: none; }
/* Bara de sus era 6 pastile colorate cu contur — zgomot vizual. Acum: transparente,
   fara contur, doar icoana + cifra. */
.stat-chip {
  flex: none; display: flex; align-items: center; gap: 6px;
  background: transparent; border: none;
  padding: 6px 2px; border-radius: 0; font-size: 14px; font-weight: 400;
  letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-icon { font-size: 14px; }
.era-chip { background: linear-gradient(135deg, #2c3a63, #1c2438); color: var(--gold); }
.season-chip.recession { background: rgba(227,93,93,.15); color: var(--red); border: 1px solid var(--red); }
.season-chip.boom { background: rgba(48,209,88,.15); color: var(--teal); border: 1px solid var(--teal); }
/* Indicator unificat de sanatate a companiei (backlog runda 7, #20) */
.health-chip.health-good { background: rgba(48,209,88,.15); color: var(--teal); border: 1px solid var(--teal); }
.health-chip.health-warn { background: rgba(10,132,255,.15); color: var(--gold); border: 1px solid var(--gold-dim); }
.health-chip.health-critical { background: rgba(227,93,93,.15); color: var(--red); border: 1px solid var(--red); }
.theme-toggle { cursor: pointer; font-size: 14px; padding: 7px 10px; }

/* ===== VIEWS ===== */
#views { padding: 56px 22px 130px; max-width: 700px; margin: 0 auto; }
.view { display: none; animation: fadein .2s ease; }
.view.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Ecran gol la incarcarea initiala (backlog runda 4, #16) — inlocuit cu placeholder-e cat
   timp Promise.all-ul din startGame() asteapta cele 5 cereri API, in special vizibil pe
   conexiuni mobile lente. Ascuns explicit din JS imediat ce primul render e gata. */
.loading-skeleton { padding-top: 4px; }
.skeleton-bar, .skeleton-card {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-border) 50%, var(--card) 75%);
  background-size: 200% 100%; border-radius: 10px; animation: skeleton-shimmer 1.4s ease infinite;
}
.skeleton-bar { height: 16px; margin-bottom: 16px; width: 55%; }
.skeleton-bar-title { height: 20px; width: 65%; }
.skeleton-card { height: 64px; margin-bottom: 10px; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.view-header { margin-bottom: 44px; }
.view-header h2 { margin: 0 0 10px; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
.view-sub { margin: 0; color: var(--text-dim); font-size: 13px; }
.section-title { font-size: 24px; color: var(--text); font-weight: 600; letter-spacing: -0.022em; margin: 64px 0 18px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.btn-ghost-small {
  background: transparent; border: 1px solid var(--hairline); color: var(--accent);
  border-radius: 980px; padding: 9px 18px; font-size: 14px; font-weight: 400;
  letter-spacing: -0.01em; cursor: pointer; transition: background-color .2s ease;
}
.btn-ghost-small:disabled { opacity: .5; }
.btn-ghost-small.active-toggle { background: var(--teal); border-color: var(--teal); color: #fff; }

.card-list { display: flex; flex-direction: column; gap: 12px; }
/* Apple nu deseneaza contur pe carduri: separarea vine din contrastul de fundal
   (#f5f5f7 pe alb / #1c1c1e pe negru) plus spatiu generos. */
.card {
  background: var(--card); border: none; border-radius: 18px;
  padding: 24px;
}

/* Employee / role cards */
.person-card { display: flex; align-items: center; gap: 12px; }
.person-card.at-risk-high { border-color: var(--red); }
.person-card.at-risk-mid { border-color: var(--gold-dim); }
.person-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #2c3a63, #1c2438);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none;
}
.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-role { color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; font-size: 11px; color: var(--text-dim); }
.person-action { flex: none; display: flex; gap: 4px; }
.icon-btn {
  /* Prag minim de atingere WCAG/HIG (44px) — vezi audit accesibilitate, backlog runda 4 #20 */
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--card-border);
  background: transparent; color: var(--text-dim); font-size: 16px; cursor: pointer;
}
.role-card { display: flex; align-items: center; gap: 12px; }
.office-tier-card { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; border-color: var(--gold-dim); }
.rd-card { border-color: var(--teal); }
.wellness-card { border-color: var(--teal); }
.wellness-card.active .hire-btn { background: var(--red); color: #fff; }
.remote-work-card { border-color: var(--gold-dim); }
.remote-work-card.active .hire-btn { background: var(--red); color: #fff; }
.four-day-week-card { border-color: var(--teal); }
.four-day-week-card.active .hire-btn { background: var(--red); color: #fff; }
.paid-time-off-card { border-color: var(--gold-dim); }
.paid-time-off-card.active .hire-btn { background: var(--red); color: #fff; }
.role-card.locked { opacity: .5; }
.role-badge {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(10,132,255,.12);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none;
}
.role-details { flex: 1; min-width: 0; }
.role-title { font-weight: 700; font-size: 14px; }
.role-desc { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.region-competitors { margin: 6px 0 0; padding: 0; list-style: none; }
.region-competitors li { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.region-competitors li b { color: var(--text); }
.hire-btn { flex: none; background: var(--accent); color: #fff; border: none; border-radius: 980px; padding: 9px 16px; font-weight: 500; font-size: 14px; letter-spacing: -0.01em; cursor: pointer; }
.hire-btn:disabled { background: var(--card-border); color: var(--text-dim); }
.hire-btn.archetype-selected { background: var(--red); color: #fff; }

/* Competitor bars */
.competitor-card { }
.competitor-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.competitor-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bar-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--red), #f0937a); }
.bar-fill.self { background: linear-gradient(90deg, var(--teal), #8ff0cf); }
.competitor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.pricing-panel { margin-top: 22px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px; }
.price-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
#price-slider { width: 100%; accent-color: var(--gold); margin: 6px 0 14px; }
#price-hint { font-size: 13px; color: var(--text-dim); min-height: 34px; margin: 0 0 14px; }

/* Decision / quiz cards */
.decision-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 18px;
  padding: 22px 18px; text-align: center;
}
.decision-category {
  display: inline-block; background: rgba(10,132,255,.14); color: var(--gold);
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.decision-card.crisis-mode { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.decision-card.crisis-mode .decision-category { background: rgba(227,93,93,.16); color: var(--red); }
.decision-card.recall-mode { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.decision-card.recall-mode .decision-category { background: rgba(184,134,11,.16); color: var(--gold); }
.decision-card.pr-crisis-mode { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.decision-card.pr-crisis-mode .decision-category { background: rgba(59,130,246,.16); color: #3b82f6; }
.team-vote-hint { font-size: 12px; color: var(--teal); font-style: italic; margin: -12px 0 16px; line-height: 1.4; }
.cert-card { border-color: var(--gold-dim); margin-bottom: 16px; }
.cert-badge { margin-top: 10px; font-weight: 700; color: var(--teal); font-size: 13px; text-align: center; }
.decision-text { font-size: 16px; line-height: 1.45; margin: 0 0 20px; }
.decision-choices { display: flex; flex-direction: column; gap: 10px; }
.btn-choice { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--card-border); text-align: left; }
.btn-choice:active { border-color: var(--gold-dim); }

.quiz-choices { display: flex; flex-direction: column; gap: 10px; }
.quiz-choice { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--bg-elevated); color: var(--text); text-align: left; font-size: 15px; line-height: 1.4; cursor: pointer; transition: border-color .2s ease; }
.quiz-choice.correct { border-color: var(--teal); background: rgba(48,209,88,.12); }
.quiz-choice.wrong { border-color: var(--red); background: rgba(227,93,93,.12); }

.insight-panel {
  margin-top: 16px; background: linear-gradient(135deg, #1c2438, #171e2e);
  border: 1px solid var(--gold-dim); border-radius: 16px; padding: 20px; text-align: center;
  animation: fadein .25s ease;
}
.insight-icon { font-size: 28px; margin-bottom: 8px; }
.insight-panel p { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0 0 16px; }
.whatif-label { font-size: 12px; font-weight: 700; color: var(--gold); margin: 0 0 4px !important; }
.whatif-text { font-size: 13px; color: var(--text-dim); font-style: italic; }
.archetype-line { font-size: 12.5px !important; color: var(--text-dim) !important; font-style: italic; padding-top: 10px; border-top: 1px solid var(--card-border); }

.empty-state { text-align: center; color: var(--text-dim); padding: 40px 20px; font-size: 14px; }

.mentor-card {
  text-align: center; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(10,132,255,.10), var(--card));
  border-color: var(--gold-dim);
}
.mentor-icon { font-size: 22px; margin-bottom: 6px; }
.mentor-quote { font-size: 14px; font-style: italic; line-height: 1.5; margin: 0 0 6px; color: var(--text); }
.mentor-author { font-size: 12px; font-weight: 700; color: var(--gold); margin: 0 0 8px; }
.mentor-context { font-size: 12px; color: var(--text-dim); line-height: 1.4; margin: 0; }

.advisor-card { display: flex; gap: 12px; align-items: flex-start; }
.advisor-card.locked { opacity: .5; }
.advisor-icon { font-size: 26px; flex: none; width: 40px; text-align: center; }
.advisor-info { flex: 1; min-width: 0; }
.advisor-name { font-weight: 700; font-size: 13px; }
.advisor-role { font-size: 11px; color: var(--gold); margin-bottom: 4px; }
.advisor-advice { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin: 0; }

.challenge-card { max-width: 380px; text-align: center; }
.challenge-header { display: flex; justify-content: space-between; margin-bottom: 16px; font-weight: 800; }
#challenge-timer { color: var(--gold); font-size: 20px; }
#challenge-progress { color: var(--text-dim); font-size: 14px; align-self: center; }
#challenge-result h2 { color: var(--gold); margin: 8px 0; }
#challenge-result p { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }

.culture-indicator {
  display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-dim);
  margin-bottom: 14px; font-weight: 700;
}
.culture-indicator > span:first-child { flex: none; white-space: nowrap; }
.culture-indicator .bar-track { flex: 1; min-width: 30px; }
.culture-indicator #culture-value { flex: none; color: var(--text); }

.warning-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.4; margin-bottom: 12px; border: 1px solid;
}
.warning-banner span { flex: 1 1 200px; min-width: 0; }
.warning-banner.warn { background: rgba(10,132,255,.12); border-color: var(--gold-dim); color: var(--text); }
.warning-banner.danger { background: rgba(227,93,93,.14); border-color: var(--red); color: var(--text); animation: pulse-danger 1.6s ease-in-out infinite; }
.warning-banner.black-friday { background: rgba(48,209,88,.12); border-color: var(--teal); color: var(--text); }
.fix-now-btn {
  flex: none; background: var(--teal); color: #fff; border: none; border-radius: 8px;
  padding: 8px 12px; font-weight: 700; font-size: 12px; cursor: pointer;
}
.fix-now-btn:disabled { background: var(--card-border); color: var(--text-dim); }
@keyframes pulse-danger { 0%, 100% { opacity: 1; } 50% { opacity: .75; } }

.era-filter {
  display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px;
  scrollbar-width: none;
}
.era-filter::-webkit-scrollbar { display: none; }
.era-filter-btn {
  flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--card-border);
  background: var(--card); color: var(--text-dim); font-size: 12px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.era-filter-btn.active { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Leaderboard */
.leaderboard-row { display: flex; align-items: center; gap: 12px; }
.rank-badge { width: 30px; text-align: center; font-weight: 800; color: var(--gold); flex: none; }
.lb-info { flex: 1; min-width: 0; }
.lb-name-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.lb-name, .lb-company { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name { flex: 1; font-weight: 700; font-size: 14px; min-width: 0; }
.lb-title { flex: none; font-size: 10.5px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.lb-custom-title { color: var(--text); background: var(--bg-elevated); border: 1px solid var(--card-border); border-radius: 6px; padding: 1px 6px; }
.lb-company { color: var(--text-dim); font-size: 12px; }
.lb-value { font-weight: 800; color: var(--teal); font-size: 14px; }
.rival-btn {
  /* Prag minim de atingere WCAG/HIG (44px) — vezi audit accesibilitate, backlog runda 4 #20 */
  flex: none; background: none; border: none; color: var(--text-dim); font-size: 16px; cursor: pointer;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}

.alliance-card { margin-bottom: 12px; border-color: var(--teal); }
.alliance-member-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.alliance-member-row { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-challenge-card { margin-bottom: 16px; border-color: var(--gold-dim); }
.friend-challenge-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.friend-challenge-row { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-feed-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.global-feed-row {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 8px 12px;
}
.global-feed-icon { flex: none; font-size: 15px; }
.global-feed-text { flex: 1; min-width: 0; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-feed-text strong { color: var(--text); }
.case-study-result-row { padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.case-study-result-row:last-child { border-bottom: none; }
.case-study-result-q { font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.case-study-result-q.correct { color: var(--teal); }
.case-study-result-q.wrong { color: var(--red); }
.case-study-result-explanation { font-size: 12.5px; color: var(--text-dim); margin: 0; line-height: 1.5; }
.ab-test-variant-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.ab-test-variant-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.ab-test-variant-row strong { flex: none; color: var(--text); }
.pricing-model-card { border-color: var(--gold-dim); margin-top: 16px; }
.pricing-model-btn {
  flex: 1 1 90px; padding: 9px 8px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--bg-elevated); color: var(--text-dim); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.pricing-model-btn.active { border-color: var(--gold); color: #fff; background: var(--gold); }
.rival-card { margin-bottom: 12px; border-color: var(--gold-dim); }
.rival-header { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.rival-card p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.rival-compare { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rival-compare-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rival-compare-label { flex: none; width: 68px; color: var(--text-dim); }
.rival-compare-you, .rival-compare-rival { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rival-compare-you.better, .rival-compare-rival.better { color: var(--teal); font-weight: 700; }
.rival-history-chart { margin-top: 12px; }
.rival-history-chart svg { display: block; width: 100%; height: auto; }
.rival-history-legend { display: flex; justify-content: center; gap: 16px; margin-top: 4px; }
.rival-history-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.rival-history-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rival-history-dot.you { background: var(--teal); }
.rival-history-dot.rival { background: var(--gold); }

/* eNPS survey */
.enps-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 10px 0 8px; background: var(--card-border); }
.enps-bar-segment.promoters { background: var(--teal); }
.enps-bar-segment.passives { background: var(--text-dim); }
.enps-bar-segment.detractors { background: var(--red); }
.enps-legend { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-dim); margin: 0 0 8px; }
.enps-legend-item { display: flex; align-items: center; gap: 5px; }
.enps-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.enps-dot.promoters { background: var(--teal); }
.enps-dot.passives { background: var(--text-dim); }
.enps-dot.detractors { background: var(--red); }

/* Achievements */
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.achievement-tile {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px;
  padding: 12px 6px; text-align: center; font-size: 10.5px; color: var(--text-dim);
}
.achievement-tile.unlocked { border-color: var(--gold-dim); background: rgba(10,132,255,.08); color: var(--text); }
.achievement-tile.near { border-color: var(--teal); color: var(--text); }
.achievement-tile .ach-icon { font-size: 22px; display: block; margin-bottom: 4px; filter: grayscale(1); opacity: .4; }
.achievement-tile.unlocked .ach-icon, .achievement-tile.near .ach-icon { filter: none; opacity: 1; }
.achievement-tile .ach-progress { margin-top: 5px; height: 4px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.achievement-tile .ach-progress-fill { height: 100%; background: var(--teal); }
.achievement-tile .ach-progress-label { margin-top: 3px; font-size: 9px; color: var(--text-dim); }

.chart-card { padding: 14px 10px; }
#history-chart svg, #dept-stats-chart svg { display: block; width: 100%; height: auto; }
.chart-tooltip-label { font-size: 9px; fill: var(--text-dim); }

.quiz-progress-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.quiz-progress-label { flex: 0 0 100px; font-size: 12px; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-progress-row .bar-track { flex: 1; min-width: 30px; }
.quiz-progress-frac { flex: none; font-size: 11px; color: var(--text-dim); width: 34px; text-align: right; }

.percentile-card { margin-bottom: 16px; border-color: var(--gold-dim); text-align: center; }
.percentile-card p { margin: 0; font-size: 14px; font-weight: 700; color: var(--gold); line-height: 1.4; }
.vacation-card { margin-bottom: 16px; border-color: var(--teal); }
.weekly-digest-card { margin-bottom: 16px; border-color: var(--gold-dim); }
.weekly-digest-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.weekly-digest-row:not(:last-child) { border-bottom: 1px solid var(--card-border); padding-bottom: 8px; margin-bottom: 4px; }
.weekly-digest-ach { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.weekly-digest-ach span { font-size: 11px; background: var(--bg); border-radius: 999px; padding: 3px 9px; }
.rename-card { margin-bottom: 18px; }
.rename-row { display: flex; gap: 8px; margin-top: 8px; }
.rename-row input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--bg-elevated); color: var(--text); font-size: 14px; outline: none;
}
.rename-row input:focus { border-color: var(--gold-dim); }

.capsule-textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--bg-elevated); color: var(--text); font-size: 14px; outline: none; resize: vertical;
  font-family: inherit; margin-top: 8px;
}
.capsule-textarea:focus { border-color: var(--gold-dim); }
.capsule-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.capsule-days-select {
  flex: 1 1 140px; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--bg-elevated); color: var(--text); font-size: 13px; outline: none;
}
.capsule-controls .hire-btn { flex: none; }
.accent-swatch-btn {
  flex: 1 1 90px; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--bg-elevated); color: var(--text-dim); font-size: 12px; font-weight: 700; cursor: pointer;
}
.accent-swatch-btn.active { border-color: var(--gold); color: var(--text); }
.accent-swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.capsule-pending-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.capsule-pending-row { font-size: 12px; color: var(--text-dim); padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.capsule-reveal-card { max-width: 380px; }
.capsule-reveal-message { background: var(--bg); border-radius: 10px; padding: 14px; font-size: 14px; line-height: 1.5; color: var(--text); text-align: left; white-space: pre-wrap; word-break: break-word; }

.password-form { display: flex; flex-direction: column; gap: 6px; }
.password-form input {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--bg-elevated); color: var(--text); font-size: 14px; outline: none; margin-bottom: 6px;
}
.password-form input:focus { border-color: var(--gold-dim); }

.danger-zone { border-color: rgba(227,93,93,.4); margin-top: 20px; }
.danger-zone .role-desc { margin: 6px 0 12px; }

.journal-entry { }
.journal-cat { font-size: 10.5px; text-transform: uppercase; color: var(--gold); letter-spacing: .5px; }
.journal-text { font-size: 13px; color: var(--text-dim); margin: 4px 0; }
.founder-journal-date { font-size: 10.5px; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; }
.founder-journal-text { font-size: 13px; color: var(--text); margin: 4px 0 0; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.journal-insight { font-size: 13px; margin: 0; }

/* ===== TAB BAR ===== */
#tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--bar-bg-strong); backdrop-filter: blur(10px);
  border-top: 1px solid var(--hairline);
  padding-bottom: var(--safe-bottom);
}
.tab-btn {
  position: relative;
  flex: 1; background: none; border: none; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px 6px; font-size: 10px; font-weight: 400; letter-spacing: 0;
  cursor: pointer; transition: color .2s ease;
}
.tab-btn .tab-icon { display: flex; align-items: center; justify-content: center; }
.tab-btn.active { color: var(--gold); }
/* Mod "focus" (backlog runda 7, #18): ascunde tab-uri neesentiale, pastreaza mereu vizibil
   tab-ul ales + Profil (ca sa poti oricand reveni si dezactiva focus-ul). */
.tab-btn.focus-hidden { display: none; }
.tab-notif-badge {
  position: absolute; top: 4px; right: 50%; margin-right: -22px;
  background: var(--red); color: #fff; border-radius: 999px;
  min-width: 15px; height: 15px; padding: 0 3px; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ===== TOASTS ===== */
#toast-container { position: fixed; top: 12px; left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--gold); color: #fff; font-weight: 700; font-size: 13px;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.35);
  animation: toast-in .25s ease, toast-out .3s ease 2.7s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

.toast-undo {
  background: var(--card); color: var(--text); border: 1px solid var(--card-border);
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); font-size: 13px; font-weight: 600;
  animation: toast-in .25s ease; pointer-events: auto; max-width: 90vw;
}
.toast-undo-btn {
  flex: none; background: var(--gold); color: #fff; border: none; border-radius: 999px;
  padding: 6px 14px; font-weight: 700; font-size: 12px; cursor: pointer;
}
.person-card.pending-remove { opacity: .35; pointer-events: none; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.modal-card { background: var(--bg-elevated); border: 1px solid var(--card-border); border-radius: 18px; padding: 28px 22px; text-align: center; width: 100%; max-width: 340px; }
.modal-icon { font-size: 40px; margin-bottom: 10px; }
.modal-card h2 { margin: 0 0 10px; color: var(--red); }
.modal-card p { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.onboarding-card h2 { color: var(--gold); }
.onb-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.onb-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--card-border); }
.onb-dots span.active { background: var(--gold); }

.cv-card { max-width: 420px; text-align: left; position: relative; max-height: 85vh; overflow-y: auto; }
.reassign-card { max-width: 380px; text-align: left; position: relative; max-height: 85vh; overflow-y: auto; }
.reassign-card h2 { color: var(--text); text-align: center; }
.reassign-card p { text-align: center; }
.reassign-role-list { display: flex; flex-direction: column; gap: 8px; }
.journal-export-card { max-width: 460px; text-align: left; position: relative; max-height: 85vh; overflow-y: auto; }
.journal-export-card .journal-entry { padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.journal-export-card .journal-entry:last-child { border-bottom: none; }
.journal-export-card .journal-date { font-size: 10px; color: var(--text-dim); }

.swot-card { max-width: 480px; text-align: left; position: relative; max-height: 85vh; overflow-y: auto; }
.help-card { max-width: 460px; text-align: left; position: relative; max-height: 85vh; overflow-y: auto; }
.help-results { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.help-item { border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 12px; }
.help-item summary { font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text); }
.help-item p { margin: 8px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.help-item .help-section { font-size: 10px; text-transform: uppercase; color: var(--gold); letter-spacing: .5px; margin-bottom: 3px; }
.swot-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.swot-quadrant { border-radius: 12px; padding: 12px; border: 1px solid var(--card-border); }
.swot-quadrant-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.swot-quadrant ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.swot-quadrant li { margin-bottom: 4px; }
.swot-strengths { border-color: var(--teal); }
.swot-weaknesses { border-color: var(--red); }
.swot-opportunities { border-color: var(--gold-dim); }
.swot-threats { border-color: var(--text-dim); }
@media (min-width: 420px) {
  .swot-grid { grid-template-columns: 1fr 1fr; }
}
.cv-close {
  /* Prag minim de atingere WCAG/HIG (44px) — vezi audit accesibilitate, backlog runda 4 #20 */
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--card-border); background: var(--bg); color: var(--text-dim); cursor: pointer;
  font-size: 16px;
}
.cv-header { text-align: center; margin-bottom: 18px; }
.cv-logo { font-size: 32px; }
.cv-header h2 { margin: 6px 0 2px; color: var(--gold); }
.cv-header p { margin: 0; color: var(--text-dim); font-size: 13px; }
.cv-philosophy { font-style: italic; color: var(--gold) !important; margin-top: 6px !important; }
.cv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.cv-stat { background: var(--bg-elevated); border: 1px solid var(--card-border); border-radius: 10px; padding: 10px; text-align: center; }
.cv-stat-value { font-size: 16px; font-weight: 800; color: var(--gold); }
.cv-stat-label { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; }
.cv-section-title { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin: 16px 0 8px; }
.cv-timeline { display: flex; flex-direction: column; gap: 6px; }
.cv-timeline-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.cv-timeline-icon { flex: none; font-size: 14px; }
.cv-timeline-label { flex: 1; min-width: 0; color: var(--text); }
.cv-timeline-date { flex: none; color: var(--text-dim); font-size: 11px; }
.cv-footer { text-align: center; color: var(--text-dim); font-size: 11px; margin-top: 16px; }

@media print {
  body * { visibility: hidden; }
  .modal { position: static; background: none; padding: 0; }
  #cv-content, #cv-content *, #journal-export-content, #journal-export-content * { visibility: visible; }
  #cv-content, #journal-export-content { position: absolute; left: 0; top: 0; width: 100%; max-height: none; box-shadow: none; border: none; }
  .no-print { display: none !important; }
}

@media (min-width: 480px) {
  .decision-choices { flex-direction: row; }
  .btn-choice { flex: 1; text-align: center; }
}

/* Tipografie de tip apple.com: titlurile cresc mult pe ecrane late. */
@media (min-width: 560px) {
  .view-header h2 { font-size: 56px; letter-spacing: -0.035em; }
  .section-title { font-size: 32px; margin: 80px 0 22px; }
  #views { padding: 72px 32px 140px; }
  .card { padding: 28px; }
}
