/* ============================================================
   ATOME - styles globaux (v0.9.2)
   Fond 100% blanc + vrais onglets style classeur
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-0: #ffffff;
  --bg-1: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --accent: #f06e0a;
  --accent-light: #38bdf8;
  --accent-dark: #c2410c;
  --warn: #d97706;
  --danger: #dc2626;
  --ok: #16a34a;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --card-bg: #ffffff;
  --input-bg: #ffffff;
}

html, body { height: 100%; background: #ffffff; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; background: #ffffff; }
a { color: inherit; }

/* ============================================================ NAVBAR */
.nav {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}
.brand {
  display: flex; align-items: center; gap: 0.65rem;
  color: var(--text); text-decoration: none;
  font-weight: 800; letter-spacing: 0.18em; font-size: 0.95rem;
}
.brand-icon { width: 28px; height: 28px; color: var(--accent); }
.nav-meta {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.88rem; color: var(--text-muted);
}
.nav-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--text-muted); text-decoration: none;
  padding: 0.5rem 0.85rem; border-radius: 6px;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link.primary { color: white; background: var(--accent); font-weight: 600; }
.nav-link.primary:hover { background: var(--accent-dark); color: white; }
.nav-meta-info {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--text-muted); font-size: 0.85rem;
}
.nav-meta-info .dot { opacity: 0.4; }

/* ============================================================ VRAIS ONGLETS (style classeur)
   Le conteneur a une bordure basse continue.
   Les tabs sont assis dessus. L'actif "casse" la bordure (pour fusionner avec le contenu blanc en dessous).
   ============================================================ */
/* Barre d'onglets des modules (gescom, compta, finance, caisse, etc.)
   Theme sombre coherent avec la nav du haut. */
