/* ============================================================
   Team Manager — Global Stylesheet
   Primary: #1e3a5f | Background: #f8fafc | Accent: #3B82F6
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1e3a5f;
  --primary-light: #2d5a94;
  --primary-dark: #132540;
  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #22C55E;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #F59E0B;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #EF4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --team1: #3B82F6;
  --team2: #22C55E;
  --team3: #F97316;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --sidebar-w: 240px;
}

/* Dark mode */
body.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273548;
  --border: #334155;
  --border-light: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --success-bg: #052e16;
  --warning-bg: #1c1500;
  --danger-bg: #1c0000;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ============================================================
   Typography
   ============================================================ */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { color: var(--text-muted); }

/* ============================================================
   Layout — Auth Pages (login, register)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-logo-icon svg { color: white; }

.auth-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.auth-logo p { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

.auth-card h2 { margin-bottom: 6px; }
.auth-card > p { margin-bottom: 24px; }

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

textarea { resize: vertical; min-height: 80px; }

select { cursor: pointer; }

input::placeholder { color: var(--text-light); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #16a34a; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* ============================================================
   Admin Layout
   ============================================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo h1 {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.sidebar-logo p {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

.sidebar-nav { padding: 12px 8px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  user-select: none;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(255,255,255,0.15); color: white; }

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

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

.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.admin-topbar h2 { margin: 0; font-size: 1.125rem; }

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

.admin-content { padding: 24px; }

/* ============================================================
   Cards & Panels
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.card-body { padding: 20px; }

/* Dashboard team cards */
.team-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.team-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.team-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}

.team-card.team-1::before { background: var(--team1); }
.team-card.team-2::before { background: var(--team2); }
.team-card.team-3::before { background: var(--team3); }

