/* ═══════════════════════════════════════════════════════════
   MyTimeKeep — Cyber Dark Theme
   ═══════════════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────────────── */
/* JetBrains Mono: SIL Open Font License 1.1 (Copyright JetBrains s.r.o.)  */
/* Inter: SIL Open Font License 1.1 (Copyright Rasmus Andersson)           */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg:           #080c14;
  --bg2:          #0d1321;
  --bg3:          #111827;
  --border:       #1a2744;
  --border2:      #243357;
  --cyan:         #00d4ff;
  --cyan-dim:     rgba(0,212,255,0.15);
  --cyan-glow:    0 0 12px rgba(0,212,255,0.4);
  --purple:       #7b2fff;
  --purple-dim:   rgba(123,47,255,0.15);
  --pink:         #ff0080;
  --green:        #00ff9f;
  --green-dim:    rgba(0,255,159,0.15);
  --yellow:       #ffb700;
  --yellow-dim:   rgba(255,183,0,0.15);
  --red:          #ff3a5c;
  --red-dim:      rgba(255,58,92,0.15);
  --text:         #e2e8f0;
  --text-muted:   #8892a4;
  --text-dim:     #4a5568;
  --sidebar-w:    260px;
  --topbar-h:     60px;
  --radius:       8px;
  --radius-lg:    12px;
  --transition:   0.2s ease;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Light Mode ────────────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;
  --bg:           #e8ecf2;
  --bg2:          #f1f4f8;
  --bg3:          #f8f9fb;
  --border:       #d0d7e2;
  --border2:      #bcc5d3;
  --cyan:         #0077aa;
  --cyan-dim:     rgba(0,119,170,0.1);
  --cyan-glow:    0 0 12px rgba(0,119,170,0.2);
  --purple:       #6320cc;
  --purple-dim:   rgba(99,32,204,0.1);
  --pink:         #d4006a;
  --green:        #008a52;
  --green-dim:    rgba(0,138,82,0.1);
  --yellow:       #b38000;
  --yellow-dim:   rgba(179,128,0,0.1);
  --red:          #d42a48;
  --red-dim:      rgba(212,42,72,0.1);
  --text:         #1a202c;
  --text-muted:   #5a6577;
  --text-dim:     #8a95a7;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; background: var(--bg3); }
body {
  font-family: var(--font-sans);
  background: var(--bg3);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: #33dcff; }
img { max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }
::-webkit-scrollbar-corner { background: var(--bg3); }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════ */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; position: relative; overflow: hidden; }

.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(123,47,255,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(0,212,255,0.1) 0%, transparent 50%),
              var(--bg);
}

.auth-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
}

.auth-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px, rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
}

.auth-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  padding: 1.5rem;
}

.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 0 40px rgba(0,212,255,0.08), 0 20px 60px rgba(0,0,0,0.5);
}

.auth-logo {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}
.auth-logo-icon svg { filter: drop-shadow(0 0 6px rgba(0,212,255,0.5)); }
.auth-logo-text { display: flex; flex-direction: column; }
.auth-logo-title { font-size: 1.1rem; font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.auth-logo-sub { font-size: 0.72rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.12em; font-family: var(--font-mono); }

.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.auth-footer {
  margin-top: 1.5rem; text-align: center;
  font-size: 0.78rem; font-family: var(--font-mono);
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════ */

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: 64px; }
/* ── Collapsed sidebar state ───────────────────────────────── */
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-ext-link span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 1rem 0.5rem; }
.sidebar.collapsed .sidebar-nav { padding: 1rem 0.4rem; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.6rem; }
.sidebar.collapsed .nav-item svg { width: 20px; height: 20px; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 0.75rem 0.5rem; }
.sidebar.collapsed .sidebar-user-link { justify-content: center; }
.sidebar.collapsed .user-logout { display: none; }
.sidebar.collapsed .sidebar-ext-link .nav-item { justify-content: center; margin: 0 0.4rem 0.5rem; }

