/* ============================================================
   GAM RATP — Carnet de Bord · Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,500;1,400&display=swap');

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

:root {
  --bg:       #F0F2F5;
  --surface:  #FFFFFF;
  --nav-bg:   #1E3A5F;
  --nav-text: rgba(255,255,255,0.85);
  --or:       #C9A84C;
  --or2:      #E2C47A;
  --text:     #1A1C2E;
  --muted:    #6B7280;
  --border:   #E5E7EB;
  --radius:   12px;
  --radius-sm:8px;
  /* couleurs orchestres */
  --harmonie-bg:   #FEF3C7; --harmonie-text: #92400E;
  --philo-bg:      #DBEAFE; --philo-text:    #1E40AF;
  --both-bg:       #F3E8FF; --both-text:     #6B21A8;
  /* statuts */
  --green-bg:#D1FAE5; --green-text:#065F46;
  --red-bg:  #FEE2E2; --red-text:  #991B1B;
  --yellow-bg:#FEF3C7;--yellow-text:#92400E;
  --blue-bg: #DBEAFE; --blue-text: #1E40AF;
}

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

/* ── NAVBAR ──────────────────────────────────────────────── */
.navbar {
  background: var(--nav-bg);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(201,168,76,0.3);
}
.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--or2);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}
.navbar-nav {
  display: flex;
  gap: .25rem;
  flex: 1;
  overflow-x: auto;
}
.navbar-nav a {
  color: var(--nav-text);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  white-space: nowrap;
  transition: background .15s;
}
.navbar-nav a:hover, .navbar-nav a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.navbar-avatar {
  width: 32px; height: 32px;
  background: var(--or);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.navbar-name { font-size: 13px; color: var(--nav-text); }
.navbar-logout {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.navbar-logout:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ── LAYOUT PRINCIPAL ────────────────────────────────────── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}
.layout-cols {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .layout-cols { grid-template-columns: 1fr; }
  .navbar-nav a { display: none; }
  .navbar-nav a.active { display: block; }
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-sub   { font-size: 12px; color: var(--muted); margin-top: 1px; }
.card-body  { padding: 1.25rem; }

/* ── STAT CARDS (accueil) ────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem 1rem;
  text-align: center;
}
.stat-num {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: .25rem;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-sub   { font-size: 11px; margin-top: 3px; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-harmonie  { background: var(--harmonie-bg); color: var(--harmonie-text); }
.badge-philo     { background: var(--philo-bg);    color: var(--philo-text); }
.badge-both      { background: var(--both-bg);     color: var(--both-text); }
.badge-green     { background: var(--green-bg);    color: var(--green-text); }
.badge-red       { background: var(--red-bg);      color: var(--red-text); }
.badge-yellow    { background: var(--yellow-bg);   color: var(--yellow-text); }
.badge-blue      { background: var(--blue-bg);     color: var(--blue-text); }
.badge-new       { background: var(--or); color: #fff; }

/* ── TABLEAU ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
td { padding: .75rem 1rem; border-bottom: 1px solid #F3F4F6; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F9FAFB; }

/* ── FORMULAIRES ─────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
.form-control:focus { border-color: var(--nav-bg); box-shadow: 0 0 0 3px rgba(30,58,95,0.08); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── BOUTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.btn-primary   { background: var(--nav-bg); color: #fff; }
.btn-primary:hover { background: #152d4a; }
.btn-gold      { background: var(--or); color: #fff; }
.btn-gold:hover{ background: #b8903d; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--nav-bg); color: var(--nav-bg); }
.btn-danger    { background: var(--red-bg); color: var(--red-text); }
.btn-sm        { padding: 6px 12px; font-size: 12px; }
.btn-full      { width: 100%; justify-content: center; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-success { background: var(--green-bg); color: var(--green-text); }
.alert-error   { background: var(--red-bg);   color: var(--red-text); }
.alert-info    { background: var(--blue-bg);   color: var(--blue-text); }
.alert-warning { background: var(--yellow-bg); color: var(--yellow-text); }

/* ── PAGE CONNEXION ──────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo-circle {
  width: 60px; height: 60px;
  background: var(--nav-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--or2);
}
.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}
.login-logo p { font-size: 13px; color: var(--muted); }

/* ── PROFIL HEADER ───────────────────────────────────────── */
.profil-header {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.profil-avatar {
  width: 64px; height: 64px;
  background: var(--nav-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--or2);
  flex-shrink: 0;
  overflow: hidden;
}
.profil-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profil-name { font-size: 20px; font-weight: 600; }
.profil-sub  { font-size: 13px; color: var(--muted); margin-top: 3px; }
.profil-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.profil-actions {
  margin-left: auto;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ── QUICK ACTIONS ───────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.qa-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem .75rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
  display: block;
}
.qa-btn:hover { border-color: var(--nav-bg); transform: translateY(-2px); }
.qa-icon { font-size: 22px; margin-bottom: 6px; }
.qa-label { font-size: 12px; font-weight: 500; }

/* ── CALENDRIER ──────────────────────────────────────────── */
.event-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #F3F4F6;
}
.event-row:last-child { border-bottom: none; }
.event-date-box {
  text-align: center;
  min-width: 44px;
}
.event-day {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--or);
  line-height: 1;
}
.event-month { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.event-info { flex: 1; }
.event-title { font-weight: 500; font-size: 14px; }
.event-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.event-badges{ display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }

/* ── TROMBINOSCOPE ───────────────────────────────────────── */
.trombi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}
.trombi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.trombi-card:hover { border-color: var(--nav-bg); transform: translateY(-2px); }
.trombi-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--or2);
  margin: 0 auto .75rem;
  overflow: hidden;
}
.trombi-avatar img { width: 100%; height: 100%; object-fit: cover; }
.trombi-name { font-size: 13px; font-weight: 500; }
.trombi-inst { font-size: 11px; color: var(--muted); margin-top: 2px; }
.trombi-filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tfilter {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Inter', sans-serif;
}
.tfilter:hover, .tfilter.active {
  background: var(--nav-bg);
  color: #fff;
  border-color: var(--nav-bg);
}

