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

:root {
  /* RA-style monochrome: the old gold accent is now ink, so every var(--gold*)
     reference across the CSS and the inline styles in app.js resolves to black. */
  --gold: #0A0A0A;
  --gold-light: #ECECE9;
  --gold-dark: #0A0A0A;
  --bg: #FFFFFF;
  --bg2: #F4F4F2;
  --bg3: #E7E7E3;
  --surface: #FFFFFF;
  --text: #0A0A0A;
  --text2: #54524D;
  --text3: #8C8A84;
  --border: rgba(0,0,0,0.16);
  --border2: rgba(0,0,0,0.32);
  --radius: 2px;
  --radius-lg: 2px;
  --success: #1F5138;
  --success-bg: #E4EDE7;
  --warning: #6B5200;
  --warning-bg: #F1ECDC;
  --danger: #8A1E22;
  --danger-bg: #F1E2E2;
  --info: #16405C;
  --info-bg: #E1E9EE;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Login ─────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #FFFFFF;
}
/* Debrief illustration, bottom-left of the login screen - large; the login card
   is lifted above it (below) so the modal slightly overlaps the artwork. */
.login-art {
  position: fixed;
  left: -140px;
  bottom: 0;
  width: 1300px;
  max-width: 80vw;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
@media (max-width: 760px) { .login-art { display: none; } }
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 2;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.25rem;
}
.login-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.login-logo-text {
  font-family: 'Archivo Black', 'Inter', sans-serif;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
.login-sub {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 2rem;
}
.login-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
  display: block;
}
.login-input {
  width: 100%;
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  margin-bottom: 0.75rem;
  transition: border 0.1s, background 0.1s;
}
.login-input:focus { outline: none; border-color: var(--gold); background: var(--surface); }
.login-btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--text);
  color: var(--surface);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 0.5rem;
}
.login-btn:hover { opacity: 0.85; }
.login-error { font-size: 13px; color: var(--danger); margin-top: 0.5rem; }

/* ── App shell ─────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 1.25rem;
  margin-bottom: 0.25rem;
}
.sidebar-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: 'Archivo Black', 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 17px;
  color: var(--gold-dark);
}
.sidebar-cycle {
  font-size: 11px;
  color: var(--text3);
  padding: 0 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  padding: 0 1.25rem;
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1.25rem;
  font-size: 13.5px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.1s;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--bg2); color: var(--text); }
.nav-item.active { background: var(--bg2); color: var(--text); border-left-color: var(--gold); font-weight: 500; }
.nav-item i { font-size: 16px; }

.sidebar-user {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-light);
  color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.sidebar-name { font-size: 13px; font-weight: 500; line-height: 1.2; }
.sidebar-role { font-size: 11px; color: var(--text3); }
.logout-btn {
  margin-left: auto;
  background: none; border: none;
  cursor: pointer; color: var(--text3);
  font-size: 16px; padding: 2px;
  transition: color 0.1s;
}
.logout-btn:hover { color: var(--text); }

.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: calc(100% - 240px);
}

/* ── Page header ──────────────────────────────────── */
h1, h2, h3 { font-weight: 600; }
.page-header { margin-bottom: 2rem; }
.page-title { font-family: 'Archivo Black', 'Inter', sans-serif; font-size: 25px; font-weight: 400; letter-spacing: -0.5px; text-transform: uppercase; color: var(--text); line-height: 1.1; }
.page-sub { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 1rem; }

/* ── Stat grid ────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.stat-label { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 400; font-family: 'Archivo Black', 'Inter', sans-serif; letter-spacing: -0.5px; color: var(--text); }

/* ── Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 2px;
}
.badge-pending  { background: var(--warning-bg); color: var(--warning); }
.badge-progress { background: var(--info-bg);    color: var(--info); }
.badge-done     { background: var(--success-bg); color: var(--success); }
.badge-locked   { background: var(--bg3);        color: var(--text2); }

/* ── Employee table ───────────────────────────────── */
.emp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.emp-table th {
  text-align: left; font-size: 11px; font-weight: 500;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0 12px 10px 0;
  border-bottom: 0.5px solid var(--border);
}
.emp-table td { padding: 12px 12px 12px 0; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
.emp-table tr:last-child td { border-bottom: none; }
.emp-table tr:hover td { background: var(--bg); }

.emp-name { font-weight: 500; }
.emp-title { font-size: 12px; color: var(--text2); }
.emp-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg3); color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0; margin-right: 10px;
  vertical-align: middle;
}

