/* AutozenCRM - Professional HRMS Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* Primary Palette */
  --primary: #5B6AF0;
  --primary-dark: #4457E8;
  --primary-light: #8B98F7;
  --primary-glow: rgba(91, 106, 240, 0.25);

  /* Accent Colors */
  --accent-teal: #00C9A7;
  --accent-orange: #FF7043;
  --accent-purple: #9C5CF5;
  --accent-gold: #FFB300;

  /* Dark Background System */
  --bg-base: #0B0E1A;
  --bg-surface: #121627;
  --bg-card: #1A1F35;
  --bg-card-hover: #1F2540;
  --bg-elevated: #222845;
  --bg-modal: #161B2E;

  /* Borders */
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --border-primary: rgba(91,106,240,0.35);

  /* Text */
  --text-primary: #E8EAF6;
  --text-secondary: #8B91B3;
  --text-muted: #5A617A;
  --text-inverse: #0B0E1A;

  /* Status Colors */
  --success: #00C897;
  --warning: #FFB300;
  --danger: #FF4757;
  --info: #38A7FF;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-bg: #0D1123;
  --sidebar-border: rgba(91,106,240,0.15);

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-primary: 0 8px 24px rgba(91,106,240,0.3);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT
============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: var(--transition-slow);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(91,106,240,0.3); border-radius: 4px; }

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-primary);
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(91,106,240,0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(91,106,240,0.15), transparent);
  color: var(--primary-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-item .nav-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 16px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  transition: var(--transition);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: rgba(91,106,240,0.15);
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
}

.user-info-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.user-info-card:hover { background: rgba(255,255,255,0.07); }

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

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 99;
  backdrop-filter: blur(12px);
}

.topbar-title {
  flex: 1;
}

.topbar-title h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-title p {
  font-size: 12px;
  color: var(--text-muted);
}

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

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-size: 16px;
}

.topbar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.topbar-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* PAGE CONTENT */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ============================================================
   CARDS
============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.card:hover { border-color: var(--border-strong); }

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

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* STAT CARDS */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-slow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.teal::before { background: var(--accent-teal); }
.stat-card.orange::before { background: var(--accent-orange); }
.stat-card.purple::before { background: var(--accent-purple); }

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

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.stat-icon.blue { background: rgba(91,106,240,0.15); color: var(--primary); }
.stat-icon.teal { background: rgba(0,201,167,0.15); color: var(--accent-teal); }
.stat-icon.orange { background: rgba(255,112,67,0.15); color: var(--accent-orange); }
.stat-icon.purple { background: rgba(156,92,245,0.15); color: var(--accent-purple); }
.stat-icon.gold { background: rgba(255,179,0,0.15); color: var(--accent-gold); }

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  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-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13.5px;
  vertical-align: middle;
}

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