/* Section labels become a centered divider line when collapsed */
.sidebar.collapsed .nav-section-label {
  font-size: 0; color: transparent; padding: 0; margin: 0 auto 4px;
  width: 24px; height: 1px; background: var(--border2); overflow: hidden;
  display: block;
}

/* Tooltips on collapsed nav items */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2);
  padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
  z-index: 200; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }

.sidebar.mobile-hidden { transform: translateX(-100%); }

.sidebar-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
  position: relative;
}

.sidebar-logo { flex-shrink: 0; }
.sidebar-logo svg { filter: drop-shadow(0 0 4px rgba(0,212,255,0.4)); }

.sidebar-brand { flex: 1; min-width: 0; overflow: hidden; }
.brand-name { display: block; font-weight: 700; font-size: 0.88rem; color: var(--text); white-space: nowrap; }
.brand-sub  { display: block; font-size: 0.68rem; color: var(--cyan); font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }


.sidebar-nav {
  flex: 1; padding: 1rem 0.75rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.5rem;
}

.nav-section { display: flex; flex-direction: column; gap: 2px; }

/* Blinking red alert on collapsed leave-requests icon when pending requests exist */
@keyframes nav-alert-pulse {
  0%, 100% { color: var(--red); filter: drop-shadow(0 0 4px var(--red)); opacity: 1; }
  50%      { color: var(--red); filter: drop-shadow(0 0 0px transparent); opacity: 0.45; }
}
.sidebar.collapsed .nav-item.has-pending svg {
  animation: nav-alert-pulse 2.5s ease-in-out infinite;
}

.nav-section-label {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-dim); font-family: var(--font-mono);
  padding: 0 0.5rem; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden;
}

.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: var(--radius);
  color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition); position: relative;
  white-space: nowrap; overflow: hidden;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--cyan-dim); color: var(--cyan); }
.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.nav-badge {
  margin-left: auto; background: var(--red); color: #ffffff;
  font-size: 0.68rem; font-family: var(--font-mono); font-weight: 700;
  padding: 2px 7px; border-radius: 10px; min-width: 18px; text-align: center;
  text-shadow: 0 0 2px rgba(255,255,255,0.5);
}

