/* ═══════════════════════════════════════════════
   MAIN.CSS — Global · Sidebar · Accueil
   Outils ARE — France Travail
   ═══════════════════════════════════════════════ */

/* ── Reset & Variables ──────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #060f24;
  --navy2:  #0c1e42;
  --violet: #7c3aed;
  --teal:   #0d9488;
  --green:  #16a34a;
  --amber:  #d97706;
  --red:    #dc2626;
  --blue:   #1756f8;
  --slate:  #475569;
  --slate2: #334155;
  --border: #e2e8f0;
  --surface:#f1f5f9;
  --white:  #ffffff;
  --text:   #0f172a;
  --text2:  #475569;
  --text3:  #94a3b8;
  /* Color extras used in panels */
  --violet-bg: #f5f3ff; --violet-lt: #ede9fe;
  --teal-bg:   #f0fdfa; --teal-lt:   #99f6e4;
  --green-bg:  #f0fdf4; --green-lt:  #bbf7d0;
  --amber-bg:  #fffbeb; --amber-lt:  #fde68a;
  --red-bg:    #fef2f2; --red-lt:    #fecaca;
  --blue-bg:   #eff6ff; --blue-lt:   #dbeafe;
  --r: 10px; --r-lg: 14px;
  --shadow: 0 1px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.14);
  --mono: 'DM Mono', 'Fira Code', monospace;
  /* Variants foncées */
  --violet-dk: #5b21b6;
}