/* ── Review form ──────────────────────────────────── */
.form-section { margin-bottom: 1.5rem; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 4px; display: block; }
.form-hint  { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
textarea, input[type=text], input[type=date] {
  width: 100%;
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
  transition: border 0.1s, background 0.1s;
}
input[type=text], input[type=date] { min-height: unset; }
/* Self-review answer boxes: taller by default so there's room to type (drag to resize for more). */
#sq0, #sq1, #sq2 { min-height: 170px; }
textarea:focus, input[type=text]:focus, input[type=date]:focus { outline: none; border-color: var(--gold); background: var(--surface); }
textarea:disabled, input:disabled, select:disabled { opacity: 0.85; cursor: default; }
/* Dark mode: the browser's resize grip is dark-on-dark and invisible, so draw
   white diagonal grip lines in the corner of resizable text fields. */
[data-theme="dark"] textarea::-webkit-resizer {
  background-color: transparent;
  background-image: linear-gradient(135deg,
    transparent 0 45%, #fff 45% 55%,
    transparent 55% 65%, #fff 65% 75%,
    transparent 75%);
}

.rating-row { display: flex; gap: 6px; margin-top: 0.4rem; flex-wrap: wrap; }
.rating-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border2);
  background: var(--bg2);
  font-size: 14px; font-weight: 500;
  cursor: pointer; color: var(--text2);
  transition: all 0.1s; font-family: inherit;
}
.rating-btn:hover { border-color: var(--gold); color: var(--text); }
.rating-btn.selected { background: var(--text); color: var(--surface); border-color: var(--text); }
.rating-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); margin-top: 4px; max-width: 222px; }

/* ── Appraisal Scale (1-5 on a red->green bar) ─────── */
.appraisal-scale { max-width: 460px; }
.appraisal-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; border-radius: 2px;
  background: linear-gradient(90deg, #c0392b 0%, #e67e22 25%, #f1c40f 50%, #93c54b 75%, #27ae60 100%);
}
.appraisal-num {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; box-sizing: border-box; padding: 0;
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.18); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 0.1s, background 0.1s, box-shadow 0.1s; font-family: inherit;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.appraisal-num:hover:not(:disabled) { background: rgba(255,255,255,0.4); }
.appraisal-num.selected { background: #fff; color: #111; border-color: #fff; text-shadow: none; box-shadow: 0 0 0 4px rgba(255,255,255,0.35); transform: scale(1.12); }
.appraisal-num:disabled { cursor: default; }
.appraisal-num:disabled:not(.selected) { opacity: 0.55; }
.appraisal-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--text3); }
.appraisal-labels span { flex: 1; }
.appraisal-labels span:nth-child(2) { text-align: center; }
.appraisal-labels span:nth-child(3) { text-align: right; }
.appraisal-scale.readonly .appraisal-num { cursor: default; }
.appraisal-scale.readonly .appraisal-num:hover { background: rgba(255,255,255,0.18); }
.appraisal-scale.readonly .appraisal-num.selected:hover { background: #fff; }

/* ── Manager review: employee | manager side-by-side ─ */
.rc-head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 10px; }
.rc-head-col { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; color: var(--text3); }
.review-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: stretch; }
.rc-cell {
  background: var(--bg2); border-radius: var(--radius);
  padding: 0.85rem 1rem; border-left: 3px solid var(--gold);
  display: flex; flex-direction: column;
}
.rc-cell.rc-mgr { border-left-color: var(--info, #4a90d9); }
.rc-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); font-weight: 600; margin-bottom: 6px; }
.rc-self { font-size: 14px; color: var(--text); white-space: pre-wrap; line-height: 1.5; max-height: 200px; overflow-y: auto; }
.rc-cell textarea { width: 100%; min-height: 90px; margin: 0; flex: 1; }
@media (max-width: 720px) {
  .rc-head { display: none; }
  .review-compare { grid-template-columns: 1fr; }
}

