/* =====================================================
   USPSO Intranet — Feuille de style v3
   v3 : Layout sidebar verticale + bloc "Ce week-end" + météo
   ===================================================== */

:root {
  /* Palette claire (inchangée) */
  --bg:                #ffffff;
  --bg-soft:           #f7f8fb;
  --bg-soft-2:         #eef0f5;
  --line:              #e3e6ed;
  --line-strong:       #ced3dd;
  --text:              #0e1b2c;
  --text-2:            #2a3a52;
  --muted:             #677085;
  --muted-2:           #8b94a8;

  /* Accents USPSO */
  --bleu-uspso:        #0072CE;
  --bleu-uspso-2:      #0061b0;
  --bleu-light:        #e8f1fb;
  --or:                #b48a3a;
  --or-2:              #d4ac57;
  --or-light:          #faf3e2;

  /* États */
  --green:             #2f8d4a;
  --green-light:       #e6f4ea;
  --red:               #b03441;
  --red-light:         #fce8eb;
  --orange:            #c47a2c;
  --orange-light:      #fdf2e3;

  /* Ombres */
  --shadow-sm:  0 1px 2px rgba(14, 27, 44, .04), 0 1px 3px rgba(14, 27, 44, .04);
  --shadow:     0 4px 12px rgba(14, 27, 44, .04), 0 2px 4px rgba(14, 27, 44, .04);
  --shadow-lg:  0 24px 48px -12px rgba(14, 27, 44, .12);

  /* Sidebar */
  --sidebar-w:         260px;
  --sidebar-bg:        #f9fafc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--bleu-uspso); text-decoration: none; transition: color .15s; }
a:hover { color: var(--bleu-uspso-2); text-decoration: underline; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* =====================================================
   LAYOUT 2 COLONNES : sidebar + contenu
   ===================================================== */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.app-content {
  min-width: 0;  /* important pour que les enfants flex/grid ne dépassent pas */
}

@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   SIDEBAR VERTICALE
   ===================================================== */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 1.5rem 1.25rem 1rem;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 .5rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand img {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: 6px;
  flex: 0 0 auto;
}
.sidebar-brand-text {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--text);
  line-height: 1.1;
}
.sidebar-brand-sub {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.sidebar-section {
  margin-top: 1.5rem;
  padding: 0 .5rem;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar-section::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--line-strong);
}

.sidebar-nav {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: flex; flex-direction: column;
  gap: 1px;
}

.sidebar-nav a, .sidebar-nav span.locked {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover {
  background: var(--bleu-light);
  color: var(--bleu-uspso);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--bleu-uspso);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 50%; transform: translateY(-50%);
  width: 4px; height: 24px;
  background: var(--or);
  border-radius: 0 4px 4px 0;
}

.sidebar-nav .num {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-2);
  min-width: 22px;
  letter-spacing: .04em;
}
.sidebar-nav a.active .num { color: rgba(255,255,255,.8); }

.sidebar-nav span.locked {
  color: var(--muted-2);
  cursor: not-allowed;
}
.sidebar-nav span.locked .num { color: var(--muted-2); opacity: .6; }
.sidebar-nav span.locked:hover {
  background: var(--bg-soft);
}
.sidebar-nav span.locked::after {
  content: "Bientôt";
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 99px;
  border: 1px solid var(--line);
}

.sidebar-nav .pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  letter-spacing: .04em;
}
.sidebar-nav a.active .pill { background: var(--or); color: var(--text); }

/* USER (en bas de sidebar) */
.sidebar-user {
  margin-top: auto;
  padding: 1rem .5rem 0;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-avatar {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bleu-uspso) 0%, var(--bleu-uspso-2) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}
