/* e-duflow — Premium SaaS — Palette officielle */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #155EEF;
  --primary-hover: #0E4CD6;
  --primary-dark: #0B1F3A;
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --text-primary: #101828;
  --text-secondary: #667085;
  --text-tertiary: #98A2B3;
  --border: #E4E7EC;
  --border-light: #F2F4F7;
  --success: #12B76A;
  --success-light: #ECFDF3;
  --warning: #F79009;
  --warning-light: #FFFAEB;
  --error: #F04438;
  --error-light: #FEF3F2;
  --info: #2E90FA;
  --info-light: #EFF8FF;
  --ai: #7F56D9;
  --ai-light: #F4EBFF;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,0.08), 0 1px 2px rgba(16,24,40,0.06);
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html,body { margin:0; padding:0; background: var(--bg); color: var(--text-primary); font-family: 'Inter', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; font-size:14px; line-height:1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; }

/* Typography - Inter only */
.h1 { font-size: 30px; font-weight:700; line-height:1.2; letter-spacing:-0.02em; color: var(--text-primary); }
.h2 { font-size: 22px; font-weight:700; line-height:1.3; letter-spacing:-0.01em; color: var(--text-primary); }
.h3 { font-size: 18px; font-weight:600; line-height:1.4; color: var(--text-primary); }
.body { font-size:14px; line-height:1.6; color: var(--text-secondary); }
.small { font-size:12px; line-height:1.5; color: var(--text-secondary); }
.tiny { font-size:11px; color: var(--text-tertiary); }

/* Layout - Premium SaaS */
.app-shell { display:flex; min-height:100vh; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; position:fixed; top:0; bottom:0; left:0; z-index:40; transition: width .2s ease; }
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-brand { height: var(--topbar-h); padding:0 20px; display:flex; align-items:center; gap:12px; border-bottom:1px solid var(--border); flex-shrink:0; }
.logo-mark { width:32px; height:32px; background: var(--primary); border-radius:8px; display:grid; place-items:center; color:white; font-weight:700; font-size:14px; letter-spacing:-0.02em; flex-shrink:0; }
.logo-type { font-weight:700; font-size:16px; letter-spacing:-0.02em; color: var(--primary-dark); white-space:nowrap; }
.logo-sub { font-size:11px; color: var(--text-tertiary); font-weight:500; }
.sidebar-nav { flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:2px; }
.nav-section-title { font-size:11px; font-weight:600; letter-spacing:0.06em; text-transform:uppercase; color: var(--text-tertiary); padding:16px 12px 8px; }
.nav-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; font-size:14px; font-weight:500; color: var(--text-secondary); transition: all .15s ease; cursor:pointer; white-space:nowrap; }
.nav-item:hover { background: var(--bg); color: var(--text-primary); }
.nav-item.active { background: #EFF4FF; color: var(--primary); font-weight:600; }
.nav-item.active .nav-icon { color: var(--primary); }
.nav-icon { width:20px; height:20px; display:grid; place-items:center; font-size:16px; flex-shrink:0; }
.nav-item .badge { margin-left:auto; font-size:11px; font-weight:600; padding:2px 8px; border-radius:999px; background: var(--error-light); color: var(--error); }
.sidebar-footer { padding:12px; border-top:1px solid var(--border); margin-top:auto; }
.user-mini { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; transition:.15s; }
.user-mini:hover { background: var(--bg); }
.avatar { width:32px; height:32px; border-radius:50%; background: var(--primary-dark); color:white; display:grid; place-items:center; font-weight:600; font-size:12px; flex-shrink:0; }
.main { margin-left: var(--sidebar-w); flex:1; min-width:0; transition: margin-left .2s ease; }
.sidebar.collapsed + .main { margin-left: var(--sidebar-collapsed); }
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:0 24px; position:sticky; top:0; z-index:20; }
.topbar-left { display:flex; align-items:center; gap:16px; flex:1; max-width:640px; }
.search-box { display:flex; align-items:center; gap:10px; background: var(--bg); border:1px solid var(--border); border-radius:10px; padding:10px 14px; flex:1; transition:.15s; }
.search-box:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(21,94,239,0.12); }
.search-box input { border:0; outline:0; flex:1; font-size:14px; background:transparent; color: var(--text-primary); }
.search-box input::placeholder { color: var(--text-tertiary); }
.topbar-right { display:flex; align-items:center; gap:12px; }
.icon-btn { width:40px; height:40px; border-radius:10px; border:1px solid var(--border); background: var(--surface); display:grid; place-items:center; cursor:pointer; position:relative; transition:.15s; color: var(--text-secondary); }
.icon-btn:hover { background: var(--bg); border-color: var(--border); color: var(--text-primary); }
.dot { position:absolute; top:6px; right:6px; width:8px; height:8px; background: var(--error); border-radius:50%; border:2px solid var(--surface); }

