/* =====================================================================
   USSS — San Andreas Field Office
   ===================================================================== */
:root {
  --bg: #0a101c;
  --bg-2: #0e1626;
  --panel: #121b2d;
  --panel-2: #172238;
  --line: #233150;
  --line-soft: #1b2741;
  --text: #e6e9ef;
  --muted: #8f9bb3;
  --gold: #c9a24a;
  --gold-2: #e3c06e;
  --gold-soft: rgba(201, 162, 74, .12);
  --blue: #3b82f6;
  --ok: #2fb67c;
  --warn: #e0a526;
  --danger: #e2545a;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Oswald', 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 600; letter-spacing: .02em; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 2rem; } h2 { font-size: 1.55rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.gold { color: var(--gold); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.emblem { color: var(--gold); flex: none; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: 600 .92rem var(--font);
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: #fff; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1405; border-color: transparent; }
.btn-gold:hover { filter: brightness(1.08); color: #000; }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(226, 84, 90, .15); border-color: rgba(226, 84, 90, .5); color: #ffb3b6; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ok { background: rgba(47, 182, 124, .15); border-color: rgba(47, 182, 124, .5); color: #9be8c5; }
.btn-ok:hover { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.inline { display: inline; }

/* ---------- Alertes & badges ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; border: 1px solid; font-weight: 500; }
.alert-success, .alert-ok { background: rgba(47, 182, 124, .1); border-color: rgba(47, 182, 124, .4); color: #a6ecca; }
.alert-error, .alert-danger { background: rgba(226, 84, 90, .1); border-color: rgba(226, 84, 90, .45); color: #ffc0c3; }
.alert-warn { background: rgba(224, 165, 38, .1); border-color: rgba(224, 165, 38, .45); color: #f5d795; }
.alert-info { background: rgba(59, 130, 246, .1); border-color: rgba(59, 130, 246, .4); color: #bcd4ff; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; border: 1px solid; white-space: nowrap; }
.badge-ok { color: #8fe3bd; border-color: rgba(47, 182, 124, .5); background: rgba(47, 182, 124, .1); }
.badge-warn { color: #f3cf7f; border-color: rgba(224, 165, 38, .5); background: rgba(224, 165, 38, .1); }
.badge-danger { color: #ffadb1; border-color: rgba(226, 84, 90, .5); background: rgba(226, 84, 90, .1); }
.badge-gold { color: var(--gold-2); border-color: rgba(201, 162, 74, .5); background: var(--gold-soft); }
.badge-neutral { color: var(--muted); border-color: var(--line); background: var(--panel-2); }
.badge-blue { color: #a9c8ff; border-color: rgba(59, 130, 246, .5); background: rgba(59, 130, 246, .1); }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 6px; color: #cdd3df; }
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font: inherit; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; vertical-align: -3px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.req { color: var(--danger); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: flex-end; }
.filters > * { width: auto; }
.filters input, .filters select { min-width: 160px; }

/* ---------- Cartes & tableaux ---------- */
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title h2, .card-title h3 { margin: 0; }
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; }
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font: 600 1.9rem var(--font-title); margin-top: 4px; }
.stat-sub { font-size: .82rem; color: var(--muted); }
.progress { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 99px; }
.progress.ok > span { background: var(--ok); }
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; }
.prose { white-space: normal; }
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.pager a.active, .pager a:hover { border-color: var(--gold); color: var(--gold-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.active, .tabs a:hover { color: var(--gold-2); border-bottom-color: var(--gold); }
details.box { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 14px; margin-top: 10px; }
details.box summary { cursor: pointer; font-weight: 600; }

/* =====================================================================
   SITE PUBLIC
   ===================================================================== */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(10, 16, 28, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font: 600 1.05rem var(--font-title); letter-spacing: .06em; text-transform: uppercase; }
.brand small { color: var(--muted); font-size: .75rem; }
.mainnav { display: flex; align-items: center; gap: 26px; }
.mainnav > a:not(.btn) { color: #c8cfdc; font-weight: 500; font-size: .93rem; position: relative; }
.mainnav > a:not(.btn).active, .mainnav > a:not(.btn):hover { color: var(--gold-2); }
.mainnav > a:not(.btn).active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -25px; height: 2px; background: var(--gold); }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }
.public-main { min-height: calc(100vh - 72px - 120px); padding-bottom: 40px; }
.public-main > .wrap:first-child .alert { margin-top: 20px; }

.hero {
  position: relative; overflow: hidden; padding: 110px 0 100px; border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(201, 162, 74, .16), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(59, 130, 246, .12), transparent 60%),
    linear-gradient(180deg, #0c1424, var(--bg));
}
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 60px 60px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; font: 600 .78rem var(--font); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 18px; }
.hero h1 span { color: var(--gold-2); }
.hero p.lead { font-size: 1.1rem; color: #c3cad8; max-width: 580px; }
.hero .row { margin-top: 28px; }
.hero-emblem { display: flex; justify-content: center; }
.hero-emblem .emblem { width: min(320px, 70vw); height: auto; filter: drop-shadow(0 0 40px rgba(201, 162, 74, .25)); }

.section { padding: 70px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: 2rem; text-transform: uppercase; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; transition: .2s; }
.feature:hover { border-color: rgba(201, 162, 74, .45); transform: translateY(-2px); }
.feature .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); margin-bottom: 14px; font: 600 1rem var(--font-title); }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.values div { background: var(--panel); padding: 26px 20px; text-align: center; }
.values strong { display: block; font: 600 1.2rem var(--font-title); text-transform: uppercase; color: var(--gold-2); letter-spacing: .08em; }
.values span { color: var(--muted); font-size: .88rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.quote { border-left: 3px solid var(--gold); padding: 6px 0 6px 20px; color: #c9d0dd; font-size: 1.05rem; }
.cta { text-align: center; background: linear-gradient(135deg, rgba(201, 162, 74, .14), rgba(59, 130, 246, .08)); border: 1px solid rgba(201, 162, 74, .3); border-radius: 14px; padding: 46px 24px; }
.cta h2 { text-transform: uppercase; }

/* Organigramme */
.hierarchy { display: grid; gap: 18px; }
.tier { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px; }
.tier-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tier-head h3 { margin: 0; text-transform: uppercase; }
.ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.rank { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 14px; }
.rank b { display: block; color: #fff; }
.rank small { color: var(--gold); font-weight: 600; letter-spacing: .08em; }
.rank p { margin: 6px 0 0; color: var(--muted); font-size: .87rem; }
.office { margin-bottom: 28px; }
.office h3 { color: var(--gold-2); text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.divs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.div-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; }
.div-card .code { font: 600 1.3rem var(--font-title); color: var(--gold-2); letter-spacing: .06em; }
.div-card .name { font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.div-card p { color: var(--muted); font-size: .88rem; margin: 0; }

/* Règlement */
.reg-layout { display: grid; grid-template-columns: 270px 1fr; gap: 34px; align-items: start; padding-top: 40px; }
.reg-toc { position: sticky; top: 92px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; max-height: calc(100vh - 110px); overflow: auto; }
.reg-toc a { display: block; padding: 6px 10px; border-radius: 6px; color: #c3cad8; font-size: .88rem; }
.reg-toc a:hover, .reg-toc a.active { background: var(--gold-soft); color: var(--gold-2); }
.reg-toc a b { color: var(--gold); margin-right: 6px; }
.reg-search { margin-bottom: 12px; }
.article { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 26px; margin-bottom: 22px; scroll-margin-top: 92px; }
.article-head { display: flex; gap: 14px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.article-num { font: 600 .8rem var(--font); letter-spacing: .2em; color: var(--gold); text-transform: uppercase; }
.article-head h2 { margin: 0; text-transform: uppercase; }
.rule { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.rule:last-child { border-bottom: 0; }
.rule-ref { font: 600 .82rem var(--font); color: var(--gold-2); padding-top: 2px; }
.rule-body p:last-child, .rule-body ul:last-child { margin-bottom: 0; }
.rule-body ul { margin: 6px 0 10px; padding-left: 20px; }
.rule.hidden { display: none; }
.rule mark { background: rgba(201, 162, 74, .35); color: #fff; border-radius: 3px; padding: 0 2px; }
.reg-sub { margin: 20px 0 10px; color: var(--gold-2); font-size: 1rem; text-transform: uppercase; }
.note { background: var(--panel-2); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 0 6px 6px 0; color: #c9d0dd; font-size: .9rem; margin: 10px 0; }
.page-hero { padding: 60px 0 40px; border-bottom: 1px solid var(--line-soft); background: radial-gradient(700px 300px at 85% 0, rgba(201, 162, 74, .12), transparent 60%), var(--bg-2); }
.page-hero h1 { text-transform: uppercase; font-size: 2.4rem; }
.page-hero p { color: var(--muted); max-width: 680px; margin: 0; }

/* Login */
.auth { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 34px; box-shadow: var(--shadow); }
.auth-card .emblem { display: block; margin: 0 auto 16px; }
.auth-card h1 { text-align: center; font-size: 1.5rem; text-transform: uppercase; }

.footer { border-top: 1px solid var(--line-soft); background: var(--bg-2); padding: 30px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer p { margin: 0; }

/* =====================================================================
   INTRANET
   ===================================================================== */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line-soft); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 0 6px 16px; border-bottom: 1px solid var(--line-soft); }
.sidebar .brand strong { font-size: .95rem; }
.me { margin: 16px 6px; padding: 12px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; }
.me-name { font-weight: 600; }
.me-grade { font-size: .8rem; color: var(--gold); }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: #5f6d8a; margin: 16px 10px 6px; font-weight: 700; }
.sidenav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 7px; color: #c0c8d6; font-size: .9rem; font-weight: 500; }
.sidenav a:hover { background: var(--panel); color: #fff; }
.sidenav a.active { background: var(--gold-soft); color: var(--gold-2); }
.count { font-style: normal; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.content { min-width: 0; }
.content-top { display: flex; align-items: center; gap: 16px; padding: 18px 30px; border-bottom: 1px solid var(--line-soft); background: rgba(10, 16, 28, .9); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.content-top h1 { margin: 0; font-size: 1.4rem; flex: 1; text-transform: uppercase; }
.content-body { padding: 26px 30px 60px; max-width: 1300px; }
.duty { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; font-size: .82rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.duty i { width: 9px; height: 9px; border-radius: 50%; background: #5f6d8a; }
.duty.on { color: #9be8c5; border-color: rgba(47, 182, 124, .45); }
.duty.on i { background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 182, 124, .2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(47, 182, 124, 0); } }
.big-clock { font: 600 3rem var(--font-title); letter-spacing: .05em; }
.annonce { border-left: 3px solid var(--gold); padding: 4px 0 4px 16px; margin-bottom: 18px; }
.annonce h3 { margin-bottom: 4px; }
.annonce .meta { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 980px) {
  .hero-inner, .split, .grid-main { grid-template-columns: 1fr; }
  .hero-emblem { display: none; }
  .values { grid-template-columns: repeat(2, 1fr); }
  .reg-layout { grid-template-columns: 1fr; }
  .reg-toc { position: static; max-height: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 100; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .content-top .burger { display: block; }
}
@media (max-width: 820px) {
  .burger { display: block; }
  .mainnav { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; display: none; }
  .mainnav.open { display: flex; }
  .mainnav > a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .mainnav > a:not(.btn).active::after { display: none; }
  .mainnav .btn { margin-top: 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 6px; }
  .content-body { padding: 20px 16px 50px; }
  .content-top { padding: 14px 16px; }
  .content-top h1 { font-size: 1.1rem; }
  .rule { grid-template-columns: 1fr; gap: 2px; }
  .hero { padding: 70px 0 60px; }
  .section { padding: 50px 0; }
}
@media (max-width: 480px) {
  .values { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .duty { font-size: 0; padding: 8px; }
  .duty i { margin: 0; }
}

/* ---------- Impression ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .footer, .reg-toc, .sidebar, .content-top, .btn, .page-hero, .burger { display: none !important; }
  .shell, .reg-layout { display: block; padding: 0; }
  .card, .article { background: #fff; border: 1px solid #ccc; color: #000; break-inside: avoid; }
  .muted, .rule-ref, .article-num, .gold { color: #333 !important; }
  th { background: #eee; color: #000; }
  a { color: #000; }
}
