/* ═══════════════════════════════════════════════════════════
   Jelenléti Nyilvántartó – V2 CSS
   ═══════════════════════════════════════════════════════════ */

:root {
  --sidebar-w:    220px;
  --sidebar-bg:   #1e293b;
  --sidebar-hover:#334155;
  --topbar-h:     48px;
  --primary:      #3b82f6;
}

/* ── Alap ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin:0; font-family:'Segoe UI',system-ui,sans-serif; background:#f1f5f9; }

/* ── Login ────────────────────────────────────────────── */
.login-wrap {
  min-height:100vh; display:flex;
  align-items:center; justify-content:center;
  background:linear-gradient(135deg,#1e293b,#334155);
}
.login-card { width:100%; max-width:420px; border-radius:12px; }

/* ── Topbar (mobil) ───────────────────────────────────── */
#topbar {
  position:fixed; top:0; left:0; right:0; height:var(--topbar-h);
  background:var(--sidebar-bg); color:#fff;
  display:flex; align-items:center; padding:0 1rem;
  z-index:200;
}

/* ── Sidebar ──────────────────────────────────────────── */
#sidebar {
  position:fixed; top:0; left:0; bottom:0; width:var(--sidebar-w);
  background:var(--sidebar-bg); color:#94a3b8;
  display:flex; flex-direction:column; z-index:150;
  transition:transform .25s ease;
}

@media (max-width:767px) {
  #sidebar { transform:translateX(-100%); top:var(--topbar-h); }
  #sidebar.open { transform:translateX(0); }
}

.sidebar-header {
  padding:1.25rem 1.2rem;
  font-weight:700; font-size:1rem; color:#fff;
  display:flex; align-items:center; gap:.6rem;
  border-bottom:1px solid #334155;
}
.sidebar-header i { font-size:1.3rem; color:var(--primary); }

.sidebar-menu { list-style:none; margin:0; padding:.5rem 0; flex:1; overflow-y:auto; }
.sidebar-menu li { }
.sidebar-menu .nav-link {
  display:flex; align-items:center; gap:.65rem;
  padding:.55rem 1.2rem; color:#94a3b8;
  text-decoration:none; border-radius:0;
  transition:background .15s, color .15s;
  font-size:.9rem;
}
.sidebar-menu .nav-link:hover  { background:var(--sidebar-hover); color:#e2e8f0; }
.sidebar-menu .nav-link.active { background:var(--primary); color:#fff; }
.sidebar-menu .nav-link i { font-size:1rem; width:1.25rem; text-align:center; }

.sidebar-footer {
  padding:.75rem 1rem; border-top:1px solid #334155;
  display:flex; align-items:center; font-size:.85rem;
  color:#94a3b8;
}
#sidebar-user { flex:1; truncate:ellipsis; overflow:hidden; white-space:nowrap; }

/* ── Sidebar overlay (mobil) ──────────────────────────── */
#sidebar-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  z-index:140; top:var(--topbar-h);
}

/* ── Fő tartalom ──────────────────────────────────────── */
#app { display:flex; min-height:100vh; }

#main-content {
  margin-left:var(--sidebar-w);
  flex:1; min-width:0;
  padding:1.5rem;
}

@media (max-width:767px) {
  #main-content { margin-left:0; padding:.75rem; padding-top:calc(var(--topbar-h) + .75rem); }
}

/* ── Oldal fejléc ─────────────────────────────────────── */
.page-header {
  margin-bottom:1.25rem;
  padding-bottom:.75rem;
  border-bottom:1px solid #e2e8f0;
}
.page-header h4 { font-weight:700; }
.page-header i { font-size:1.3rem; color:var(--primary); }