.team-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.team-color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-card-header h3 { font-size: 1rem; color: var(--text); }
.team-card-header p { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

.team-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.team-stat {
  text-align: center;
  padding: 10px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.team-stat-num { font-size: 1.375rem; font-weight: 700; color: var(--text); }
.team-stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   Table
   ============================================================ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

.table-actions { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

/* ============================================================
   Tabs (sub-navigation)
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  user-select: none;
}

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

/* ============================================================
   Alert / Notice
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.875rem;
  border: 1px solid;
}

.alert-success { background: var(--success-bg); border-color: var(--success-border); color: #065f46; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: #92400e; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-border); color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ============================================================
   Pending registrations banner
   ============================================================ */
.pending-section {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.pending-section h3 {
  color: #92400e;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-item {
  background: white;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pending-info { flex: 1; min-width: 200px; }
.pending-info strong { display: block; color: var(--text); }
.pending-info span { font-size: 0.8125rem; color: var(--text-muted); }

.pending-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

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

.modal-header h3 { font-size: 1.125rem; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  line-height: 0;
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Employee Panel (panel.html)
   ============================================================ */
.panel-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header-info h2 { color: white; font-size: 1.25rem; }
.panel-header-info p { color: rgba(255,255,255,0.75); font-size: 0.875rem; margin: 0; }

.panel-content { max-width: 800px; margin: 0 auto; padding: 24px 16px; }

/* Clock */
.clock-display {
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

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

.clock-date { font-size: 0.9375rem; color: var(--text-muted); margin-top: 6px; }

/* Status selector */
.status-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }

.status-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
  user-select: none;
}

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

.status-card.selected-present { border-color: var(--success); background: var(--success-bg); }
.status-card.selected-sick { border-color: var(--danger); background: var(--danger-bg); }
.status-card.selected-hotel { border-color: #3b82f6; background: #eff6ff; }
.status-card.selected-absent { border-color: var(--warning); background: var(--warning-bg); }

.status-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.status-card-icon.green { background: #dcfce7; color: var(--success); }
.status-card-icon.red { background: #fee2e2; color: var(--danger); }
.status-card-icon.blue { background: #dbeafe; color: #2563eb; }
.status-card-icon.yellow { background: #fef9c3; color: var(--warning); }

.status-card span { font-size: 0.8125rem; font-weight: 500; color: var(--text); display: block; }

/* Checkin confirmed state */
.checkin-confirmed {
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
}

.checkin-confirmed h3 { color: #065f46; font-size: 1.25rem; margin-bottom: 8px; }
.checkin-confirmed p { color: #065f46; margin: 0; }

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

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  min-height: 40px;
  cursor: default;
  transition: background 0.1s;
}

.calendar-day.other-month { color: var(--text-light); }
.calendar-day.today { background: var(--accent); color: white; font-weight: 700; }
.calendar-day.today .dot { background: white !important; }

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

.dot-green { background: var(--success); }
.dot-red { background: var(--danger); }
.dot-blue { background: #3b82f6; }
.dot-yellow { background: var(--warning); }
.dot-gray { background: var(--text-light); }

/* Month navigation */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.month-nav h3 { font-size: 1rem; color: var(--text); }

/* ============================================================
   Dark mode toggle
   ============================================================ */
.dark-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all 0.15s;
}

.dark-toggle:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   Search bar
   ============================================================ */
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrap input { padding-left: 36px; }

/* ============================================================
   GPS link
   ============================================================ */
.gps-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
}

.gps-link:hover { text-decoration: underline; }

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

.empty-state svg { opacity: 0.3; margin-bottom: 12px; }
.empty-state h3 { color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: 0.875rem; }

/* ============================================================
   Loading spinner
   ============================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

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

/* ============================================================
   Team color stripes in tables
   ============================================================ */
.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   Section label
   ============================================================ */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ============================================================
   Divider
   ============================================================ */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ============================================================
   Success screen (register)
   ============================================================ */
.success-screen {
  text-align: center;
  padding: 20px 0;
}

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

.success-screen h2 { color: var(--text); margin-bottom: 8px; }
.success-screen p { color: var(--text-muted); font-size: 0.9375rem; max-width: 320px; margin: 0 auto; }

/* ============================================================
   Employee detail view (attendance history)
   ============================================================ */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-back { cursor: pointer; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .team-cards { grid-template-columns: 1fr; }
  .status-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }

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

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

  .admin-content { padding: 16px; }

  .team-cards { grid-template-columns: 1fr 1fr; }

  .auth-card { padding: 28px 20px; }

  .form-row { grid-template-columns: 1fr; }

  .clock-time { font-size: 2.25rem; }

  .menu-btn { display: flex !important; }
}

@media (max-width: 480px) {
  .team-cards { grid-template-columns: 1fr; }
  .calendar-grid { gap: 2px; }
  .calendar-day { font-size: 0.75rem; min-height: 32px; }
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  color: white;
  padding: 7px;
  cursor: pointer;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}

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

/* ============================================================
   Today attendance grouped view
   ============================================================ */
.team-group { margin-bottom: 24px; }

.team-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.team-group-header h4 { color: var(--text); font-size: 0.9375rem; }
.team-group-header .count { margin-left: auto; color: var(--text-muted); font-size: 0.8125rem; }

/* ============================================================
   Attendance record card (mobile-friendly)
   ============================================================ */
.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
  flex-wrap: wrap;
}

.record-row:last-child { border-bottom: none; }

.record-name { font-weight: 500; color: var(--text); font-size: 0.9375rem; }
.record-meta { font-size: 0.8125rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Confirmation warnings (employee panel)
   ============================================================ */
.confirmation-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #9a3412;
  line-height: 1.4;
}

.confirmation-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #ea580c;
}

body.dark .confirmation-warning {
  background: #431407;
  border-color: #9a3412;
  color: #fed7aa;
}

body.dark .confirmation-warning svg {
  color: #fb923c;
}

.confirmation-pending-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  padding: 8px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #92400e;
}

body.dark .confirmation-pending-notice {
  background: #1c1500;
  border-color: #92400e;
  color: #fde68a;
}

/* ============================================================
   Confirmation tab (admin panel)
   ============================================================ */
.confirm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.confirm-card-info {
  flex: 1;
  min-width: 200px;
}

.confirm-card-info .confirm-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 4px;
}

.confirm-card-info .confirm-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.confirm-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirm-reason-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.confirm-reason-badge.reason-sunday {
  background: #fef3c7;
  color: #92400e;
}

.confirm-reason-badge.reason-overtime {
  background: #dbeafe;
  color: #1e40af;
}

body.dark .confirm-reason-badge.reason-sunday {
  background: #422006;
  color: #fbbf24;
}

body.dark .confirm-reason-badge.reason-overtime {
  background: #1e3a5f;
  color: #93c5fd;
}

.confirm-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.confirm-bulk-bar span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Confirmation status badges for existing views */
.badge-pending-confirm {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.6875rem;
  padding: 2px 6px;
}

.badge-confirmed {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.6875rem;
  padding: 2px 6px;
}

body.dark .badge-pending-confirm {
  background: #422006;
  color: #fbbf24;
}

body.dark .badge-confirmed {
  background: #052e16;
  color: #4ade80;
}

/* Nav item badge count */
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.3;
}

/* ============================================================
   Security LED & button
   ============================================================ */
.security-led-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 40px;
}

.security-led {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border);
  transition: all 0.3s ease;
}

.security-led.active {
  background: #22C55E;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #22C55E33, 0 0 8px #22C55E66;
  animation: ledPulse 2s ease-in-out infinite;
}

@keyframes ledPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #22C55E33, 0 0 8px #22C55E66; }
  50% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #22C55E55, 0 0 14px #22C55E88; }
}

.security-led-time {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
}

/* Security report button (employee panel) */
.security-report-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a94 100%);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.security-report-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #2d5a94 0%, #3b72b8 100%);
}

.security-report-btn:active {
  transform: translateY(0);
}

.security-report-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.security-report-btn .security-icon {
  font-size: 1.5rem;
}

.security-done {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-lg);
}

body.dark .security-done {
  background: #052e16;
  border-color: #15803d44;
}

.security-icon-done {
  font-size: 2rem;
}

/* Leader badge */
.badge-leader {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.6875rem;
  padding: 2px 6px;
  margin-left: 4px;
}

body.dark .badge-leader {
  background: #1e3a5f;
  color: #93c5fd;
}

/* ============================================================
   Misc utility
   ============================================================ */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ═══════════════════════════════════════════════════════
   v5 Additions
   ═══════════════════════════════════════════════════════ */

/* Textarea in modals */
.modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.modal textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Archived badge in payroll */
.archived-badge {
  display: none;
  align-items: center;
  gap: 5px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Leader badge */
.badge-leader {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 0.6875rem;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Archive btn group */
.archive-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Calendar table row hover */
#calTableBody tr:hover {
  background: var(--bg);
  cursor: pointer;
}

/* Payroll summary table in panel */
.payroll-summary-table td {
  padding: 8px 4px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.payroll-summary-table tr:last-child td {
  border-bottom: none;
}

/* Time inputs in forms */
input[type="time"],
input[type="date"] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
input[type="time"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