.module-tabs {
  display: flex; gap: 0;
  padding: 0 1.5rem;
  background: linear-gradient(180deg, #152042 0%, #0a1428 100%);
  border-bottom: 1px solid rgba(240,110,10,.25);  /* liseré orange brand */
  position: sticky; top: 0; z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.module-tabs .tab {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: #f1f5f9 !important;       /* blanc casse, tres lisible sur fond sombre */
  font-size: 0.92rem;
  font-weight: 600;                /* plus gras pour mieux ressortir */
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-right: 4px;
  margin-bottom: -1px;
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.module-tabs .tab i { font-size: 1rem; opacity: .9; }
.module-tabs .tab:hover {
  color: #ffffff !important;
  background: rgba(240,110,10,.18);   /* hover : teinte orange brand */
}
.module-tabs .tab.active {
  background: rgba(240,110,10,.18);
  border-color: rgba(240,110,10,.4);
  border-bottom-color: rgba(240,110,10,.18);
  color: #ffffff !important;
  font-weight: 600;
  z-index: 1;
}
.module-tabs .tab.active::after {
  /* Indicateur en haut du tab actif - orange brand */
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 2px;
  background: #f06e0a;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 0 8px rgba(240,110,10,.6);
}

/* ============================================================ FLASH */
.flash-zone {
  position: fixed; top: 5rem; right: 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 1000; max-width: 420px;
}
.flash {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.85rem 1rem; border-radius: 8px;
  border: 1px solid var(--border);
  background: white; color: var(--text);
  box-shadow: 0 4px 16px rgba(15,23,42,0.08);
  animation: slideIn 0.2s ease;
}
.flash i { font-size: 1.1rem; margin-top: 1px; }
.flash-success i { color: var(--ok); }
.flash-success { border-left: 3px solid var(--ok); }
.flash-danger i { color: var(--danger); }
.flash-danger { border-left: 3px solid var(--danger); }
.flash-warning i { color: var(--warn); }
.flash-warning { border-left: 3px solid var(--warn); }
.flash-info i { color: var(--accent); }
.flash-info { border-left: 3px solid var(--accent); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); max-height: 200px; margin-bottom: .5rem; padding-top: .85rem; padding-bottom: .85rem; }
  to   { opacity: 0; transform: translateX(20px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}
.flash-out { animation: slideOut 0.4s ease forwards; pointer-events: none; overflow: hidden; }
.flash-close {
  margin-left: auto; background: transparent; border: 0; color: inherit;
  font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .25rem;
  opacity: .55; transition: opacity .15s;
}
.flash-close:hover { opacity: 1; }

/* ============================================================ HERO (home) */
body.home main { display: flex; flex-direction: column; background: #ffffff; }
.hero {
  position: relative; z-index: 1;
  min-height: calc(100vh - 200px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1.5rem; background: #ffffff;
}
.atom { width: 240px; height: 240px; position: relative; margin-bottom: 2.5rem; perspective: 800px; }
.orbit { position: absolute; inset: 0; border: 1.5px solid rgba(240,110,10,0.4); border-radius: 50%; }
.orbit-1 { animation: spin1 4s linear infinite; }
.orbit-2 { animation: spin2 5.5s linear infinite; }
.orbit-3 { animation: spin3 7s linear infinite reverse; }
@keyframes spin1 { from { transform: rotateX(75deg) rotateZ(0); } to { transform: rotateX(75deg) rotateZ(360deg); } }
@keyframes spin2 { from { transform: rotateX(75deg) rotateY(60deg) rotateZ(0); } to { transform: rotateX(75deg) rotateY(60deg) rotateZ(360deg); } }
@keyframes spin3 { from { transform: rotateX(75deg) rotateY(-60deg) rotateZ(0); } to { transform: rotateX(75deg) rotateY(-60deg) rotateZ(360deg); } }
.electron {
  position: absolute; top: -7px; left: 50%;
  width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(240,110,10,0.4);
}
.nucleus {
  position: absolute; top: 50%; left: 50%;
  width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--accent-light) 50%, var(--accent-dark) 100%);
  box-shadow: 0 0 16px var(--accent), 0 0 32px rgba(56,189,248,0.4);
  transform: translate(-50%, -50%);
  animation: pulseNucleus 3s ease-in-out infinite;
}
@keyframes pulseNucleus {
  0%, 100% { box-shadow: 0 0 16px var(--accent), 0 0 32px rgba(56,189,248,0.4); }
  50%      { box-shadow: 0 0 24px var(--accent), 0 0 48px rgba(56,189,248,0.6); }
}
.title {
  font-size: clamp(4rem, 14vw, 9rem); font-weight: 900;
  letter-spacing: 0.18em; line-height: 1; margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 50%, var(--accent-light) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tagline {
  color: var(--text-muted); font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  letter-spacing: 0.05em; max-width: 560px; margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* ============================================================ HERO LOGIN */
.hero-login {
  display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
  width: 100%; max-width: 520px; margin-top: 1rem;
}
.hero-login input[type="text"] {
  flex: 1; min-width: 220px;
  padding: 0.85rem 1.25rem; border-radius: 999px;
  background: white; border: 1px solid var(--border-strong); color: var(--text);
  font-family: inherit; font-size: 1rem; letter-spacing: 0.05em;
  transition: all 0.15s;
}
.hero-login input[type="text"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.15);
}
@media (max-width: 600px) {
  .hero-login { flex-direction: column; }
  .hero-login button { width: 100%; justify-content: center; }
}

/* ============================================================ NEXT */
.next { padding: 5rem 1.5rem; display: flex; justify-content: center; background: #ffffff; }
.next-inner { max-width: 640px; text-align: center; }
.next h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1rem; }
.next p { color: var(--text-muted); line-height: 1.7; }

/* ============================================================ BUTTONS */
.btn-primary, .btn-ghost, .btn-ghost-sm {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.2rem; border-radius: 6px;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-primary.w-100 { width: 100%; justify-content: center; padding: 0.75rem 1.25rem; }
.btn-ghost { background: white; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--accent); }
.btn-ghost-sm {
  padding: 0.35rem 0.7rem; font-size: 0.83rem;
  background: white; color: var(--text-muted); border-color: var(--border);
}
.btn-ghost-sm:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-strong); }

.btn-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.8rem; border-radius: 999px;
  background: white; color: var(--text-muted);
  border: 1px solid var(--border); cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  transition: all 0.15s;
}
.btn-toggle:hover { color: var(--text); }
.btn-toggle.on { color: var(--ok); border-color: rgba(22,163,74,0.4); background: rgba(22,163,74,0.08); }
.btn-toggle i { font-size: 1.1rem; }

/* ============================================================ AUTH PAGES */
.auth-page {
  min-height: calc(100vh - 200px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem; background: #ffffff;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 2.25rem 2rem;
  box-shadow: 0 4px 20px rgba(15,23,42,0.06);
  text-align: center;
}
.auth-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(56,189,248,0.1); color: var(--accent-dark);
  font-size: 1.7rem; border: 1px solid rgba(56,189,248,0.25);
}
.auth-icon.admin { background: rgba(217,119,6,0.1); color: var(--warn); border-color: rgba(217,119,6,0.25); }
.auth-tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  background: rgba(56,189,248,0.1); color: var(--accent-dark);
  border: 1px solid rgba(56,189,248,0.25);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.auth-tag.admin { background: rgba(217,119,6,0.1); color: var(--warn); border-color: rgba(217,119,6,0.25); }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 0.4rem; }
