/* TalentVision Dashboard — Sodexo Branding */

:root {
  --sodexo-primary: #283897;
  --sodexo-primary-light: #E7E9F7;
  --sodexo-primary-dark: #2A295C;
  --sodexo-accent: #DA2020;
  --sodexo-dark: #1D1D1B;
  --sodexo-gray: #58585A;
  --sodexo-gray-light: #a0a0a0;
  --sodexo-border: #e8e8e8;
  --sodexo-bg: #f4f5f7;
  --sodexo-white: #ffffff;
  --sodexo-green: #2ecc71;
  --sodexo-orange: #f39c12;
  --sodexo-blue: #3498db;
}

/* ---- Dashboard Layout ---- */
.tv-dashboard {
  flex: 1;
  overflow-y: auto;
  background: var(--sodexo-bg);
  padding: 0;
  height: 100vh;
}

/* ---- Topbar ---- */
.tv-topbar {
  background: var(--sodexo-white);
  color: var(--sodexo-dark);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--sodexo-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tv-topbar-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.tv-topbar-logo {
  height: 28px;
  object-fit: contain;
}

.tv-topbar-sep {
  width: 1px;
  height: 24px;
  background: var(--sodexo-border);
}

.tv-topbar-title {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--sodexo-primary-dark);
}

.tv-topbar-title span {
  color: var(--sodexo-gray);
  font-weight: 400;
}

.tv-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Notification bell */
.tv-notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--sodexo-border);
  background: var(--sodexo-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.tv-notif-btn:hover {
  background: var(--sodexo-primary-light);
  border-color: var(--sodexo-primary);
}

.tv-notif-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--sodexo-gray);
}

.tv-notif-btn:hover svg {
  fill: var(--sodexo-primary);
}

.tv-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sodexo-accent);
  color: var(--sodexo-white);
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--sodexo-white);
}

/* Notification panel */
.tv-notif-wrapper {
  position: relative;
}

.tv-notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--sodexo-white);
  border: 1px solid var(--sodexo-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 300;
  overflow: hidden;
}

.tv-notif-panel.open {
  display: block;
}

.tv-notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--sodexo-border);
}

.tv-notif-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sodexo-dark);
}

.tv-notif-mark-read {
  font-size: 0.62rem;
  color: var(--sodexo-primary);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.tv-notif-mark-read:hover {
  text-decoration: underline;
}

.tv-notif-list {
  max-height: 300px;
  overflow-y: auto;
}

.tv-notif-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.15s;
}

.tv-notif-item:hover {
  background: var(--sodexo-primary-light);
}

.tv-notif-item:last-child {
  border-bottom: none;
}

.tv-notif-item.unread {
  background: #f8f9ff;
}

.tv-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sodexo-primary);
  flex-shrink: 0;
  margin-top: 4px;
}

.tv-notif-item:not(.unread) .tv-notif-dot {
  background: transparent;
}

.tv-notif-content {
  flex: 1;
  min-width: 0;
}

.tv-notif-text {
  font-size: 0.7rem;
  color: var(--sodexo-dark);
  line-height: 1.4;
}

.tv-notif-text strong {
  font-weight: 700;
}

.tv-notif-time {
  font-size: 0.58rem;
  color: var(--sodexo-gray-light);
  margin-top: 0.2rem;
}

/* Modal overlay */
.tv-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.tv-modal-overlay.open {
  display: flex;
}

.tv-modal {
  background: var(--sodexo-white);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.tv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--sodexo-border);
}

.tv-modal-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sodexo-dark);
}

.tv-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--sodexo-bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--sodexo-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-modal-close:hover {
  background: var(--sodexo-border);
}

.tv-modal-body {
  padding: 1rem 1.2rem;
}

.tv-modal-formation {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem;
  border: 1px solid var(--sodexo-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tv-modal-formation:hover {
  border-color: var(--sodexo-primary);
  background: var(--sodexo-primary-light);
}

.tv-modal-formation.selected {
  border-color: var(--sodexo-primary);
  background: var(--sodexo-primary-light);
  box-shadow: 0 0 0 2px var(--sodexo-primary);
}

.tv-modal-formation-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--sodexo-border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-modal-formation.selected .tv-modal-formation-radio {
  border-color: var(--sodexo-primary);
}

.tv-modal-formation.selected .tv-modal-formation-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sodexo-primary);
}

