/* ═══════════════════════════════════════════════════════════════
   GRID-TASK 2.0 — Thème clair
   Chargé automatiquement en dernier dans toutes les pages (adm/security.php)
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg: #f4f5f7; --sidebar: #f4f5f7; --card: #ffffff; --text: #0b0f19; --ink-2: #3f4652; --muted: #5f6673;
  --border: #e8e9ec; --line: #f1f2f4; --card2: #f7f8fa; --purple: #7e22ce; --success: #067647; --danger: #b42318; --warn: #b45309;
  --dark: #111827; --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05);
  --ring: 0 0 0 3px rgba(37,99,235,.18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font) !important; background: var(--bg) !important; color: var(--text); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
::selection { background: rgba(37,99,235,.18); }
a { color: var(--accent); }
img { max-width: 100%; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: #f1f2f4; padding: 1px 6px; border-radius: 5px; }

/* ── Barre latérale ─────────────────────────────────────────── */
.sidebar { width: 252px !important; background: var(--sidebar) !important; border-right: 0 !important; padding: 18px 12px 14px !important;
  height: 100vh; position: fixed; top: 0; left: 0; z-index: 1000; overflow-y: auto; display: flex; flex-direction: column; transition: transform .25s ease; }
.sidebar-logo { display: flex; align-items: center; gap: 9px; font-size: 15px !important; font-weight: 700 !important; color: var(--text) !important;
  margin: 2px 6px 16px !important; letter-spacing: -.01em; }
.gt-logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -.01em; }
.gt-logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--dark); flex: 0 0 auto; position: relative;
  background-image: linear-gradient(#fff,#fff), linear-gradient(#60a5fa,#60a5fa), linear-gradient(#60a5fa,#60a5fa), linear-gradient(#fff,#fff);
  background-size: 7px 7px; background-repeat: no-repeat; background-position: 6px 6px, 13px 6px, 6px 13px, 13px 13px; }