/* ── Mode clair (light) ─────────────────────── */
[data-theme="light"] {
  --navy:   #f8fafc;
  --navy2:  #e2e8f0;
  --border: #cbd5e1;
  --surface:#f1f5f9;
  --white:  #ffffff;
  --text:   #0f172a;
  --text2:  #334155;
  --text3:  #64748b;
}
/* Sidebar en mode clair */
[data-theme="light"] .spa-sidebar {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}
[data-theme="light"] .sb-logo { border-bottom-color: #e2e8f0; }
[data-theme="light"] .sb-logo-name { color: #0f172a; }
[data-theme="light"] .sb-logo-sub  { color: #94a3b8; }
[data-theme="light"] .sb-section-label { color: #94a3b8; }
[data-theme="light"] .sb-item:hover  { background: rgba(0,0,0,.05); }
[data-theme="light"] .sb-item.active { background: rgba(124,58,237,.08); }
[data-theme="light"] .sb-item-name  { color: #334155; }
[data-theme="light"] .sb-item.active .sb-item-name { color: #7c3aed; }
[data-theme="light"] .sb-item-desc  { color: #94a3b8; }
[data-theme="light"] .sb-footer { border-top-color: #e2e8f0; }
[data-theme="light"] .sb-footer p   { color: #94a3b8; }
[data-theme="light"] .sb-footer a   { color: #64748b; }
[data-theme="light"] .hamburger { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
[data-theme="light"] .sb-backdrop.show { background: rgba(0,0,0,.3); }

/* Toggle bouton */
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin: 6px 8px 0;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05); cursor: pointer;
  font-family: 'Sora', sans-serif; font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.55); transition: all .2s; width: calc(100% - 16px);
  text-align: left;
}
.theme-toggle:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); }
.theme-toggle .tt-icon { font-size: 15px; flex-shrink: 0; }
.theme-toggle .tt-label { flex: 1; }
.theme-toggle .tt-pill {
  width: 32px; height: 18px; border-radius: 9px;
  background: rgba(255,255,255,.15); position: relative; flex-shrink: 0;
  transition: background .2s;
}
.theme-toggle .tt-pill::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,.6); transition: all .2s;
}
[data-theme="light"] .theme-toggle {
  border-color: #e2e8f0; background: #fff;
  color: #475569; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
[data-theme="light"] .theme-toggle:hover { background: #f1f5f9; color: #334155; }
[data-theme="light"] .theme-toggle .tt-pill { background: #7c3aed; }
[data-theme="light"] .theme-toggle .tt-pill::after { left: calc(100% - 15px); background: #fff; }

/* ── Accueil : tuiles en mode clair ─────────── */
[data-theme="light"] #panel-home { background: #f1f5f9; }
[data-theme="light"] .hcard {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
[data-theme="light"] .hcard:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-3px);
}
[data-theme="light"] .hcard-name   { color: #0f172a; }
[data-theme="light"] .hcard-desc   { color: #64748b; }
[data-theme="light"] .hcard-arrow  { color: #94a3b8; }
[data-theme="light"] .hcard:hover .hcard-arrow { color: #475569; }
[data-theme="light"] .home-title   { color: #0f172a; }
[data-theme="light"] .home-sub     { color: #64748b; }
[data-theme="light"] .home-pill    {
  background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.1); color: #475569;
}
[data-theme="light"] .hstat-v { color: #0f172a; }
[data-theme="light"] .hstat-l { color: #94a3b8; }
[data-theme="light"] .hstat-div { background: rgba(0,0,0,.1); }

html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Sidebar ────────────────────────────────── */
.spa-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: var(--navy);
  display: flex; flex-direction: column;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.sb-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.sb-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--violet), var(--teal));
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: 0 4px 14px rgba(124,58,237,.4); flex-shrink: 0;
}
.sb-logo-name  { font-size: 13px; font-weight: 800; color: #fff; letter-spacing: -.2px; line-height: 1.2; }
.sb-logo-sub   { font-size: 9px; color: rgba(255,255,255,.35); font-weight: 500; letter-spacing: .03em; }
.sb-nav        { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sb-section-label {
  font-size: 9px; font-weight: 800; color: rgba(255,255,255,.3);
  letter-spacing: .14em; text-transform: uppercase; padding: 8px 10px 4px;
}
[data-theme="light"] .sb-section-label { color: #94a3b8; }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 10px; cursor: pointer; border: none; background: transparent;
  width: 100%; text-align: left; transition: all .18s; margin-bottom: 2px; position: relative;
}
.sb-item:hover  { background: rgba(255,255,255,.07); }
.sb-item.active { background: rgba(255,255,255,.1); }
.sb-item.active::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--violet);
}
.sb-item-icon  { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.sb-item-name  { font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,.72); line-height: 1.3; }
.sb-item.active .sb-item-name { color: #fff; }
.sb-item-desc  { font-size: 9.5px; color: rgba(255,255,255,.32); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-badge      { font-size: 8px; font-weight: 800; padding: 2px 6px; border-radius: 20px; flex-shrink: 0; }
.sb-footer     { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); }
.sb-footer p   { font-size: 9px; color: rgba(255,255,255,.2); line-height: 1.65; }
.sb-footer a   { color: rgba(255,255,255,.38); text-decoration: none; }

/* ── Hamburger / Mobile ─────────────────────── */
.hamburger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 200;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy); border: 1px solid rgba(255,255,255,.15);
  color: #fff; font-size: 16px; cursor: pointer;
  align-items: center; justify-content: center;
}
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

/* ── Layout principal ───────────────────────── */
.spa-main {
  margin-left: 240px; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s; overflow-y: auto;
}
.tool-panel          { display: none; flex: 1; background: var(--surface); }
.tool-panel.active   { display: block; }
.tool-panel .header,
.tool-panel .hdr     { position: relative !important; top: auto !important; }
.tool-panel .toolbar { position: sticky !important; top: 0; z-index: 50; }

/* ── Panel Accueil ──────────────────────────── */
#panel-home {
  flex: 1; background: var(--navy);
  position: relative; overflow: hidden; min-height: 100vh;
}
.home-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 5% 95%, rgba(124,58,237,.5) 0%, transparent 55%),
    radial-gradient(ellipse 55% 65% at 98% 5%, rgba(13,148,136,.35) 0%, transparent 50%),
    radial-gradient(ellipse 40% 60% at 55% 50%, rgba(23,86,248,.15) 0%, transparent 60%);
}
.home-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 20%, transparent 75%);
}
.home-inner {
  position: relative; z-index: 2; max-width: 820px; margin: 0 auto;
  padding: 80px 40px 100px; display: flex; flex-direction: column;
  align-items: center; text-align: center;
}
.home-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px; padding: 5px 16px; color: rgba(255,255,255,.7);
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 26px; animation: fadeUp .5s ease both;
}
.home-dot {
  width: 6px; height: 6px; background: #a78bfa;
  border-radius: 50%; animation: blink-dot 2s infinite;
}
@keyframes blink-dot { 0%,100%{opacity:1} 50%{opacity:.2} }

.home-title {
  font-size: clamp(30px,5vw,58px); font-weight: 900; color: #fff;
  letter-spacing: -2px; line-height: 1.08; margin-bottom: 16px;
  animation: fadeUp .5s .08s ease both;
}
.home-title .grad {
  background: linear-gradient(120deg, #c4b5fd, #34d399, #93c5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.home-sub {
  font-size: clamp(13px,1.8vw,16px); color: rgba(255,255,255,.5); line-height: 1.8;
  max-width: 500px; margin: 0 auto 44px; animation: fadeUp .5s .16s ease both;
}
.home-stats {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  justify-content: center; margin-bottom: 56px; animation: fadeUp .5s .24s ease both;
}
.hstat       { text-align: center; }
.hstat-v     { font-size: clamp(22px,3vw,32px); font-weight: 900; color: #fff; letter-spacing: -1px; line-height: 1; }
.hstat-l     { font-size: 10px; color: rgba(255,255,255,.35); margin-top: 3px; font-weight: 500; letter-spacing: .05em; }
.hstat-div   { width: 1px; height: 32px; background: rgba(255,255,255,.1); }
.home-cards  {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 14px;
  width: 100%; max-width: 820px; animation: fadeUp .5s .32s ease both;
}
.hcard {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 18px; cursor: pointer; text-align: left;
  transition: all .22s cubic-bezier(.22,1,.36,1); backdrop-filter: blur(8px);
}
.hcard:hover       { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); transform: translateY(-3px); }
.hcard-top         { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hcard-icon        { font-size: 20px; }
.hcard-arrow       { color: rgba(255,255,255,.3); font-size: 13px; transition: all .2s; }
.hcard:hover .hcard-arrow { color: #fff; transform: translateX(3px); }
.hcard-name        { font-size: 12.5px; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 3px; }
.hcard-desc        { font-size: 10.5px; color: rgba(255,255,255,.42); line-height: 1.55; }
.hcard-badge       { display: inline-block; font-size: 8.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-top: 9px; letter-spacing: .05em; }

@keyframes fadeUp { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .spa-sidebar          { transform: translateX(-100%); }
  .spa-sidebar.open     { transform: translateX(0); }
  .spa-main             { margin-left: 0; }
  .hamburger            { display: flex; }
  .sb-backdrop.show     { display: block; }
  .home-inner           { padding: 56px 20px 72px; }
  .home-cards           { grid-template-columns: 1fr 1fr; }
}
