/* ============================================================
   Space Lab Marketing HR — main.css
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary-bg:   #0f1117;
  --sidebar-bg:   #1a1d2e;
  --accent:       #6366f1;
  --accent2:      #8b5cf6;
  --accent-hover: #4f46e5;
  --card-bg:      #ffffff;
  --body-bg:      #f1f5f9;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #3b82f6;
  --border:       #e2e8f0;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 10px 30px rgba(0,0,0,.10);
  --transition:   0.2s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text); }

img { max-width: 100%; display: block; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Logo area */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  flex: 1;
  overflow: hidden;
}

.sidebar-logo-text .brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo-text .brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,.45);
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
}

.sidebar-nav .nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 10px 8px 4px;
  margin-top: 8px;
}

.sidebar-nav .nav-item {
  margin-bottom: 2px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.sidebar-nav .nav-link svg,
.sidebar-nav .nav-link i {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke-width: 2;
}

.sidebar-nav .nav-link:hover {
  background: rgba(99,102,241,.18);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
}

.sidebar-nav .nav-link.active svg { stroke: #fff; }

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 8px 12px;
}

/* User info at bottom */
.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,.4);
}

.sidebar-user-logout {
  color: rgba(255,255,255,.35);
  transition: color var(--transition);
  display: flex; align-items: center;
}

.sidebar-user-logout:hover { color: var(--danger); }

/* ── Main Layout ────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 900;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-date {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--body-bg);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Sidebar toggle button (mobile) */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--body-bg); }

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
  padding: 24px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left h1 {
  font-size: 22px;
  font-weight: 700;
}

.breadcrumb {
  background: none;
  padding: 0;
  margin: 4px 0 0;
  font-size: 12.5px;
}

.breadcrumb-item.active { color: var(--text-muted); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }

/* ── Stats Cards ────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.stat-card.blue::before   { background: var(--info); }
.stat-card.green::before  { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.purple::before { background: var(--accent2); }
.stat-card.red::before    { background: var(--danger); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-card.blue .stat-icon   { background: rgba(59,130,246,.12); color: var(--info); }
.stat-card.green .stat-icon  { background: rgba(16,185,129,.12); color: var(--success); }
.stat-card.orange .stat-icon { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,.12); color: var(--accent2); }
.stat-card.red .stat-icon    { background: rgba(239,68,68,.12);  color: var(--danger); }

.stat-icon svg { width: 22px; height: 22px; stroke-width: 2; }

.stat-content { flex: 1; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.table thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: #f8fafc;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Striped */
.table-striped tbody tr:nth-child(even) {
  background: #fafbfc;
}
.table-striped tbody tr:nth-child(even):hover {
  background: #f8fafc;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn-lg {
  padding: 11px 24px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-xl {
  padding: 16px 32px;
  font-size: 17px;
  border-radius: 12px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover {
  background: #059669;
  border-color: #059669;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,.3);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}
.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline-secondary:hover {
  background: var(--body-bg);
  color: var(--text);
}

.btn-outline-success {
  background: transparent;
  color: var(--success);
  border-color: var(--success);
}
.btn-outline-success:hover {
  background: var(--success);
  color: #fff;
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--body-bg);
  color: var(--text);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

/* Status: actiu/inactiu */
.badge-actiu,
.badge-success {
  background: rgba(16,185,129,.12);
  color: #065f46;
}

.badge-inactiu,
.badge-danger {
  background: rgba(239,68,68,.12);
  color: #991b1b;
}

/* Vacation/payroll status */
.badge-aprovat  { background: rgba(16,185,129,.12); color: #065f46; }
.badge-pendent  { background: rgba(245,158,11,.12);  color: #92400e; }
.badge-rebutjat { background: rgba(239,68,68,.12);   color: #991b1b; }

/* Time record status */
.badge-correcte  { background: rgba(16,185,129,.12); color: #065f46; }
.badge-modificat { background: rgba(59,130,246,.12); color: #1e40af; }
.badge-incomplet { background: rgba(239,68,68,.12);  color: #991b1b; }

/* Contract type */
.badge-indefinit  { background: rgba(99,102,241,.12); color: #3730a3; }
.badge-temporal   { background: rgba(245,158,11,.12); color: #92400e; }
.badge-practiques { background: rgba(139,92,246,.12); color: #5b21b6; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  width: 100%;
  padding: 9px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-control::placeholder { color: var(--text-light); }

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,.15);
}

.invalid-feedback {
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-control.is-invalid ~ .invalid-feedback { display: block; }

.form-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Input group */
.input-group {
  display: flex;
  position: relative;
}

.input-group .form-control {
  border-radius: 0;
}

.input-group .form-control:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
}

.input-icon {
  position: relative;
}

.input-icon .form-control {
  padding-left: 38px;
}

.input-icon .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.input-icon .icon svg { width: 16px; height: 16px; }

/* Select arrow */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}

/* ── Alert / Flash Messages ─────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  position: relative;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-success {
  background: rgba(16,185,129,.1);
  border-color: rgba(16,185,129,.25);
  color: #065f46;
}

.alert-danger,
.alert-error {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.25);
  color: #991b1b;
}

.alert-warning {
  background: rgba(245,158,11,.1);
  border-color: rgba(245,158,11,.25);
  color: #92400e;
}

.alert-info {
  background: rgba(59,130,246,.1);
  border-color: rgba(59,130,246,.25);
  color: #1e40af;
}

.alert .alert-close {
  position: absolute;
  right: 12px; top: 10px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: .5;
  line-height: 1;
  color: inherit;
  padding: 0;
}

.alert .alert-close:hover { opacity: 1; }

/* ── Clock Widget ────────────────────────────────────────────── */
.clock-widget {
  text-align: center;
  padding: 28px 20px;
}

.clock-time {
  font-size: 56px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.clock-date {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 400;
}

.clock-seconds {
  font-size: 32px;
  font-weight: 400;
  opacity: .5;
}

/* Punch buttons */
.punch-card {
  text-align: center;
  padding: 24px;
}

.punch-status {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 8px 16px;
  background: var(--body-bg);
  border-radius: 20px;
  display: inline-block;
}

.punch-time {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.punch-date {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  margin-top: 4px;
}

.btn-punch {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.btn-punch svg { width: 32px; height: 32px; stroke-width: 1.5; }

.btn-punch-in {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
}

.btn-punch-in:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(16,185,129,.4);
}

.btn-punch-out {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
}

.btn-punch-out:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(239,68,68,.4);
}

.btn-pause {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: #fff;
}

.btn-pause:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(245,158,11,.4);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,17,23,.6);
  z-index: 1040;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-backdrop.show { display: flex; }

.modal-dialog {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-md);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(99,102,241,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* ── Calendar Grid ───────────────────────────────────────────── */
.vacation-calendar {
  width: 100%;
  overflow-x: auto;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-month-title {
  font-size: 16px;
  font-weight: 600;
}

.cal-grid {
  display: grid;
  grid-template-columns: 160px repeat(31, 1fr);
  gap: 2px;
  min-width: 900px;
  font-size: 11.5px;
}

.cal-grid-head {
  display: contents;
}

.cal-grid-head .cal-cell {
  background: #f8fafc;
  font-weight: 600;
  text-align: center;
  padding: 6px 4px;
  color: var(--text-muted);
  border-radius: 4px;
}

.cal-grid-head .cal-cell.today {
  background: var(--accent);
  color: #fff;
}

.cal-row { display: contents; }

.cal-cell-name {
  padding: 7px 10px;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

.cal-cell {
  height: 30px;
  border-radius: 4px;
  background: #f8fafc;
}

.cal-cell.vacation-day {
  background: rgba(99,102,241,.2);
  border-radius: 0;
}

.cal-cell.vacation-start {
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.cal-cell.vacation-end {
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}

.cal-cell.vacation-solo {
  background: var(--accent);
  border-radius: 4px;
}

.cal-cell.weekend { background: #f1f5f9; }

.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.cal-legend-color {
  width: 14px; height: 14px;
  border-radius: 3px;
}

/* Simple 7-col month calendar */
.month-calendar {
  width: 100%;
}

.month-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.month-calendar-header .day-name {
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.month-calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
  padding: 4px;
  min-height: 48px;
}

.cal-day:hover { background: var(--body-bg); }

.cal-day.today {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.cal-day.has-vacation {
  background: rgba(99,102,241,.1);
}

.cal-day.vacation-approved { background: rgba(16,185,129,.15); }
.cal-day.vacation-pending  { background: rgba(245,158,11,.15); }
.cal-day.other-month { opacity: .3; }
.cal-day.weekend { color: var(--text-muted); }

.cal-day-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  position: absolute;
  bottom: 4px;
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
}

.tab-btn svg { width: 15px; height: 15px; }
.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search-bar .form-control {
  padding-left: 38px;
}

.search-bar .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-bar .search-icon svg { width: 16px; height: 16px; }

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card-bg);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.filter-bar .form-select,
.filter-bar .form-control {
  max-width: 180px;
  flex-shrink: 0;
}

/* ── Employee avatar ────────────────────────────────────────── */
.employee-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emp-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.emp-name   { font-weight: 500; font-size: 13.5px; }
.emp-email  { font-size: 12px; color: var(--text-muted); }

/* ── Payroll preview panel ──────────────────────────────────── */
.payroll-preview {
  background: linear-gradient(135deg, #1a1d2e, #0f1117);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
}

.payroll-preview h3 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.payroll-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
}

.payroll-line-label { color: rgba(255,255,255,.65); }
.payroll-line-value { font-weight: 600; font-variant-numeric: tabular-nums; }

.payroll-line.section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: rgba(255,255,255,.35);
  padding-top: 12px;
  padding-bottom: 2px;
}

.payroll-divider {
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 8px 0;
}

.payroll-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid rgba(255,255,255,.15);
}

.payroll-total-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
}

.payroll-total-value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.payroll-net-badge {
  display: inline-block;
  background: var(--success);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--body-bg);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}

.empty-state-icon svg { width: 28px; height: 28px; color: var(--text-light); }

.empty-state h4 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 13.5px; max-width: 320px; margin: 0 auto; }

/* ── Info grid (employee detail) ─────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.info-item {}
.info-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  margin-bottom: 3px;
}
.info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ── Login page ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--card-bg);
}

.login-brand {
  flex: 0 0 45%;
  background: linear-gradient(135deg, #0f1117 0%, #1a1d2e 40%, #1e1033 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
  top: -200px; left: -200px;
}

.login-brand::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.12) 0%, transparent 70%);
  bottom: -100px; right: -100px;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.login-logo-icon {
  width: 80px; height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
  box-shadow: 0 16px 48px rgba(99,102,241,.35);
}

.login-brand-name {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.login-brand-tagline {
  font-size: 15px;
  color: rgba(255,255,255,.5);
  letter-spacing: .5px;
}

.login-brand-features {
  margin-top: 40px;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: rgba(255,255,255,.65);
  font-size: 13.5px;
}

.login-feature-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(99,102,241,.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.login-feature-icon svg { width: 16px; height: 16px; color: var(--accent); }

.login-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
}

.login-form-container {
  width: 100%;
  max-width: 400px;
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-form-container .form-label { font-size: 13.5px; margin-bottom: 7px; }

.login-demo {
  margin-top: 32px;
  padding: 16px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.login-demo h6 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.login-demo-cred {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.login-demo-cred:last-child { border-bottom: none; }
.login-demo-cred .role { font-weight: 600; color: var(--text); }
.login-demo-cred .cred { color: var(--text-muted); font-family: monospace; font-size: 12px; }

/* ── Vacation days counter ───────────────────────────────────── */
.days-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Misc utilities ──────────────────────────────────────────── */
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-accent  { color: var(--accent) !important; }
.fw-semibold  { font-weight: 600; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.gap-2 { gap: 8px !important; }

.rounded-full { border-radius: 9999px !important; }

/* Action buttons in tables */
.action-btns { display: flex; gap: 4px; align-items: center; }

/* Pending request mini-card */
.pending-request-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: background var(--transition);
}

.pending-request-item:hover { background: #fafbfc; }

.pending-request-name { font-weight: 600; font-size: 13.5px; }
.pending-request-dates { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pending-request-actions { margin-top: 8px; display: flex; gap: 6px; }

/* Form section card */
.form-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.form-section-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-header h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.form-section-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(99,102,241,.12);
  display: flex; align-items: center; justify-content: center;
}

.form-section-icon svg { width: 14px; height: 14px; color: var(--accent); }

.form-section-body { padding: 20px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cal-grid { grid-template-columns: 130px repeat(31, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    z-index: 1050;
  }

  .sidebar.open { transform: translateX(0); }

  .main-wrapper { margin-left: 0; }

  .sidebar-toggle { display: flex; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1045;
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay.show { display: block; }

  .page-content { padding: 16px; }

  .topbar { padding: 0 16px; }

  .topbar-date { display: none; }

  .info-grid { grid-template-columns: 1fr; }

  .login-brand { display: none; }
  .login-form-side { padding: 32px 24px; }

  .stat-value { font-size: 22px; }

  .btn-punch { width: 110px; height: 110px; font-size: 14px; }
  .btn-punch svg { width: 26px; height: 26px; }

  .clock-time { font-size: 40px; }

  .filter-bar { gap: 8px; }
  .filter-bar .form-select,
  .filter-bar .form-control { max-width: 100%; flex: 1; }

  .payroll-preview { position: static; }
}

/* ── Print styles ────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .filter-bar, .tab-nav,
  .page-header .btn, .action-btns { display: none !important; }

  .main-wrapper { margin-left: 0 !important; }

  .page-content { padding: 0 !important; }

  .card, .form-section, .stat-card {
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
  }

  body { background: #fff !important; font-size: 12px; }

  .payroll-preview {
    background: #f8fafc !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
  }

  .payroll-preview h3 { color: #1e293b !important; }
  .payroll-line-label { color: #64748b !important; }
  .payroll-total-value, .payroll-total-label { color: #1e293b !important; }
}
