/* ══ EVT — Plateforme de Pointage ══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Brand */
  --p:  #009FE3; --p2: #0082c8; --p3: #005f9e;
  --pl: #e6f6fd; --pm: #99d8f5;
  --ac: #E3001B; --al: #fde8ea;
  --su: #059669; --sl: #ecfdf5;
  --da: #dc2626; --dl: #fef2f2;
  --go: #d97706; --gl: #fffbeb;

  /* Surfaces */
  --bg:  #f1f5f9;
  --bg2: #ffffff;
  --bg3: #f8fafc;
  --bg4: #e2e8f0;

  /* Borders */
  --bd:  #e2e8f0;
  --bd2: #cbd5e1;

  /* Text */
  --tx:  #0f172a;
  --tx2: #475569;
  --tx3: #94a3b8;

  /* Shadows */
  --sh:  0 1px 3px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.06);
  --sh2: 0 8px 32px rgba(0,159,227,.13), 0 2px 8px rgba(0,0,0,.06);
  --sh3: 0 24px 64px rgba(15,23,42,.14), 0 4px 16px rgba(0,0,0,.07);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Transitions */
  --t:     all .18s ease;
  --t-fast: all .11s ease;

  /* Layout */
  --sidebar-w: 252px;
}

/* ── BASE ── */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--tx3); }
::selection { background: var(--pl); color: var(--p2); }

/* ── LAYOUT ── */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ══ SIDEBAR ══ */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.s-logo {
  padding: 1.4rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--bd);
  display: flex;
  align-items: center;
  gap: 10px;
}
.s-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #E3001B;
  letter-spacing: 1.5px;
}
.s-badge {
  font-size: .57rem;
  background: var(--pl);
  color: var(--p);
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 600;
  margin-top: 2px;
  display: inline-block;
  letter-spacing: .3px;
}
.s-sec {
  padding: 1.15rem 1.3rem .3rem;
  font-size: .61rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--tx3);
  font-weight: 600;
}
.ni {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: .62rem 1.05rem;
  margin: 2px .6rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: .845rem;
  color: var(--tx2);
  transition: var(--t);
  border: none;
  background: none;
  width: calc(100% - 1.2rem);
  text-align: left;
  font-family: 'Inter', sans-serif;
  position: relative;
}
.ni:hover { background: var(--bg3); color: var(--tx); }
.ni.active {
  background: var(--pl);
  color: var(--p);
  font-weight: 600;
}
.ni.active::before {
  content: '';
  position: absolute;
  left: -.6rem;
  top: 18%;
  bottom: 18%;
  width: 3px;
  background: var(--p);
  border-radius: 0 3px 3px 0;
}
.ni .ico { width: 18px; text-align: center; flex-shrink: 0; font-size: .95rem; }
.nbadge {
  margin-left: auto;
  background: var(--p);
  color: #fff;
  font-size: .59rem;
  padding: 2px 7px;
  border-radius: 50px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}
.nbadge.g { background: var(--su); }