.tv-modal-formation-info {
  flex: 1;
}

.tv-modal-formation-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sodexo-dark);
}

.tv-modal-formation-provider {
  font-size: 0.62rem;
  color: var(--sodexo-gray);
}

.tv-modal-formation-tag {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.tv-modal-formation-tag.critical { background: #fde8e8; color: #c0392b; }
.tv-modal-formation-tag.recommended { background: #fef3e2; color: #e67e22; }
.tv-modal-formation-tag.optional { background: #e8f8f0; color: #27ae60; }

.tv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--sodexo-border);
}

.tv-modal-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--sodexo-border);
}

.tv-modal-btn-primary {
  background: var(--sodexo-primary);
  color: var(--sodexo-white);
  border-color: var(--sodexo-primary);
}

.tv-modal-btn-primary:hover {
  background: var(--sodexo-primary-dark);
}

.tv-modal-btn-secondary {
  background: var(--sodexo-white);
  color: var(--sodexo-dark);
}

.tv-modal-btn-secondary:hover {
  background: var(--sodexo-bg);
}

.tv-modal-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  text-align: center;
  animation: successFadeIn 0.3s ease;
}

@keyframes successFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
  .tv-notif-panel {
    width: 280px;
    right: -40px;
  }
}

/* User pill in topbar */
.tv-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem 0.3rem 0.3rem;
  border-radius: 20px;
  border: 1px solid var(--sodexo-border);
  background: var(--sodexo-white);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sodexo-dark);
  cursor: default;
}

.tv-topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sodexo-primary);
  color: var(--sodexo-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
}

.tv-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--sodexo-gray);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--sodexo-border);
  transition: all 0.2s;
}

.tv-topbar-back:hover {
  color: var(--sodexo-primary);
  border-color: var(--sodexo-primary);
  background: var(--sodexo-primary-light);
}

.tv-topbar-back svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ---- Grid ---- */
.tv-grid {
  display: grid;
  grid-template-columns: 300px 1fr 1fr;
  gap: 1rem;
  padding: 1.2rem 1.5rem 2rem;
}

/* ---- Cards ---- */
.tv-card {
  background: var(--sodexo-white);
  border-radius: 10px;
  border: 1px solid var(--sodexo-border);
  padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.tv-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--sodexo-primary);
}

.tv-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sodexo-primary-dark);
}

.tv-card-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  color: var(--sodexo-white);
}

.tv-badge-green { background: var(--sodexo-green); }
.tv-badge-orange { background: var(--sodexo-orange); }
.tv-badge-red { background: var(--sodexo-accent); }
.tv-badge-blue { background: var(--sodexo-primary); }

/* ---- Profile Card ---- */
.tv-profile {
  grid-row: span 2;
}

.tv-profile-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.tv-profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--sodexo-primary);
  color: var(--sodexo-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 0.8rem;
}

.tv-profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sodexo-dark);
  margin-bottom: 0.2rem;
}

.tv-profile-role {
  font-size: 0.75rem;
  color: var(--sodexo-gray);
  font-weight: 500;
}

.tv-profile-id {
  font-size: 0.65rem;
  color: var(--sodexo-gray-light);
  font-weight: 500;
  margin-top: 0.3rem;
  font-family: monospace;
}

.tv-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tv-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.73rem;
  color: var(--sodexo-gray);
}

.tv-meta-row svg {
  width: 14px;
  height: 14px;
  fill: var(--sodexo-primary);
  flex-shrink: 0;
}

.tv-meta-label {
  font-weight: 600;
  color: var(--sodexo-dark);
  min-width: 75px;
}

/* Langs */
.tv-langs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.tv-lang-tag {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--sodexo-primary-light);
  color: var(--sodexo-primary);
}

/* ---- Score Circle ---- */
.tv-score-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 0.8rem;
}

.tv-score-circle svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.tv-score-circle-bg {
  fill: none;
  stroke: var(--sodexo-border);
  stroke-width: 8;
}