.auth-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.75rem; }
.auth-foot { margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-link { color: var(--accent-dark); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ============================================================ FORMS */
.field { display: block; text-align: left; margin-bottom: 1rem; }
.field > span {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 0.35rem;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 0.6rem 0.8rem; border-radius: 6px;
  background: white; border: 1px solid var(--border-strong);
  color: var(--text); font-family: inherit; font-size: 0.93rem;
  transition: all 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
.field .hint { display: block; font-size: 0.78rem; color: var(--text-dim); margin-top: 0.4rem; line-height: 1.4; }

/* ============================================================ PAGE / CARDS */
.page { max-width: 1200px; margin: 0 auto; padding: 1.5rem; background: #ffffff; }
.page.narrow { max-width: 760px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.page-head h1 {
  font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 800;
  letter-spacing: -0.015em; margin: 0.25rem 0;
}
.kicker {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.7rem; border-radius: 999px;
  background: rgba(56,189,248,0.1); color: var(--accent-dark);
  border: 1px solid rgba(56,189,248,0.2);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
}
.muted { color: var(--text-muted); }
.muted.small { font-size: 0.85rem; }
.dot { opacity: 0.4; }

.card {
  background: white; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 1rem;
}
.card-head { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 0.95rem; font-weight: 700; }
.card-head p { font-size: 0.83rem; margin-top: 0.2rem; }
.card-body { padding: 1.1rem; }
.card-foot {
  padding: 0.7rem 1.1rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.5rem;
  background: var(--bg-2);
}

/* ============================================================ TABLE */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 0.6rem 0.9rem; text-align: left;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.table th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600;
  background: var(--bg-2);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-2); }

.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.1rem 0.5rem; border-radius: 999px;
  background: rgba(56,189,248,0.1); color: var(--accent-dark);
  border: 1px solid rgba(56,189,248,0.2);
  font-size: 0.72rem; font-weight: 600;
}

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.badge.ok { background: rgba(22,163,74,0.1); color: #15803d; border: 1px solid rgba(22,163,74,0.3); }
.badge.ko { background: rgba(220,38,38,0.1); color: #b91c1c; border: 1px solid rgba(220,38,38,0.3); }

/* ============================================================ METRICS */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem; margin-bottom: 1.25rem;
}
.metric {
  background: white; border: 1px solid var(--border);
  border-radius: 8px; padding: 0.85rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.metric-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px;
  background: rgba(56,189,248,0.1); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; border: 1px solid rgba(56,189,248,0.2);
}
.metric-val { font-size: 1.45rem; font-weight: 800; line-height: 1; }
.metric-lab { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.1rem; }

/* ============================================================ MODULES TILES */
.modules-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.module-card {
  background: white; border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: all 0.15s;
  text-decoration: none; color: inherit;
}
.module-card.is-active { border-color: rgba(56,189,248,0.3); }
.module-card.link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(240,110,10,0.1);
}
.module-card-head { display: flex; align-items: center; gap: 0.7rem; }
.module-card-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(56,189,248,0.1); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0; border: 1px solid rgba(56,189,248,0.2);
}
.module-cta {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.83rem; font-weight: 600; color: var(--accent-dark);
  margin-top: auto;
}

.empty { padding: 2rem 1.5rem; text-align: center; color: var(--text-muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.5; }
.empty p { margin: 0.3rem 0; }

.info-list {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem; font-size: 0.88rem;
}
.info-list dt { color: var(--text-muted); font-weight: 500; }
.info-list dd code {
  background: var(--bg-2); padding: 0.15rem 0.4rem;
  border-radius: 4px; font-size: 0.83rem;
}

/* ============================================================ FOOTER */
.footer {
  padding: 1rem 1.75rem; display: flex;
  justify-content: center; align-items: center; gap: 0.75rem;
  color: var(--text-dim); font-size: 0.8rem;
  border-top: 1px solid var(--border); background: #ffffff;
}
.footer-link { color: var(--text-dim); text-decoration: none; }
.footer-link:hover { color: var(--text-muted); }

/* ============================================================ 2FA */
.totp-input {
  font-size: 1.5rem !important;
  letter-spacing: 0.4em !important;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
}
.qr-box {
  display: flex; justify-content: center; align-items: center;
  background: white; padding: 1rem; border-radius: 12px; margin: 1rem 0;
  border: 1px solid var(--border-strong);
}
.qr-box svg { width: 220px; height: 220px; display: block; }
.totp-step { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 0; border-top: 1px solid var(--border); }
.totp-step:first-child { border-top: none; padding-top: 0; }
.totp-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: white; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.totp-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.totp-manual { margin-top: 0.5rem; font-size: 0.88rem; }
.totp-manual summary { cursor: pointer; color: var(--accent-dark); padding: 0.4rem 0; font-weight: 500; }
.totp-secret {
  display: block; padding: 0.6rem 0.85rem; margin-top: 0.4rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.88rem; word-break: break-all;
  font-family: ui-monospace, monospace; color: var(--accent-dark);
}
.totp-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.totp-status > div:first-child { display: flex; align-items: center; gap: 1rem; }

/* ============================================================ BANNERS */
.banner {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.1rem; border-radius: 8px;
  margin-bottom: 1.25rem; border: 1px solid var(--border);
  background: white; flex-wrap: wrap;
}
.banner > i { font-size: 1.4rem; flex-shrink: 0; }
.banner > div { flex: 1; min-width: 220px; }
.banner > div strong { display: block; margin-bottom: 0.1rem; }
.banner-warn { border-left: 3px solid var(--warn); }
.banner-warn > i { color: var(--warn); }

/* ============================================================ TEXT */
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.mt-3 { margin-top: 1rem; }
.w-100 { width: 100%; }

/* ============================================================ ECRITURES */
.lignes-table input {
  width: 100%; padding: 0.4rem 0.55rem; border-radius: 5px;
  background: white; border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 0.92rem;
}
.lignes-table input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56,189,248,0.15);
}
.lignes-table input.amt { text-align: right; font-family: ui-monospace, monospace; }
.lignes-table input.compte-input { font-family: ui-monospace, monospace; font-weight: 600; }