/* ── Competency grid ──────────────────────────────── */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.comp-label { font-size: 13px; font-weight: 500; margin-bottom: 6px; }

/* ── Self summary (manager view) ──────────────────── */
.self-block {
  background: var(--bg2);
  border-left: 2px solid var(--gold);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 0.85rem;
  font-size: 13px; color: var(--text2); line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;   /* preserve the writer's line breaks & indentation */
}
.self-block strong {
  display: block; font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text3); margin-bottom: 3px;
}

/* ── Calibration ──────────────────────────────────── */
.cal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cal-table th { text-align: left; font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 10px 8px 0; border-bottom: 0.5px solid var(--border); }
.cal-table td { padding: 10px 10px 10px 0; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
.cal-table tr:last-child td { border-bottom: none; }

.score-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
}
.sc-low  { background: var(--danger-bg);  color: var(--danger); }
.sc-mid  { background: var(--warning-bg); color: var(--warning); }
.sc-high { background: var(--success-bg); color: var(--success); }

.final-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.fc {
  padding: 4px 10px; border-radius: 2px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 0.5px solid var(--border2);
  color: var(--text2); background: transparent;
  font-family: inherit; transition: all 0.1s;
}
.fc:hover { background: var(--bg2); }
.fc.sel-be { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.fc.sel-me { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.fc.sel-ee { background: var(--info-bg);    color: var(--info);    border-color: transparent; }
.fc.sel-oe { background: var(--success-bg); color: var(--success); border-color: transparent; }

/* ── Buttons ──────────────────────────────────────── */
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.5rem; }
.btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 12px; font-family: inherit;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; font-weight: 600;
  transition: all 0.12s;
}
.btn-primary   { background: var(--text); color: var(--surface); border: none; }
.btn-primary:hover   { opacity: 0.85; }
.btn-secondary { background: transparent; color: var(--text2); border: 0.5px solid var(--border2); }
.btn-secondary:hover { background: var(--bg2); color: var(--text); }
.btn-gold { background: var(--gold); color: var(--surface); border: none; }
.btn-gold:hover { background: var(--gold-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Action button ────────────────────────────────── */
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 12.5px; font-family: inherit;
  cursor: pointer; font-weight: 500;
  background: var(--bg2); color: var(--text2);
  border: 0.5px solid var(--border);
  transition: all 0.1s;
}
.action-btn:hover { background: var(--bg3); color: var(--text); }
.action-btn i { font-size: 14px; }

/* Pulsing red CTA to draw attention to reviews awaiting the manager */
@keyframes pulseReview {
  0%   { box-shadow: 0 0 0 0 rgba(155,34,38,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(155,34,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(155,34,38,0); }
}
.action-btn.pulse-review {
  background: var(--danger); color: #fff; border-color: var(--danger);
  animation: pulseReview 1.4s ease-out infinite;
}
.action-btn.pulse-review:hover { background: var(--danger); color: #fff; opacity: 0.9; }

/* Gold edge pulse for "Continue self review" (a saved draft awaiting completion) */
@keyframes pulseGold {
  0%   { box-shadow: 0 0 0 0 rgba(201,168,76,0.65); }
  70%  { box-shadow: 0 0 0 10px rgba(201,168,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
}
.btn.pulse-gold { animation: pulseGold 1.5s ease-out infinite; }

/* 1:1 action button colors */
.btn-green { background: #27ae60; color: #fff; border-color: #27ae60; }
.btn-green:hover { background: #219150; border-color: #219150; }
.btn-red { background: var(--danger, #c0392b); color: #fff; border-color: var(--danger, #c0392b); }
.btn-red:hover { opacity: 0.9; }
@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(39,174,96,0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(39,174,96,0); }
  100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}
.btn.pulse-green { animation: pulseGreen 1.5s ease-out infinite; }
.action-btn.action-yellow { background: #f1c40f; color: #3a2f00; border-color: #f1c40f; }
.action-btn.action-yellow:hover { background: #e0b70c; border-color: #e0b70c; }

/* ── Progress steps ───────────────────────────────── */
.step-nav { display: flex; gap: 0; margin-bottom: 2rem; background: var(--bg2); border-radius: var(--radius-lg); padding: 4px; border: 0.5px solid var(--border); }
.step-btn {
  flex: 1; padding: 0.6rem 0.5rem;
  border: none; background: transparent; cursor: pointer;
  border-radius: calc(var(--radius) - 1px);
  font-size: 13px; font-family: inherit;
  color: var(--text2); display: flex; align-items: center;
  justify-content: center; gap: 6px;
  transition: all 0.15s; font-weight: 400;
}
.step-btn:hover { color: var(--text); }
.step-btn.active { background: var(--surface); color: var(--text); font-weight: 500; border: 0.5px solid var(--border); }
.step-btn.done { color: var(--success); }
.step-btn i { font-size: 15px; }

.progress-bar { height: 3px; background: var(--border); border-radius: 99px; margin-bottom: 2rem; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 99px; transition: width 0.4s ease; }

/* ── Notion config ────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.modal-bg.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  padding: 1.75rem;
  width: 100%; max-width: 440px;
}
.modal-title { font-family: 'Archivo Black', 'Inter', sans-serif; font-size: 17px; font-weight: 400; text-transform: uppercase; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 1.25rem; line-height: 1.5; }

/* ── Toast ────────────────────────────────────────── */
#toast {
  position: fixed; top: 50%; left: 50%;
  background: var(--text); color: var(--surface);
  padding: 0.9rem 1.4rem; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  opacity: 0; transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 300;
}
#toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ── Notion banner ────────────────────────────────── */
.notion-bar {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 0.65rem 1rem;
  margin-bottom: 1.5rem; display: flex; align-items: center;
  gap: 10px; font-size: 13px; color: var(--text2);
}
.notion-bar i { font-size: 15px; }

/* ── Divider ──────────────────────────────────────── */
hr.div { border: none; border-top: 0.5px solid var(--border); margin: 1.5rem 0; }

/* ── Section label ────────────────────────────────── */
.slabel { font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }

select {
  border: 0.5px solid var(--border2); border-radius: var(--radius);
  padding: 0.4rem 0.65rem; font-size: 13px; font-family: inherit;
  background: var(--bg); color: var(--text); cursor: pointer;
}
select:focus { outline: none; border-color: var(--gold); }

.dist-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 0.5rem; }
.dist-card { background: var(--bg2); border-radius: var(--radius); padding: 0.85rem; text-align: center; }
.dist-num { font-size: 24px; font-weight: 400; font-family: 'Archivo Black', 'Inter', sans-serif; letter-spacing: -0.5px; }
.dist-lbl { font-size: 11px; color: var(--text3); }

.emp-meta-card {
  background: var(--bg2); border-radius: var(--radius-lg);
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 12px;
  border: 0.5px solid var(--border);
}
.meta-av { width: 42px; height: 42px; border-radius: 50%; background: var(--gold-light); color: var(--gold-dark); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; flex-shrink: 0; }
.meta-av.done { background: var(--success-bg); color: var(--success); }
.meta-name { font-size: 15px; font-weight: 500; }
.meta-sub  { font-size: 12px; color: var(--text2); }

.panel { display: none; }
.panel.active { display: block; }

@media (max-width: 700px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; max-width: 100%; padding: 1.25rem; }
  .comp-grid { grid-template-columns: 1fr; }
}

/* ── Print / Download PDF ─────────────────────────── */
@media print {
  .sidebar, .btn, .back-btn, .theme-toggle, .nav-item, .page-header button { display: none !important; }
  .app-shell { display: block !important; }
  .main-content { margin-left: 0 !important; max-width: 100% !important; padding: 0 !important; }
  body, .main-content, .card { background: #fff !important; }
  * { color: #000 !important; }
  .readonly-banner { display: none !important; }
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    margin-bottom: 12px;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  /* Keep scores and status legible without colored fills */
  .badge, .score-chip {
    background: #fff !important;
    border: 1px solid #000 !important;
    color: #000 !important;
  }
  .self-block { page-break-inside: avoid; break-inside: avoid; }
}

/* ── Timeline banner ──────────────────────────────────────── */
.timeline-banner {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 4px;
}
.tl-stage {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 4px 8px;
}
.tl-stage-label { font-size: 11px; font-weight: 500; color: var(--text2); margin-bottom: 2px; }
.tl-stage-date  { font-size: 13px; font-weight: 500; color: var(--text); }
.tl-stage-status{ font-size: 11px; margin-top: 2px; }
.tl-arrow { color: var(--text3); font-size: 14px; align-self: center; }
.tl-past  { opacity: 0.5; }
.tl-soon-stage .tl-stage-date { color: var(--warning); }

/* ── Timeline badges ──────────────────────────────────────── */
.tl-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500;
  padding: 2px 7px; border-radius: 2px;
}
.tl-badge i { font-size: 11px; }
.tl-done     { background: var(--success-bg); color: var(--success); }
.tl-overdue  { background: var(--danger-bg);  color: var(--danger); }
.tl-urgent   { background: var(--warning-bg); color: var(--warning); }
.tl-soon     { background: var(--amber-bg);   color: var(--amber-text); }
.tl-upcoming { background: var(--bg2);         color: var(--text3); }

/* ── Chain view ───────────────────────────────────────────── */
.chain-wrap { display: flex; flex-direction: column; gap: 8px; }

.chain-node {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.chain-node:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.chain-focus { border-color: var(--gold); border-width: 1.5px; }

.chain-node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
}
.chain-node-header:hover { background: var(--bg2); }

.chain-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg3); color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.chain-av-focus { background: var(--gold-light); color: var(--gold-dark); }

.chain-info { flex: 1; min-width: 0; }
.chain-name  { font-size: 14px; font-weight: 500; color: var(--text); }
.chain-title { font-size: 12px; color: var(--text2); }

.chain-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.chain-tl-badges { display: flex; gap: 4px; }
.chain-chevron { font-size: 16px; color: var(--text3); flex-shrink: 0; }

.chain-you-tag {
  display: inline-block;
  font-size: 10px; font-weight: 500;
  background: var(--gold-light); color: var(--gold-dark);
  padding: 1px 6px; border-radius: 2px;
  margin-left: 6px; vertical-align: middle;
}

.chain-review-summary {
  border-top: 0.5px solid var(--border);
  padding: 0.85rem 1rem;
  background: var(--bg);
}
.chain-summary-row {
  display: block;
  font-size: 12.5px; margin-bottom: 10px;
  line-height: 1.5;
}
.chain-summary-row:last-child { margin-bottom: 0; }
.chain-summary-label {
  display: block;
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text3); margin-bottom: 3px;
}
.chain-summary-val { display: block; color: var(--text2); word-break: break-word; }

/* ── Read-only banner ─────────────────────────────────────── */
.readonly-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 1.5rem;
}
.readonly-banner i { font-size: 15px; color: var(--text3); }

/* ── Pizza tracker ────────────────────────────────────────── */
.pizza-tracker {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.pt-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 90px;
}

.pt-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  margin: 0 4px;
  margin-bottom: 28px;
  transition: background 0.3s;
}
.pt-conn-done { background: var(--gold); }

.pt-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  border: 2px solid var(--border);
  background: var(--bg2);
  color: var(--text3);
  transition: all 0.2s;
}

.pt-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-align: center;
  line-height: 1.3;
}

.pt-status {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Done state */
.pt-done .pt-icon {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.pt-done .pt-label { color: var(--text2); }
/* Dark mode: the muted-gray completed label is hard to read, so make it white. */
[data-theme="dark"] .pt-done .pt-label { color: var(--text); }
.pt-status-done { background: var(--success-bg); color: var(--success); }

/* Active state */
.pt-active .pt-icon {
  background: var(--surface);
  border-color: var(--gold);
  border-width: 2.5px;
  color: var(--gold-dark);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.15);
  animation: pt-pulse 2s ease-in-out infinite;
}
.pt-active .pt-label { color: var(--text); font-weight: 600; }
.pt-status-active { background: var(--amber-bg); color: var(--amber-text); }

/* Pending state */
.pt-pending .pt-icon { opacity: 0.4; }
.pt-pending .pt-label { opacity: 0.4; }
.pt-status-pending { background: var(--bg2); color: var(--text3); }

@keyframes pt-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(201,168,76,0.15); }
  50%       { box-shadow: 0 0 0 8px rgba(201,168,76,0.08); }
}

/* ── Overview toggle buttons ──────────────────────────────── */
.ov-toggle {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
}
.ov-toggle:hover { background: var(--bg2); color: var(--text); }
.ov-toggle.active { background: var(--text); color: var(--surface); border-color: var(--text); }

/* ── HR Tickets ───────────────────────────────────────────── */
.ticket-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.ticket-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.ticket-active { border-color: var(--gold); border-width: 1.5px; }

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.85rem 1rem;
}

.ticket-meta {
  display: flex;
  gap: 16px;
  padding: 0 1rem 0.75rem;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text3);
}
.ticket-meta span { display: flex; align-items: center; gap: 4px; }