.tv-score-circle-fill {
  fill: none;
  stroke: var(--sodexo-primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.tv-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sodexo-dark);
  line-height: 1;
}

.tv-score-label {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--sodexo-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ---- Skill bars ---- */
.tv-skills {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tv-skill-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tv-skill-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--sodexo-dark);
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-skill-bar {
  flex: 1;
  height: 7px;
  background: var(--sodexo-bg);
  border-radius: 4px;
  overflow: hidden;
}

.tv-skill-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--sodexo-primary);
  transition: width 1s ease;
}

.tv-skill-fill.green { background: var(--sodexo-green); }
.tv-skill-fill.orange { background: var(--sodexo-orange); }
.tv-skill-fill.blue { background: var(--sodexo-blue); }

.tv-skill-pct {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--sodexo-gray);
  min-width: 32px;
  text-align: right;
}

/* ---- Gap table ---- */
.tv-gap-table {
  width: 100%;
  border-collapse: collapse;
}

.tv-gap-table th {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--sodexo-gray);
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--sodexo-border);
}

.tv-gap-table td {
  font-size: 0.7rem;
  color: var(--sodexo-dark);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.tv-gap-table tr:last-child td {
  border-bottom: none;
}

.tv-gap-level {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.tv-gap-high { background: #fde8e8; color: #c0392b; }
.tv-gap-medium { background: #fef3e2; color: #e67e22; }
.tv-gap-low { background: #e8f8f0; color: #27ae60; }

/* ---- Turnover card ---- */
.tv-turnover-meter {
  text-align: center;
  margin: 1rem 0;
}

.tv-turnover-bar {
  width: 100%;
  height: 10px;
  background: linear-gradient(to right, var(--sodexo-green), var(--sodexo-orange), var(--sodexo-accent));
  border-radius: 5px;
  position: relative;
  margin-bottom: 0.6rem;
}

.tv-turnover-indicator {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  background: var(--sodexo-white);
  border: 3px solid var(--sodexo-primary-dark);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 1s ease;
}

.tv-turnover-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--sodexo-gray);
  font-weight: 500;
}

.tv-turnover-factors {
  margin-top: 1rem;
}

.tv-factor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.7rem;
}

.tv-factor-row:last-child { border-bottom: none; }

.tv-factor-name { color: var(--sodexo-dark); font-weight: 500; }
.tv-factor-impact { font-weight: 700; }
.tv-impact-pos { color: var(--sodexo-green); }
.tv-impact-neg { color: var(--sodexo-accent); }
.tv-impact-neutral { color: var(--sodexo-orange); }

/* ---- Succession / Career ---- */
.tv-career-path {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 1.2rem;
}

.tv-career-path::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--sodexo-border);
}

.tv-career-step {
  position: relative;
  padding: 0.55rem 0 0.55rem 0.8rem;
}

.tv-career-step::before {
  content: '';
  position: absolute;
  left: -1.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sodexo-border);
  border: 2px solid var(--sodexo-white);
}

.tv-career-step.current::before {
  background: var(--sodexo-primary);
  box-shadow: 0 0 0 3px var(--sodexo-primary-light);
}

.tv-career-step.future::before {
  background: var(--sodexo-white);
  border: 2px dashed var(--sodexo-gray-light);
}

.tv-career-step.past::before {
  background: var(--sodexo-green);
}

.tv-step-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sodexo-dark);
}

.tv-step-sub {
  font-size: 0.65rem;
  color: var(--sodexo-gray);
  margin-top: 0.1rem;
}

.tv-step-date {
  font-size: 0.6rem;
  color: var(--sodexo-gray-light);
  font-weight: 500;
}

/* ---- Full-width / span cards ---- */
.tv-full {
  grid-column: 1 / -1;
}

.tv-two-third {
  grid-column: span 2;
}

/* ---- KPI row ---- */
.tv-kpi-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.tv-kpi {
  flex: 1;
  text-align: center;
  padding: 0.7rem;
  background: var(--sodexo-bg);
  border-radius: 8px;
}

.tv-kpi-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sodexo-dark);
}