/* ── DOCS ────────────────────────────────────────────────── */
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
  transition: background .1s;
}
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: #F9FAFB; }
.doc-ext {
  width: 32px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: .04em;
}
.ext-pdf { background: #FEE2E2; color: #991B1B; }
.ext-mp3 { background: #D1FAE5; color: #065F46; }
.ext-img { background: #DBEAFE; color: #1E40AF; }
.ext-doc { background: #EDE9FE; color: #5B21B6; }
.doc-section-head {
  padding: .6rem 1.25rem;
  background: #F9FAFB;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

/* ── SIDEBAR WIDGETS ─────────────────────────────────────── */
.widget {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1rem;
}
.widget-header {
  padding: .9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.widget-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.widget-title { font-size: 14px; font-weight: 600; }
.widget-sub   { font-size: 12px; color: var(--muted); }
.widget-body  { padding: 1rem 1.1rem; }
.widget-cta   { padding: .75rem 1.1rem; border-top: 1px solid var(--border); }

/* Couleurs widgets */
.wi-cotis  { background: linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%); }
.wi-trombi { background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%); }
.wi-badge  { background: linear-gradient(135deg, #7C3AED 0%, #C026D3 100%); }
.wi-galerie{ background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%); }

/* ── SECURITY LOG ────────────────────────────────────────── */
.security-row {
  display: grid;
  grid-template-columns: 110px 1fr 100px 80px;
  gap: 1rem;
  padding: .65rem 1.25rem;
  border-bottom: 1px solid #F3F4F6;
  font-size: 12px;
  align-items: center;
}
.security-row:last-child { border-bottom: none; }
.security-head { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing:.05em; background: #F9FAFB; }

/* ── ADMIN ───────────────────────────────────────────────── */
.admin-bar {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  font-size: 12px;
  color: #92400E;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── MISC ────────────────────────────────────────────────── */
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.text-muted { color: var(--muted); }
.text-small { font-size: 12px; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