.ticket-detail {
  border-top: 0.5px solid var(--border);
  padding: 1rem;
  background: var(--bg);
}

/* ── AI Search ────────────────────────────────────────────── */
.ai-suggestions { margin-bottom: 1.25rem; }
.ai-suggest-label { font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.ai-suggest-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip {
  padding: 5px 12px; border-radius: 2px;
  border: 0.5px solid var(--border2);
  background: var(--surface); color: var(--text2);
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: all 0.1s;
}
.ai-chip:hover { background: var(--gold-light); color: var(--gold-dark); border-color: var(--gold); }

.ai-chat {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-height: 200px;
  max-height: 480px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2rem;
  text-align: center;
  margin: auto;
}
.ai-welcome-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--gold-dark);
}
.ai-welcome-text { font-size: 13px; color: var(--text2); max-width: 320px; line-height: 1.5; }

.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg-user { flex-direction: row-reverse; }
.ai-msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold-light); color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.ai-msg-bubble {
  max-width: 80%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.6;
}
.ai-msg-bubble-user {
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}
.ai-msg-bubble-assistant {
  background: var(--bg2);
  color: var(--text);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  border: 0.5px solid var(--border);
}

/* Typing indicator */
.ai-typing { display: flex; gap: 5px; align-items: center; padding: 0.75rem 1rem; }
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text3);
  animation: ai-bounce 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