/* ── Stat kártyák (dashboard) ─────────────────────────── */
.stat-card {
  background:#fff; border-radius:10px;
  padding:1rem 1.25rem;
  box-shadow:0 1px 3px rgba(0,0,0,.07);
  text-align:center;
}
.stat-num  { font-size:2rem; font-weight:700; line-height:1; }
.stat-label{ font-size:.8rem; color:#64748b; margin-top:.25rem; }
.stat-sub  { font-size:.72rem; color:#94a3b8; margin-top:.15rem; }

/* ── Stat mini (dolgozó oldal) ────────────────────────── */
.stat-mini {
  background:#f8fafc; border-radius:8px; padding:.6rem .75rem; text-align:center;
  border:1px solid #e2e8f0;
}
.stat-mini-num { font-size:1.4rem; font-weight:700; line-height:1; }
.stat-mini-lbl { font-size:.72rem; color:#64748b; margin-top:.15rem; }
.stat-mini.stat-ok   { border-color:#22c55e; background:#f0fdf4; }
.stat-mini.stat-ok   .stat-mini-num { color:#16a34a; }
.stat-mini.stat-warn { border-color:#f59e0b; background:#fffbeb; }
.stat-mini.stat-warn .stat-mini-num { color:#d97706; }

/* ── Kártyák általános ────────────────────────────────── */
.card { border:none; box-shadow:0 1px 3px rgba(0,0,0,.07); border-radius:10px; }
.card-header { background:#fff; border-bottom:1px solid #f1f5f9; border-radius:10px 10px 0 0 !important; }

/* ── Dashboard figyelmeztetés kártyák ────────────────── */
.warn-cat-card {
  background:#fff; border-radius:10px;
  box-shadow:0 1px 3px rgba(0,0,0,.07);
  border-left:4px solid #e2e8f0;
  overflow:hidden; height:100%;
}
.warn-cat-head {
  display:flex; align-items:center; gap:.5rem;
  padding:.5rem .75rem;
  border-bottom:1px solid #f1f5f9;
  font-size:.82rem; font-weight:600;
}
.warn-cat-head i { font-size:.85rem; flex-shrink:0; }
.warn-cat-head span { flex:1; }
.warn-count { font-size:.7rem; flex-shrink:0; }

.warn-items { max-height:180px; overflow-y:auto; }
.warn-item {
  display:flex; align-items:baseline; gap:.4rem;
  padding:.25rem .75rem;
  text-decoration:none; color:inherit;
  border-bottom:1px solid #f8fafc;
  transition:background .12s;
  cursor:pointer;
  line-height:1.3;
}
.warn-item:hover { background:#f8fafc; color:inherit; text-decoration:none; }
.warn-item:last-child { border-bottom:none; }
.warn-dot { font-size:.4rem; flex-shrink:0; position:relative; top:-1px; }
.warn-date { font-size:.72rem; color:#94a3b8; flex-shrink:0; font-variant-numeric:tabular-nums; }
.warn-name { flex:1; font-size:.8rem; font-weight:500; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.warn-detail { font-weight:400; color:#64748b; margin-left:.2rem; }
.warn-chevron { font-size:.6rem; color:#cbd5e1; flex-shrink:0; }

.warn-empty-state {
  display:flex; align-items:center; gap:.5rem;
  padding:.75rem 1rem;
  background:#fff; border-radius:10px;
  box-shadow:0 1px 3px rgba(0,0,0,.07);
  font-size:.85rem;
}
.warn-empty-state i { font-size:1.1rem; }

/* ── Dolgozó kártya ───────────────────────────────────── */
.emp-avatar {
  width:48px; height:48px; border-radius:50%; object-fit:cover; flex-shrink:0;
}
.photo-zoomable {
  cursor:zoom-in; transition:opacity .15s, box-shadow .15s;
}
.photo-zoomable:hover {
  opacity:.85; box-shadow:0 0 0 3px rgba(99,102,241,.4);
}
.emp-avatar-ph {
  width:48px; height:48px; border-radius:50%;
  background:#e2e8f0; display:flex; align-items:center; justify-content:center;
  flex-shrink:0; font-size:1.5rem; color:#94a3b8;
}
.emp-photo-lg {
  width:90px; height:90px; border-radius:50%; object-fit:cover;
}
.emp-photo-ph {
  width:90px; height:90px; border-radius:50%;
  background:#e2e8f0; display:flex; align-items:center; justify-content:center;
  margin:0 auto;
}
.opacity-60 { opacity:.6; }
.min-w-0 { min-width:0; }

/* ── Dolgozó kártya – statisztika sáv ────────────────── */
.emp-stat-bar {
  border-top:1px solid #f1f5f9;
  padding-top:.5rem;
  font-size:.75rem;
}
.emp-stat-row {
  display:flex; justify-content:space-between; align-items:baseline;
  gap:.25rem; line-height:1.5;
}
.emp-stat-lbl { color:#64748b; white-space:nowrap; }
.emp-stat-val  { color:#1e293b; text-align:right; }
.emp-stat-row.stat-ok   .emp-stat-val { color:#16a34a; }
.emp-stat-row.stat-mid  .emp-stat-val { color:#d97706; }
.emp-stat-row.stat-warn .emp-stat-val { color:#dc2626; }
/* Progress bar */
.emp-stat-progress {
  position:relative; height:5px; background:#e2e8f0;
  border-radius:3px; margin:.35rem 0 .15rem; overflow:visible;
}
.emp-stat-fill {
  height:100%; border-radius:3px; transition:width .3s;
  background:#94a3b8;
}
.emp-stat-fill.stat-ok   { background:#22c55e; }
.emp-stat-fill.stat-mid  { background:#f59e0b; }
.emp-stat-fill.stat-warn { background:#ef4444; }
/* 10 órás standard marker */
.emp-stat-marker {
  position:absolute; right:0; top:-3px; bottom:-3px;
  width:2px; background:#cbd5e1; border-radius:1px;
  pointer-events:none;
}

/* ── Brigád ───────────────────────────────────────────── */
.brig-dot {
  width:12px; height:12px; border-radius:50%; flex-shrink:0;
  display:inline-block;
}
.brig-dot-sm {
  width:8px; height:8px; border-radius:50%; display:inline-block;
  flex-shrink:0; margin-right:.25rem; vertical-align:middle;
}
.emp-row { padding:.2rem .5rem; font-size:.875rem; }

/* ── Manuális rácsos nézet ────────────────────────────── */
.manual-grid-wrap {
  overflow-x:auto; -webkit-overflow-scrolling:touch;
}
.manual-grid {
  min-width:max-content;
  font-size:.8rem;
}
.manual-grid .sticky-col {
  position:sticky; background:#fff; z-index:2;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  border-right:2px solid #e2e8f0;
}
/* Névoszlop: bal szélső, fix szélesség → brig-col left értéke pontosan egyezzen */
.manual-grid .name-col { left:0; width:140px; min-width:140px; max-width:140px; border-right:1px solid #e2e8f0; }
/* Brigádoszlop: névoszlop szélességével egyenlő left */
.manual-grid .brig-col { left:140px; width:90px; min-width:90px; max-width:90px; border-right:2px solid #e2e8f0; white-space:nowrap; }
.manual-grid thead .sticky-col { background:#f8fafc; }
.manual-grid .day-col {
  width:38px; min-width:38px; max-width:38px;
  cursor:pointer; padding:.25rem .1rem;
  font-size:.75rem; user-select:none;
}
.manual-grid .day-col:hover { background:#f0f9ff; }
/* Hétvége/ünnep: halvány piros tint */
.manual-grid .sp-day { background:#fff0f0; }
.manual-grid .sp-day:hover { background:#ffe4e4; }
.manual-grid .has-rec { background:#f0fdf4; }
.manual-grid .has-rec.sp-day { background:#f0fdf4; }
.manual-grid .emp-cell { padding:.35rem .5rem; }
.manual-grid .brig-col { font-size:.72rem; padding:.25rem .35rem; }
.manual-grid .ip-only-cell { background:#eff6ff; }

.rec-dot { font-size:.9rem; line-height:1; }
.rec-dot.full     { color:#16a34a; }
.rec-dot.half     { color:#f59e0b; }
.rec-dot.open-dot { color:#f97316; font-size:.75rem; } /* nyitott = narancs óra */
.rec-dot.ip-only-dot { color:#93c5fd; font-size:.7rem; }
.add-dot  { color:#cbd5e1; font-size:.8rem; }

/* ── Nyitott (lezáratlan) bejegyzés cella ─────────────── */
.manual-grid .open-rec { background:#fff7ed; }
.manual-grid .open-rec:hover { background:#ffedd5; }
.manual-grid .open-rec.sp-day { background:#fff7ed; }

/* ── Naptár (dolgozó részletek) ───────────────────────── */
.cal-grid {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:2px;
}
.cal-head {
  text-align:center; font-size:.7rem; font-weight:600;
  color:#64748b; padding:.25rem 0;
  background:#f8fafc; border-radius:4px;
}
.cal-head.sp { color:#ef4444; }
.cal-day {
  min-height:52px; border-radius:6px; padding:.2rem .25rem;
  background:#f8fafc; cursor:pointer; transition:background .12s;
  font-size:.72rem; position:relative;
}
.cal-day:hover     { background:#e0f2fe; }
.cal-day.empty     { background:transparent; cursor:default; }
.cal-day.special   { background:#fff7ed; }
.cal-day.manual-only { background:#dcfce7; }
.cal-day.ip-only   { background:#eff6ff; }
.cal-day.both      { background:#f0fdf4; border:1.5px solid #22c55e; }
.cal-day.manual-only:hover { background:#bbf7d0; }
.cal-day.ip-only:hover     { background:#dbeafe; }
.cal-day.both:hover        { background:#dcfce7; }
/* IP-primér naptár (IP jelenlét + dolgozó nézet) */
.cal-day.ip-good  { background:#dcfce7; }
.cal-day.ip-half  { background:#fef9c3; }
.cal-day.ip-low   { background:#eff6ff; }
.cal-day.ip-rovid { background:#fee2e2; border:1px solid #fca5a5; }
.cal-day.ip-good:hover { background:#bbf7d0; }
.cal-day.ip-half:hover { background:#fef08a; }
.cal-day.ip-low:hover  { background:#dbeafe; }
.cal-day.ip-rovid:hover{ background:#fecaca; }
.leg.ip-rovid { background:#fee2e2; border:1px solid #fca5a5; }
/* IP Jelenlét rács – rövid nap cella */
.ip-cell-rovid { background:#fee2e2 !important; }

.cal-dn  { font-weight:600; color:#334155; font-size:.72rem; }
.cal-day.special .cal-dn { color:#ef4444; }
.cal-info { margin-top:.1rem; }
.cal-t    { font-size:.65rem; color:#334155; }
.cal-half { font-size:.6rem; color:#f59e0b; margin-left:.15rem; }
.cal-bonus{ font-size:.6rem; color:#d97706; margin-left:.15rem; }
.cal-info.ip { color:#3b82f6; }

/* Legenda */
.leg {
  display:inline-block; width:12px; height:12px; border-radius:3px;
  vertical-align:middle; margin-right:.25rem;
}
.leg.manual-only { background:#dcfce7; border:1px solid #86efac; }
.leg.ip-only     { background:#eff6ff; border:1px solid #93c5fd; }
.leg.both        { background:#f0fdf4; border:1.5px solid #22c55e; }
.leg.special     { background:#fff7ed; border:1px solid #fed7aa; }
.leg.ip-good     { background:#dcfce7; border:1px solid #86efac; }
.leg.ip-half     { background:#fef9c3; border:1px solid #fde047; }
.leg.ip-low      { background:#eff6ff; border:1px solid #93c5fd; }
/* ── Nap-jelző pont (egységes szimbólum minden nézetben) ─── */
.day-dot {
  display:inline-block; width:11px; height:11px;
  border-radius:50%; vertical-align:middle; flex-shrink:0;
}
.day-dot.full-ok   { background:#16a34a; }
.day-dot.half-ok   { background:transparent; border:2.5px solid #16a34a; }
.day-dot.full-warn { background:#dc2626; }
.day-dot.half-warn { background:transparent; border:2.5px solid #dc2626; }
.day-dot.muted     { opacity:.4; }

/* Naptár badge-ek (jelzők) */
.cal-badges { display:flex; gap:1px; justify-content:center; margin-top:2px; flex-wrap:wrap; }
.cal-badge {
  display:inline-flex; align-items:center; justify-content:center;
  font-size:.5rem; font-weight:700; border-radius:3px;
  width:11px; height:11px; line-height:1;
}
.cal-kieső-badge { background:#ef4444; color:#fff; }
.cal-discr-badge { background:#8b5cf6; color:#fff; }
/* Visszafelé kompatibilitás – régi cal-warn (ha még van valahol) */
.cal-warn {
  display:inline-block; background:#ef4444; color:#fff;
  font-size:.55rem; font-weight:700; border-radius:50%;
  width:11px; height:11px; line-height:11px; text-align:center;
  position:absolute; top:2px; right:2px;
}
.cal-warn-leg { display:flex; align-items:center; gap:.3rem; position:relative; }
.disc-warn {
  display:inline-block; background:#ef4444; color:#fff;
  font-size:.55rem; font-weight:700; border-radius:50%;
  width:10px; height:10px; line-height:10px; text-align:center;
  vertical-align:super; margin-left:1px;
}
/* Brigád naptár – új IP-alapú háttérszínek */
.manual-grid .has-rec-half { background:#fef9c3; }
.manual-grid .has-rec-low  { background:#eff6ff; }
/* Brigád naptár cellák kattinthatók */
.clickable-day { cursor:pointer; }
.clickable-day:hover { filter:brightness(.93); }

/* ── Gombok ───────────────────────────────────────────── */
.btn-xs {
  padding:.15rem .4rem; font-size:.75rem; border-radius:4px;
}

/* ── Táblázat ─────────────────────────────────────────── */
.table-hover tbody tr:hover { background:#f8fafc; }
.table > :not(caption) > * > * { padding:.5rem .6rem; }
.table-sm > :not(caption) > * > * { padding:.3rem .5rem; }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:#f1f5f9; }
::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:#94a3b8; }

/* ── Modal ────────────────────────────────────────────── */
@media (max-width:576px) {
  .modal-dialog { margin:.5rem; }
}

/* ── Toast ────────────────────────────────────────────── */
#appToast { min-width:200px; }

/* ── Figyelmeztetés listák ────────────────────────────── */
.list-group-item { border-left:none; border-right:none; }
.list-group-item:first-child { border-top:none; }
.list-group-item-warning { background:#fffbeb; }
.list-group-item-danger  { background:#fef2f2; }
.list-group-item-info    { background:#eff6ff; }
