:root {
  color-scheme: light;
  --brand-primary: #0066CC;
  --brand-dark: #004999;
  --brand-light: #3385FF;
  --brand-accent: #00B8D4;
  --brand-success: #00C853;
  --brand-warning: #FFB300;
  --brand-danger: #E53935;
  
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-dark: #94A3B8;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748B;
  }
}
* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 24px; 
}

.header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.brand { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
}

.brand .logo { 
  height: 48px; 
  width: auto; 
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand h1 { 
  margin: 0; 
  font-size: 26px; 
  font-weight: 700;
  letter-spacing: -0.5px; 
  color: var(--brand-primary);
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header nav { 
  display: flex; 
  gap: 16px; 
  flex-wrap: wrap; 
  align-items: center;
}

.header nav a { 
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.header nav a:hover {
  background: var(--bg-tertiary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}
.camera-section { position: relative; aspect-ratio: 4/3; background: #111; border-radius: 12px; overflow: hidden; margin: 16px 0; }
.camera-section.small { max-width: 480px; }
video { width: 100%; height: 100%; object-fit: cover; }
.mirror { transform: scaleX(-1); }
.overlay { position: absolute; inset: 0; border: 4px solid rgba(0, 85, 166, 0.55); border-radius: 12px; pointer-events: none; }
.face-circle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(60vmin, 70%); height: min(60vmin, 70%); border: 4px dashed rgba(0, 85, 166, 0.6); border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0,0,0,0.1) inset; pointer-events: none; }
.controls { display: flex; align-items: center; gap: 12px; }
button { 
  position: relative;
  overflow: hidden;
  padding: 12px 24px; 
  border-radius: var(--radius-md); 
  border: none; 
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
  color: white; 
  font-weight: 600;
  font-size: 15px;
  cursor: pointer; 
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.3px;
}

button:hover { 
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-primary) 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

button:active { 
  transform: translateY(0px); 
  box-shadow: var(--shadow-sm);
}

button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow-sm);
}
.status { 
  margin-left: 8px; 
  margin-top: 8px;
  opacity: 0.95; 
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hidden { display: none; }
.card { 
  border: 1px solid var(--border-light); 
  padding: 28px; 
  border-radius: var(--radius-lg); 
  margin: 20px 0; 
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-light);
}

.card h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  border-radius: 2px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 12px; margin-bottom: 12px; }
label { 
  display: grid; 
  gap: 8px; 
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

input, select { 
  padding: 12px 16px; 
  border-radius: var(--radius-md); 
  border: 2px solid var(--border-light);
  width: 100%;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
  font-family: inherit;
}

input:hover, select:hover {
  border-color: var(--border-medium);
}

/* Terminal mobile : interface tactile et lisible sur chantier */
.mobile-terminal {
  max-width: 620px;
  min-height: 100dvh;
  padding: 14px 14px 24px;
}
.mobile-terminal .header {
  display: block;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0759a5, #063d78);
  color: #fff;
}
.mobile-terminal .brand { gap: 12px; }
.mobile-terminal .brand .logo { height: 38px; max-width: 135px; object-fit: contain; }
.mobile-terminal .brand h1 { font-size: 19px; color: #fff; background: none; -webkit-text-fill-color: #fff; letter-spacing: -.2px; }
.header-subtitle { margin: 10px 0 0; font-size: 13px; opacity: .82; }
.mobile-terminal #userInfo { margin-top: 14px !important; }
.mobile-terminal #userInfo button { padding: 10px 13px !important; font-size: 13px !important; border-radius: 12px !important; box-shadow: none !important; }
.mobile-camera { aspect-ratio: 3 / 4; margin: 0 0 14px; border-radius: 24px; box-shadow: 0 12px 30px rgba(15,23,42,.18); }
.mobile-camera .overlay { border: 1px solid rgba(255,255,255,.35); border-radius: 24px; }
.mobile-camera .face-circle { width: min(70vw, 280px); height: min(70vw, 280px); border: 3px solid rgba(255,255,255,.82); box-shadow: 0 0 0 9999px rgba(0,0,0,.18); }
.mobile-controls { display: grid; gap: 10px; }
.status-card { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--border-light); border-radius: 15px; background: var(--bg-secondary); box-shadow: var(--shadow-sm); }
.status { margin: 0; font-size: 13px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--brand-success); box-shadow: 0 0 0 4px rgba(0,200,83,.12); }
.pointer-button { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 17px; font-size: 17px; background: linear-gradient(135deg, #0877d1, #0054a6); }
.pointer-icon { display: inline-grid; place-items: center; width: 27px; height: 27px; border: 2px solid rgba(255,255,255,.7); border-radius: 50%; font-weight: 800; }
.mobile-footer { display: flex; justify-content: space-between; align-items: center; padding: 16px 4px 0; font-size: 12px; color: var(--text-muted); }
.mobile-footer a { color: var(--brand-primary); text-decoration: none; font-weight: 700; }
.mobile-footer a span { margin-right: 4px; }
.footer-hint { opacity: .7; }
@media (min-width: 700px) {
  .mobile-terminal { padding-top: 28px; }
  .mobile-camera { aspect-ratio: 4 / 3; }
}

input::placeholder {
  color: var(--text-muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-action { 
  padding: 10px 20px; 
  font-size: 14px; 
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary { 
  background: linear-gradient(135deg, #64748B 0%, #475569 100%);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover { 
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-danger { 
  background: linear-gradient(135deg, var(--brand-danger) 0%, #C62828 100%);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover { 
  background: linear-gradient(135deg, #C62828 0%, #B71C1C 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-success { 
  background: linear-gradient(135deg, var(--brand-success) 0%, #00A346 100%);
  box-shadow: var(--shadow-sm);
}

.btn-success:hover { 
  background: linear-gradient(135deg, #00A346 0%, #00913E 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.table-wrap { 
  width: 100%; 
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch; 
  border-radius: var(--radius-lg); 
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

table { 
  min-width: 720px; 
  width: 100%; 
  border-collapse: collapse;
}

th { 
  background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  position: sticky; 
  top: 0; 
  backdrop-filter: blur(8px);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border-medium);
}

th, td { 
  padding: 14px 16px; 
  text-align: left;
}

td {
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 14px;
}
.footer { opacity: 0.8; font-size: 14px; }

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Mobile optimisations */
button { touch-action: manipulation; }
* { -webkit-tap-highlight-color: transparent; }

@supports (padding: max(0px)) {
  .container {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

@media (max-width: 640px) {
  .container { 
    max-width: none; 
    padding: 16px; 
  }
  
  .header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 12px;
    padding: 16px;
  }
  
  .brand .logo { 
    height: 36px; 
  }
  
  .brand h1 { 
    font-size: 20px; 
  }
  
  .camera-section { 
    height: 62vh; 
    aspect-ratio: auto; 
  }
  
  .camera-section.small { 
    max-width: none; 
    width: 100%; 
  }
  
  .controls { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 10px; 
  }
  
  button { 
    width: 100%; 
    padding: 14px 20px; 
    font-size: 16px; 
  }
  
  .status { 
    font-size: 14px; 
  }
  
  .face-circle { 
    width: 70%; 
    height: 70%; 
  }
  
  table { 
    min-width: 600px; 
  }
  
  th, td { 
    padding: 10px 12px; 
    font-size: 13px;
  }
  
  /* Masquer la table des chantiers sur mobile - affichage readonly uniquement */
  #tblChantiers { 
    display: none; 
  }
  
  /* Ajustement de la grille des filtres de pointage */
  .grid[style*="grid-template-columns: 1fr 1fr 1fr auto"] {
    grid-template-columns: 1fr !important;
  }
  
  .card {
    padding: 16px;
    margin: 12px 0;
  }
  
  .card h2 {
    font-size: 18px;
  }
}

/* V9 — navigation, historique, sécurité et terminal premium */
svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.top-actions { display:flex; align-items:center; gap:8px !important; }
.top-action { display:inline-flex; align-items:center; gap:8px; padding:10px 13px !important; border:1px solid #e1eaf2; border-radius:11px !important; color:#40586f !important; background:#fff; font-size:12px; text-decoration:none !important; }
.top-action:hover { border-color:#bfd9ee; background:#f2f8fd !important; }
.top-action.danger-link:hover { color:#b64040 !important; border-color:#f0caca; background:#fff5f5 !important; }
.top-action svg { width:17px; height:17px; }
.tab-icon { display:grid; place-items:center; }
.tab-icon svg { width:19px; height:19px; }
.tab-btn.active .tab-icon { transform:none; }
.admin-section-head { margin:4px 0 20px; padding:8px 4px; }
.admin-section-head h2 { margin:7px 0 5px; color:#10243e; font-size:27px; }
.admin-section-head p { margin:0; color:#6f8397; font-size:14px; }
.filter-card { padding:22px 24px; }
.filter-card-head { display:flex; justify-content:space-between; gap:20px; align-items:center; padding-bottom:18px; border-bottom:1px solid #e8eef4; }
.filter-card h3,.results-card h3,.security-card h3 { margin:0 0 4px; color:#10243e; font-size:16px; }
.filter-card p,.results-card p,.security-card p { margin:0; color:#7b8da0; font-size:12px; }
.quick-filters { display:flex; gap:6px; }
.quick-filters button { padding:8px 11px; color:#526a81; background:#f1f5f8; box-shadow:none; font-size:11px; }
.quick-filters button:hover,.quick-filters button.selected { color:#0759a5; background:#e5f2fd; transform:none; }
.history-filter-grid { display:grid; grid-template-columns:1fr auto 1fr 1fr auto; gap:12px; align-items:end; padding-top:20px; }
.filter-separator { align-self:center; margin-top:20px; color:#98a8b8; font-size:11px; font-weight:700; text-transform:uppercase; }
.primary-action { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:46px; padding:11px 17px; border-radius:11px; background:linear-gradient(135deg,#0759a5,#06467f); box-shadow:0 8px 18px rgba(7,89,165,.16); white-space:nowrap; }
.primary-action:hover { transform:translateY(-1px); }
.primary-action svg { width:17px; height:17px; }
.results-card { min-height:160px; }
.results-head { display:flex; justify-content:space-between; align-items:center; }
.security-card { max-width:980px; }
.security-intro { display:flex; align-items:center; gap:14px; margin-bottom:24px; padding-bottom:20px; border-bottom:1px solid #e8eef4; }
.security-icon { display:grid; place-items:center; width:44px; height:44px; flex:0 0 44px; border-radius:13px; color:#0759a5; background:#e8f3fc; }
.security-grid { grid-template-columns:repeat(3,1fr); }
.security-submit { display:flex; justify-content:flex-end; margin-top:18px; }
.terminal-app { width:min(1180px,calc(100% - 32px)); margin:0 auto; padding:22px 0 18px; }
.terminal-topbar { display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:74px; padding:13px 18px; border:1px solid #e2ebf3; border-radius:18px; background:#fff; box-shadow:0 8px 26px rgba(16,36,62,.06); }
.terminal-topbar .brand { gap:13px; }
.terminal-topbar .logo { width:82px; height:52px; object-fit:contain; }
.terminal-topbar h1 { margin:0; color:#10243e; font-size:18px; }
.terminal-topbar .brand p { margin:2px 0 0; color:#7a8da0; font-size:11px; }
.terminal-topbar > .header-subtitle { display:none; }
.terminal-topbar #userInfo { margin:0 !important; }
.terminal-topbar #userInfo > div { gap:7px !important; }
.terminal-topbar #btnManagement,.terminal-topbar #btnLogout { min-height:38px; padding:9px 12px !important; border:1px solid #dce7f0 !important; border-radius:10px !important; color:#40586f !important; background:#fff !important; box-shadow:none !important; font-size:12px !important; }
.terminal-topbar #btnLogout { color:#b14646 !important; background:#fff7f7 !important; border-color:#f0d5d5 !important; }
.terminal-topbar #btnManagement svg,.terminal-topbar #btnLogout svg { width:16px; height:16px; }
.terminal-intro { display:grid; grid-template-columns:1.05fr 1fr; gap:34px; align-items:center; margin:20px 0; padding:28px 30px; border-radius:22px; color:#fff; background:linear-gradient(125deg,#062e59,#0759a5 62%,#0b72c3); box-shadow:0 18px 42px rgba(6,61,120,.17); }
.terminal-eyebrow { color:#fbbf24; font-size:10px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; }
.terminal-intro h2 { max-width:520px; margin:8px 0; font-size:29px; line-height:1.18; }
.terminal-intro > div > p { margin:0; color:rgba(255,255,255,.74); font-size:13px; line-height:1.6; }
.terminal-trust { display:grid; grid-template-columns:auto 1fr; gap:10px 12px; }
.terminal-trust > span { display:grid; place-items:center; width:32px; height:32px; border:1px solid rgba(255,255,255,.2); border-radius:10px; color:#fbbf24; background:rgba(255,255,255,.08); font-size:10px; font-weight:800; }
.terminal-trust p { display:grid; margin:0; }
.terminal-trust strong { font-size:12px; }
.terminal-trust small { color:rgba(255,255,255,.62); font-size:10px; }
.camera-panel { max-width:850px; margin:0 auto; padding:14px; border:1px solid #e1eaf2; border-radius:22px; background:#fff; box-shadow:0 12px 35px rgba(16,36,62,.09); }
.camera-panel-head { display:flex; justify-content:space-between; align-items:center; padding:2px 4px 12px; color:#71869a; font-size:11px; }
.camera-panel-head > div { display:flex; align-items:center; gap:8px; color:#233f59; }
.live-dot { width:8px; height:8px; border-radius:50%; background:#20ad67; box-shadow:0 0 0 4px rgba(32,173,103,.12); }
.terminal-app .mobile-camera { width:100%; aspect-ratio:16/9; margin:0; border:0; border-radius:16px; box-shadow:none; }
.terminal-controls { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,360px); gap:12px; max-width:850px; margin:12px auto 0; }
.terminal-controls .status-card { min-height:54px; }
.terminal-controls .pointer-button { min-height:54px; margin:0; border-radius:14px; font-size:14px; }
.terminal-footer { max-width:850px; margin:10px auto 0; padding:8px 4px; }
@media (max-width:900px) {
  .history-filter-grid { grid-template-columns:1fr 1fr; }
  .filter-separator { display:none; }
  .history-filter-grid .primary-action { grid-column:1/-1; }
  .security-grid { grid-template-columns:1fr; }
  .terminal-intro { grid-template-columns:1fr; }
}
@media (max-width:640px) {
  .top-action span { display:none; }
  .terminal-app { width:min(100% - 20px,560px); padding-top:10px; }
  .terminal-topbar { padding:10px 12px; }
  .terminal-topbar .logo { width:62px; height:42px; }
  .terminal-topbar h1 { font-size:15px; }
  .terminal-topbar #btnManagement span,.terminal-topbar #btnLogout span { display:none; }
  .terminal-topbar #btnManagement,.terminal-topbar #btnLogout { width:38px; padding:0 !important; justify-content:center; }
  .terminal-intro { padding:21px; margin:12px 0; }
  .terminal-intro h2 { font-size:22px; }
  .terminal-trust { margin-top:16px; }
  .camera-panel { padding:9px; border-radius:18px; }
  .camera-panel-head > span { display:none; }
  .terminal-app .mobile-camera { aspect-ratio:3/4; }
  .terminal-controls { grid-template-columns:1fr; }
  .filter-card-head { display:block; }
  .quick-filters { margin-top:14px; overflow:auto; }
  .history-filter-grid { grid-template-columns:1fr; }
  .security-submit .primary-action { width:100%; }
  .table-wrap:not(.emp-table) { display:block; overflow:auto; }
}

@media (max-height: 700px) and (orientation: landscape) {
  .camera-section { height: 72vh; aspect-ratio: auto; }
  .brand h1 { font-size: 16px; }
}

/* Overlay de succès dans la zone caméra */
.success-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0, 61, 125, 0.92); color: #fff; z-index: 3; padding: 24px; border-radius: 12px; }
.success-overlay.show { display: flex; }
.success-card { text-align: center; max-width: 820px; }
.success-card h2 { margin: 0 0 12px; font-size: clamp(28px, 5vmin, 48px); letter-spacing: 0.4px; }
.success-card p { margin: 6px 0; font-size: clamp(18px, 3vmin, 24px); opacity: 0.95; }
.success-card .name { font-weight: 800; font-size: clamp(28px, 6vmin, 56px); letter-spacing: 0.6px; }
.success-card .meta { opacity: 0.9; font-weight: 600; }

/* Petit spinner pour états de chargement */
.spinner { 
  display: inline-block; 
  width: 16px; 
  height: 16px; 
  border: 3px solid var(--border-light); 
  border-top-color: var(--brand-primary); 
  border-radius: 50%; 
  vertical-align: -3px; 
  animation: spin 0.6s linear infinite; 
}

@keyframes spin { 
  to { 
    transform: rotate(360deg); 
  } 
}
/* Toasts */
.toast-container { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; display: grid; gap: 8px; z-index: 1000; width: min(92%, 560px); }
.toast { background: #0b1f33; color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.22); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.toast.success { background: #1d7f4e; }
.toast.error { background: #b83030; }
.toast .msg { flex: 1; }
.toast .close { background: transparent; border: 0; color: #fff; font-weight: 700; cursor: pointer; }

/* Cartes employés (mobile) */
.badge { 
  display: inline-block; 
  padding: 5px 12px; 
  border-radius: 999px; 
  font-size: 12px; 
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.badge:hover {
  transform: scale(1.05);
}

.badge.success { 
  background: linear-gradient(135deg, var(--brand-success) 0%, #00A346 100%);
  color: white;
}

.badge.danger { 
  background: linear-gradient(135deg, var(--brand-danger) 0%, #C62828 100%);
  color: white;
}
.emp-cards { 
  display: none; 
  grid-template-columns: 1fr; 
  gap: 12px; 
}

.emp-card { 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-lg); 
  padding: 16px; 
  background: var(--bg-secondary); 
  display: grid; 
  gap: 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.emp-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

.emp-card .title { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  font-weight: 800;
  color: var(--text-primary);
  font-size: 16px;
}

.emp-card .subtitle { 
  color: var(--text-muted); 
  font-size: 12px; 
  margin-left: 6px; 
  font-weight: 600;
  letter-spacing: 0.5px;
}

.emp-card .row { 
  display: grid; 
  gap: 8px;
  color: var(--text-secondary);
}

.emp-card .actions { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 8px; 
  margin-top: 4px; 
}
.btn-action { padding: 12px 10px; font-size: 14px; border-radius: 10px; }
.btn-secondary { background: #6b7a8a; }
.btn-secondary:hover { background: #566372; }
.btn-danger { background: #cf3b3b; }
.btn-danger:hover { background: #b83030; }
.btn-success { background: #2e8b57; }
.btn-success:hover { background: #257047; }

/* Appliquer le style d'actions mobile aussi au tableau desktop */
.emp-table .btnToggle, .emp-table .btnSave, .emp-table .btnDel {
  padding: 12px 10px;
  font-size: 14px;
  border-radius: 10px;
}
.emp-table .btnToggle { background: #6b7a8a; }
.emp-table .btnSave { background: #2e8b57; }
.emp-table .btnDel { background: #cf3b3b; }
.emp-table .btnToggle:hover { background: #566372; }
.emp-table .btnSave:hover { background: #257047; }
.emp-table .btnDel:hover { background: #b83030; }

@media (max-width: 640px) {
  /* Afficher cartes mobile, masquer table */
  .emp-cards { display: grid; }
  .table-wrap { display: none; }
}

/* Overlay d'erreur (périmètre chantier / localisation) */
.error-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(184, 48, 48, 0.92); color: #fff; z-index: 4; padding: 24px; border-radius: 12px; }
.error-overlay.show { display: flex; }
.error-card { text-align: center; max-width: 820px; }
.error-card h2 { margin: 0 0 12px; font-size: clamp(26px, 5vmin, 44px); letter-spacing: 0.3px; }
.error-card p { margin: 6px 0; font-size: clamp(16px, 3vmin, 22px); opacity: 0.95; }

/* Statistiques - Cartes */
.stats-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
  gap: 12px; 
  margin-top: 12px;
}

.stat-card {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.4s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.stat-value {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  animation: numberPop 0.5s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

/* Animations pour l'UX */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes numberPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Amélioration des cartes */
.card {
  animation: fadeInUp 0.4s ease;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0, 85, 166, 0.08);
}

/* Amélioration des inputs et selects */
input:focus, select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
  background: var(--bg-secondary);
}

/* Effet de ripple visuel pour les boutons */
button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
  z-index: 0;
}

button:active::before {
  width: 300px;
  height: 300px;
}

button > * {
  position: relative;
  z-index: 1;
}

/* Amélioration des lignes de tableau */
tbody tr {
  animation: slideIn 0.3s ease;
  transition: all 0.2s ease;
}

tbody tr:hover {
  background-color: var(--bg-tertiary);
  transform: scale(1.01);
}

tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.01);
}

/* Status avec animations */
.status {
  transition: color 0.3s ease;
}

.status .spinner {
  animation: spin 0.8s linear infinite;
}

/* Amélioration responsive des statistiques */
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .stat-label {
    font-size: 12px;
  }
}

/* Tableau d'historique de pointage */
#tblPointagesAdmin td:nth-child(5),
#tblPointagesAdmin td:nth-child(6),
#tblPointagesAdmin td:nth-child(7),
#tblPointagesAdmin td:nth-child(8) {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  text-align: center;
}

#tblPointagesAdmin td:nth-child(9) {
  background-color: rgba(46, 139, 87, 0.08);
  font-weight: 700;
  color: #2e8b57;
  text-align: center;
  font-size: 15px;
}

#tblPointagesAdmin th:nth-child(9) {
  background-color: rgba(46, 139, 87, 0.12);
  color: #1d7f4e;
}

/* Améliorer l'affichage du tableau opérateur */
#tblPointages td {
  font-size: 14px;
}

#tblPointages td:nth-child(5),
#tblPointages td:nth-child(6),
#tblPointages td:nth-child(7),
#tblPointages td:nth-child(8) {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  text-align: center;
}

#tblPointages td:nth-child(9) {
  background-color: rgba(46, 139, 87, 0.08);
  font-weight: 700;
  color: #2e8b57;
  text-align: center;
  font-size: 15px;
}

#tblPointages th:nth-child(9) {
  background-color: rgba(46, 139, 87, 0.12);
  color: #1d7f4e;
}

/* Effet de highlight sur les lignes importantes */
tbody tr:has(strong) {
  background-color: rgba(0, 85, 166, 0.02);
}

/* Navigation par onglets - Design Premium */
.tabs-nav {
  display: flex;
  gap: 12px;
  margin: 24px 0 20px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

.tabs-nav::-webkit-scrollbar {
  height: 6px;
}

.tabs-nav::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.tabs-nav::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

.tabs-nav::-webkit-scrollbar-thumb:hover {
  background: var(--border-dark);
}

.tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
}

/* Effet de brillance au hover */
.tab-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.tab-btn:hover::before {
  left: 100%;
}

.tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--brand-primary);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}


/* Animation de pulse pour l'onglet actif */
@keyframes tabPulse {
  0%, 100% {
    box-shadow: var(--shadow-lg);
  }
  50% {
    box-shadow: var(--shadow-xl);
  }
}

.tab-btn.active {
  animation: tabPulse 2s ease-in-out infinite;
}

/* Icônes et labels des onglets */
.tab-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.tab-label {
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.tab-btn:hover .tab-icon {
  transform: scale(1.15) rotate(5deg);
}

.tab-btn.active .tab-icon {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tab-btn.active .tab-label {
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Compteur de badge optionnel */
.tab-btn[data-count]::before {
  content: attr(data-count);
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, var(--brand-danger) 0%, #C62828 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.5);
  z-index: 2;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Indicateur de progression sous les onglets */
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  transition: width 0.3s ease;
  border-radius: 2px;
}

.tab-btn:hover::after {
  width: 100%;
}

.tab-btn.active::after {
  width: 100% !important;
  background: white;
  height: 4px;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
  bottom: -2px;
  left: 0;
  transform: none;
}

.tab-content {
  display: none;
  animation: fadeInTab 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* Responsive Tablette (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .tabs-nav {
    gap: 10px;
    padding: 6px;
    margin: 20px 0 16px;
  }
  
  .tab-btn {
    padding: 12px 18px;
    gap: 8px;
  }
  
  .tab-icon {
    font-size: 18px;
  }
  
  .tab-label {
    font-size: 13px;
  }
  
  .container {
    max-width: 95%;
    padding: 20px;
  }
  
  .header {
    padding: 18px 20px;
  }
  
  .card {
    padding: 24px;
  }
}

/* Responsive Mobile (< 640px) */
@media (max-width: 640px) {
  .btnChChangePwd {
    display: none !important;
  }
  
  .tabs-nav {
    gap: 6px;
    padding: 6px;
    margin: 16px 0 12px;
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
  }
  
  .tab-btn {
    flex-direction: column;
    padding: 12px 10px;
    gap: 6px;
    min-width: 75px;
    text-align: center;
    border-radius: var(--radius-sm);
  }
  
  .tab-icon {
    font-size: 24px;
  }
  
  .tab-label {
    font-size: 11px;
    line-height: 1.2;
  }
  
  .tab-btn.active::after {
    bottom: 0;
    width: 100% !important;
    height: 3px;
  }
  
  .tab-btn[data-count]::before {
    top: 4px;
    right: 4px;
    font-size: 9px;
    padding: 2px 5px;
    min-width: 16px;
  }
  
  .tab-btn:hover .tab-icon {
    transform: scale(1.1);
  }
  
  .tab-btn.active .tab-icon {
    transform: scale(1.15);
  }
  
  .stat-value {
    font-size: 32px;
  }
  
  .stat-card {
    padding: 20px;
  }
}

/* Responsive Très petit mobile (< 380px) */
@media (max-width: 380px) {
  .tab-btn {
    padding: 10px 8px;
    min-width: 68px;
  }
  
  .tab-icon {
    font-size: 22px;
  }
  
  .tab-label {
    font-size: 10px;
  }
  
  .tabs-nav {
    gap: 4px;
    padding: 4px;
  }
}

/* Mode paysage mobile */
@media (max-width: 900px) and (orientation: landscape) {
  .tabs-nav {
    gap: 8px;
    padding: 4px;
    margin: 12px 0 10px;
  }
  
  .tab-btn {
    flex-direction: row;
    padding: 8px 16px;
    min-width: auto;
  }
  
  .tab-icon {
    font-size: 18px;
  }
  
  .tab-label {
    font-size: 12px;
  }
}

/* Connexion et espace opérateur mobile */
.mobile-login { min-height: 100dvh; background: linear-gradient(145deg, #eef6ff, #f8fafc); }
.mobile-login .login-box { max-width: 430px; }
.mobile-login .logo-container { margin-bottom: 18px; }
.mobile-login .logo-container img { max-width: 150px; }
.mobile-login .login-title { font-size: 1.35rem; margin: 12px 0 18px; }
.mobile-login .info-box { border-radius: 17px; padding: 14px; background: linear-gradient(135deg, #0759a5, #063d78); }
.mobile-login .card { padding: 20px; margin: 0; border-radius: 22px; }
.mobile-login .card h2 { font-size: 19px; margin-bottom: 16px; }
.mobile-login label { margin-bottom: 13px; }
.mobile-login input, .mobile-login select { min-height: 50px; }
.mobile-login #btnLogin { min-height: 54px; border-radius: 15px; font-size: 16px; }
.operator-mobile { max-width: 760px; padding: 14px; }
.operator-mobile .header { border-radius: 20px; padding: 15px; }
.operator-mobile .header nav { gap: 8px; font-size: 13px; }
.operator-mobile .card { border-radius: 20px; padding: 18px; }
.operator-mobile .camera-section.small { max-width: none; width: 100%; aspect-ratio: 4 / 3; border-radius: 20px; }
.operator-mobile #btnCapture { width: 100%; min-height: 54px; margin-top: 12px; border-radius: 15px; }
@media (max-width: 520px) {
  .operator-mobile .brand h1 { font-size: 18px; }
  .operator-mobile .brand .logo { height: 35px; }
  .operator-mobile .header { display: block; }
  .operator-mobile .header nav { margin-top: 10px; justify-content: space-between; }
  .operator-mobile .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .operator-mobile .stat-card { padding: 12px 6px; border-radius: 14px; }
  .operator-mobile .stat-value { font-size: 24px; }
  .operator-mobile .stat-label { font-size: 10px; }
  .operator-mobile .card h2 { font-size: 18px; }
  .operator-mobile .table-wrap { overflow-x: auto; }
}

/* Identité visuelle premium Pointage Chantier */
:root { color-scheme: light; --brand-primary:#0759A5; --brand-dark:#063D78; --brand-light:#2789D8; --brand-accent:#F59E0B; --bg-primary:#F6F9FC; --bg-secondary:#FFFFFF; --text-primary:#10243E; --text-secondary:#48617A; --border-light:#E3EBF3; }
body { background: radial-gradient(circle at 90% 0%, #EAF4FF 0, transparent 34%), var(--bg-primary); }
button { background: linear-gradient(135deg,#0759A5,#063D78); }
button:hover { background: linear-gradient(135deg,#063D78,#052E5D); }
.card { border-color:#E1EAF3; box-shadow:0 12px 30px rgba(27,70,109,.08); }
.card h2::before { background:linear-gradient(180deg,#F59E0B,#D97706); }
.mobile-terminal .header, .mobile-login .info-box { background:linear-gradient(135deg,#063D78 0%,#0759A5 62%,#0B6DBE 100%); box-shadow:0 16px 34px rgba(6,61,120,.22); }
.mobile-terminal .brand .logo, .operator-mobile .brand .logo { width:112px; height:48px; object-fit:contain; object-position:left center; filter:drop-shadow(0 3px 7px rgba(0,0,0,.16)); }
.mobile-login .logo-container img { width:230px; max-width:78vw; }
.mobile-camera { border:4px solid #fff; }
.mobile-camera .face-circle { border-color:#FBBF24; box-shadow:0 0 0 9999px rgba(3,24,45,.22), 0 0 0 7px rgba(245,158,11,.16); }
.pointer-button { background:linear-gradient(135deg,#F59E0B,#D97706); box-shadow:0 10px 22px rgba(217,119,6,.24); }
.pointer-button:hover { background:linear-gradient(135deg,#D97706,#B45309); }
.status-dot { background:#16A34A; }

/* Refonte globale : console professionnelle */
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .01em; }
.container { max-width: 1180px; padding: 24px; }
.container > .header { min-height: 76px; border: 1px solid #e5edf5; border-radius: 20px; background:#fff; box-shadow:0 8px 28px rgba(16,36,62,.07); }
.container > .header .brand h1 { color:#10243E; background:none; -webkit-text-fill-color:#10243E; font-size:24px; }
.container > .header .brand .logo { width:126px; height:54px; object-fit:contain; }
.header nav a { color:#48617A; border-radius:10px; }
.header nav a:hover { color:#0759A5; background:#EEF6FF; }
.tabs-nav { margin:20px 0; padding:6px; border:1px solid #e1eaf3; border-radius:16px; background:#fff; box-shadow:0 6px 20px rgba(16,36,62,.05); }
.tab-btn { border-radius:11px; color:#587089; background:transparent; box-shadow:none; }
.tab-btn.active { color:#0759A5; background:#EEF6FF; box-shadow:inset 0 0 0 1px #cfe4f8; }
.tab-btn:hover { transform:none; background:#F5F9FD; color:#0759A5; }
.card { border-radius:18px; background:#fff; padding:24px; box-shadow:0 8px 24px rgba(16,36,62,.06); }
.card h2 { color:#10243E; font-size:20px; border-bottom:1px solid #edf2f7; }
label { color:#48617A; }
input, select { min-height:46px; border:1px solid #d9e5ef; border-radius:11px; background:#fff; }
input:focus, select:focus { outline:none; border-color:#5aa5df; box-shadow:0 0 0 4px rgba(39,137,216,.12); }
button { border-radius:11px; }
.btn-secondary { background:#edf5fc !important; color:#0759A5 !important; box-shadow:none !important; }
.btn-secondary:hover { background:#dcecf9 !important; transform:none; }
.table-wrap { border:1px solid #e2ebf3; border-radius:14px; overflow:auto; }
table { min-width:650px; border-collapse:collapse; background:#fff; }
th { background:#f5f8fb; color:#48617A; font-size:12px; text-transform:uppercase; letter-spacing:.05em; }
td, th { padding:13px 14px; border-bottom:1px solid #edf2f7; }
tr:last-child td { border-bottom:0; }
.stat-card { border:1px solid #e0eaf3; border-radius:16px; background:linear-gradient(145deg,#fff,#f6faff); box-shadow:none; }
.stat-value { color:#0759A5; }
.footer { color:#7a8ea3; }
@media (max-width: 700px) {
  .container { padding:12px; }
  .container > .header { padding:14px; }
  .container > .header .brand h1 { font-size:18px; }
  .container > .header .brand .logo { width:104px; height:46px; }
  .card { padding:16px; }
  .tabs-nav { overflow:auto; justify-content:flex-start; }
  .tab-btn { min-width:92px; }
}

/* Administration V8 — interface SaaS claire et commerciale */
.admin-shell { max-width:1280px; }
.brand-kicker { margin:3px 0 0; color:#71869a; font-size:12px; }
.admin-overview { display:flex; justify-content:space-between; gap:32px; align-items:center; margin:0 0 20px; padding:28px 30px; border-radius:22px; color:#fff; background:linear-gradient(125deg,#062f5e 0%,#0759a5 64%,#0b73c6 100%); box-shadow:0 18px 45px rgba(6,61,120,.2); }
.overview-copy { max-width:590px; }
.eyebrow { display:block; color:#fbbf24; font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.overview-copy h2 { margin:7px 0 6px; font-size:27px; }
.overview-copy p { margin:0; color:rgba(255,255,255,.78); font-size:14px; }
.overview-stats { display:grid; grid-template-columns:repeat(3,minmax(90px,1fr)); gap:10px; min-width:330px; }
.overview-stats div { display:grid; gap:2px; padding:15px; border:1px solid rgba(255,255,255,.14); border-radius:15px; background:rgba(255,255,255,.09); backdrop-filter:blur(8px); }
.overview-stats strong { color:#fff; font-size:25px; }
.overview-stats span { color:rgba(255,255,255,.68); font-size:11px; }
.admin-two-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(340px,.72fr); gap:20px; align-items:start; }
.admin-two-columns .card { margin-top:0; }
.admin-two-columns .camera-section { aspect-ratio:16/10; margin:12px 0; }
.admin-shell .card { border:1px solid #e2ebf3; }
.admin-shell .card:hover { transform:none; box-shadow:0 12px 30px rgba(16,36,62,.08); }
.admin-shell .card h2 { margin-bottom:22px; }
.admin-shell #empSearch { padding-left:18px; background:#f9fbfd; }
.admin-shell .emp-table { overflow:visible; border-radius:15px; box-shadow:none; }
.admin-shell #tblEmployees { min-width:0; table-layout:auto; }
.admin-shell #tblEmployees thead th { position:static; padding:13px 16px; border:0; background:#f5f8fb !important; color:#60758a !important; }
.admin-shell #tblEmployees tbody tr,
.admin-shell #tblEmployees tbody tr:nth-child(even) { background:#fff !important; color:#10243e !important; animation:none; }
.admin-shell #tblEmployees tbody tr:hover { background:#f9fbfd !important; transform:none; }
.admin-shell #tblEmployees td { padding:15px 16px; color:#40586f !important; vertical-align:middle; }
.employee-cell { display:flex; align-items:center; gap:12px; min-width:190px; }
.employee-cell strong { display:block; color:#10243e; font-size:14px; }
.employee-cell small { display:block; margin-top:2px; color:#8a9bae; font-size:11px; }
.employee-avatar { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border-radius:12px; color:#0759a5; background:#e9f4ff; font-size:12px; font-weight:800; }
.matricule-pill { display:inline-flex; padding:6px 9px; border-radius:8px; color:#31516e; background:#f0f4f8; font-size:12px; font-weight:700; }
.status-badge { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border-radius:999px; font-size:11px; font-weight:800; }
.status-badge i { width:7px; height:7px; border-radius:50%; }
.status-badge.active { color:#147a48; background:#e9f8f0; }
.status-badge.active i { background:#22a866; }
.status-badge.blocked { color:#b04444; background:#fff0f0; }
.status-badge.blocked i { background:#dc5555; }
.row-actions { display:flex; justify-content:flex-end; align-items:center; gap:7px; white-space:nowrap; }
.actions-heading { text-align:right; }
.row-actions button { min-height:34px; padding:8px 11px; border-radius:9px; font-size:11px; box-shadow:none; }
.btn-icon-label { color:#0759a5; background:#eaf4fd; }
.btn-icon-label:hover { color:#fff; background:#0759a5; transform:none; }
.btn-icon-label.muted { color:#5d7185; background:#f0f3f6; }
.btn-icon-label.muted:hover { color:#fff; background:#5d7185; }
.btn-icon-only { width:34px; padding:0 !important; font-size:20px !important; }
.btn-icon-only.danger { color:#c84141; background:#fff0f0; }
.btn-icon-only.danger:hover { color:#fff; background:#d94a4a; transform:none; }
.app-modal { position:fixed; inset:0; z-index:100; display:none; place-items:center; padding:20px; }
.app-modal.open { display:grid; }
.modal-backdrop { position:absolute; inset:0; background:rgba(8,24,42,.55); backdrop-filter:blur(4px); }
.modal-panel { position:relative; width:min(560px,100%); padding:26px; border-radius:22px; background:#fff; box-shadow:0 30px 90px rgba(8,24,42,.26); animation:modalIn .18s ease-out; }
.modal-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
.modal-header h2 { margin:6px 0 0; color:#10243e; font-size:21px; }
.icon-button { display:grid; place-items:center; width:38px; height:38px; padding:0; color:#60758a; background:#f0f4f7; box-shadow:none; font-size:24px; }
.modal-grid { grid-template-columns:1fr 1fr; }
.modal-full { grid-column:1/-1; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; }
.btn-ghost { color:#60758a; background:#f0f4f7; box-shadow:none; }
.modal-open { overflow:hidden; }
@keyframes modalIn { from { opacity:0; transform:translateY(10px) scale(.98); } to { opacity:1; transform:none; } }
.employee-card-head { display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center; }
.emp-card .row { grid-template-columns:1fr auto; align-items:center; padding:10px 0; border-top:1px solid #edf2f7; }
.emp-card .actions button { padding:10px 7px; font-size:11px; }
@media (max-width: 900px) {
  .admin-overview { display:block; padding:24px; }
  .overview-stats { min-width:0; margin-top:20px; }
  .admin-two-columns { grid-template-columns:1fr; }
  .admin-shell #tblEmployees { min-width:850px; }
  .admin-shell .emp-table { overflow:auto; }
}
@media (max-width: 640px) {
  .admin-shell .emp-table { display:none; }
  .admin-shell .emp-cards { display:grid; }
  .overview-copy h2 { font-size:22px; }
  .overview-stats { grid-template-columns:repeat(3,1fr); gap:7px; }
  .overview-stats div { padding:11px 8px; }
  .overview-stats strong { font-size:20px; }
  .modal-grid { grid-template-columns:1fr; }
  .modal-full { grid-column:auto; }
  .modal-actions { display:grid; grid-template-columns:1fr; }
}

/* V10 — Enregistrement facial premium et réellement mobile */
.face-enrollment-card { min-width:0; overflow:hidden; }
.face-enrollment-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:18px; }
.face-enrollment-heading .eyebrow { color:#D97706; }
.face-enrollment-heading h2 { margin:5px 0 5px !important; }
.face-enrollment-heading p { max-width:470px; margin:0; color:#71869A; font-size:12px; line-height:1.55; }
.camera-secure-badge { display:inline-flex; flex:0 0 auto; align-items:center; gap:6px; padding:7px 10px; border:1px solid #D8EFE4; border-radius:999px; color:#16784B; background:#F0FAF5; font-size:10px; font-weight:800; }
.camera-secure-badge svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.face-enrollment-filters { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; margin-bottom:12px; }
.face-enrollment-filters label { min-width:0; }
.face-enrollment-filters select { display:block; width:100%; min-width:0; text-overflow:ellipsis; }
.admin-two-columns > *, .admin-two-columns .card { min-width:0; }
.admin-two-columns .face-camera-frame { position:relative; width:100%; height:auto; min-height:0; max-width:none; aspect-ratio:4 / 3; margin:0 0 12px; overflow:hidden; border:1px solid #D8E4EF; border-radius:18px; background:linear-gradient(145deg,#06101B,#0A1C2D); box-shadow:inset 0 0 0 1px rgba(255,255,255,.05); }
.face-camera-frame video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.face-camera-frame .overlay { border:0; border-radius:18px; background:radial-gradient(circle at 50% 44%,transparent 0,transparent 31%,rgba(1,12,22,.14) 54%,rgba(1,12,22,.38) 100%); }
.face-camera-frame .face-circle { top:50%; left:50%; width:clamp(122px,38%,170px); height:clamp(178px,66%,235px); border:1.5px solid rgba(255,255,255,.76); border-radius:46% 46% 43% 43% / 40% 40% 52% 52%; box-shadow:0 0 0 1px rgba(10,104,181,.18),0 0 28px rgba(7,89,165,.13); }
.face-camera-frame .face-circle::before,
.face-camera-frame .face-circle::after,
.face-camera-frame .face-circle span::before,
.face-camera-frame .face-circle span::after { content:""; position:absolute; width:24px; height:24px; border-color:#F4A000; border-style:solid; }
.face-camera-frame .face-circle::before { top:-4px; left:-4px; border-width:3px 0 0 3px; border-radius:9px 0 0; }
.face-camera-frame .face-circle::after { top:-4px; right:-4px; border-width:3px 3px 0 0; border-radius:0 9px 0 0; }
.face-camera-frame .face-circle span::before { bottom:-4px; left:-4px; border-width:0 0 3px 3px; border-radius:0 0 0 9px; }
.face-camera-frame .face-circle span::after { right:-4px; bottom:-4px; border-width:0 3px 3px 0; border-radius:0 0 9px; }
.camera-permission { position:absolute; inset:0; z-index:4; display:none; align-items:center; justify-content:center; padding:18px; color:#fff; text-align:center; background:rgba(2,13,24,.7); backdrop-filter:blur(5px); }
.camera-permission-card { width:min(300px,100%); padding:20px 18px 17px; border:1px solid rgba(255,255,255,.13); border-radius:18px; background:rgba(9,30,49,.9); box-shadow:0 18px 50px rgba(0,0,0,.28); }
.camera-permission-icon { display:grid; place-items:center; width:44px; height:44px; margin:0 auto 10px; border:1px solid rgba(255,255,255,.16); border-radius:14px; color:#F6AD1B; background:rgba(255,255,255,.08); }
.camera-permission-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.camera-permission-card h3 { margin:0 0 6px; color:#fff; font-size:16px; }
.camera-permission-card p { margin:0 0 14px; color:rgba(255,255,255,.72); font-size:11px; line-height:1.5; }
.camera-permission-card small { display:block; margin-top:10px; color:rgba(255,255,255,.48); font-size:9px; }
.camera-enable-button,.face-capture-button { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; }
.camera-enable-button { min-height:44px; padding:10px 14px; border-radius:12px; background:linear-gradient(135deg,#1375C5,#0759A5); box-shadow:0 8px 20px rgba(0,70,135,.28); font-size:13px; }
.camera-enable-button svg,.face-capture-button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.face-capture-button { min-height:50px; border-radius:14px; background:linear-gradient(135deg,#075EAB,#064A88); box-shadow:0 9px 20px rgba(7,89,165,.2); font-size:14px; }
.face-enrollment-card #adminStatus { min-height:18px; margin-top:9px; text-align:center; font-size:11px; }
@media (max-width:640px) {
  .face-enrollment-card { padding:16px 14px; }
  .face-enrollment-heading { gap:10px; margin-bottom:15px; }
  .face-enrollment-heading p { font-size:11px; }
  .camera-secure-badge { padding:6px 8px; font-size:9px; }
  .face-enrollment-filters { grid-template-columns:1fr; gap:9px; }
  .admin-two-columns .face-camera-frame { height:auto; max-height:none; aspect-ratio:4 / 3; border-radius:16px; }
  .face-camera-frame .overlay { border-radius:16px; }
  .face-camera-frame .face-circle { width:clamp(112px,39%,145px); height:clamp(158px,65%,196px); }
  .camera-permission { padding:12px; }
  .camera-permission-card { padding:16px 14px 14px; border-radius:16px; }
  .camera-permission-icon { width:38px; height:38px; margin-bottom:8px; border-radius:12px; }
  .camera-permission-card p { margin-bottom:11px; }
}