.tv-kpi-label {
  font-size: 0.6rem;
  color: var(--sodexo-gray);
  font-weight: 500;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* ---- Stats bar (employees page + dashboard top) ---- */
.tv-stats-bar {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.5rem;
}

.tv-stat-card {
  flex: 1;
  background: var(--sodexo-white);
  border: 1px solid var(--sodexo-border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tv-stat-card:hover {
  border-color: var(--sodexo-primary);
  box-shadow: 0 2px 8px rgba(40,56,151,0.1);
}

.tv-stat-card.active {
  border-color: var(--sodexo-primary);
  background: var(--sodexo-primary-light);
}

.tv-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tv-stat-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--sodexo-white);
}

.tv-stat-icon.blue { background: var(--sodexo-primary); }
.tv-stat-icon.green { background: var(--sodexo-green); }
.tv-stat-icon.orange { background: var(--sodexo-orange); }
.tv-stat-icon.red { background: var(--sodexo-accent); }

.tv-stat-info { display: flex; flex-direction: column; }

.tv-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sodexo-dark);
  line-height: 1;
}

.tv-stat-label {
  font-size: 0.65rem;
  color: var(--sodexo-gray);
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 0.2rem;
}

.tv-stat-change {
  font-size: 0.6rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

.tv-stat-up { color: #27ae60; }
.tv-stat-down { color: var(--sodexo-accent); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .tv-grid {
    grid-template-columns: 1fr 1fr;
    padding: 1rem;
  }
  .tv-profile {
    grid-row: span 1;
    grid-column: 1 / -1;
  }
  .tv-profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
  }
  .tv-profile-avatar {
    margin: 0;
  }
  .tv-full {
    grid-column: 1 / -1;
  }
  .tv-two-third {
    grid-column: span 1;
  }
  .tv-stats-bar {
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
  }
  .tv-stat-card {
    min-width: calc(50% - 0.4rem);
  }
}

@media (max-width: 600px) {
  .tv-topbar {
    padding: 0 1rem;
    height: 48px;
  }
  .tv-topbar-title {
    font-size: 0.75rem;
  }
  .tv-topbar-logo {
    height: 20px;
  }
  .tv-grid {
    grid-template-columns: 1fr;
    padding: 0.8rem;
    gap: 0.8rem;
  }
  .tv-profile {
    grid-row: span 1;
  }
  .tv-two-third {
    grid-column: span 1;
  }
  .tv-card {
    padding: 1rem;
  }
  .tv-skill-name {
    width: 110px;
    min-width: 110px;
    font-size: 0.65rem;
  }
  .tv-kpi-row {
    flex-wrap: wrap;
  }
  .tv-kpi {
    min-width: calc(50% - 0.5rem);
  }
  .tv-stats-bar {
    flex-direction: column;
    padding: 0.6rem;
  }
  .tv-stat-card {
    min-width: auto;
  }
  .tv-topbar-user span {
    display: none;
  }
}

/* ── Role-based Visibility ── */
.tv-dashboard[data-role="manager"] [data-view="rh"],
.tv-dashboard[data-role="employe"] [data-view="rh"],
.tv-dashboard[data-role="employe"] [data-view="rh-manager"] {
  display: none !important;
}
.tv-view-banner {
  display: none;
  padding: 0.5rem 1.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-bottom: 1px solid var(--sodexo-border);
}
.tv-view-banner.manager {
  background: #eaf0fb;
  color: var(--sodexo-primary);
}
.tv-view-banner.employe {
  background: #e8f8f0;
  color: #27ae60;
}
.tv-dashboard[data-role="manager"] .tv-view-banner.manager,
.tv-dashboard[data-role="employe"] .tv-view-banner.employe {
  display: block;
}

/* ── RGPD Consent Overlay ── */
.tv-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tv-consent-card {
  background: var(--sodexo-white);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  max-width: 420px;
  width: 100%;
  padding: 2rem 1.8rem;
  text-align: center;
  animation: tvConsentIn 0.3s ease;
}
@keyframes tvConsentIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tv-consent-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  background: var(--sodexo-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv-consent-icon svg {
  width: 26px;
  height: 26px;
  fill: var(--sodexo-primary);
}
.tv-consent-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sodexo-dark);
  margin-bottom: 0.6rem;
}
.tv-consent-text {
  font-size: 0.75rem;
  color: var(--sodexo-gray);
  line-height: 1.6;
  margin-bottom: 1.4rem;
}
.tv-consent-btns {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}
.tv-consent-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.tv-consent-btn:active {
  transform: scale(0.97);
}
.tv-consent-refuse {
  background: var(--sodexo-bg);
  color: var(--sodexo-gray);
  border: 1px solid var(--sodexo-border);
}
.tv-consent-refuse:hover {
  background: #e8e8e8;
}
.tv-consent-accept {
  background: var(--sodexo-primary);
  color: #fff;
}
.tv-consent-accept:hover {
  background: var(--sodexo-primary-dark);
}