.sidebar-user {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
  color: #000; flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }
.sidebar-user-link {
  display: flex; align-items: center; gap: 0.75rem;
  flex: 1; min-width: 0; flex-direction: row;
  border-radius: var(--radius);
  color: inherit; transition: background var(--transition);
  text-decoration: none;
}
.sidebar-user-link:hover { background: var(--cyan-dim); }
.sidebar-user-link:hover .user-name { color: var(--cyan); }
.user-logout {
  flex-shrink: 0; color: var(--text-dim); padding: 4px;
  border-radius: 4px; transition: color var(--transition);
  display: flex; align-items: center;
}
.user-logout:hover { color: var(--red); }

/* Main wrapper */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition);
  background: var(--bg3);
}
.sidebar.collapsed ~ .main-wrapper { margin-left: 64px; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
  overflow: visible;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-toggle {
  display: flex; background: none; border: none;
  color: var(--text-muted); padding: 4px;
  border-radius: 4px; transition: color var(--transition);
}
.topbar-toggle:hover { color: var(--cyan); }
.page-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.topbar-date { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

/* Main content */
.main-content {
  flex: 1; padding: 1.5rem;
  background-color: var(--bg3);
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Footer */
.app-footer {
  padding: 1rem 1.5rem;
  background: var(--bg3);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: var(--text-dim); font-family: var(--font-mono);
}

/* ══════════════════════════════════════════════════════════════
   IMPORT BANNER
   ══════════════════════════════════════════════════════════════ */
.import-banner {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  background: rgba(0,255,159,0.08);
  border-bottom: 1px solid rgba(0,255,159,0.22);
  color: var(--green);
  font-size: 0.875rem;
  position: relative; overflow: hidden;
  animation: slideIn 0.25s ease;
}
.import-banner--processing {
  display: none;
  background: rgba(0,212,255,0.08);
  border-bottom-color: rgba(0,212,255,0.22);
  color: var(--cyan);
}
.import-banner-progress {
  position: absolute; bottom: 0; left: 0;
  height: 2px; width: 100%;
  background: var(--green); opacity: 0.55;
}
@keyframes spin { to { transform: rotate(360deg); } }
.import-spinner { animation: spin 0.9s linear infinite; }

/* ══════════════════════════════════════════════════════════════
   FLASH / ALERTS
   ══════════════════════════════════════════════════════════════ */
.flash-container { padding: 0 1.5rem; padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.flash-msg { animation: slideIn 0.3s ease; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 0.75rem;
  border: 1px solid transparent;
}
.alert-success  { background: var(--green-dim);  border-color: rgba(0,255,159,0.3);  color: var(--green); }
.alert-danger   { background: var(--red-dim);    border-color: rgba(255,58,92,0.3);  color: var(--red); }
.alert-warning  { background: var(--yellow-dim); border-color: rgba(255,183,0,0.3);  color: var(--yellow); }
.alert-info     { background: var(--cyan-dim);   border-color: rgba(0,212,255,0.3);  color: var(--cyan); }
.alert-close { margin-left: auto; background: none; border: none; color: inherit; font-size: 1.1rem; line-height: 1; padding: 0 2px; opacity: 0.7; }
.alert-close:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border2); }
.card-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.card-body { padding: 1.25rem; }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative; overflow: hidden;
  transition: all var(--transition);
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-color, var(--cyan));
}
.stat-card:hover {
  border-color: var(--accent-color, var(--cyan));
  box-shadow: 0 0 20px rgba(0,212,255,0.1);
  transform: translateY(-2px);
}
.stat-card-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.75rem;
  background: var(--accent-color, var(--cyan));
  background: color-mix(in srgb, var(--accent-color, var(--cyan)) 20%, transparent);
}
.stat-card-icon svg { width: 20px; height: 20px; color: var(--accent-color, var(--cyan)); }
.stat-value {
  font-size: 2rem; font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text); line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  padding: 0.75rem 1rem; text-align: left;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text); font-family: var(--font-mono);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(26,39,68,0.5);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(0,212,255,0.03); }
.table tbody tr:last-child td { border-bottom: none; }

/* Employee avatar in table */
.emp-cell { display: flex; align-items: center; gap: 0.75rem; }
.emp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
  color: #000; flex-shrink: 0;
}
.emp-name  { font-weight: 500; }
.emp-email { font-size: 0.78rem; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 100px;
  font-size: 0.7rem; font-weight: 600; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
.badge-success { background: var(--green-dim);  color: var(--green); }
.badge-danger  { background: var(--red-dim);    color: var(--red); }
.badge-warning { background: var(--yellow-dim); color: var(--yellow); }
.badge-muted   { background: rgba(136,146,164,0.15); color: var(--text-muted); }
.badge-info    { background: var(--cyan-dim);   color: var(--cyan); }
.badge-outline { background: transparent; color: var(--cyan); border: 1px solid var(--border2); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.1rem; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
  line-height: 1.4;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--cyan-dim);
  border-color: rgba(0,212,255,0.4);
  color: var(--cyan);
}
.btn-primary:hover { background: rgba(0,212,255,0.2); border-color: var(--cyan); color: var(--cyan); box-shadow: var(--cyan-glow); }

.btn-success {
  background: var(--green-dim);
  border-color: rgba(0,255,159,0.3);
  color: var(--green);
}
.btn-success:hover { background: rgba(0,255,159,0.2); border-color: var(--green); color: var(--green); }