/* Content */
.content { padding: 24px; max-width: 1280px; margin:0 auto; width:100%; }

/* Cards - Premium, light border, radius 14, almost no shadow */
.card { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); transition: all .15s ease; }
.card:hover { box-shadow: var(--shadow-sm); }
.card-pad { padding:20px; }
.card-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card-header h3 { margin:0; font-size:14px; font-weight:600; }

/* KPI - Intelligent cards with action */
.kpi-grid { display:grid; grid-template-columns: repeat(4,1fr); gap:16px; }
.kpi { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding:20px; transition:.15s; }
.kpi:hover { border-color: var(--border); box-shadow: var(--shadow-xs); }
.kpi-label { font-size:12px; font-weight:600; letter-spacing:0.02em; color: var(--text-secondary); }
.kpi-value { font-size:28px; font-weight:700; letter-spacing:-0.02em; margin-top:8px; color: var(--text-primary); }
.kpi-meta { font-size:12px; color: var(--text-secondary); margin-top:8px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.kpi-action { margin-top:12px; font-size:12px; font-weight:600; color: var(--primary); display:inline-flex; align-items:center; gap:4px; cursor:pointer; }
.kpi-action:hover { color: var(--primary-hover); }

/* Buttons - System */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 16px; border-radius:10px; font-size:14px; font-weight:600; border:1px solid transparent; cursor:pointer; transition: all .15s ease; white-space:nowrap; line-height:1; }
.btn:disabled { opacity:0.6; cursor:not-allowed; }
.btn-primary { background: var(--primary); color:white; border-color: var(--primary); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--border); }
.btn-ghost { background: var(--surface); color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }
.btn-sm { padding:8px 12px; font-size:13px; border-radius:8px; }
.btn-lg { padding:12px 20px; font-size:15px; border-radius:12px; }