.sidebar-user-meta {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.2;
  min-width: 0;
}
.sidebar-user-meta b {
  display: block;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-meta span {
  display: block;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}
.sidebar-logout {
  margin-left: auto;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
  text-decoration: none;
  transition: all .15s;
}
.sidebar-logout:hover {
  border-color: var(--red);
  color: var(--red);
}
.sidebar-logout:hover { text-decoration: none; }

/* Mobile : sidebar devient une top-bar simple */
@media (max-width: 980px) {
  .sidebar {
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .sidebar-brand {
    border-bottom: none;
    padding: 0;
    flex: 1;
  }
  .sidebar-section, .sidebar-nav { display: none; }
  .sidebar-user {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}

/* =====================================================
   BANDEAU TOP (au-dessus du hero, dans la zone contenu)
   ===================================================== */
.intranet-bar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 12px;
  color: var(--muted);
}
.intranet-bar > div {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.intranet-bar .left {
  display: flex; align-items: center; gap: 16px;
}
.intranet-bar .badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px;
  background: var(--green-light);
  color: var(--green);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .04em;
  border-radius: 99px;
}
.intranet-bar .badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
}

/* =====================================================
   HERO
   ===================================================== */
.intranet-hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% -10%, var(--bleu-light) 0%, transparent 60%),
    var(--bg);
}
.intranet-hero > div {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.4fr .7fr;
  gap: 4rem;
  align-items: end;
}
.intranet-hero .kicker {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--bleu-uspso);
  padding: 6px 12px;
  background: var(--bleu-light);
  border-radius: 99px;
}
.intranet-hero h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.05; letter-spacing: -.02em;
  margin: 1.25rem 0 0;
  color: var(--text);
}
.intranet-hero h1 em {
  font-family: 'Playfair Display', serif;
  font-style: italic; font-weight: 400;
  color: var(--bleu-uspso);
}
.intranet-hero .lead {
  margin-top: 1rem;
  max-width: 580px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
}

.intranet-hero .summary {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.intranet-hero .summary .row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
}
.intranet-hero .summary .row:last-child { border-bottom: none; }
.intranet-hero .summary .row:first-child { padding-top: 0; }
.intranet-hero .summary .k {
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.intranet-hero .summary .v {
  font-family: 'Oswald', sans-serif;
  font-weight: 500; font-size: 1.05rem;
  color: var(--text); letter-spacing: .01em;
  text-align: right;
}
.intranet-hero .summary .v.gold  { color: var(--or); }
.intranet-hero .summary .v.green { color: var(--green); }

@media (max-width: 980px) {
  .intranet-hero > div { grid-template-columns: 1fr; gap: 2rem; }
}

/* =====================================================
   PANELS / CARDS
   ===================================================== */
.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.panel:hover { box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1.25rem; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  gap: 1rem; flex-wrap: wrap;
}
.panel-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--bleu-uspso);
}
.panel-head .muted-meta {
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500;
  color: var(--muted);
}
.panel h3 {
  font-family: 'Oswald', sans-serif;
  font-weight: 500; font-size: 1.5rem;
  letter-spacing: -.005em;
  margin: 0 0 .5rem;
  color: var(--text);
}
.panel h3 em {
  font-family: 'Playfair Display', serif;
  font-style: italic; font-weight: 400;
  color: var(--bleu-uspso);
}
.panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 .75rem;
}
.panel.placeholder {
  background: var(--bg-soft);
  border-style: dashed;
}
.panel.placeholder h3 { color: var(--text-2); }
.placeholder-tag {
  display: inline-block;
  margin-top: .75rem;
  padding: 4px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
}

a.panel-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.panel-link:hover {
  text-decoration: none;
  border-color: var(--bleu-uspso);
  transform: translateY(-2px);
  transition: all .2s;
}

/* =====================================================
   BLOC "CE WEEK-END" (carte spéciale)
   ===================================================== */