.ai-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ai-input {
  flex: 1;
  border: 0.5px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  min-height: unset;
  resize: none;
  transition: border 0.1s;
}
.ai-input:focus { outline: none; border-color: var(--gold); }
.ai-send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  transition: opacity 0.15s;
}
.ai-send-btn:hover { opacity: 0.85; }
.ai-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Ticket attachments ───────────────────────────────────── */
.ticket-attachments {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ticket-attach-empty {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  padding: 0.5rem 0;
}
.ticket-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}
.ticket-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 0.5px dashed var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.1s;
  margin-top: 4px;
  width: fit-content;
}
.ticket-attach-btn:hover { background: var(--bg3); color: var(--text); border-style: solid; }

/* ── Debrief SVG logo ──────────────────────────────────────── */
.login-logo-svg {
  margin-bottom: 0.75rem;
  line-height: 0;
}
.login-logo-svg svg text {
  fill: var(--text);
}
.sidebar-logo-svg {
  padding: 0 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 0;
}
.sidebar-logo-svg svg text {
  fill: var(--text);
}

[data-theme="dark"] {
  /* RA-black mode: true black, white ink, crisp hairlines. */
  --gold: #FFFFFF;
  --gold-light: #1E1E1E;
  --gold-dark: #FFFFFF;
  --bg: #000000;
  --bg2: #0D0D0D;
  --bg3: #191919;
  --surface: #0A0A0A;
  --text: #FFFFFF;
  --text2: #B2B0AA;
  --text3: #6E6C66;
  --border: rgba(255,255,255,0.16);
  --border2: rgba(255,255,255,0.30);
}
.theme-toggle { display:flex; align-items:center; gap:8px; padding:0 1.25rem; margin-bottom:0.75rem; cursor:pointer; user-select:none; }
.theme-toggle-track { width:32px; height:18px; border-radius:9px; background:var(--bg3); border:1px solid var(--border2); position:relative; transition:background 0.2s; flex-shrink:0; }
.theme-toggle-track::after { content:''; position:absolute; top:2px; left:2px; width:12px; height:12px; border-radius:50%; background:var(--text3); transition:transform 0.2s,background 0.2s; }
[data-theme="dark"] .theme-toggle-track { background:#FFFFFF; border-color:#FFFFFF; }
[data-theme="dark"] .theme-toggle-track::after { transform:translateX(14px); background:#000000; }
.theme-toggle-label { font-size:12px; color:var(--text3); }

/* ── Profile photos ─────────────────────────────────────── */
.sidebar-avatar, .emp-avatar, .chain-avatar, .meta-av { position: relative; overflow: hidden; }
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-photo {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--gold-light); color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 600; position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.profile-photo .av-img { border-radius: 50%; }

/* ── Owner console inline controls ──────────────────────── */
.org-inline {
  font-family: inherit; font-size: 12.5px; color: var(--text);
  background: var(--bg2); border: 0.5px solid var(--border2);
  border-radius: var(--radius); padding: 4px 8px; cursor: pointer; max-width: 160px;
}
.org-inline:focus { outline: none; border-color: var(--gold); }

/* ── Wordmark (exact brand asset, light/dark variants) ─── */
.wordmark { display: block; }
.wordmark-dark { display: none; }
[data-theme="dark"] .wordmark-light { display: none; }
[data-theme="dark"] .wordmark-dark { display: block; }
.login-logo-svg .wordmark { margin-bottom: 2px; }

/* ── Ticket conversation thread ─────────────────────────── */
.tkt-thread { display: flex; flex-direction: column; gap: 0.9rem; }
.tkt-system { text-align: center; font-size: 11.5px; color: var(--text3); padding: 2px 0; }
.tkt-msg { max-width: 82%; align-self: flex-start; }
.tkt-msg.tkt-mine { align-self: flex-end; }
.tkt-msg-head { font-size: 11.5px; color: var(--text3); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.tkt-mine .tkt-msg-head { justify-content: flex-end; }
.tkt-msg-time { color: var(--text3); }
.tkt-bubble { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.85rem; font-size: 13.5px; white-space: pre-wrap; line-height: 1.5; }
.tkt-mine .tkt-bubble { background: var(--text); color: var(--surface); border-color: var(--text); }

/* ── Owner console tabs + permission rows ──────────────── */
.org-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.org-tab { font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text2); background: none; border: none; border-bottom: 2px solid transparent; padding: 0.6rem 0.9rem; cursor: pointer; margin-bottom: -1px; }
.org-tab:hover { color: var(--text); }
.org-tab.active { color: var(--text); border-bottom-color: var(--gold); }
.perm-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 13.5px; cursor: pointer; }
.perm-row input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--text); }