tbody tr:hover td {
  background: rgba(255,255,255,0.02);
  color: var(--text-primary);
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(91,106,240,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(91,106,240,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary-light);
}

.btn-success {
  background: rgba(0,200,151,0.15);
  color: var(--success);
  border-color: rgba(0,200,151,0.3);
}

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

.btn-danger {
  background: rgba(255,71,87,0.12);
  color: var(--danger);
  border-color: rgba(255,71,87,0.3);
}

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

.btn-warning {
  background: rgba(255,179,0,0.12);
  color: var(--warning);
  border-color: rgba(255,179,0,0.3);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================================
   FORMS
============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-label .required { color: var(--danger); margin-left: 4px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

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

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-card);
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea.form-control { resize: vertical; min-height: 100px; }

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 12 12'%3E%3Cpath fill='%238B91B3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 6px; }

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input-prefix,
.input-group .input-suffix {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.input-group .input-prefix { border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input-suffix { border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .form-control { border-radius: 0; }

/* Checkboxes & Radios */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 10px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check-label { font-size: 13.5px; color: var(--text-secondary); cursor: pointer; }

/* ============================================================
   BADGES & STATUS
============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-success { background: rgba(0,200,151,0.15); color: var(--success); }
.badge-danger { background: rgba(255,71,87,0.15); color: var(--danger); }
.badge-warning { background: rgba(255,179,0,0.15); color: var(--warning); }
.badge-info { background: rgba(56,167,255,0.15); color: var(--info); }
.badge-primary { background: rgba(91,106,240,0.15); color: var(--primary-light); }
.badge-muted { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.badge-present { background: rgba(0,200,151,0.15); color: #00C897; border-radius: 20px; padding: 3px 10px; font-size:11px; font-weight:600; }
.badge-absent { background: rgba(255,71,87,0.15); color: #FF4757; border-radius: 20px; padding: 3px 10px; font-size:11px; font-weight:600; }
.badge-halfday { background: rgba(255,179,0,0.15); color: #FFB300; border-radius: 20px; padding: 3px 10px; font-size:11px; font-weight:600; }
.badge-late { background: rgba(156,92,245,0.15); color: #9C5CF5; border-radius: 20px; padding: 3px 10px; font-size:11px; font-weight:600; }
.badge-leave { background: rgba(56,167,255,0.15); color: #38A7FF; border-radius: 20px; padding: 3px 10px; font-size:11px; font-weight:600; }
.badge-holiday { background: rgba(0,201,167,0.15); color: #00C9A7; border-radius: 20px; padding: 3px 10px; font-size:11px; font-weight:600; }
.badge-weekend { background: rgba(255,255,255,0.06); color: #8B91B3; border-radius: 20px; padding: 3px 10px; font-size:11px; font-weight:600; }

/* ============================================================
   GRID & LAYOUT UTILITIES
============================================================ */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ============================================================
   MODALS
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255,71,87,0.15);
  color: var(--danger);
  border-color: rgba(255,71,87,0.3);
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* ============================================================
   LOGIN PAGE
============================================================ */
.auth-page {
  min-height: 100vh;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(91,106,240,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(156,92,245,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-mark {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  box-shadow: 0 16px 40px rgba(91,106,240,0.35);
}

.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  border: none;
  background: none;
}

.auth-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(91,106,240,0.3);
}

/* ============================================================
   ALERTS
============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(0,200,151,0.1); border: 1px solid rgba(0,200,151,0.25); color: var(--success); }
.alert-danger { background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.25); color: var(--danger); }
.alert-warning { background: rgba(255,179,0,0.1); border: 1px solid rgba(255,179,0,0.25); color: var(--warning); }
.alert-info { background: rgba(56,167,255,0.1); border: 1px solid rgba(56,167,255,0.25); color: var(--info); }

/* ============================================================
   PUNCH IN/OUT WIDGET
============================================================ */
.punch-widget {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.punch-clock {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

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

.camera-preview {
  width: 100%;
  max-width: 320px;
  height: 240px;
  background: var(--bg-base);
  border-radius: var(--radius-md);
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  border: 2px solid var(--border);
}

.punch-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  cursor: pointer;
  transition: var(--transition-slow);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

.punch-btn.punch-in {
  background: linear-gradient(135deg, var(--success), #00A876);
  box-shadow: 0 8px 24px rgba(0,200,151,0.4);
}

.punch-btn.punch-out {
  background: linear-gradient(135deg, var(--danger), #CC3344);
  box-shadow: 0 8px 24px rgba(255,71,87,0.4);
}

.punch-btn:hover {
  transform: scale(1.08);
}

.punch-status {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
}

.punch-status.in { color: var(--success); }
.punch-status.out { color: var(--danger); }

/* ============================================================
   LOCATION MAP
============================================================ */
.map-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 350px;
}

.map-container iframe,
.map-container #map {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   SEARCH & FILTERS
============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

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

/* ============================================================
   AVATAR / EMPLOYEE CARD
============================================================ */
.employee-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.employee-card:hover {
  border-color: var(--border-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.emp-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.emp-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(91,106,240,0.35);
}

/* ============================================================
   PROGRESS BARS
============================================================ */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-fill.blue { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.progress-fill.teal { background: linear-gradient(90deg, var(--accent-teal), #00E5C4); }
.progress-fill.orange { background: linear-gradient(90deg, var(--accent-orange), #FF8A65); }
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #FF7080); }

/* ============================================================
   TOASTS
============================================================ */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  animation: slideInToast 0.3s ease;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; font-size: 13.5px; color: var(--text-primary); }
.toast-close { color: var(--text-muted); cursor: pointer; font-size: 16px; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

/* ============================================================
   PHOTO UPLOAD
============================================================ */
.photo-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255,255,255,0.02);
}

.photo-upload-zone:hover {
  border-color: var(--primary);
  background: rgba(91,106,240,0.05);
}

.photo-upload-zone .upload-icon {
  font-size: 36px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ============================================================
   TIMELINE / ACTIVITY
============================================================ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-content { font-size: 13.5px; color: var(--text-secondary); }

/* ============================================================
   TABS
============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
  border: none;
  background: none;
}

.tab.active {
  background: var(--bg-card);
  color: var(--primary-light);
  border: 1px solid var(--border-primary);
}

/* ============================================================
   CALENDAR
============================================================ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.cal-day:hover { background: var(--bg-elevated); color: var(--text-primary); }
.cal-day.today { background: var(--primary); color: #fff; }
.cal-day.present { background: rgba(0,200,151,0.15); color: var(--success); }
.cal-day.absent { background: rgba(255,71,87,0.12); color: var(--danger); }
.cal-day.leave { background: rgba(56,167,255,0.12); color: var(--info); }
.cal-day.holiday { background: rgba(255,179,0,0.12); color: var(--warning); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* Text utils */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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