.weekend-panel {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bleu-light) 100%);
  border: 1px solid var(--bleu-uspso);
  position: relative;
  overflow: hidden;
}
.weekend-panel::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle at center, var(--or-light) 0%, transparent 70%);
  opacity: .5;
  pointer-events: none;
}
.weekend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}
@media (max-width: 700px) {
  .weekend-grid { grid-template-columns: 1fr; }
}
.weekend-info h3 {
  font-size: 1.7rem;
  margin-bottom: .25rem !important;
}
.weekend-when {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  color: var(--text-2);
  margin: 0 0 1rem;
}
.weekend-where {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
}
.weekend-where-label {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.weekend-where-label svg { flex: 0 0 auto; }
.weekend-where-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 2px;
}
.weekend-where-addr {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 10px;
}
.weekend-itineraire {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--bleu-uspso);
  text-decoration: none;
}
.weekend-itineraire:hover {
  color: var(--bleu-uspso-2);
  text-decoration: underline;
}

/* Mini météo dans la colonne droite du weekend */
.weather-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex; flex-direction: column;
}
.weather-loc {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
}
.weather-main {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.weather-icon {
  width: 56px; height: 56px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--bleu-light);
  border-radius: 50%;
  color: var(--bleu-uspso);
}
.weather-temp {
  font-family: 'Oswald', sans-serif;
  font-weight: 300;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.03em;
}
.weather-temp sup { font-size: 1rem; vertical-align: top; margin-left: 4px; color: var(--muted); }
.weather-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  text-transform: capitalize;
}
.weather-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.weather-grid div {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .04em;
}
.weather-grid div b {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  margin-top: 2px;
  font-family: 'Oswald', sans-serif;
}
.weather-loading, .weather-error {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 2rem 0;
  font-style: italic;
}
.weather-error { color: var(--red); }

/* =====================================================
   FORMULAIRES
   ===================================================== */
.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 1rem;
}
.field label {
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-2);
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font: 500 14px 'Inter', sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--bleu-uspso);
  box-shadow: 0 0 0 3px var(--bleu-light);
}
input::placeholder, textarea::placeholder {
  color: var(--muted-2);
}

/* =====================================================
   BOUTONS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 14px;
  padding: 11px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--text);
  color: var(--text);
}
.btn-primary {
  background: var(--bleu-uspso);
  border-color: var(--bleu-uspso);
  color: #fff;
}
.btn-primary:hover {
  background: var(--bleu-uspso-2);
  border-color: var(--bleu-uspso-2);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--line-strong);
}
.btn-sm { font-size: 12px; padding: 8px 14px; }

/* =====================================================
   FLASH / MESSAGES
   ===================================================== */
.flash {
  padding: 12px 16px;
  margin-bottom: 1rem;
  border: 1px solid;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
}
.flash.ok  { background: var(--green-light);  border-color: var(--green);  color: var(--green); }
.flash.err { background: var(--red-light);    border-color: var(--red);    color: var(--red); }
.flash.info{ background: var(--bleu-light);   border-color: var(--bleu-uspso);   color: var(--bleu-uspso-2); }

.muted { color: var(--muted); }

/* =====================================================
   FOOTER
   ===================================================== */
.intranet-footer {
  background: var(--bg-soft);
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  margin-top: 3rem;
}
.intranet-footer > div {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
}

/* =====================================================
   PAGE LOGIN (autonome — pas de sidebar)
   ===================================================== */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(60% 40% at 30% 20%, var(--bleu-light) 0%, transparent 60%),
    radial-gradient(40% 30% at 80% 80%, var(--or-light) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 460px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.login-brand img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; }
.login-brand h1 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 600; font-size: 1.4rem;
  letter-spacing: .06em;
  line-height: 1; color: var(--text);
}
.login-brand span {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-top: 6px;
}
.login-card h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: 1.85rem;
  margin: 0 0 .5rem;
  color: var(--text);
}
.login-card .muted { font-size: .9rem; line-height: 1.6; margin: 0 0 1.5rem; }
.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 13px;
  margin-top: .25rem;
}
.login-help {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
}
.login-help a { color: var(--bleu-uspso); font-weight: 500; }
.login-error {
  padding: 12px 16px;
  margin-bottom: 1.25rem;
  background: var(--red-light);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
}

/* =====================================================
   Animation
   ===================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.panel, .login-card, .intranet-hero { animation: rise .4s ease both; }