.s-foot {
  margin-top: auto;
  padding: .9rem;
  border-top: 1px solid var(--bd);
}
.u-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: .6rem .75rem;
  border-radius: var(--r-sm);
  background: var(--bg3);
  cursor: pointer;
  transition: var(--t);
}
.u-row:hover { background: var(--bg4); }
.av {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
}
.av.dg  { background: linear-gradient(135deg, #009FE3, #E3001B); }
.av.soc { background: linear-gradient(135deg, #059669, #0d9488); }
.av.ag  { background: linear-gradient(135deg, #d97706, #dc2626); }
.u-name { font-size: .79rem; font-weight: 500; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: .65rem; color: var(--tx3); margin-top: 1px; }
.logout {
  width: 26px; height: 26px;
  border-radius: var(--r-xs);
  border: 1px solid var(--bd);
  background: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--tx3);
  font-size: .8rem;
  transition: var(--t);
  flex-shrink: 0;
}
.logout:hover { background: var(--dl); color: var(--da); border-color: #fecaca; }

/* ══ TOPBAR ══ */
.topbar {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bd);
  padding: .85rem 1.9rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
}
.tb-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
  color: var(--tx);
  letter-spacing: -.2px;
}
.srch {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  border: 1.5px solid var(--bd);
  border-radius: var(--r-sm);
  padding: .44rem .95rem;
  width: 215px;
  transition: var(--t);
}
.srch:focus-within {
  border-color: var(--p);
  background: var(--bg2);
  box-shadow: 0 0 0 3px rgba(0,159,227,.09);
}
.srch input { background: none; border: none; outline: none; font-size: .83rem; color: var(--tx); width: 100%; font-family: 'Inter', sans-serif; }
.srch input::placeholder { color: var(--tx3); }

/* ══ BUTTONS ══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .5rem 1.1rem;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: var(--t);
  white-space: nowrap;
  letter-spacing: .1px;
  user-select: none;
}
.btn:active { transform: scale(.96); }

.bp {
  background: var(--p);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,159,227,.28);
}
.bp:hover {
  background: var(--p2);
  box-shadow: 0 4px 18px rgba(0,159,227,.38);
  transform: translateY(-1px);
}
.bp:active { transform: scale(.96); box-shadow: 0 1px 6px rgba(0,159,227,.2); }

.bo {
  background: var(--bg2);
  color: var(--tx2);
  border: 1.5px solid var(--bd);
}
.bo:hover { background: var(--bg3); border-color: var(--bd2); color: var(--tx); }

.bs { background: var(--sl); color: var(--su); border: 1.5px solid #a7f3d0; }
.bs:hover { background: #d1fae5; }

.br { background: var(--dl); color: var(--da); border: 1.5px solid #fecaca; }
.br:hover { background: #fee2e2; border-color: #fca5a5; }

.notif-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--bd);
  background: var(--bg2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  position: relative;
  transition: var(--t);
}
.notif-btn:hover { background: var(--bg3); border-color: var(--bd2); }
.ndot {
  display: none;
  position: absolute;
  top: 4px; right: 4px;
  min-width: 17px; height: 17px;
  border-radius: 999px;
  background: #ef4444;
  border: 2px solid #fff;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ══ CONTENT ══ */
.main { display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1; padding: 2rem 2.1rem; }
.page { display: none; }
.page.active { display: block; animation: pgIn .2s ease; }
@keyframes pgIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* ══ PAGE HEADER ══ */
.ph {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.pt { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--tx); letter-spacing: -.3px; }
.ps { font-size: .79rem; color: var(--tx3); margin-top: 4px; line-height: 1.55; }
.flex { display: flex; align-items: center; }
.gap1 { gap: .4rem; }

/* ══ CARDS ══ */
.card {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow .22s ease, transform .22s ease;
}
.card:hover { box-shadow: var(--sh); }
.card-h {
  padding: 1.05rem 1.45rem;
  border-bottom: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.card-t { font-weight: 600; font-size: .9rem; color: var(--tx); }
.card-b { padding: 1.45rem; }

/* ══ KPI ══ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.kpi {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  padding: 1.3rem 1.4rem;
  transition: var(--t);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0) 60%, rgba(255,255,255,.4) 100%);
  pointer-events: none;
}
.kpi:hover { box-shadow: var(--sh2); transform: translateY(-2px); }
.kpi-ico {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.kpi.kp  .kpi-ico { background: var(--pl); box-shadow: 0 4px 14px rgba(0,159,227,.18); }
.kpi.kac .kpi-ico { background: var(--al); box-shadow: 0 4px 14px rgba(227,0,27,.14); }
.kpi.ks  .kpi-ico { background: var(--sl); box-shadow: 0 4px 14px rgba(5,150,105,.14); }
.kpi.kg  .kpi-ico { background: var(--gl); box-shadow: 0 4px 14px rgba(217,119,6,.14); }
.kpi-v {
  font-family: 'Syne', sans-serif;
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--tx);
  line-height: 1;
  letter-spacing: -1.5px;
}
.kpi-l { font-size: .73rem; color: var(--tx3); margin-top: 5px; }
.kpi-tr { font-size: .69rem; color: var(--su); font-weight: 600; margin-top: 9px; }

/* ══ PILLS ══ */
.pill {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .67rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .2px;
}
.pl  { background: #dcfce7; color: #15803d; }
.ps2 { background: var(--pl); color: var(--p2); }
.pd  { background: var(--bg4); color: var(--tx3); }
.pw  { background: #fef9c3; color: #92400e; }
.pr2 { background: var(--dl); color: var(--da); }
.bdg { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px; font-size: .67rem; font-weight: 600; }

/* ══ PROGRESS ══ */
.pbar { height: 6px; background: var(--bg4); border-radius: 50px; overflow: hidden; }
.pfill { height: 100%; border-radius: 50px; background: linear-gradient(90deg, var(--p), var(--ac)); transition: width .7s ease; }

/* ══ TABLES ══ */
.tbl { width: 100%; border-collapse: collapse; font-size: .83rem; }
.tbl th {
  text-align: left;
  padding: .75rem 1.1rem;
  font-size: .64rem;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--tx3);
  font-weight: 600;
  background: var(--bg3);
  border-bottom: 1px solid var(--bd);
}
.tbl td {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--bd);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg3); }
.nm  { font-weight: 500; color: var(--tx); }
.sub { font-size: .71rem; color: var(--tx3); margin-top: 2px; }

/* ══ AVATAR ══ */
.ava {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .71rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ══ FORMS ══ */
.fg { display: flex; flex-direction: column; gap: 5px; margin-bottom: .95rem; }
.fl { font-size: .73rem; font-weight: 600; color: var(--tx2); letter-spacing: .1px; }
.fi {
  padding: .65rem 1rem;
  border: 1.5px solid var(--bd);
  border-radius: var(--r-sm);
  font-size: .855rem;
  color: var(--tx);
  background: var(--bg2);
  font-family: 'Inter', sans-serif;
  transition: var(--t);
  width: 100%;
}
.fi::placeholder { color: var(--tx3); }
.fi:hover:not(:focus) { border-color: var(--bd2); }
.fi:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px rgba(0,159,227,.1); }
select.fi {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}
textarea.fi { resize: vertical; min-height: 90px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .95rem; }
.full { grid-column: 1 / -1; }
.div { height: 1px; background: var(--bd); margin: 1.25rem 0; }

/* ══ TABS ══ */
.tabs { display: flex; border-bottom: 1px solid var(--bd); margin-bottom: 1.45rem; }
.tab {
  padding: .65rem 1.05rem;
  font-size: .81rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--tx3);
  transition: var(--t);
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: 'Inter', sans-serif;
  margin-bottom: -1px;
}
.tab.active { color: var(--p); border-bottom-color: var(--p); font-weight: 600; }
.tab:hover:not(.active) { color: var(--tx2); }
.tp { display: none; }
.tp.active { display: block; }

/* ══ AI BOX ══ */
.ai-box {
  background: linear-gradient(135deg, var(--pl) 0%, #fafeff 55%, var(--al) 100%);
  border: 1px solid var(--pm);
  border-radius: var(--r-md);
  padding: 1.2rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 1.5rem;
}
.ai-ico {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #009FE3, #E3001B);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .9rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,159,227,.22);
}
.ai-tit { font-size: .77rem; font-weight: 700; color: var(--p); margin-bottom: 3px; }
.ai-txt { font-size: .78rem; color: var(--tx2); line-height: 1.6; }

/* ══ SCAN FEED ══ */
.sfeed { display: flex; flex-direction: column; gap: 7px; }
.se {
  display: flex; align-items: center; gap: 10px;
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--bd);
  background: var(--bg2);
  transition: var(--t);
}
.se.ok   { border-color: #bbf7d0; background: #f0fdf4; }
.se.late { border-color: #fde68a; background: #fffbeb; }
.se.err  { border-color: #fecaca; background: var(--dl); }
.se-ico { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.se.ok   .se-ico { background: #dcfce7; color: #15803d; }
.se.late .se-ico { background: #fef9c3; color: #a16207; }
.se.err  .se-ico { background: #fee2e2; color: #dc2626; }
.se-nm { font-size: .81rem; font-weight: 500; color: var(--tx); }
.se-dt { font-size: .69rem; color: var(--tx3); }
.se-tm { margin-left: auto; font-size: .69rem; color: var(--tx3); white-space: nowrap; }

/* ══ QR FRAME ══ */
.qrframe {
  width: 168px; height: 168px;
  border-radius: var(--r-md);
  border: 2px dashed var(--pm);
  background: linear-gradient(145deg, var(--pl), #f0f9ff);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin: .9rem auto;
  position: relative;
  overflow: hidden;
  transition: var(--t);
  cursor: pointer;
}
.qrframe:hover { border-color: var(--p); background: var(--pl); transform: scale(1.02); }
.qrline {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--p), transparent);
  animation: scan 2s ease-in-out infinite;
}
@keyframes scan { 0% { top: 8%; } 100% { top: 90%; } }

/* ══ MODALS ══ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.overlay.show { display: flex; }
.modal {
  background: var(--bg2);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--sh3);
  animation: mIn .22s cubic-bezier(.34, 1.48, .64, 1);
}
@keyframes mIn {
  from { transform: scale(.92) translateY(16px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}
.modal-h {
  padding: 1.3rem 1.55rem;
  border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-t { font-family: 'Syne', sans-serif; font-weight: 700; font-size: .97rem; }
.modal-cls {
  width: 28px; height: 28px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--bd);
  background: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--tx3);
  font-size: 1rem;
  transition: var(--t);
}
.modal-cls:hover { background: var(--dl); color: var(--da); border-color: #fecaca; }
.modal-b { padding: 1.55rem; }
.modal-f {
  padding: 1.05rem 1.55rem;
  border-top: 1px solid var(--bd);
  display: flex; justify-content: flex-end; gap: .6rem;
  background: var(--bg3);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ══ LOGIN ══ */
#login-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(145deg, #ddf0fb 0%, #f0f4ff 45%, #fde8ea 100%);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.login-wrap {
  width: 100%;
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.login-card {
  background: var(--bg2);
  border-radius: var(--r-xl);
  padding: 2.5rem 2.1rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 28px 80px rgba(0,159,227,.1), 0 4px 24px rgba(0,0,0,.07);
  border: 1px solid rgba(226,232,240,.9);
}
@media (max-width: 480px) {
  .login-wrap { padding: 1rem; }
  .login-card { padding: 1.8rem 1.3rem; border-radius: var(--r-lg); }
  .ll-name { font-size: 1.25rem; }
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.ll-name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.5rem; color: #E3001B; letter-spacing: 2px; margin-top: .5rem; }
.ll-sub { font-size: .72rem; color: var(--tx3); margin-top: 3px; letter-spacing: .5px; }

/* Role buttons (login) */
.role-sel { display: flex; gap: 6px; margin-bottom: 1rem; }
.rb {
  flex: 1;
  padding: .58rem .5rem;
  text-align: center;
  border: 1.5px solid var(--bd);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: .76rem;
  color: var(--tx3);
  transition: var(--t);
  background: var(--bg2);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}
.rb.active { border-color: var(--p); background: var(--pl); color: var(--p); font-weight: 600; }
.rb:hover:not(.active) { background: var(--bg3); border-color: var(--bd2); }
.rtab { padding: .55rem .4rem; text-align: center; border: 1.5px solid var(--bd); border-radius: var(--r-sm); cursor: pointer; font-size: .73rem; color: var(--tx3); transition: var(--t); background: var(--bg2); font-family: 'Inter', sans-serif; font-weight: 500; }
.rtab.active { border-color: var(--p); background: var(--pl); color: var(--p); }
.rtab:hover:not(.active) { background: var(--bg3); }
.lb { font-size: .7rem; letter-spacing: 1px; text-transform: uppercase; color: var(--tx3); background: none; border: 1.5px solid var(--bd); cursor: pointer; padding: 3px 10px; border-radius: 50px; transition: var(--t); font-family: 'Inter', sans-serif; }
.lb.active, .lb:hover { color: var(--p); border-color: var(--pm); background: var(--pl); }

/* ══ SOCIETIES ══ */
.g2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.05rem; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .95rem; }
.filt-btn {
  padding: .32rem .9rem;
  border-radius: 50px;
  font-size: .73rem;
  border: 1.5px solid var(--bd);
  background: var(--bg2);
  color: var(--tx3);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--t);
}
.filt-btn.active { background: var(--pl); color: var(--p); border-color: var(--pm); font-weight: 600; }
.filt-btn:hover:not(.active) { border-color: var(--pm); color: var(--p); }
.ev-tag { display: inline-flex; align-items: center; gap: 3px; background: var(--bg3); border: 1px solid var(--bd); border-radius: 5px; padding: 3px 7px; font-size: .67rem; color: var(--tx2); margin: 2px; }
.ev-tag .qt { font-weight: 700; color: var(--p); }

/* ══ EVENT ROWS ══ */
.ev-row { background: var(--bg3); border-radius: 9px; padding: .75rem .95rem; display: flex; align-items: center; gap: .7rem; border: 1.5px solid var(--bd); transition: var(--t); }
.ev-row.selected { background: var(--pl); border-color: var(--pm); }
.ev-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--p); cursor: pointer; flex-shrink: 0; }
.ev-row-name { font-size: .82rem; font-weight: 500; color: var(--tx); }
.ev-row-date { font-size: .68rem; color: var(--tx3); margin-top: 1px; }
.quota-fi { width: 76px; padding: .32rem .48rem; border: 1.5px solid var(--bd); border-radius: var(--r-xs); font-size: .81rem; text-align: center; font-family: 'Inter', sans-serif; background: var(--bg2); transition: var(--t); }
.quota-fi:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 2px rgba(0,159,227,.1); }
.quota-fi:disabled { background: var(--bg3); color: var(--tx3); }

/* ══ EVENT DATE BOX ══ */
.ev-date { width: 50px; height: 50px; border-radius: 10px; background: var(--pl); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.ev-day { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--p); line-height: 1; }
.ev-mon { font-size: .55rem; text-transform: uppercase; color: var(--p); letter-spacing: .5px; }

/* ══ MISC ══ */
.rel { position: relative; }
.notif-drop {
  position: absolute; top: calc(100% + 9px); right: 0;
  width: 300px; background: var(--bg2);
  border: 1px solid var(--bd); border-radius: var(--r-md);
  box-shadow: var(--sh2); z-index: 100; display: none; overflow: hidden;
}
.notif-drop.show { display: block; animation: dropIn .15s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.notif-item { padding: .85rem 1.05rem; border-bottom: 1px solid var(--bd); cursor: pointer; transition: var(--t-fast); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg3); }
.notif-item.unread { background: var(--pl); }
.ni-t { font-size: .79rem; font-weight: 600; color: var(--tx); }
.ni-s { font-size: .71rem; color: var(--tx3); margin-top: 2px; line-height: 1.45; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: .72rem .9rem; border-bottom: 1px solid var(--bd); cursor: pointer; transition: var(--t-fast); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--pl); }
.confirm-bar { background: linear-gradient(135deg, var(--sl), var(--pl)); border: 1px solid #a7f3d0; border-radius: 10px; padding: .95rem 1.2rem; display: flex; align-items: center; gap: 10px; margin-bottom: 1.05rem; }

/* ══ LOADING ══ */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(248,250,252,.93);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
}
.loading-spinner { width: 44px; height: 44px; border: 3px solid var(--bd); border-top: 3px solid var(--p); border-radius: 50%; animation: spin .72s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: .86rem; color: var(--tx2); font-family: 'Inter', sans-serif; font-weight: 500; }

/* ══ TOAST ══ */
.toast {
  position: fixed;
  bottom: 1.6rem; right: 1.6rem;
  background: var(--tx);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: var(--r-sm);
  font-size: .81rem;
  display: none;
  z-index: 999;
  animation: toIn .22s cubic-bezier(.34, 1.48, .64, 1);
  max-width: 320px;
  line-height: 1.5;
  box-shadow: 0 8px 36px rgba(15,23,42,.22);
}
@keyframes toIn { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ══ SCAN SUCCESS FLASH ══ */
.scan-success { position: fixed; inset: 0; background: rgba(5,150,105,.07); z-index: 300; display: none; pointer-events: none; animation: flash .6s ease; }
@keyframes flash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

/* ══ SCAN FEED ANIMATION ══ */
@keyframes slideIn { from { transform: translateX(-10px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ══ MISC UTILS ══ */
.cb { width: 15px; height: 15px; accent-color: var(--p); cursor: pointer; }
.s-user { margin-top: auto; padding: .85rem; border-top: 1px solid var(--bd); }

/* ══ HAMBURGER ══ */
#btn-sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--bd);
  background: var(--bg2);
  cursor: pointer;
  align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--tx2);
  transition: var(--t);
  flex-shrink: 0;
}
#btn-sidebar-toggle:hover { background: var(--bg3); color: var(--tx); }

/* ══ SIDEBAR OVERLAY (mobile) ══ */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 299;
}
#sidebar-overlay.show { display: block; }

/* ══ RESPONSIVE ══ */

/* Tablet — 1024px */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .g2 { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 1.5rem 1.6rem; }
}

/* Mobile — 768px */
@media (max-width: 768px) {
  :root { --sidebar-w: 265px; }

  /* Full-width layout — no sidebar column */
  .app { grid-template-columns: 1fr; }

  /* Sidebar: fixed drawer, hidden off-screen */
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-w));
    top: 0;
    height: 100dvh;
    z-index: 300;
    box-shadow: none;
    transition: left .26s cubic-bezier(.4,0,.2,1), box-shadow .26s ease;
  }
  .sidebar.open {
    left: 0;
    box-shadow: var(--sh3);
  }

  /* Hamburger button — visible on mobile */
  #btn-sidebar-toggle { display: flex; }

  /* Topbar */
  .topbar { padding: .7rem 1rem; gap: .55rem; }
  .tb-title { font-size: .88rem; }
  .srch { display: none; }

  /* Content */
  .content { padding: 1rem; }

  /* Page header */
  .ph { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .ph > .flex { width: 100%; justify-content: flex-start; flex-wrap: wrap; }

  /* KPIs */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: 1.2rem; }
  .kpi { padding: 1rem 1.1rem; }
  .kpi-v { font-size: 1.6rem; letter-spacing: -1px; }
  .kpi-ico { width: 36px; height: 36px; font-size: .9rem; margin-bottom: .8rem; }

  /* Grids */
  .g2, .g3 { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }

  /* AI box */
  .ai-box { flex-direction: column; gap: .8rem; }
  .ai-box > .btn { align-self: flex-end; }

  /* Tables: scroll container */
  .card { overflow-x: auto; }
  .tbl { min-width: 560px; }

  /* Modals */
  .overlay { padding: .5rem; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: var(--r-xl) var(--r-xl) var(--r-sm) var(--r-sm);
    animation: mInMobile .24s cubic-bezier(.34,1.48,.64,1);
  }
  @keyframes mInMobile {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* Toast: full-width at bottom */
  .toast { left: 1rem; right: 1rem; max-width: none; bottom: 1rem; }

  /* Action button in topbar: shorter text */
  #tb-action { padding: .45rem .8rem; font-size: .76rem; }

  /* Tabs: scrollable */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; white-space: nowrap; }
  .tab { flex-shrink: 0; }

  /* Pointage scan card full width */
  #page-pointage .g2 { grid-template-columns: 1fr; }
}

/* Small mobile — 480px */
@media (max-width: 480px) {
  .content { padding: .75rem; }
  .kpi-grid { gap: .5rem; }
  .kpi { padding: .85rem .9rem; }
  .kpi-v { font-size: 1.35rem; }
  .kpi-ico { width: 30px; height: 30px; font-size: .78rem; margin-bottom: .6rem; border-radius: 8px; }
  .kpi-l { font-size: .65rem; }
  .kpi-tr { font-size: .63rem; }

  /* Hide topbar action on very small screens — use page header btn */
  #tb-action { display: none; }
  /* Show page header button on mobile */
  .ph .btn { display: inline-flex !important; }

  .topbar { height: 52px; padding: .6rem .75rem; }
  .modal-b { padding: 1.1rem; }
  .modal-f { padding: .85rem 1.1rem; }
  .card-b { padding: 1rem; }
  .card-h { padding: .8rem 1rem; }

  /* Stack card header on small screens */
  .card-h { flex-wrap: wrap; gap: .5rem; }
}
