/* =========================================================
   HR Platforma — Modern Responsive Stylesheet
   ========================================================= */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --primary: #ff762b;
  --primary-dark: #e65f15;
  --primary-light: #fff2e8;
  --primary-soft: #ffe0cc;

  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --pink: #ec4899;
  --pink-light: #fce7f3;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 12px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, .15);
  --shadow-xl: 0 25px 60px -15px rgba(15, 23, 42, .25);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --sidebar-w: 260px;
  --topbar-h: 72px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
svg { width: 18px; height: 18px; flex-shrink: 0; }

/* =========================================================
   LOGIN SCREEN
   ========================================================= */
.login-screen {
  position: fixed; inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 50%, #fdf2f8 100%);
  padding: 20px;
  overflow: hidden;
  z-index: 100;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .6;
  animation: float 18s infinite ease-in-out;
}
.blob-1 { width: 420px; height: 420px; background: #c7d2fe; top: -120px; left: -120px; }
.blob-2 { width: 480px; height: 480px; background: #fbcfe8; bottom: -180px; right: -180px; animation-delay: -6s; }
.blob-3 { width: 320px; height: 320px; background: #ddd6fe; top: 40%; left: 60%; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-40px) scale(1.05); }
  66% { transform: translate(-20px,30px) scale(.95); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  box-shadow: var(--shadow-xl);
  z-index: 1;
  animation: cardIn .6s cubic-bezier(.16,1,.3,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand h1 {
  font-size: 26px; font-weight: 700; color: var(--text); margin-top: 16px;
  letter-spacing: -.02em;
}
.login-brand p { color: var(--text-muted); margin-top: 6px; font-size: 14px; }

.logo-square {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, #ff9a55 100%);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 10px 30px -10px rgba(255, 118, 43, .6);
  letter-spacing: .02em;
}
.logo-square.small { width: 38px; height: 38px; font-size: 14px; border-radius: 10px; }

.logo-mak {
  width: 96px; height: 96px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 30px -8px rgba(255, 118, 43, .55);
}
.logo-mak-small {
  width: 38px; height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; font-weight: 500; color: var(--text); }
.input-wrap {
  position: relative;
  display: flex; align-items: center;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
}
.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.input-wrap svg { color: var(--text-light); margin: 0 12px; }
.input-wrap input {
  flex: 1;
  padding: 12px 14px 12px 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
}
.input-wrap input::placeholder { color: var(--text-light); }

.login-error {
  background: var(--danger-light);
  color: #b91c1c;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
  text-align: center;
}

.login-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 8px;
}
.login-hint strong { color: var(--text); font-weight: 600; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
  box-shadow: 0 4px 12px -4px rgba(79,70,229,.5);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -6px rgba(79,70,229,.6); }
.btn-primary:active { transform: translateY(0); }
.btn-large { padding: 14px 18px; font-size: 15px; width: 100%; margin-top: 4px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500; font-size: 14px;
  transition: all .15s;
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 500; font-size: 13px;
  transition: all .15s;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 500; font-size: 14px;
  transition: all .15s;
}
.btn-danger:hover { background: #dc2626; }

.btn-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* =========================================================
   APP SHELL
   ========================================================= */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  transition: transform .25s ease;
}
.sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-title { font-weight: 700; font-size: 16px; letter-spacing: -.01em; flex: 1; }
.sidebar-close { display: none; width: 32px; height: 32px; border-radius: 8px; color: var(--text-muted); }
.sidebar-close:hover { background: var(--surface-2); }

.nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all .15s;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 24px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 18px; height: 18px; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #ff9a55);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 14px; color: var(--text); }
.user-role { font-size: 12px; color: var(--text-muted); }

.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500; font-size: 14px;
  transition: all .15s;
}
.logout-btn:hover { background: var(--danger-light); color: var(--danger); }

/* Main */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  padding: 0 28px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 20px;
  position: sticky; top: 0; z-index: 20;
}
.menu-toggle { display: none; width: 38px; height: 38px; border-radius: 10px; color: var(--text); }
.menu-toggle:hover { background: var(--surface-2); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.topbar-title p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  width: 280px;
  transition: all .15s;
}
.search-box:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-box svg { color: var(--text-light); }
.search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 10px 10px;
  color: var(--text);
}

/* View container */
.view-container { padding: 28px; max-width: 1400px; width: 100%; }

/* Overlay (mobile) */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.4);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* =========================================================
   PAGE HEADERS / SECTIONS
   ========================================================= */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.section-header p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* =========================================================
   CARDS / STATS
   ========================================================= */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-card .stat-icon svg { width: 22px; height: 22px; }
