/* ══════════════════════════════════════════════
   PASIG-1 — Tableau de Bord Décisionnel
   Styles principaux
   ══════════════════════════════════════════════ */

/* ── VARIABLES & RESET ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ink:            #0a0c10;
  --surface:        #111318;
  --panel:          #181c24;
  --card:           #1e2330;
  --border:         rgba(255, 255, 255, 0.07);
  --border-accent:  rgba(196, 160, 80, 0.3);
  --gold:           #c4a050;
  --gold-light:     #e8c87a;
  --gold-dim:       rgba(196, 160, 80, 0.15);
  --red:            #c0392b;
  --red-bg:         rgba(192, 57, 43, 0.12);
  --orange:         #d35400;
  --orange-bg:      rgba(211, 84, 0, 0.12);
  --amber:          #d4a017;
  --amber-bg:       rgba(212, 160, 23, 0.12);
  --green:          #27ae60;
  --green-bg:       rgba(39, 174, 96, 0.12);
  --muted:          rgba(255, 255, 255, 0.35);
  --text:           rgba(255, 255, 255, 0.88);
  --text-dim:       rgba(255, 255, 255, 0.55);
  --font-serif:     'EB Garamond', Georgia, serif;
  --font-sans:      'Barlow', sans-serif;
  --font-cond:      'Barlow Condensed', sans-serif;
}

html, body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── UTILITY ── */
.gold          { color: var(--gold); }
.text-red      { color: #e74c3c; }
.text-amber    { color: var(--amber); }
.text-primary  { color: var(--text); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: var(--ink); }
::-webkit-scrollbar-thumb  { background: rgba(196, 160, 80, 0.3); border-radius: 2px; }

/* ══════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════ */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-accent);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.gov-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a5276, #154360);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.header-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.date-badge {
  font-size: 11px;
  color: var(--gold);
  font-family: var(--font-cond);
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  background: var(--gold-dim);
}

/* ══════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════ */
.nav-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }

.nav-item {
  padding: 14px 20px;
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ══════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════ */
.main {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SECTION HEADER ── */
.section-eyebrow {
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--text);
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.section-lead {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 300;
  max-width: 640px;
}

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* ══════════════════════════════════════════════
   KPI STRIP
   ══════════════════════════════════════════════ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.kpi-cell {
  background: var(--panel);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.kpi-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.kpi-cell.red::before    { background: var(--red); }
.kpi-cell.orange::before { background: var(--orange); }
.kpi-cell.amber::before  { background: var(--amber); }
.kpi-cell.green::before  { background: var(--green); }
.kpi-cell.blue::before   { background: #2980b9; }

.kpi-label {
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.kpi-number {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 300;
}

/* ══════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════ */
.alert-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 2rem;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: 2px;
  padding: 1rem 1.25rem;
  transition: background 0.2s;
}

.alert:hover { background: rgba(255, 255, 255, 0.03); }

.alert.critical {
  border-left-color: var(--red);
  background: rgba(192, 57, 43, 0.06);
}

.alert.high {
  border-left-color: var(--orange);
  background: rgba(211, 84, 0, 0.05);
}

.alert-icon {
  font-size: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}

.alert-title {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.alert-desc {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 300;
}

.alert-meta {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}

.deadline-badge {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 2px;
  white-space: nowrap;
}

.dl-red    { background: var(--red-bg);    color: #e74c3c; border: 1px solid rgba(192, 57, 43, 0.3); }
.dl-orange { background: var(--orange-bg); color: #e67e22; border: 1px solid rgba(211, 84, 0, 0.3); }
.dl-amber  { background: var(--amber-bg);  color: #f1c40f; border: 1px solid rgba(212, 160, 23, 0.3); }

.deadline-days {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  font-family: var(--font-cond);
  letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════
   SITE CARDS (Vue Exécutive)
   ══════════════════════════════════════════════ */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.site-card {
  background: var(--panel);
  padding: 1.25rem 1.5rem;
}

.site-text {
  font-size: 12px;
  color: var(--text);
  margin-top: 8px;
  line-height: 1.65;
}

/* ══════════════════════════════════════════════
   TABLE (Engagements)
   ══════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--border-accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

thead th {
  background: var(--panel);
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-accent);
  white-space: nowrap;
  font-weight: 600;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
tbody tr:last-child { border-bottom: none; }

td {
  padding: 13px 14px;
  font-size: 12px;
  vertical-align: middle;
}

.ref-cell {
  font-family: var(--font-cond);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-size: 13px;
}

.desc-cell {
  color: var(--text);
  max-width: 280px;
  line-height: 1.4;
}

.desc-cell small {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 2px;
  font-weight: 300;
}

.resp-cell {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-cond);
  letter-spacing: 0.04em;
}

.date-cell {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 2px;
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.b-critique { background: var(--red-bg);    color: #e74c3c; border: 1px solid rgba(192, 57, 43, 0.35); }
.b-eleve    { background: var(--orange-bg); color: #e67e22; border: 1px solid rgba(211, 84, 0, 0.3); }
.b-moyen    { background: var(--amber-bg);  color: #f1c40f; border: 1px solid rgba(212, 160, 23, 0.3); }
.b-nd       { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.4); border: 1px solid var(--border); }
.b-encours  { background: rgba(41,128,185,0.12); color: #3498db; border: 1px solid rgba(41,128,185,0.3); }
.b-termine  { background: var(--green-bg); color: var(--green); border: 1px solid rgba(39,174,96,0.3); }

/* ── EXPAND ROW ── */
.expand-row         { display: none; background: rgba(0, 0, 0, 0.3); }
.expand-row.open    { display: table-row; }

.expand-content { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); }

.expand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.expand-block-title {
  font-family: var(--font-cond);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

.expand-block-text {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.55;
  font-weight: 300;
}

/* ══════════════════════════════════════════════
   SMART CARDS
   ══════════════════════════════════════════════ */
.smart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 1.25rem;
}

.smart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}

.smart-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.smart-card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.smart-card-ref {
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

.smart-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
  margin-top: 4px;
  line-height: 1.35;
}

.smart-dimensions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.smart-dim {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.smart-dim:nth-child(2n)     { border-right: none; }
.smart-dim:nth-last-child(-n+2) { border-bottom: none; }
.smart-dim.full-width        { grid-column: 1 / -1; border-right: none; border-bottom: none; }

.smart-dim-letter {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-style: italic;
  margin-bottom: 4px;
  line-height: 1;
}

.sl { color: #3498db; }
.ml { color: var(--green); }
.al { color: var(--amber); }
.rl { color: #e67e22; }
.tl { color: #9b59b6; }

.smart-dim-label {
  font-family: var(--font-cond);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.smart-dim-text {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  font-weight: 300;
}

.smart-card-footer {
  padding: 0.85rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.smart-footer-item { font-size: 11px; }

.smart-footer-item strong {
  color: var(--gold);
  font-family: var(--font-cond);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border-accent);
}

.tl-group { margin-bottom: 2.5rem; }

.tl-group-title {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding: 6px 14px;
  display: inline-block;
  border-radius: 2px;
}

.tl-ct { background: rgba(192, 57, 43, 0.15); color: #e74c3c; border: 1px solid rgba(192, 57, 43, 0.3); }
.tl-mt { background: rgba(211, 84, 0, 0.15);  color: #e67e22; border: 1px solid rgba(211, 84, 0, 0.3); }
.tl-lt { background: rgba(41, 128, 185, 0.12); color: #3498db; border: 1px solid rgba(41, 128, 185, 0.3); }

.tl-item {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1rem;
  margin-left: 12px;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s;
}

.tl-item:hover { border-color: var(--border-accent); }

.tl-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--ink);
}

.tl-ref {
  font-family: var(--font-cond);
  font-weight: 700;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  width: 56px;
}

.tl-body { flex: 1; }

.tl-title {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 3px;
}

.tl-meta {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 300;
}

.tl-date {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  flex-shrink: 0;
  text-align: right;
}

/* ══════════════════════════════════════════════
   RISQUES
   ══════════════════════════════════════════════ */
.risk-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.risk-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
}

.risk-card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.risk-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.risk-ref {
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
  flex-shrink: 0;
  width: 36px;
  margin-top: 1px;
}

.risk-text {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  font-weight: 300;
}

.mitigation-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
}

.mitigation-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.mitigation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .main               { padding: 1rem; }
  .app-header         { padding: 0 1rem; }
  .nav-bar            { padding: 0 1rem; }
  .risk-header        { grid-template-columns: 1fr; }
  .smart-grid         { grid-template-columns: 1fr; }
  .expand-grid        { grid-template-columns: 1fr; }
  .smart-dimensions   { grid-template-columns: 1fr; }
  .header-sub         { display: none; }
  .section-heading    { font-size: 1.35rem; }
}

/* Badge bloqué */
.b-bloque { background: rgba(192,57,43,0.12); color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }

/* ── INLINE STYLES REPLACED ── */
.kpi-number-red    { color: #e74c3c; }
.kpi-number-orange { color: #e67e22; }
.kpi-number-amber  { color: #f1c40f; }
.kpi-number-green  { color: #27ae60; }
.kpi-number-blue-large { color: #3498db; font-size: 1.6rem; }
.section-eyebrow-spaced { margin-bottom: 12px; }
.risk-card-title-red { color: #e74c3c; }
.risk-card-title-orange { color: #e67e22; }