/* Inputs */
.input { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; font-size:14px; outline:0; background: var(--surface); color: var(--text-primary); transition: all .15s ease; }
.input::placeholder { color: var(--text-tertiary); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,94,239,0.12); }
.input:disabled { background: var(--bg); color: var(--text-tertiary); }
.label { font-size:12px; font-weight:600; color: var(--text-primary); margin-bottom:6px; display:block; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-group { margin-bottom:14px; }

/* Table - Clean */
.table-wrap { overflow:auto; border-radius: var(--radius); border:1px solid var(--border); background: var(--surface); }
.table { width:100%; border-collapse:collapse; font-size:14px; }
.table th { text-align:left; padding:12px 16px; font-size:12px; font-weight:600; color: var(--text-secondary); background: var(--bg); border-bottom:1px solid var(--border); white-space:nowrap; letter-spacing:0.02em; }
.table td { padding:14px 16px; border-bottom:1px solid var(--border-light); color: var(--text-primary); }
.table tr:last-child td { border-bottom:0; }
.table tr:hover td { background: #F9FAFB; }

/* Badges - Semantic + icon + text */
.badge { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600; letter-spacing:0.01em; border:1px solid transparent; }
.badge-green { background: var(--success-light); color: var(--success); border-color: #A6F4C5; }
.badge-red { background: var(--error-light); color: var(--error); border-color: #FDA29B; }
.badge-amber { background: var(--warning-light); color: #B54708; border-color: #FEDF89; }
.badge-blue { background: var(--info-light); color: #175CD3; border-color: #B2DDFF; }
.badge-gray { background: #F9FAFB; color: var(--text-secondary); border-color: var(--border); }
.badge-violet { background: var(--ai-light); color: var(--ai); border-color: #D9D6FE; }

/* Alerts - Light, clean */
.alert { padding:14px 16px; border-radius:12px; border:1px solid; display:flex; gap:12px; font-size:13px; line-height:1.5; }
.alert-info { background: var(--info-light); border-color: #B2DDFF; color: #1849A9; }
.alert-warn { background: var(--warning-light); border-color: #FEDF89; color: #93370D; }
.alert-danger { background: var(--error-light); border-color: #FDA29B; color: #9E0F24; }
.alert-success { background: var(--success-light); border-color: #A6F4C5; color: #085D3A; }

/* Empty */
.empty { padding:48px 24px; text-align:center; }
.empty-icon { width:48px; height:48px; border-radius:12px; background: var(--bg); border:1px solid var(--border); display:grid; place-items:center; margin:0 auto 16px; font-size:20px; color: var(--text-tertiary); }
.empty-title { font-weight:600; font-size:14px; color: var(--text-primary); margin-bottom:4px; }
.empty-desc { font-size:13px; color: var(--text-secondary); }

/* Modal - Clean */
.modal-backdrop { position:fixed; inset:0; background: rgba(16,24,40,0.6); backdrop-filter: blur(4px); display:none; place-items:center; z-index:60; padding:20px; opacity:0; transition: opacity .15s ease; }
.modal-backdrop.open { display:grid; opacity:1; }
.modal { background: var(--surface); border-radius:16px; width:100%; max-width:520px; max-height:90vh; overflow:auto; box-shadow: 0 20px 40px rgba(16,24,40,0.15); border:1px solid var(--border); transform: scale(0.98) translateY(4px); transition: transform .15s ease; }
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header { padding:20px 20px 0; display:flex; justify-content:space-between; align-items:center; }
.modal-body { padding:20px; }
.modal-footer { padding:0 20px 20px; display:flex; justify-content:flex-end; gap:10px; }

/* Bottom nav mobile - Clean */
.bottom-nav { display:none; position:fixed; bottom:0; left:0; right:0; background: var(--surface); border-top:1px solid var(--border); z-index:30; padding:6px 8px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav-items { display:flex; justify-content:space-around; }
.bottom-nav-item { display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 12px; border-radius:10px; font-size:11px; font-weight:500; color: var(--text-tertiary); cursor:pointer; transition:.15s; }
.bottom-nav-item.active { color: var(--primary); background: #EFF4FF; font-weight:600; }
.bottom-nav-item .nav-icon { font-size:20px; }

/* Presence - ZERO friction */
.presence-list { display:flex; flex-direction:column; gap:8px; max-height:60vh; overflow:auto; }
.presence-item { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border:1px solid var(--border); border-radius:12px; background: var(--surface); transition:.15s; cursor:pointer; }
.presence-item:hover { border-color: var(--primary); background: #F9FAFB; }
.presence-item.present { border-color: var(--success); background: var(--success-light); }
.presence-item.present .presence-status { color: var(--success); }
.presence-item.absent .presence-status { color: var(--error); }
.checkbox { width:24px; height:24px; border-radius:8px; border:1.5px solid var(--border); display:grid; place-items:center; cursor:pointer; transition:.15s; background: var(--surface); flex-shrink:0; }
.checkbox.checked { background: var(--primary); border-color: var(--primary); color:white; }
.checkbox.checked.present { background: var(--success); border-color: var(--success); }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%); background-size:200% 100%; animation: shimmer 1.2s infinite; border-radius:8px; }
@keyframes shimmer { 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }
.skeleton-text { height:12px; margin-bottom:8px; }
.skeleton-title { height:20px; width:60%; margin-bottom:12px; }

/* Landing - Premium SaaS clear */
.landing-nav { position:sticky; top:0; z-index:50; background: rgba(255,255,255,0.8); backdrop-filter: blur(12px); border-bottom:1px solid var(--border); }
.landing-hero { padding: 64px 24px 48px; max-width:1200px; margin:0 auto; display:grid; grid-template-columns: 1.1fr 0.9fr; gap:48px; align-items:center; }
.landing-section { padding:64px 24px; max-width:1200px; margin:0 auto; }
.landing-grid-3 { display:grid; grid-template-columns: repeat(3,1fr); gap:20px; }
.landing-grid-2 { display:grid; grid-template-columns: repeat(2,1fr); gap:20px; }

/* Responsive */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .form-row { grid-template-columns:1fr; }
  .landing-hero { grid-template-columns:1fr; gap:32px; padding:40px 20px; }
  .landing-grid-3, .landing-grid-2 { grid-template-columns:1fr; }
}
@media (max-width: 768px) {
  .sidebar { display:none; }
  .main { margin-left:0; }
  .topbar { padding:0 16px; }
  .content { padding:16px; padding-bottom:88px; }
  .bottom-nav { display:block; }
  .kpi-grid { grid-template-columns:1fr 1fr; gap:12px; }
  .card-pad { padding:16px; }
  .h1 { font-size:24px; }
}

/* Focus visible */
*:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }

/* Scrollbar minimal */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius:999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