/* ── Header Toggle Button ── */
.tv-header-toggle {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--sodexo-border);
  border-radius: 4px;
  background: var(--sodexo-white);
  color: var(--sodexo-gray);
  cursor: pointer;
  transition: all 0.2s;
}
.tv-header-toggle:hover {
  border-color: var(--sodexo-primary);
  color: var(--sodexo-primary);
}
.tv-header-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ── Skill Evolution Popup ── */
.tv-skill-row {
  cursor: pointer;
  transition: background 0.15s;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  margin: -0.3rem -0.4rem;
}
.tv-skill-row:hover {
  background: var(--sodexo-primary-light);
}
.tv-skill-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.tv-skill-popup-overlay.open {
  display: flex;
}
.tv-skill-popup {
  background: var(--sodexo-white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 400px;
  max-width: 92vw;
  padding: 1.5rem 1.8rem;
  position: relative;
  animation: tvSkillPopIn 0.25s ease;
}
@keyframes tvSkillPopIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.tv-skill-popup-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--sodexo-bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--sodexo-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv-skill-popup-close:hover {
  background: var(--sodexo-border);
}
.tv-skill-popup-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--sodexo-dark);
  margin-bottom: 0.15rem;
  padding-right: 2rem;
}
.tv-skill-popup-sub {
  font-size: 0.68rem;
  color: var(--sodexo-gray);
  margin-bottom: 1rem;
}
.tv-skill-popup-sub strong {
  color: var(--sodexo-primary);
  font-weight: 700;
}
.tv-skill-popup-chart {
  width: 100%;
  height: 160px;
  display: block;
}
.tv-skill-popup-labels {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 1.8rem 0;
  font-size: 0.58rem;
  color: var(--sodexo-gray);
  font-weight: 500;
}

/* ── Mode Toggle DEMO/PROD ── */
.tv-mode-toggle {
  display: flex;
  border: 1px solid var(--sodexo-border);
  border-radius: 6px;
  overflow: hidden;
}
.tv-mode-btn {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border: none;
  background: var(--sodexo-white);
  color: var(--sodexo-gray);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tv-mode-btn.active[data-mode="demo"] {
  background: var(--sodexo-orange);
  color: #fff;
}
.tv-mode-btn.active[data-mode="prod"] {
  background: var(--sodexo-green);
  color: #fff;
}
.tv-mode-btn[data-mode="doc"] {
  border-left: 1px solid var(--sodexo-border);
  text-decoration: none;
}
.tv-mode-btn.active[data-mode="doc"] {
  background: var(--sodexo-primary);
  color: #fff;
}

/* DEMO mode indicator — red border + banner */
body.demo-mode::before {
  content: 'DEMO MODE';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  line-height: 18px;
  z-index: 99999;
  background: var(--sodexo-accent);
  color: #fff;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0;
  pointer-events: none;
}
body.demo-mode {
  outline: 3px solid var(--sodexo-accent);
  outline-offset: -3px;
}
body.demo-mode .tv-topbar,
body.demo-mode .faq-topbar,
body.demo-mode .bot-topbar {
  top: 18px;
}
body.demo-mode .tv-dashboard {
  padding-top: 18px;
}
body.demo-mode .faq-page {
  padding-top: 18px;
}
body.demo-mode .bot-page .bot-topbar {
  top: 18px;
}
