* { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --navy:        #202a39;
    --navy-light:  #2d3d52;
    --navy-dark:   #161f2b;
    --gold:        #9b8569;
    --gold-light:  #b8a080;
    --gold-dark:   #7d6a52;
    --cream:       #fef9f0;
    --cream-dark:  #f0e8d8;
    --bg:          #f2ede6;
    --card:        #ffffff;
    --primary:     #202a39;
    --primary-dark:#161f2b;
    --accent:      #9b8569;
    --danger:      #b03a2e;
    --success:     #2e7d52;
    --text:        #1a1a1a;
    --muted:       #6b6356;
    --border:      #d8d0c4;
    --shadow:      0 2px 10px rgba(32,42,57,.12);
    --radius:      8px;
  }

  /* ── BODY ── */
  body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
  }

  /* ── FILIGRANE logo unique centré pleine page ── */
  body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80vw, 80vh);
    height: min(80vw, 80vh);
    background-image: url('static/logo_watermark_couleur.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    filter: none;
  }

  /* Tout le contenu au-dessus du filigrane */
  nav { position: relative; z-index: 200; }
  .container { position: relative; z-index: 1; }

  /* ══════════════════════
     HEADER / NAV — grand
  ══════════════════════ */
  nav {
    background: var(--navy);
    color: var(--cream);
    padding: 0 40px;
    display: flex;
    align-items: center;
    height: 116px;
    gap: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    border-bottom: 4px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 200;
    overflow: hidden;
  }

  /* Reflet doré subtil */
  nav::after {
    content: '';
    position: absolute;
    bottom: 4px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent 5%, rgba(184,160,128,.5) 30%, var(--gold-light) 50%, rgba(184,160,128,.5) 70%, transparent 95%);
    pointer-events: none;
  }

  /* Texture grain subtile sur le header */
  nav::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='none'/%3E%3Ccircle cx='1' cy='1' r='.5' fill='rgba(255,255,255,.03)'/%3E%3C/svg%3E");
    pointer-events: none;
  }

  .nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
  }
  .nav-logo img {
    height: 96px;
    width: auto;
    filter: none;
    transition: transform .25s ease, filter .25s;
  }
  .nav-logo:hover img {
    transform: scale(1.06);
    filter: none;
  }

  .nav-divider {
    width: 1px;
    height: 72px;
    background: linear-gradient(to bottom, transparent, rgba(155,133,105,.7), transparent);
    flex-shrink: 0;
    position: relative; z-index: 1;
  }

  .nav-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative; z-index: 1;
  }
  .nav-title-main {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--cream);
    letter-spacing: .4px;
    line-height: 1.15;
    text-shadow: 0 1px 6px rgba(0,0,0,.3);
  }
  .nav-title-sub {
    font-size: .72rem;
    color: var(--gold-light);
    letter-spacing: 4.5px;
    text-transform: uppercase;
    line-height: 1;
    opacity: .9;
  }

  .nav-link {
    color: rgba(254,249,240,.78);
    text-decoration: none;
    font-size: .92rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all .18s;
    font-weight: 600;
    white-space: nowrap;
    position: relative; z-index: 1;
  }
  .nav-link:hover {
    color: var(--cream);
    background: rgba(155,133,105,.28);
  }

  .nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative; z-index: 1;
  }

  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .86rem;
    color: rgba(254,249,240,.55);
    position: relative; z-index: 1;
  }
  .breadcrumb a { color: rgba(254,249,240,.82); text-decoration: none; font-weight: 600; }
  .breadcrumb a:hover { color: var(--gold-light); }
  .breadcrumb span { color: var(--gold-light); }

  .nav-version {
    font-size: .75rem;
    color: var(--gold-light);
    background: rgba(155,133,105,.18);
    border: 1px solid rgba(155,133,105,.42);
    border-radius: 20px;
    padding: 5px 14px;
    letter-spacing: .5px;
    font-weight: 700;
    white-space: nowrap;
  }

  /* ── LAYOUT ── */
  .container { max-width: none; margin: 0 auto; padding: 28px 32px; }
  .page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
    padding-bottom: 14px; border-bottom: 2px solid var(--cream-dark);
  }
  .page-title { font-size: 1.45rem; font-weight: 700; color: var(--navy); display: flex; align-items: baseline; gap: 10px; }
  .page-title small { font-size: .82rem; color: var(--muted); font-weight: 400; }

  /* ── CARDS ── */
  .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; border: 1px solid var(--border); }

  /* ── BUTTONS ── */
  .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 6px; border: none; cursor: pointer; font-size: .875rem; font-weight: 700; text-decoration: none; transition: all .15s; white-space: nowrap; font-family: inherit; }
  .btn-primary { background: var(--navy); color: var(--cream); }
  .btn-primary:hover { background: var(--navy-light); box-shadow: 0 3px 8px rgba(32,42,57,.25); }
  .btn-accent, .btn-gold { background: var(--gold); color: #fff; }
  .btn-accent:hover, .btn-gold:hover { background: var(--gold-dark); box-shadow: 0 3px 8px rgba(155,133,105,.3); }
  .btn-success { background: var(--success); color: #fff; }
  .btn-success:hover { background: #235e3e; }
  .btn-danger { background: var(--danger); color: #fff; }
  .btn-danger:hover { background: #8e2d22; }
  .btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
  .btn-ghost:hover { background: var(--navy); color: var(--cream); }
  .btn-sm { padding: 5px 12px; font-size: .8rem; }

  /* ── FORMS ── */
  .form-grid { display: grid; gap: 20px; }
  .form-section { border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  .form-section-header { background: var(--navy); color: var(--cream); padding: 10px 16px; font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; letter-spacing: .3px; }
  .form-section-body { padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .form-section-body.hidden { display: none; }
  .form-group { display: flex; flex-direction: column; gap: 4px; }
  .form-group label { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
  .form-group input, .form-group select { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: .9rem; color: var(--text); background: #fff; transition: border-color .15s; width: 100%; font-family: inherit; }
  .form-group input:focus, .form-group select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(155,133,105,.15); }
  .form-group .hint { font-size: .75rem; color: var(--muted); }

  /* ── TABLES ── */
  .table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
  table { width: 100%; border-collapse: collapse; background: var(--card); }
  th { background: var(--navy); color: var(--cream); padding: 10px 14px; text-align: left; font-size: .76rem; font-weight: 700; white-space: nowrap; letter-spacing: .6px; text-transform: uppercase; }
  td { padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: var(--cream); }
  .badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .73rem; font-weight: 700; letter-spacing: .3px; }
  .badge-blue { background: #dbe8f5; color: var(--navy); }
  .badge-green { background: #d4eddf; color: #1a5e36; }
  .badge-gold { background: #f0e8d8; color: var(--gold-dark); }
  .badge-orange { background: #f0e8d8; color: var(--gold-dark); }

  /* ── ALERTS ── */
  .alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .875rem; }
  .alert-info { background: #e8f0f8; color: var(--navy); border-left: 4px solid var(--gold); }

  /* ── UTILS ── */
  .flex { display: flex; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
  .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
  .text-muted { color: var(--muted); }
  .empty-state { text-align: center; padding: 56px 24px; color: var(--muted); }
  .empty-state .icon { font-size: 2.8rem; margin-bottom: 14px; opacity: .5; }
  .empty-state p { font-size: .95rem; margin-top: 8px; }

  @media (max-width: 768px) {
    nav { height: 80px; padding: 0 16px; gap: 14px; }
    .nav-logo img { height: 66px; }
    .nav-title-main { font-size: 1rem; }
    .nav-title-sub { display: none; }
    .page-header { flex-direction: column; align-items: flex-start; }
  }
  @media (max-width: 480px) {
    body::before { width: 360px; height: 360px; }
  }


/* ══════════════════════
   SIDEBAR HUB (comme le hub local)
══════════════════════ */
body.has-sidebar { padding-left: 237px; }
.hub-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 237px; z-index: 300;
  background: var(--navy-dark); color: var(--cream);
  display: flex; flex-direction: column; padding: 18px 0;
  border-right: 1px solid rgba(155,133,105,.25);
}
.hub-sidebar .sb-title {
  font-size: .68rem; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(254,249,240,.45); padding: 14px 22px 8px; font-weight: 700;
}
.hub-sidebar a.sb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; margin: 1px 10px; border-radius: 8px;
  color: rgba(254,249,240,.85); text-decoration: none;
  font-size: .9rem; font-weight: 600; transition: background .15s;
}
.hub-sidebar a.sb-item:hover { background: rgba(155,133,105,.22); }
.hub-sidebar a.sb-item.active {
  background: rgba(155,133,105,.28); color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
.hub-sidebar a.sb-item.disabled { opacity: .5; cursor: default; pointer-events: none; }
.hub-sidebar .sb-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: rgba(254,249,240,.35); }
.hub-sidebar .sb-badge {
  margin-left: auto; font-size: .62rem; letter-spacing: 1px; text-transform: uppercase;
  background: rgba(254,249,240,.14); border-radius: 12px; padding: 2px 9px; color: rgba(254,249,240,.6);
}
.hub-sidebar .sb-foot { margin-top: auto; padding: 14px 22px; font-size: .72rem; color: rgba(254,249,240,.4); }
.hub-sidebar .sb-foot a { color: var(--gold-light); text-decoration: none; }
@media (max-width: 980px) {
  body.has-sidebar { padding-left: 0; }
  .hub-sidebar { display: none; }
}
