/* ============================================================
   Thème inspiré DashLite (Softnio) — overrides agressifs.
   Charge ce fichier APRÈS style.css + gestion.css dans base.html.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Palette DashLite */
  --bg:             #f5f6fa;
  --sidebar-bg:     #101924;
  --sidebar-hover:  #1c2b46;
  --sidebar-active: #6576ff;
  --sidebar-text:   #a3b1c2;
  --sidebar-sub:    #6e82a5;
  --primary:        #6576ff;
  --primary-dark:   #4d5ce5;
  --success:        #1ee0ac;
  --danger:         #e85347;
  --warning:        #f4bd0e;
  --info:           #09c2de;
  --card:           #ffffff;
  --border:         #dbdfea;
  --text:           #364a63;
  --muted:          #8094ae;
}

/* ---------- Typo ---------- */
body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-weight: 400;
  color: var(--text);
  background: #ebeef2;
}

/* ============================================================
   SIDEBAR — élargie, gradient subtil, section header design
   ============================================================ */
.sidebar {
  width: 260px !important;
  padding: 22px 14px !important;
  background: linear-gradient(180deg, #101924 0%, #0c1420 100%) !important;
  box-shadow: 1px 0 0 rgba(255,255,255,0.02) inset, 4px 0 24px rgba(0,0,0,0.04);
}
.side-head {
  flex-direction: column;
  align-items: flex-start !important;
  gap: 14px !important;
  padding: 6px 6px 22px !important;
  border-bottom: 1px solid #1c2b46 !important;
  margin-bottom: 16px !important;
}
.side-head > div { display: flex; flex-direction: column; gap: 2px; }
.avatar-big {
  width: 48px !important; height: 48px !important;
  background: linear-gradient(135deg, #6576ff 0%, #816bff 100%) !important;
  border-radius: 50% !important;
  font-size: 16px !important;
  box-shadow: 0 4px 12px rgba(101,118,255,0.4);
}
.side-title {
  font-weight: 800 !important;
  letter-spacing: 1px !important;
  font-size: 15px !important;
  color: #fff;
}
.side-sub {
  color: #6e82a5 !important;
  font-weight: 500 !important;
  font-size: 12px !important;
}

.side-section-title {
  color: #4f5d75 !important;
  font-size: 10px !important;
  letter-spacing: 1.4px !important;
  text-transform: uppercase;
  font-weight: 800 !important;
  padding: 18px 14px 8px !important;
}

.side-link, .side-act {
  border-radius: 6px !important;
  padding: 11px 14px !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  margin: 2px 0 !important;
  transition: all .2s ease !important;
  position: relative;
}
.side-link svg, .side-act svg { opacity: 0.7; transition: opacity .2s; }
.side-link:hover, .side-act:hover {
  background: rgba(101,118,255,0.08) !important;
  color: #fff !important;
}
.side-link:hover svg, .side-act:hover svg { opacity: 1; }
.side-link.active, .side-act.active {
  background: rgba(101,118,255,0.18) !important;
  color: #fff !important;
}
.side-link.active::before, .side-act.active::before {
  content: "";
  position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--sidebar-active);
}
.side-link.active svg, .side-act.active svg { opacity: 1; color: var(--sidebar-active); }

.side-foot { border-top: 1px solid #1c2b46; padding-top: 12px; margin-top: 16px; }

/* ============================================================
   MAIN AREA — décalée pour la sidebar 260px, fond gris clair
   ============================================================ */
.main-area {
  margin-left: 260px !important;
  padding: 32px 36px 60px !important;
  background: #ebeef2;
  min-height: 100vh;
}

/* ============================================================
   PAGE HEAD — vraie topbar de page
   ============================================================ */
.page-head {
  background: #fff;
  border-radius: 6px;
  padding: 22px 26px !important;
  margin-bottom: 22px !important;
  box-shadow: 0 0 12px 0 rgba(34,41,47,.05);
  border: 1px solid #e5e9f2;
}
.page-head h1 {
  font-weight: 800 !important;
  letter-spacing: -0.5px !important;
  color: #1f2b47 !important;
  font-size: 22px !important;
}
.page-head .sub {
  color: var(--muted) !important;
  font-weight: 500;
  font-size: 13px;
  margin-top: 2px;
}
.page-head .toolbar { gap: 8px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border-radius: 6px !important;
  border: 1px solid #e5e9f2 !important;
  box-shadow: 0 0 12px 0 rgba(34, 41, 47, 0.05);
  padding: 24px !important;
  margin-bottom: 18px;
}
.card h2 {
  color: #1f2b47;
  font-weight: 700;
  border-bottom: 1px solid #e5e9f2;
  padding-bottom: 12px;
  margin-bottom: 16px;
  font-size: 16px;
  letter-spacing: -0.2px;
}

/* ============================================================
   KPIs — gros chiffres + barre colorée
   ============================================================ */
.grid-kpi { gap: 18px !important; margin-bottom: 22px; }
.kpi {
  background: var(--card);
  border-radius: 6px !important;
  border: 1px solid #e5e9f2 !important;
  box-shadow: 0 0 12px 0 rgba(34, 41, 47, 0.05);
  padding: 22px 24px !important;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}
.kpi.positive::before { background: var(--success); }
.kpi.negative::before { background: var(--danger); }
.kpi .label {
  color: var(--muted) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.kpi .value {
  color: #1f2b47 !important;
  font-weight: 800 !important;
  font-size: 28px !important;
  margin-top: 6px !important;
  letter-spacing: -0.5px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  letter-spacing: 0.2px;
  padding: 9px 20px !important;
  font-size: 13px !important;
  transition: all .2s ease !important;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #6576ff 0%, #5b6ef5 100%) !important;
  border-color: #6576ff !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(101,118,255,0.30);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4d5ce5 0%, #4654d8 100%) !important;
  box-shadow: 0 6px 14px rgba(101,118,255,0.4);
}
.btn-ghost {
  background: #fff !important;
  border: 1px solid #dbdfea !important;
  color: var(--text) !important;
  box-shadow: 0 1px 2px rgba(34,41,47,0.04);
}
.btn-ghost:hover {
  background: #f5f6fa !important;
  border-color: #6576ff !important;
  color: var(--primary) !important;
}
.btn-danger {
  background: #e85347 !important;
  border-color: #e85347 !important;
  box-shadow: 0 2px 6px rgba(232,83,71,0.3);
}
.btn-danger:hover { background: #d83a2e !important; box-shadow: 0 6px 14px rgba(232,83,71,0.4); }
.btn-success { background: var(--success) !important; border-color: var(--success) !important; }
.btn-success:hover { background: #15c597 !important; border-color: #15c597 !important; }
.btn-sm { padding: 5px 12px !important; font-size: 11px !important; border-radius: 3px !important; }
.btn-lg { padding: 12px 26px !important; font-size: 14px !important; }

/* ============================================================
   TABLES
   ============================================================ */
table.data {
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}
table.data th {
  background: #f5f6fa !important;
  color: var(--muted) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.7px !important;
  text-transform: uppercase !important;
  border-bottom: 2px solid #e5e9f2 !important;
  padding: 14px 12px !important;
}
table.data td {
  border-bottom: 1px solid #e5e9f2 !important;
  font-size: 13px !important;
  padding: 14px 12px !important;
  color: var(--text);
}
table.data tbody tr:hover { background: #fafbfd !important; }
table.data tfoot td {
  background: #f5f6fa !important;
  font-weight: 800 !important;
  color: #1f2b47 !important;
  border-top: 2px solid #e5e9f2 !important;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  border-radius: 3px !important;
  padding: 4px 9px !important;
  font-weight: 800 !important;
  font-size: 10px !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase;
}
.badge-ok    { background: rgba(30,224,172,0.15) !important; color: #0f9c74 !important; }
.badge-warn  { background: rgba(244,189,14,0.15) !important; color: #b58807 !important; }
.badge-err   { background: rgba(232,83,71,0.15)  !important; color: #c0392b !important; }
.badge-info  { background: rgba(101,118,255,0.15) !important; color: var(--primary-dark) !important; }
.badge-muted { background: #f5f6fa !important; color: var(--muted) !important; }

/* ============================================================
   FORMS
   ============================================================ */
input, select, textarea {
  font-family: inherit !important;
  border-radius: 4px !important;
  border: 1px solid var(--border) !important;
  padding: 9px 13px !important;
  font-size: 13px !important;
  color: var(--text) !important;
  background: #fff !important;
  transition: all .15s ease !important;
}
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(101,118,255,0.15) !important;
}
label { color: var(--text); font-weight: 600; font-size: 13px; }

/* ============================================================
   HERO (page d'accueil)
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #6576ff 0%, #4d5ce5 100%) !important;
  border-radius: 6px !important;
  box-shadow: 0 6px 18px rgba(101,118,255,0.25);
}

/* ============================================================
   TOPBAR mobile + bottom nav
   ============================================================ */
.topbar-mobile { background: #101924 !important; }
.bottom-nav {
  background: #fff !important;
  box-shadow: 0 -4px 12px rgba(34,41,47,.06) !important;
  border-top: none !important;
}
.bnav-item.active { color: var(--primary) !important; }

/* ============================================================
   FLASH messages
   ============================================================ */
.flash {
  border-radius: 4px !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(34,41,47,.10);
  border-left: 4px solid;
}
.flash.success { border-color: var(--success); }
.flash.error { border-color: var(--danger); }
.flash.warning { border-color: var(--warning); }

/* ============================================================
   POINTAGE counter
   ============================================================ */
.pointage-counter {
  background: linear-gradient(135deg, #6576ff 0%, #4d5ce5 100%) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(101,118,255,0.3);
}

/* ============================================================
   Mobile : sidebar pleine largeur, plus de margin-left
   ============================================================ */
@media (max-width: 900px) {
  .main-area {
    margin-left: 0 !important;
    padding: 16px !important;
    padding-bottom: 90px !important;
  }
  .page-head { padding: 16px 18px !important; }
  .card { padding: 18px !important; }
}