.gt-sb-company { display: flex; align-items: center; gap: 9px; margin: 0 2px 18px; padding: 8px 10px; background: #fff; border: 1px solid var(--border);
  border-radius: 9px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-sb-company-ini { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 6px; background: #fef3c7; color: #93370d; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.sidebar nav { flex: 1; }
.menu-label, .nav-section { color: var(--muted) !important; font-size: 12px !important; font-weight: 500 !important; text-transform: none !important;
  letter-spacing: 0 !important; margin: 16px 0 5px 10px !important; }
.nav-item { color: var(--ink-2) !important; font-weight: 500 !important; font-size: 13.5px !important; padding: 0 10px !important; height: 34px;
  border-radius: 7px !important; margin-bottom: 1px !important; gap: 10px !important; display: flex !important; align-items: center !important;
  text-decoration: none; background: transparent !important; transition: background .12s; }
.nav-item i, .nav-item svg { width: 16px !important; color: var(--muted); font-size: 14px; }
.nav-item:hover { background: rgba(15,23,42,.05) !important; color: var(--text) !important; }
.nav-item.active { background: #fff !important; color: var(--text) !important; font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 0 0 1px var(--border); }
.nav-item.active i, .nav-item.active svg { color: var(--accent); }
.gt-sb-user { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.gt-sb-user-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-sb-user-name small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.gt-sb-logout { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--muted); }
.gt-sb-logout:hover { background: #fef2f2; color: var(--danger); }
.gt-avatar { width: 30px; height: 30px; border-radius: 999px; background: #eceef1; color: var(--ink-2); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; text-decoration: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }

/* ── Zone de contenu : feuille blanche ───────────────────────── */
.main-content, .main { margin-left: 252px !important; margin-top: 8px; margin-right: 8px; margin-bottom: 8px; min-height: calc(100vh - 16px);
  background: #fff !important; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.05);
  padding: 30px 34px 48px !important; flex: 1; min-width: 0; }
.main-content h1, .main h1, .page-title { font-weight: 650 !important; letter-spacing: -.025em; color: var(--text); }
.main-content h2, .main-content h3 { letter-spacing: -.01em; }
.header-flex { margin-bottom: 24px !important; }
.mobile-header { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 1100; height: 58px; padding: 0 14px !important;
  background: rgba(255,255,255,.92) !important; backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border) !important;
  align-items: center; justify-content: space-between; }
.gt-burger { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text); font-size: 17px; cursor: pointer; }
#overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.35) !important; z-index: 999; }
#overlay.active { display: block; }
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); background: #fff !important; box-shadow: 0 0 40px rgba(16,24,40,.18); }
  .sidebar.open { transform: translateX(0); }
  .main-content, .main { margin: 0 !important; border: 0; border-radius: 0; padding: 78px 16px 40px !important; min-height: 100vh; box-shadow: none; }
  .mobile-header { display: flex !important; }
}

/* ── Boutons ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px !important;
  border-radius: 8px !important; font-family: var(--font); font-size: 13.5px !important; font-weight: 500 !important; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .12s, box-shadow .12s, opacity .12s; white-space: nowrap; }
.btn:hover { opacity: 1 !important; }
.btn-primary { background: var(--accent) !important; color: #fff !important; border: 1px solid var(--accent) !important; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.btn-primary:hover { filter: brightness(.94); }
.btn-ghost, .btn-secondary { background: #fff !important; color: var(--text) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow); }
.btn-ghost:hover, .btn-secondary:hover { background: #f7f8fa !important; }
.btn-danger { background: #fff !important; color: var(--danger) !important; border: 1px solid #f3c7c3 !important; }
.btn-danger:hover { background: #fef2f2 !important; }
.btn:disabled, .btn[disabled] { opacity: .5 !important; cursor: not-allowed; }
.gt-btn-block { width: 100%; }

/* ── Formulaires ─────────────────────────────────────────────── */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]),
select, textarea {
  font-family: var(--font); color: var(--text) !important; background-color: #fff !important; border: 1px solid #dfe1e6 !important;
  border-radius: 8px !important; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: border-color .12s, box-shadow .12s; }