.btn-danger {
  background: var(--red-dim);
  border-color: rgba(255,58,92,0.3);
  color: var(--red);
}
.btn-danger:hover { background: rgba(255,58,92,0.2); border-color: var(--red); color: var(--red); }

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

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

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-glow { box-shadow: 0 0 20px rgba(0,212,255,0.2); }
.btn-glow:hover { box-shadow: 0 0 30px rgba(0,212,255,0.4); }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.form-label .required { color: var(--red); margin-left: 2px; }

.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-dim); pointer-events: none;
}
.input-wrapper .form-control { padding-left: 2.5rem; }

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control::placeholder { color: var(--text-dim); }
input[type="date"].form-control,
input[type="time"].form-control,
input[type="file"].form-control { color: var(--text); }
input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="time"].form-control::-webkit-calendar-picker-indicator { filter: invert(0.8); }
input[type="file"].form-control::file-selector-button {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2);
  border-radius: 4px; padding: 0.3rem 0.75rem; margin-right: 0.75rem; cursor: pointer;
}
.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.form-control:invalid:not(:placeholder-shown) { border-color: var(--red); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='%238892a4'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
select.form-control option { background: var(--bg2); }
/* Custom date picker — type="text" display proxy over invisible native date input */
.date-pick-wrap { position: relative; display: block; width: 100%; }
.date-pick-display {
  padding-right: 2.25rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23e2e8f0'%3E%3Cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.6rem center !important;
  background-size: 1rem 1rem !important;
  cursor: pointer !important;
}
.date-pick-real {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  z-index: 1;
}
select.form-control.multi-select { appearance: none; background-image: none; padding-right: 0.875rem; min-height: 110px; }
select.form-control.multi-select option { padding: 0.35rem 0.5rem; border-radius: 3px; color: var(--text); background: var(--bg3); }
select.form-control.multi-select option:checked { background: #00d4ff; color: #05090f; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 0.75rem; color: var(--text-dim); }
.form-error { font-size: 0.75rem; color: var(--red); }

.form-row { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end;
  padding-top: 0.5rem; margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Work-day toggle pills (used in employee form + location schedules) */
.workday-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--bg3);
  color: var(--text-muted); font-size: .78rem;
  font-family: var(--font-mono); font-weight: 600;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.workday-pill:hover { border-color: var(--cyan); color: var(--cyan); }
.workday-pill--on {
  background: rgba(0,212,255,.12); border-color: var(--cyan);
  color: var(--cyan); box-shadow: 0 0 8px rgba(0,212,255,.2);
}
.workday-pill[data-weekend="1"].workday-pill--on {
  background: rgba(255,183,0,.1); border-color: var(--yellow);
  color: var(--yellow); box-shadow: 0 0 8px rgba(255,183,0,.2);
}
.checkbox-list {
  display: flex; flex-direction: column; gap: 0.35rem;
  max-height: 160px; overflow-y: auto;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.5rem 0.75rem;
}
.checkbox-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; cursor: pointer; color: var(--text);
  padding: 0.15rem 0;
}
.checkbox-item:hover { color: var(--cyan); }
.checkbox-item input[type="checkbox"] { accent-color: var(--cyan); }

/* ══════════════════════════════════════════════════════════════
   CALENDAR
   ══════════════════════════════════════════════════════════════ */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.calendar-title { font-size: 1.1rem; font-weight: 700; font-family: var(--font-mono); color: var(--cyan); }

.calendar-grid-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.calendar-day-label {
  text-align: center; padding: 0.5rem;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); font-family: var(--font-mono);
}

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-cell {
  min-height: 100px; padding: 0.4rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  transition: border-color var(--transition);
}
.calendar-cell:hover { border-color: var(--border2); }
.calendar-cell.today { border-color: rgba(0,212,255,0.5); background: rgba(0,212,255,0.03); }
.calendar-cell.other-month { opacity: 0.35; }
.calendar-cell.weekend .cell-date { color: var(--text-dim); }

.cell-date {
  font-size: 0.72rem; font-family: var(--font-mono);
  color: var(--text-muted); margin-bottom: 4px;
  display: block;
}
.today .cell-date {
  color: var(--cyan);
  font-weight: 700;
}

