/* ══════════════════════════════════════════════════
   MODULE DE POINTAGE — Main CSS
   Design: Bleu marine, HP calc menu, dark/light
   ══════════════════════════════════════════════════ */

:root {
  --primary:       #0f2044;
  --primary-2:     #1a3a6b;
  --accent:        #38bdf8;
  --accent-dark:   #0284c7;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #6366f1;

  --bg:            #f0f4f8;
  --surface:       #ffffff;
  --surface-2:     #e8edf5;
  --border:        #d1dae8;
  --text:          #6366f1;
  --text-muted:    #38bdf8; /* #64748b; */
  --shadow:        0 4px 24px rgba(15,32,68,.10);
  --shadow-card:   0 8px 40px rgba(15,32,68,.08);

  /* HP nav */
  --hp-bg:         #0a1628;
  --hp-dark-bg:    #0C0F14;
  --hp-btn:        #0f2044;
  --hp-btn-hover:  #1a3a6b;
  --hp-btn-active: #38bdf8;
  --hp-text:       #94b8d0;
  --hp-text-active:#0a1628;
  --hp-border:     #1e3356;
  --good: #0f9f6e;
  --warn: #b7791f;
  --metal: linear-gradient(145deg, #050608, #252b32 48%, #090b0d);
  --metal-blue: linear-gradient(145deg, #071827, #145a8d 52%, #09243a);
  --hp-black: linear-gradient(180deg, #38424b 0%, #10151a 46%, #06080a 100%);
  --hp-black-hover: linear-gradient(180deg, #46515a 0%, #172029 48%, #07090c 100%);
  --hp-yellow: linear-gradient(180deg, #ffe56d 0%, #FFDD1A 54%, #FF8F05 100%);
  --hp-cyan: linear-gradient(180deg, #68f6ff 0%, #16b8d4 54%, #08708a 100%);
  --hp-blue: linear-gradient(180deg, #0000CD 0%, #0000FF 54%, #7575FF 100%);
  --hp-royalblue: linear-gradient(180deg, #57ABFF 0%, #4169E1 54%, #0000CD 100%);
  --hp-red: linear-gradient(180deg, #FF0000 0%, #FF4747 54%, #FF7070 100%);
  --hp-magenta: #d5569f;
  --hp-blue-label: #30d7ff;
  --hp-amber-label: #f1bd2f;
  --shadow: 0 24px 60px rgba(15, 23, 42, .13);
  /* inputs */
  --input-bg:      #f8fafc;
  --input-border:  #d1dae8;
  --input-focus:   #38bdf8;

  --radius-card:   21px;
  --radius-btn:    8px;
  --radius-input:  6px;

  --sidebar-w:     220px;
  --topbar-h:      60px;
  --font-main:     'Poppins', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg:            #070d1a;
  --surface:       #0f1829;
  --surface-2:     #162035;
  --border:        #1e3356;
  --text:          #e2e8f0;
  --text-muted:    #7a8fa8;
  --shadow:        0 4px 24px rgba(0,0,0,.4);
  --shadow-card:   0 8px 40px rgba(0,0,0,.35);
  --input-bg:      #0d1a2e;
  --input-border:  #1e3356;
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

.nav-tab,
.metal-btn,
.hp-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* min-height: 32px; */
  height: 34px !important;
  border: 1px solid rgba(190, 210, 220, .28);
  border-radius: 8px;
  background: var(--hp-black);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(0,0,0,.75);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -3px 0 rgba(0,0,0,.46),
    inset 0 0 0 1px rgba(0,0,0,.38),
    0 3px 0 #030405,
    0 12px 24px rgba(0,0,0,.22);
  transition: transform .16s ease, background .16s ease, filter .16s ease, box-shadow .16s ease;
}

.nav-tab::before,
.metal-btn::before,
.hp-btn::before {
  content: "";
  position: absolute;
  inset: 3px 4px auto;
  z-index: -1;
  height: 34px !important;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.03));
}

.hp-metal {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  padding: 8px 10px 8px 10px;
  line-height: 1;
  height: 34px !important;
  text-transform: uppercase;
}

.hp-btn {

  min-width: 64px;
  /*padding: 8px 10px 8px 10px; */
  /*line-height: 1;*/
  height: 34px !important;
  text-transform: none;
}

.nav-tab {
  padding: 0 14px;
  text-align: left;
}

.nav-tab.active,
.nav-tab:hover,
.metal-btn:hover,
.hp-btn:hover {
  background: var(--hp-black-hover);
  transform: translateY(-1px);
}

.metal-btn:active,
.hp-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(0,0,0,.5),
    0 1px 0 #030405,
    0 7px 14px rgba(0,0,0,.18);
}

.metal-btn.primary,
.hp-btn.primary,
.hp-btn.hp-cyan {
  background: var(--hp-cyan);
  color: #FAFAD2;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

.hp-btn.hp-yellow {
  background: var(--hp-yellow);
  color: #00008B;
  text-shadow: 0 1px 0 rgba(255,255,255,.42);
}

.hp-btn.hp-blue {
	background: var(--hp-blue);
	color: #FAFAD2;
	text-shadow: 0 1px 0 rgba(255,255,255,.42);
}

.hp-btn.hp-royalblue {
	background: var(--hp-royalblue);
	color: #FAFAD2;
	text-shadow: 0 1px 0 rgba(255,255,255,.42);
}
.hp-btn.hp-red {
	background: var(--hp-red);
	color: #FAFAD2;
	text-shadow: 0 1px 0 rgba(255,255,255,.42);
}

.hp-btn.hp-wide {
  min-width: 80px;
  height: 34px !important;
}

.hp-btn .hp-main,
.hp-btn .hp-sub {
  display: block;
}

.hp-btn .hp-main {
  font-size: 14px;
  font-weight: 900;
}

.hp-btn .hp-sub {
  margin-top: 4px;
  color: var(--hp-blue-label);
  font-size: 10px;
  font-weight: 900;
}

.hp-btn .hp-sub.hp-pink {
  color: var(--hp-magenta);
}

.hp-btn .hp-top {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  color: var(--hp-amber-label);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0,0,0,.8);
  transform: translateX(-50%);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── App Shell ──────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--hp-dark-bg) !important;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s;
  border-right: 1px solid var(--hp-border);
  margin-top: 0px;
}

.sidebar-logo {
  margin-top: 5px !important;
  align-items: center;
  margin-bottom: 5px !important;
  padding-bottom: 0px !important;
  display: block;          /* Eliminates standard inline layout canvas gaps */
}
/* 3. The Core Image Rules */
.sidebar-logo img {
  height: 65px;             /* Scales down if the container is tiny */
  max-width: 150px;        /* Limits absolute size so it won't blow up */
  width: auto;            /* Keeps the original asset aspect ratio intact */
  display: block;          /* Eliminates standard inline layout canvas gaps */
  object-fit: contain;     /* Fits entirely within box dimensions without warping */
  border-radius: 8px !important;
  border: 1px solid blue;
}

img{
  border-radius: 8px !important;
  padding: 0;
}

.logo-icon {
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1;
}
.logo-text {
  font-size: 19px !important;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 2.7px;
}

/* ── HP Scientific Calculator Menu ── */
.hp-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 12px;
  flex: 1;
  align-content: start;
}

.hp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--hp-btn);
  border: 1px solid var(--hp-border);
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .15s, border-color .15s;
  text-align: center;
  min-height: 62px;
  color: var(--hp-text);
}

.hp-btn:hover {
  background: #0000CC;/* var(--hp-btn-hover); */
  border-color: var(--accent);
  color: #ffffff; /* var(--accent); */
  transform: scale(1.04);
  box-shadow: 0 3px 12px rgba(56,189,248,.25);
}

.hp-btn.active {
  background: #1F8FFF;/* var(--accent); */
  border-color: var(--accent);
  color: var(--hp-text-active);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(56,189,248,.4);
}

.hp-btn:active {
  transform: scale(.97);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.3);
}

.hp-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.hp-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--hp-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 0;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--hp-border);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 32px !important; height: 32px !important;
  border-radius: 6px;
  margin-left: -10px;
  background: var(--accent);
  color: var(--hp-bg);
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-name {
  font-size: .75rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: .65rem;
  color: var(--hp-text);
}