.stat-icon.indigo { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon.red   { background: var(--danger-light); color: var(--danger); }
.stat-icon.blue  { background: var(--info-light); color: var(--info); }
.stat-icon.purple{ background: var(--purple-light); color: var(--purple); }
.stat-icon.pink  { background: var(--pink-light); color: var(--pink); }

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; color: var(--text); }
.stat-trend { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   TABLE / LIST
   ========================================================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: #fff; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
table.data-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr.clickable { cursor: pointer; transition: background .15s; }
table.data-table tr.clickable:hover { background: var(--surface-2); }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-light); margin-bottom: 12px; }
.empty-state h4 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }

/* Avatar in table */
.cell-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.avatar.lg { width: 56px; height: 56px; font-size: 18px; border-radius: 14px; }
.avatar.xl { width: 80px; height: 80px; font-size: 26px; border-radius: 18px; }
.avatar-info { display: flex; flex-direction: column; min-width: 0; }
.avatar-name { font-weight: 600; color: var(--text); }
.avatar-sub { font-size: 12px; color: var(--text-muted); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.indigo { background: var(--primary-light); color: var(--primary-dark); }
.badge.green  { background: var(--success-light); color: #047857; }
.badge.amber  { background: var(--warning-light); color: #b45309; }
.badge.red    { background: var(--danger-light); color: #b91c1c; }
.badge.blue   { background: var(--info-light); color: #0369a1; }
.badge.purple { background: var(--purple-light); color: #6d28d9; }
.badge.pink   { background: var(--pink-light); color: #be185d; }
.badge.gray   { background: #f3f4f6; color: #4b5563; }

/* Progress bar */
.progress {
  width: 100%; height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ff9a55);
  border-radius: 999px;
  transition: width .4s ease;
}
.progress-bar.green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar.red { background: linear-gradient(90deg, #ef4444, #f87171); }

/* =========================================================
   FILTER BAR
   ========================================================= */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="search"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: all .15s;
  min-width: 160px;
}
.filter-bar select:focus, .filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.filter-spacer { flex: 1; }

/* =========================================================
   CALENDAR
   ========================================================= */
.calendar-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap; gap: 12px;
}
.calendar-nav { display: flex; align-items: center; gap: 6px; }
.calendar-nav h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; min-width: 180px; text-align: center; }

.calendar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.calendar-weekdays div {
  padding: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  text-align: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-cell {
  min-height: 110px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  background: #fff;
  transition: background .15s;
}
.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell.other-month { background: #fafbfd; color: var(--text-light); }
.calendar-cell.today .day-num {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.calendar-cell.weekend { background: #fbfbfd; }
.day-num { font-size: 13px; font-weight: 600; color: var(--text); }
.calendar-cell.other-month .day-num { color: var(--text-light); font-weight: 500; }

.cal-event {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s;
}
.cal-event:hover { transform: scale(1.02); }
.cal-event.indigo { background: var(--primary-light); color: var(--primary-dark); border-left: 3px solid var(--primary); }
.cal-event.green  { background: var(--success-light); color: #047857; border-left: 3px solid var(--success); }
.cal-event.amber  { background: var(--warning-light); color: #b45309; border-left: 3px solid var(--warning); }
.cal-event.red    { background: var(--danger-light); color: #b91c1c; border-left: 3px solid var(--danger); }
.cal-event.purple { background: var(--purple-light); color: #6d28d9; border-left: 3px solid var(--purple); }
.cal-event.pink   { background: var(--pink-light); color: #be185d; border-left: 3px solid var(--pink); }

.calendar-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* =========================================================
   MODAL
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .25s cubic-bezier(.16,1,.3,1);
}
.modal.lg { max-width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 22px 26px; }
.modal-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: all .15s;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; display: block; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* =========================================================
   TOAST
   ========================================================= */
.toast-root {
  position: fixed;
  top: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 300;
  pointer-events: none;
}
.toast {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  min-width: 260px;
  pointer-events: auto;
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

/* =========================================================
   EMPLOYEE DETAIL
   ========================================================= */
.detail-header {
  display: flex; gap: 20px; align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-info { flex: 1; min-width: 240px; }
.detail-info h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.detail-info p { color: var(--text-muted); margin-top: 4px; }
.detail-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.detail-meta span { display: inline-flex; align-items: center; gap: 6px; }
.detail-meta svg { width: 14px; height: 14px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--text-muted); }
.kv-row .v { color: var(--text); font-weight: 500; }

/* =========================================================
   ANALYTICS / CHARTS
   ========================================================= */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } }

.bar-list { display: flex; flex-direction: column; gap: 14px; }
.bar-row .bar-label {
  display: flex; justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.bar-row .bar-label .k { color: var(--text); font-weight: 500; }
.bar-row .bar-label .v { color: var(--text-muted); }

.donut-wrap {
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap;
}
.donut {
  width: 160px; height: 160px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 160px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend-text { flex: 1; color: var(--text); }
.donut-legend-val { color: var(--text-muted); font-weight: 600; }

/* =========================================================
   BIRTHDAYS
   ========================================================= */
.birthday-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.birthday-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
  position: relative;
  overflow: hidden;
}
.birthday-card.upcoming { background: linear-gradient(135deg, #fff 0%, #fdf2f8 100%); border-color: #fbcfe8; }
.birthday-card.today { background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%); border-color: #fbbf24; }
.birthday-info { flex: 1; min-width: 0; }
.birthday-name { font-weight: 600; color: var(--text); }
.birthday-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.birthday-when {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pink-light);
  color: #be185d;
  white-space: nowrap;
}

/* =========================================================
   RESPONSIVE — TABLET (≤ 900px)
   ========================================================= */
@media (max-width: 900px) {
  :root { --sidebar-w: 280px; --topbar-h: 60px; }

  /* Sidebar becomes overlay */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .main { margin-left: 0; }

  /* Topbar */
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title h2 { font-size: 16px; }
  .topbar-title p { display: none; }
  .search-box { display: none; }

  /* Container padding */
  .view-container { padding: 14px; }

  /* User info: hide name/role on tablet, show only avatar */
  .user-info-text { display: none; }

  /* Section header: full-width buttons */
  .section-header { gap: 10px; margin-bottom: 16px; }
  .section-header > div:first-child { flex: 1 1 100%; }
  .section-header h3 { font-size: 17px; }
  .section-header p { font-size: 12px; }

  /* Cards */
  .card { padding: 16px; }
  .stat-card { padding: 16px; }

  /* Detail */
  .detail-header { padding: 18px; gap: 14px; }
  .detail-meta { gap: 10px 18px; font-size: 12px; }
}

/* =========================================================
   RESPONSIVE — MOBILE (≤ 640px)
   ========================================================= */
@media (max-width: 640px) {
  :root { --sidebar-w: 88vw; --topbar-h: 56px; }

  /* Login screen */
  .login-screen { padding: 16px; }
  .login-card { padding: 28px 20px; max-width: 100%; }
  .login-brand h1 { font-size: 22px; }
  .logo-mak { width: 76px; height: 76px; }

  /* Topbar */
  .topbar { padding: 0 10px; }
  .topbar-title h2 { font-size: 15px; }
  .topbar-actions { gap: 4px; }
  .btn-icon { width: 38px; height: 38px; }
  .avatar-mini { width: 34px; height: 34px; font-size: 13px; }

  /* View container */
  .view-container { padding: 12px 10px; }

  /* Section header: stack vertically, full-width buttons */
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .section-header > div:first-child { flex: initial; }
  .section-header h3 { font-size: 16px; }
  .section-header > .btn-primary,
  .section-header > .btn-secondary,
  .section-header > .btn-ghost,
  .section-header > .btn-danger,
  .section-header > button { width: 100%; justify-content: center; }
  /* Allow flex row of action buttons to wrap */
  .section-header > .flex { flex-wrap: wrap; gap: 8px; width: 100%; }
  .section-header > .flex > * { flex: 1 1 calc(50% - 4px); justify-content: center; }

  /* Stat grid: 2 cols (auto-fit goes to 1, ugly) */
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card { padding: 14px; }
  .stat-card .stat-icon { width: 36px; height: 36px; margin-bottom: 8px; }
  .stat-card .stat-value { font-size: 20px; }
  .stat-card .stat-label { font-size: 11px; }

  /* Cards */
  .card { padding: 14px; border-radius: 14px; }

  /* Buttons: bigger touch targets */
  .btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
    min-height: 44px;
    padding: 11px 16px;
    font-size: 14px;
  }
  .btn-large { padding: 14px 20px; font-size: 15px; }

  /* Filter bar: vertical stack */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }
  .filter-bar select,
  .filter-bar input[type="text"],
  .filter-bar input[type="search"],
  .filter-bar input[type="date"],
  .filter-bar input { width: 100%; min-height: 42px; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-field input,
  .form-field select,
  .form-field textarea { min-height: 44px; font-size: 16px; /* prevents iOS zoom */ }

  /* Detail header: stack avatar above info */
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 16px;
    gap: 12px;
  }
  .detail-header .avatar { width: 64px; height: 64px; font-size: 24px; }
  .detail-info h2 { font-size: 19px; }
  .detail-info { min-width: 0; width: 100%; }
  .detail-header .flex {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }
  .detail-header .flex > * { flex: 1 1 calc(50% - 4px); justify-content: center; }

  /* Tables: smaller padding, allow horizontal scroll, smaller font */
  table.data-table { min-width: 0; }
  table.data-table th,
  table.data-table td { padding: 10px 12px; font-size: 13px; }
  table.data-table th { font-size: 11px; padding: 10px 12px; }
  /* Hide less critical columns marked .hide-mobile */
  table.data-table .hide-mobile,
  .hide-mobile { display: none !important; }

  /* Calendar (month view) */
  .calendar-cell { min-height: 64px; padding: 3px; }
  .calendar-cell .day-num { font-size: 11px; }
  .calendar-cell .cal-event {
    font-size: 9px;
    padding: 1px 4px;
    line-height: 1.3;
    border-radius: 4px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .calendar-grid { font-size: 12px; }
  .calendar-grid .weekday-header,
  .calendar-weekdays > div {
    font-size: 10px;
    padding: 8px 2px;
  }
  .cal-modes { width: 100%; }
  .cal-modes .cal-mode-btn { flex: 1; padding: 8px 10px; font-size: 13px; }
  .calendar-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .calendar-toolbar > * { min-height: 40px; }
  .calendar-toolbar h3 { font-size: 16px; flex: 1 1 100%; text-align: center; order: -1; }
  .calendar-nav { width: 100%; justify-content: center; }
  .calendar-nav h3 { min-width: auto; flex: 1; }

  /* Calendar week view: already 1 col below 1100px, just tighten */
  .cal-week-day { padding: 12px; }

  /* Calendar year view */
  .cal-year { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .cal-year-month { padding: 10px; }
  .cal-year-month h4 { font-size: 12px; }

  /* Calendar legend wraps */
  .calendar-legend { flex-wrap: wrap; gap: 8px; font-size: 12px; }

  /* Modal: full screen with edge padding */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  .modal-card .modal-body { padding: 16px; }
  .modal-card .modal-header { padding: 14px 16px; }
  .modal-card .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-card .modal-footer > * { width: 100%; justify-content: center; }

  /* Toast: stretch full width */
  .toast-root { left: 10px; right: 10px; bottom: 10px; }
  .toast { max-width: 100%; }

  /* Command palette: bottom sheet feel */
  .cmdk-backdrop { padding: 60px 10px 10px; }
  .cmdk-palette { max-height: calc(100vh - 80px); border-radius: 14px; }
  .cmdk-input-wrap { padding: 12px 14px; }
  .cmdk-input { font-size: 16px; }
  .cmdk-footer { display: none; }

  /* Dashboard / detail / chart grids */
  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
  .detail-grid { grid-template-columns: 1fr; gap: 12px; }
  .chart-row { grid-template-columns: 1fr; gap: 14px; }

  /* Birthdays list */
  .birthday-list { grid-template-columns: 1fr; gap: 10px; }

  /* Buttons inside cards: full width by default */
  .card .btn-primary.w-full,
  .card .btn-secondary.w-full { padding: 12px 16px; }

  /* Topbar action labels hide */
  .topbar-actions .btn-label { display: none; }
}

/* =========================================================
   RESPONSIVE — VERY SMALL (≤ 380px)
   ========================================================= */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-title h2 { font-size: 14px; }
  .login-card { padding: 24px 16px; }
  .login-brand h1 { font-size: 20px; }
  .calendar-cell { min-height: 48px; }
  .calendar-grid .weekday-header,
  .calendar-weekdays > div { font-size: 9px; }
  .section-header > .flex > * { flex: 1 1 100%; }
  .detail-header .flex > * { flex: 1 1 100%; }
}

/* =========================================================
   ACCESSIBILITY: prefers-reduced-motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Utilities */
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* =========================================================
   COMMAND PALETTE (Ctrl/Cmd+K)
   ========================================================= */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 80px 20px 20px;
  animation: fadeIn .12s ease;
}
.cmdk-palette {
  background: #fff;
  width: 100%;
  max-width: 600px;
  border-radius: 16px;
  box-shadow: 0 25px 60px -10px rgba(15,23,42,.35), 0 10px 25px -5px rgba(15,23,42,.15);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 120px);
  animation: cmdkIn .18s cubic-bezier(.16,1,.3,1);
}
@keyframes cmdkIn {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cmdk-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-wrap > svg { width: 20px; height: 20px; color: var(--text-light); flex-shrink: 0; }
.cmdk-input {
  flex: 1;
  border: none; outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text);
  padding: 4px 0;
  font-family: inherit;
}
.cmdk-input::placeholder { color: var(--text-light); }

.cmdk-kbd {
  display: inline-block;
  padding: 2px 6px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
}

.cmdk-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}

.cmdk-group {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background .08s;
}
.cmdk-item.selected {
  background: var(--primary-light);
}
.cmdk-item.selected .cmdk-title { color: var(--primary-dark); }

.cmdk-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cmdk-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 11px;
}

.cmdk-text { flex: 1; min-width: 0; }
.cmdk-title {
  font-size: 14px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmdk-subtitle {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmdk-title mark, .cmdk-subtitle mark {
  background: var(--warning-light);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
}

.cmdk-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}
.cmdk-empty p { margin-top: 12px; font-size: 14px; }

.cmdk-footer {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .cmdk-backdrop { padding-top: 40px; }
  .cmdk-footer { font-size: 11px; }
}

/* =========================================================
   CALENDAR — Mode switcher + Week + Year views
   ========================================================= */
.cal-modes {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border);
}
.cal-mode-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 7px;
  transition: all .15s;
  white-space: nowrap;
}
.cal-mode-btn:hover { color: var(--text); }
.cal-mode-btn.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* WEEK */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.cal-week-day {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  min-height: 280px;
  overflow: hidden;
}
.cal-week-day.weekend { background: #fbfbfd; }
.cal-week-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.cal-week-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cal-week-day.today .cal-week-head { background: var(--primary-light); }
.cal-week-dow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.cal-week-day.today .cal-week-dow { color: var(--primary-dark); }
.cal-week-date {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.cal-week-list {
  flex: 1;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto;
}
.cal-week-empty {
  padding: 16px 8px;
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  font-style: italic;
}
.cal-week-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.cal-week-item:hover { background: #f0f0f5; }
.cal-week-item .avatar { width: 28px; height: 28px; font-size: 11px; }
.cal-week-item-info { flex: 1; min-width: 0; }
.cal-week-item-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-week-item-type {
  font-size: 11px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 1100px) {
  .cal-week {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .cal-week-day { min-height: auto; }
  .cal-week-day.today { box-shadow: none; }
}

/* YEAR */
.cal-year {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.cal-year-month {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.cal-year-month-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}
.cal-year-month-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: -.01em;
}
.cal-year-jump {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.cal-year-jump:hover { background: var(--surface-2); color: var(--primary); }

.cal-year-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.cal-year-dow div {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  padding: 2px 0;
}
.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-year-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s;
}
.cal-year-cell:hover { background: var(--surface-2); }
.cal-year-cell.other-month { color: #d1d5db; cursor: default; }
.cal-year-cell.other-month:hover { background: transparent; }
.cal-year-cell.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.cal-year-cell.today:hover { background: var(--primary-dark); }
.cal-year-cell.weekend { color: var(--text-muted); }
.cal-year-cell.holiday { background: var(--success-light); }
.cal-year-cell.has-abs:not(.today) { background: var(--primary-light); }

.cal-year-dots {
  position: absolute;
  bottom: 1px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 1.5px;
}
.cal-year-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
}
.cal-year-dot.indigo { background: #4f46e5; }
.cal-year-dot.green  { background: #10b981; }
.cal-year-dot.amber  { background: #f59e0b; }
.cal-year-dot.red    { background: #ef4444; }
.cal-year-dot.blue   { background: #0ea5e9; }
.cal-year-dot.purple { background: #8b5cf6; }
.cal-year-dot.pink   { background: #ec4899; }
.cal-year-dot.gray   { background: #9ca3af; }

@media (max-width: 1100px) {
  .cal-year { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .cal-year { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .cal-year { grid-template-columns: 1fr; }
  .cal-modes { width: 100%; }
  .cal-mode-btn { flex: 1; padding: 8px; font-size: 12px; }
}

/* =========================================================
   PRINT (Ctrl+P) — Hide chrome, optimize content
   ========================================================= */
@media print {
  @page { size: A4; margin: 12mm; }

  body {
    background: #fff !important;
    font-size: 11pt;
    color: #000;
  }

  /* Hide app chrome */
  .sidebar,
  .topbar,
  .overlay,
  .toast-root,
  .modal-backdrop,
  .cmdk-backdrop,
  #loginScreen,
  .menu-toggle,
  .sidebar-close,
  .login-screen,
  .filter-bar,
  .calendar-toolbar,
  .cal-modes,
  .calendar-legend,
  .section-header button,
  .section-header .btn-primary,
  .section-header .btn-secondary,
  .section-header .btn-ghost,
  .section-header .btn-danger,
  .actions,
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .btn-danger,
  .btn-icon,
  .logout-btn,
  .stat-card .stat-trend {
    display: none !important;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .view-container {
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* Print header — visible only on print */
  .view-container::before {
    content: attr(data-print-title);
    display: block;
    font-size: 18pt;
    font-weight: 700;
    margin-bottom: 4mm;
    padding-bottom: 3mm;
    border-bottom: 2pt solid #4f46e5;
  }

  /* Cards: flatten */
  .card,
  .stat-card,
  .calendar,
  .calendar-cell,
  .cal-week-day,
  .cal-year-month,
  .table-wrap,
  .detail-header,
  .birthday-card {
    background: #fff !important;
    box-shadow: none !important;
    border: 1pt solid #d1d5db !important;
    page-break-inside: avoid;
  }

  /* Tables */
  table.data-table {
    page-break-inside: auto;
    font-size: 10pt;
  }
  table.data-table thead { display: table-header-group; }
  table.data-table tr { page-break-inside: avoid; page-break-after: auto; }
  table.data-table th {
    background: #f3f4f6 !important;
    color: #111827 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Stat grid: compact */
  .stat-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8pt !important;
    margin-bottom: 6mm !important;
  }
  .stat-card { padding: 8pt !important; }
  .stat-card .stat-value { font-size: 14pt !important; }
  .stat-card .stat-icon { width: 22pt !important; height: 22pt !important; margin-bottom: 4pt !important; }

  /* Section headers without buttons */
  .section-header { margin-bottom: 4mm !important; }
  .section-header h3 { font-size: 13pt !important; }

  /* Links and icons */
  a { color: #000 !important; text-decoration: none !important; }
  svg { display: none !important; }

  /* Avatars: keep colors */
  .avatar,
  .badge,
  .progress-bar,
  .legend-dot,
  .calendar-cell.today .day-num,
  .cal-event,
  .cal-year-cell,
  .stat-card .stat-icon {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Calendar: compact cells */
  .calendar-cell { min-height: 60pt !important; }
  .cal-event { font-size: 8pt !important; }
  .calendar-grid { font-size: 9pt; }

  /* Year view: print 4 cols */
  .cal-year { grid-template-columns: repeat(4, 1fr) !important; gap: 6pt !important; }

  /* Birthday cards */
  .birthday-list { grid-template-columns: repeat(3, 1fr) !important; }

  /* Hide nav items in employee detail */
  .detail-header .flex { display: none !important; }
  .detail-header { gap: 14pt !important; padding: 10pt !important; }

  /* Avoid breaking dashboard grid */
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .chart-row { grid-template-columns: 1fr 1fr !important; }
  .detail-grid { grid-template-columns: 1fr 1fr !important; }

  /* Hide Action columns in tables (last child if it's empty/Edit) */
  /* Done dynamically by JS data-no-print on those cells */
  td[data-no-print], th[data-no-print] { display: none !important; }

  /* Page-break helpers */
  .print-page-break { page-break-before: always; }
  .print-no-break { page-break-inside: avoid; }
}