.cell-holidays { display: flex; flex-direction: column; gap: 1px; margin-bottom: 2px; }
.cell-holiday {
  font-size: 0.6rem; padding: 1px 5px; border-radius: 3px;
  background: rgba(255,183,0,0.15); color: #ffb700; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid #ffb700;
}
.cell-events { display: flex; flex-direction: column; gap: 2px; }
.cell-event {
  display: block; width: 100%;
  background: none; border: none; font-family: inherit; text-align: left;
  font-size: 0.65rem; padding: 2px 5px; border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #000; font-weight: 600;
  cursor: pointer;
}
.cell-event { transition: box-shadow .15s, filter .15s; }

/* ══════════════════════════════════════════════════════════════
   CHARTS (pure CSS/SVG)
   ══════════════════════════════════════════════════════════════ */
.chart-bar-group { display: flex; flex-direction: column; gap: 0.75rem; }
.chart-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.chart-bar-label { width: 120px; font-size: 0.8rem; color: var(--text-muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.chart-bar-track {
  flex: 1; height: 22px; background: var(--bg3);
  border-radius: 4px; overflow: hidden; position: relative;
}
.chart-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.8s ease;
  position: relative;
}
.chart-bar-fill::after {
  content: attr(data-value);
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 0.68rem; font-family: var(--font-mono); color: rgba(0,0,0,0.8); font-weight: 700;
}
.chart-bar-total { width: 40px; font-size: 0.75rem; font-family: var(--font-mono); color: var(--text-muted); text-align: right; }

.donut-wrap { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 0.5rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   MISC COMPONENTS
   ══════════════════════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.page-header-title { font-size: 1.25rem; font-weight: 700; color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }

.balance-bar-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.balance-item { display: flex; flex-direction: column; gap: 4px; }
.balance-meta { display: flex; justify-content: space-between; font-size: 0.78rem; }
.balance-name { color: var(--text-muted); }
.balance-days { font-family: var(--font-mono); font-weight: 600; }
.balance-track { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.balance-fill  { height: 100%; border-radius: 3px; transition: width 0.6s ease; }

.filters {
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 1.25rem;
}
.filters .form-control { min-width: 140px; max-width: 200px; }

.empty-state {
  padding: 4rem 2rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.empty-icon { color: var(--text-dim); }
.empty-title { font-size: 1rem; font-weight: 600; }
.empty-desc  { font-size: 0.85rem; color: var(--text-muted); max-width: 320px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.text-muted   { color: var(--text-muted) !important; }
.text-cyan    { color: var(--cyan); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-yellow  { color: var(--yellow); }
.text-mono    { font-family: var(--font-mono); }
.text-sm      { font-size: 0.82rem; }
.text-xs      { font-size: 0.72rem; }
.font-bold    { font-weight: 700; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex   { display: flex; }
.gap-1    { gap: 0.5rem; }
.gap-2    { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Who's off today ────────────────────────────────────────── */
.on-leave-list { display: flex; flex-direction: column; gap: 0.5rem; }
.on-leave-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: var(--radius);
  background: var(--bg3); border: 1px solid var(--border);
}
.on-leave-type { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Activity feed ──────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; gap: 0.75rem; padding: 0.75rem 0;
  border-bottom: 1px solid rgba(26,39,68,0.5);
  font-size: 0.85rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  color: #000; flex-shrink: 0;
}
.activity-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }

/* ── Detail view ────────────────────────────────────────────── */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-family: var(--font-mono); }
.detail-value { font-size: 0.9rem; font-weight: 500; }

/* ── Color swatch ───────────────────────────────────────────── */
.color-swatch { display: flex; align-items: center; gap: 0.5rem; }
.swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 0.25rem; align-items: center; justify-content: flex-end; }
.page-link {
  padding: 0.35rem 0.65rem; border-radius: 5px;
  font-size: 0.78rem; font-family: var(--font-mono);
  color: var(--text-muted); border: 1px solid var(--border);
  background: var(--bg3); transition: all var(--transition);
}
.page-link:hover, .page-link.active { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }


/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes glow {
  0%, 100% { text-shadow: 0 0 8px rgba(0,212,255,0.5); }
  50%       { text-shadow: 0 0 18px rgba(0,212,255,0.9), 0 0 30px rgba(0,212,255,0.4); }
}
.glow-text { animation: glow 2.5s ease-in-out infinite; }

/* ══════════════════════════════════════════════════════════════
   CUSTOM FILTER DROPDOWNS
   ══════════════════════════════════════════════════════════════ */
.filter-dd { position: relative; display: inline-block; }
.filter-dd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  cursor: pointer;
  text-align: left;
}
.filter-dd-chevron { flex-shrink: 0; transition: transform .15s; }
.filter-dd--open .filter-dd-chevron { transform: rotate(180deg); }
.filter-dd-panel {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 600;
  min-width: 100%;
  background: var(--bg3, #0d1321);
  border: 1px solid var(--cyan, #00d4ff);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,212,255,.2);
  max-height: calc(8 * 2.15rem);
  overflow-y: auto;
  padding: 4px 0;
  display: none;
}
.filter-dd--open .filter-dd-panel { display: block; }
.filter-dd-item {
  padding: 6px 12px;
  font-size: .85rem;
  cursor: pointer;
  color: var(--text, #e2e8f0);
  white-space: nowrap;
}
.filter-dd-item:hover { background: rgba(0,212,255,.08); color: var(--cyan, #00d4ff); }
.filter-dd-item.is-selected { color: var(--cyan, #00d4ff); font-weight: 600; }
.filter-dd-group {
  padding: 6px 12px 2px;
  font-size: .68rem;
  color: var(--text-dim, #4a5568);
  font-family: var(--font-mono, monospace);
  text-transform: uppercase;
  letter-spacing: .06em;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar: off-screen by default on mobile, slides in as overlay */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    position: fixed;
    z-index: 200;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  /* Overlay backdrop when sidebar is open */
  .sidebar.mobile-open ~ .main-wrapper::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
  }

  .main-wrapper { margin-left: 0 !important; }
  .main-content { padding: 1rem; }

  /* Topbar fixes */
  .topbar { padding: 0 .75rem; }
  .topbar-right { gap: .25rem; }
  .topbar-date { font-size: .65rem; }
  .page-title { font-size: .9rem; }

  /* Grids go single column */
  .grid-2, .grid-3, .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tables: horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }

  /* Cards */
  .card-header { flex-wrap: wrap; gap: .5rem; }

  /* Calendar */
  .calendar-cell { min-height: 60px; }
  .cell-event { display: none; }
  .cell-event:first-child { display: block; }

  /* Detail grids */
  .detail-grid { flex-direction: column; }

  /* Hide company name in topbar on mobile */
  .topbar-right span[style*="font-weight:600"][style*="color:var(--cyan)"] { display: none; }

  /* Feedback button smaller on mobile */
  .feedback-fab { width: 42px; height: 42px; bottom: 1rem; right: 1rem; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; gap: .5rem; }
  .filters .form-control { max-width: 100%; }
  .page-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .main-content { padding: .75rem; }
  .topbar-date { display: none; }
  .card-body { padding: .75rem; }
  .btn { font-size: .82rem; padding: .45rem .8rem; }
}

/* ══════════════════════════════════════════════════════════════
   INSTALL / SETUP PAGE
   ══════════════════════════════════════════════════════════════ */
.install-card {
  max-width: 480px; margin: 4rem auto;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 2.5rem;
  box-shadow: 0 0 40px rgba(0,212,255,0.06);
}
.install-title {
  font-size: 1.4rem; font-weight: 700; color: var(--cyan);
  margin-bottom: 0.25rem; animation: glow 3s ease-in-out infinite;
}
.install-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 2rem; }