.btn-logout {
  width: 32px !important; height: 32px !important;
  border-radius: 6px;
  margin-left: 36px;
  background: rgba(239,68,68,.15);
  color: #ef4444;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(239,68,68,.25);
  transition: background .2s;
  flex-shrink: 0;
}
.btn-logout:hover { background: rgba(239,68,68,.3); }

/* ─── Main Wrap ──────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .3s;
}

/* ─── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 200;
  box-shadow: var(--shadow);
  transition: background .3s, border-color .3s, left .3s;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text);
  cursor: pointer;
  padding: .3rem;
  border-radius: var(--radius-input);
}

.topbar-title {
  flex: 1;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  color: var(--text);
}
.theme-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.notif-bell {
  position: relative;
  font-size: 1.2rem;
  cursor: pointer;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .2s;
}
.notif-bell:hover { background: var(--surface-2); }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── Page Content ───────────────────────────────── */
.page-content {
  flex: 1;
  padding: 1.8rem;
  padding-top: calc(var(--topbar-h) + 1.8rem);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Page Header ────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.3px;
}
.page-header p {
  color: var(--text-muted);
  font-size: .88rem;
  margin-top: .2rem;
}
.page-header-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

/* ─── Cards ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: background .3s, border-color .3s;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  gap: 1rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.ci-blue   { background: rgba(56,189,248,.15); color: var(--accent); }
.ci-green  { background: rgba(16,185,129,.15); color: var(--success); }
.ci-orange { background: rgba(245,158,11,.15);  color: var(--warning); }
.ci-red    { background: rgba(239,68,68,.15);   color: var(--danger); }
.ci-indigo { background: rgba(99,102,241,.15);  color: var(--info); }

/* ─── KPI Cards ──────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: background .3s, transform .2s;
}
.kpi-card:hover { transform: translateY(-2px); }

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-info { flex: 1; }
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: .3rem;
  font-family: var(--font-mono);
}
.kpi-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi-delta {
  font-size: .75rem;
  font-weight: 600;
  margin-top: .2rem;
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }

/* ─── Grid Layouts ───────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.grid-12 { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; }
.grid-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-12, .grid-21 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius-btn);
  font-family: var(--font-main);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .18s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(.97); }

.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); }

.btn-accent    { background: var(--accent); color: #0a1628; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(1.1); }

.btn-warning   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(1.1); }

.btn-outline   { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(56,189,248,.06); }

.btn-ghost     { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: var(--border); }

.btn-sm { padding: .4rem .85rem; font-size: .78rem; }
.btn-lg { padding: .85rem 1.8rem; font-size: .95rem; }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: .95rem;
  transition: all .18s;
}
.btn-icon:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"],
input[type="password"], input[type="search"],
select, textarea {
  width: 100%;
  padding: .6rem .9rem;
  border-radius: var(--radius-input);
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: .88rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .3s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: .7;
}
textarea { resize: vertical; min-height: 90px; }

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group input {
  border-radius: var(--radius-input) 0 0 var(--radius-input);
  flex: 1;
}
.input-group .input-addon {
  padding: 0 .8rem;
  background: var(--surface-2);
  border: 1.5px solid var(--input-border);
  border-left: none;
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.input-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .3rem;
}
.input-error {
  font-size: .75rem;
  color: var(--danger);
  margin-top: .3rem;
}

/* ─── Badge / Status ─────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .7rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-success  { background: rgba(16,185,129,.15);  color: #059669; }
.badge-warning  { background: rgba(245,158,11,.15);   color: #d97706; }
.badge-danger   { background: rgba(239,68,68,.15);    color: #dc2626; }
.badge-info     { background: rgba(56,189,248,.15);   color: #0284c7; }
.badge-gray     { background: var(--surface-2);       color: var(--text-muted); }
.badge-primary  { background: rgba(15,32,68,.12);     color: var(--primary); }

[data-theme="dark"] .badge-primary { background: rgba(56,189,248,.15); color: var(--accent); }

/* ─── Table ──────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: calc(var(--radius-card) - 4px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

thead tr {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}
thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child { border-bottom: none; }
tbody td {
  padding: .8rem 1rem;
  vertical-align: middle;
  color: var(--text);
}

.td-mono { font-family: var(--font-mono); font-size: .82rem; }
.td-actions { display: flex; gap: .4rem; align-items: center; }

/* Employee avatar in table */
.emp-cell {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.emp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.emp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.emp-name { font-weight: 600; font-size: .88rem; }
.emp-mat  { font-size: .75rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ─── Search & Filters Bar ───────────────────────── */
.filters-bar {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.2rem;
}
.filters-bar input,
.filters-bar select {
  width: auto;
  min-width: 160px;
}

/* ─── Pagination ─────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .8rem;
}
.pagination-info { font-size: .8rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: .3rem; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.page-btn:hover, .page-btn.active {
  background: var(--accent);
  color: #0a1628;
  border-color: var(--accent);
}

/* ─── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,13,26,.7);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 860px; }
.modal-header {
  padding: 1.3rem 1.5rem .8rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.modal-body  { padding: 1.3rem 1.5rem; }
.modal-footer {
  padding: .8rem 1.5rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .7rem;
  justify-content: flex-end;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Alerts ─────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid transparent;
  margin-bottom: 1rem;
}
.alert-success { background: rgba(16,185,129,.1); color: #059669; border-color: rgba(16,185,129,.25); }
.alert-warning { background: rgba(245,158,11,.1);  color: #d97706; border-color: rgba(245,158,11,.25); }
.alert-danger  { background: rgba(239,68,68,.1);   color: #dc2626; border-color: rgba(239,68,68,.25); }
.alert-info    { background: rgba(56,189,248,.1);  color: #0284c7; border-color: rgba(56,189,248,.25); }

/* ─── Progress ───────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 50px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width .5s ease;
}

/* ─── Timeline ───────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: flex;
  gap: .8rem;
  padding-bottom: 1.2rem;
  position: relative;
}
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  z-index: 1;
}
.tl-content { flex: 1; padding-top: .3rem; }
.tl-title { font-weight: 600; font-size: .88rem; }
.tl-time  { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* ─── QR Code Viewer ─────────────────────────────── */
.qr-box {
  width: 180px; height: 180px;
  border-radius: 14px;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  margin: 0 auto;
  overflow: hidden;
}
.qr-box img { max-width: 160px; max-height: 160px; }

/* ─── Scan Widget ────────────────────────────────── */
.scan-area {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1;
  border-radius: 18px;
  background: #000;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scan-frame {
  width: 200px; height: 200px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4000px rgba(0,0,0,.5);
  animation: scanPulse 2s ease-in-out infinite;
}
@keyframes scanPulse {
  0%, 100% { border-color: var(--accent); box-shadow: 0 0 0 4000px rgba(0,0,0,.5), 0 0 20px rgba(56,189,248,.4); }
  50% { border-color: #fff; box-shadow: 0 0 0 4000px rgba(0,0,0,.5), 0 0 30px rgba(56,189,248,.7); }
}
.scan-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanLine 2s linear infinite;
}
@keyframes scanLine {
  0% { top: 0; }
  100% { top: 100%; }
}

/* ─── ZKTeco Status ──────────────────────────────── */
.device-statut {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
}
.statut-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.statut-dot.online  { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.statut-dot.offline { background: var(--danger);  box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.statut-dot.syncing { background: var(--warning);  animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ─── Calendar ───────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-header-cell {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: .4rem 0;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s;
  position: relative;
  padding: 2px;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.today { background: var(--accent); color: #0a1628; font-weight: 700; }
.cal-day.absent  { background: rgba(239,68,68,.15); }
.cal-day.present { background: rgba(16,185,129,.12); }
.cal-day.retard  { background: rgba(245,158,11,.12); }
.cal-day.conge   { background: rgba(99,102,241,.12); }
.cal-day.other-month { opacity: .35; }
.cal-day-dot { width: 5px; height: 5px; border-radius: 50%; margin-top: 2px; }

/* ─── Toast ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1.1rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn .25s ease;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--accent); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Login Page ─────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(56,189,248,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(56,189,248,.05) 0%, transparent 50%);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: .5rem;
}
.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.login-logo p { color: var(--text-muted); font-size: .85rem; margin-top: .2rem; }

/* ─── Divider ────────────────────────────────────── */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.2rem 0;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrap {
    margin-left: 0;
  }
  .topbar {
    left: 0;
  }
  .menu-toggle { display: flex; }
  .page-content {
    padding: 1.2rem;
    padding-top: calc(var(--topbar-h) + 1.2rem);
  }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .modal { max-width: 100%; margin: 0; border-radius: 14px 14px 0 0; align-self: flex-end; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 50px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Utilities ──────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-mono   { font-family: var(--font-mono); }
.fw-700      { font-weight: 700; }
.fw-600      { font-weight: 600; }
.fs-sm       { font-size: .82rem; }
.fs-xs       { font-size: .72rem; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