/* ============================================================ RESPONSIVE */
@media (max-width: 600px) {
  .nav { padding: 0.7rem 1rem; flex-wrap: wrap; }
  .nav-meta { gap: 0.4rem; }
  .nav-meta-info { display: none; }
  .module-tabs { padding: 0 0.85rem; overflow-x: auto; }
  .module-tabs .tab { padding: 0.55rem 0.85rem; font-size: 0.85rem; white-space: nowrap; }
  .atom { width: 180px; height: 180px; }
  .nucleus { width: 30px; height: 30px; }
  .auth-card { padding: 1.5rem 1.1rem; }
  .page { padding: 1rem 0.85rem; }
  .table th, .table td { padding: 0.45rem 0.6rem; font-size: 0.85rem; }
  .flash-zone { left: 1rem; right: 1rem; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .orbit, .nucleus, .flash { animation: none !important; }
}

/* ============================================================
   OVERRIDE COULEURS - banniere bleu marine Sogeplan, fond blanc
   ============================================================ */
body { background: #ffffff !important; }
main { background: #ffffff; }

.nav {
  background: #1e3a5f !important;
  border-bottom: 2px solid #2d5a9e !important;
  color: #ffffff !important;
}
.brand,
.brand:hover,
.brand:visited { color: #ffffff !important; }
.brand-icon { color: #ffffff !important; }

.nav-meta,
.nav-meta-info,
.nav-meta-info .dot { color: #cbd5e1 !important; }

.nav-link {
  color: #ffffff !important;
}
.nav-link:hover {
  color: #ffffff !important;
  background: rgba(255,255,255,0.12) !important;
}
.nav-link.primary {
  background: #ffffff !important;
  color: #1e3a5f !important;
}
.nav-link.primary:hover {
  background: #f1f5f9 !important;
  color: #1e3a5f !important;
}

/* Force fond blanc sur toute la page (sauf .nav qui est bleu) */
html, body, main, .footer, .page, section.page, section.narrow {
  background: #ffffff !important;
}

/* Affiner la hauteur de la navbar bleue */
.nav { padding: 0.45rem 1.5rem !important; }
.brand { font-size: 0.85rem !important; }
.brand-icon { width: 22px !important; height: 22px !important; }
.nav-link { padding: 0.35rem 0.7rem !important; font-size: 0.85rem !important; }
.nav-meta-info { font-size: 0.8rem !important; }

/* Affiner les onglets de modules (Atome) */
.module-tabs .tab {
  padding: 0.45rem 0.95rem !important;
  font-size: 0.85rem !important;
}

/* ============================================================
   IDENTITE VISUELLE SOGEPLAN
   Bleu marine #1e3a5f partout (au lieu du bleu clair Atome)
   ============================================================ */
:root {
  --accent: #1e3a5f !important;
  --accent-light: #2d5a9e !important;
  --accent-dark: #152d4a !important;
}

/* Force la cohrerence sur les elements qui referencent ces couleurs en dur */
.orbit { border-color: rgba(30,58,95,0.4) !important; }
.electron {
  background: #1e3a5f !important;
  box-shadow: 0 0 8px #1e3a5f, 0 0 16px rgba(30,58,95,0.35) !important;
}
.nucleus {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #2d5a9e 50%, #152d4a 100%) !important;
  box-shadow: 0 0 16px #1e3a5f, 0 0 32px rgba(45,90,158,0.35) !important;
}
.brand-icon { color: #1e3a5f; }

/* Buttons primaire / accents en bleu marine */
.btn-primary {
  background: #1e3a5f !important;
  border-color: #1e3a5f !important;
  color: #ffffff !important;
}
.btn-primary:hover {
  background: #2d5a9e !important;
  border-color: #2d5a9e !important;
}

/* Focus inputs en bleu marine */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #1e3a5f !important;
  box-shadow: 0 0 0 3px rgba(30,58,95,0.15) !important;
}

/* Onglets module : repris dans la regle theme-sombre plus haut.
   On laisse vides pour ne pas ecraser. */
/* (anciennement override Sogeplan -> remplace par theme brand orange) */

/* Liens / metric icons */
a:not(.brand):not(.nav-link):not(.tab) { color: #1e3a5f; }
.metric-icon i { color: #1e3a5f !important; }

/* Card heads */
.card-head { background: #f8fafc; border-bottom: 1.5px solid #e2e8f0; }

/* Sur les pages Compta : la navbar haut est dorenavant la nav standard centralisee
   par base.html (Home + Logo + Societe + Module/Annee + Profil). L'ancien header
   custom integre dans le contenu a ete retire des pages compta. */
/* body.compta nav.nav { display: none !important; }   -- DESACTIVE */
body.compta main { padding-top: 0; }

/* ============================================================
   LOGO ATOME (SVG) — orbites fixes, electrons animes
   ============================================================ */
.atom-mini {
  width: 38px; height: 38px;
  display: inline-block; vertical-align: middle; flex-shrink: 0;
}
.kompta-atom {
  width: 130px; height: 130px;
  display: inline-block; vertical-align: middle;
  margin-right: 18px; flex-shrink: 0;
}
.kompta-name { display: inline-flex !important; align-items: center; }
a[title="Deconnexion"]:hover { background: rgba(220,38,38,0.08); }


/* ============================================================
   ONGLETS COMPTA — hover lift + fade-in panes
   ============================================================ */

/* Tabs principaux Compta (cpta-main-tabs) : hover lift */
.cpta-main-tab,
a[style*="border-radius:6px 6px 0 0"] {
  transition: transform .18s cubic-bezier(.4,0,.2,1),
              box-shadow .18s ease,
              background .18s ease,
              color .18s ease !important;
}
.cpta-main-tab:hover,
a[style*="border-radius:6px 6px 0 0"]:not([style*="background:#1e3a5f"]):hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 14px rgba(30,58,95,0.20) !important;
  background: #e0e7ff !important;
  color: #1e3a5f !important;
  z-index: 2;
  position: relative;
}

/* Tabs secondaires (sous-onglets) : meme effet plus discret */
.gl-tab, .ecr-tab, .am-tab, .param-tab, .param-group {
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease !important;
}
.gl-tab:hover, .ecr-tab:hover, .am-tab:hover, .param-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(30,58,95,0.12);
}

/* Fade-in des panes au switch */
@keyframes cptaFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gl-pane.active,
.ecr-pane.active,
.am-pane.active,
.param-pane.active,
.icoh-pane.active {
  animation: cptaFadeIn .25s ease-out;
}



/* ============================================================
   Layout : body en flex column, main remplit l'espace dispo
   pour que le contenu touche le footer en bas
   ============================================================ */
html, body { height: 100%; }
body {
  display: flex !important;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1 1 auto !important;
  display: flex;
  flex-direction: column;
}
main > section.page,
main > .page {
  flex: 1 1 auto;
  min-height: 100%;
}
.footer { flex-shrink: 0; }

/* ============================================================
   Barre des onglets Compta : sticky au top
   ============================================================ */
.cpta-main-tabs,
body.compta div[style*="border-bottom:2.5px solid #e2e8f0"][style*="display:flex"] {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background: #ffffff !important;
  margin-bottom: 1rem !important;
  padding-top: 0.4rem !important;
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.08);
}

/* Sur les sous-onglets ecritures aussi */
.ecr-tabbar, .gl-tabbar, .am-tabs, .param-tabs, .param-groups {
  position: sticky;
  top: 56px;  /* sous la barre principale */
  z-index: 90;
  background: #ffffff;
}

/* Sticky renforce des sous-onglets sur toutes les pages Compta */
.ecr-tabbar, .gl-tabbar, .am-tabs, .param-tabs, .param-groups,
.res-tabs, .res-tabs-bar, .icoh-tabs {
  position: sticky !important;
  top: 60px !important;  /* sous la barre principale (cpta-main-tabs) */
  z-index: 90 !important;
  background: #ffffff !important;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  box-shadow: 0 2px 4px rgba(30, 58, 95, 0.06);
}