input:disabled, select:disabled, textarea:disabled { background-color: #f4f5f7 !important; color: var(--muted) !important; }
input::placeholder, textarea::placeholder { color: #8a909b !important; }
input:focus, select:focus, textarea:focus { outline: none !important; border-color: var(--accent) !important; box-shadow: var(--ring) !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
select option { background: #fff; color: var(--text); }
label { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Cartes, tableaux, badges ────────────────────────────────── */
.card, .stat-card, .kpi, .table-wrap, .kpi-card, .box, .panel { box-shadow: var(--shadow); border-color: var(--border) !important; }
.stat-card, .kpi, .kpi-card { border-radius: 12px !important; }
.card { border-radius: 12px !important; }
table { border-color: var(--border); }
th { background: #fafafb !important; color: var(--muted) !important; font-weight: 500 !important; font-size: 12px !important;
  text-transform: none !important; letter-spacing: 0 !important; border-bottom: 1px solid var(--border) !important; }
td { border-bottom-color: var(--line) !important; color: var(--text); }
tr:hover td { background: #fafbfc !important; }
.badge, .badge-status, .status, [class^="s-"], [class*=" s-"] { border-radius: 6px !important; font-weight: 600 !important; letter-spacing: 0 !important; }
hr { border: 0; border-top: 1px solid var(--border); }

/* ── Alertes ─────────────────────────────────────────────────── */
.alert, .gt-alert { border-radius: 10px !important; }
.gt-alert { padding: 11px 14px; font-size: 13.5px; margin: 0 0 14px; border: 1px solid; }
.gt-alert-error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.gt-alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.gt-alert-info { background: #eff4ff; border-color: #c7d7fe; color: #1d4ed8; }
.gt-alert-warn { background: #fffaeb; border-color: #fedf89; color: #93370d; }

/* ── Barres de défilement ────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: #d5d8de transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5d8de; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }

/* ── Pages autonomes : connexion, maintenance, super admin ──── */
.gt-muted { color: var(--muted); } .gt-small { font-size: 12.5px; } .gt-center { text-align: center; }
.gt-stack { display: flex; flex-direction: column; gap: 14px; }
.gt-stack label, .gt-auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.gt-stack input, .gt-auth-form input { height: 42px; padding: 0 12px; font-size: 14px; width: 100%; }
.gt-inline { display: flex; gap: 8px; flex-wrap: wrap; } .gt-inline input { height: 40px; padding: 0 12px; max-width: 160px; }

body.gt-solo, body.gt-auth, body.gt-plain { display: block; margin: 0; }
body.gt-solo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gt-solo-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px;
  box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 16px 40px rgba(16,24,40,.06); }
.gt-solo-card h1 { font-size: 21px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 8px; }
.gt-solo-card p { color: var(--ink-2); line-height: 1.6; margin: 0 0 16px; font-size: 14.5px; }
.gt-solo-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 22px; }
.gt-solo-logo::before { content: ""; width: 26px; height: 26px; border-radius: 7px; background: var(--dark);
  background-image: linear-gradient(#fff,#fff), linear-gradient(#60a5fa,#60a5fa), linear-gradient(#60a5fa,#60a5fa), linear-gradient(#fff,#fff);
  background-size: 7px 7px; background-repeat: no-repeat; background-position: 6px 6px, 13px 6px, 6px 13px, 13px 13px; }
.gt-badge-sup { font-size: 11.5px; font-weight: 600; color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 6px; padding: 1px 7px; }

.gt-auth-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; }
.gt-auth-brand { flex: 1 1 520px; min-height: 380px; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background-color: #f7f8fa; border-right: 1px solid var(--border);
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px; }
.gt-auth-brand h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.1; font-weight: 650; letter-spacing: -.035em; margin: 0 0 18px; max-width: 560px; }
.gt-auth-brand p { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 520px; margin: 0; }
.gt-auth-brand small { color: var(--muted); }
.gt-auth-form { flex: 1 1 440px; display: flex; align-items: center; justify-content: center; padding: 48px 28px; background: #fff; }
.gt-auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.gt-auth-form h2 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin: 0; }
.gt-auth-form .gt-muted { margin: -8px 0 4px; }
.gt-auth-form .btn { height: 44px; }
.gt-auth-row { display: flex; justify-content: flex-end; font-size: 13.5px; margin-top: -4px; }
.gt-auth-row a { text-decoration: none; font-weight: 500; }
.gt-logo-mobile { display: none; }
@media (max-width: 900px) { .gt-auth-brand { display: none; } .gt-logo-mobile { display: inline-flex; margin-bottom: 10px; } }

.gt-page { max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }
.gt-page h1 { font-size: 24px; font-weight: 650; letter-spacing: -.025em; margin: 6px 0 4px; }
.gt-back { color: var(--muted); text-decoration: none; font-size: 13.5px; }
.gt-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.gt-card h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.gt-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.gt-steps { padding-left: 20px; margin: 0 0 14px; line-height: 1.7; font-size: 14px; }
.gt-code-big { display: block; margin: 8px 0 4px; font-size: 16px; letter-spacing: .08em; padding: 10px 12px; }
.gt-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f1f2f4; color: var(--ink-2); font-size: 12px; font-weight: 500; }
.gt-pill-success { background: #ecfdf3; color: #067647; } .gt-pill-danger { background: #fef3f2; color: #b42318; }
.gt-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.gt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.gt-table th, .gt-table td { padding: 10px 14px; text-align: left; }

/* ── Impression ──────────────────────────────────────────────── */
@media print {
  .sidebar, .mobile-header, #overlay { display: none !important; }
  .main-content, .main { margin: 0 !important; border: 0; box-shadow: none; padding: 0 !important; }
}
