/* ============================================================
   People First Co — Admin Dashboard
   Design system matched to PFC client portal
   ============================================================ */

:root {
  --color-primary: #2d3436;
  --color-accent: #E5A835;
  --color-accent-light: #f0be4a;
  --color-accent-dim: rgba(229, 168, 53, 0.12);
  --color-bg: #1a2021;
  --color-surface: rgba(255,255,255,0.04);
  --color-surface-solid: #232a2b;
  --color-surface-hover: rgba(255,255,255,0.07);
  --color-surface-active: rgba(255,255,255,0.10);
  --color-border: rgba(255,255,255,0.06);
  --color-border-strong: rgba(255,255,255,0.1);
  --color-text: rgba(255,255,255,0.85);
  --color-text-muted: rgba(255,255,255,0.4);
  --color-text-dim: rgba(255,255,255,0.25);
  --status-active-bg: rgba(22,163,74,0.15);
  --status-active-color: #4ade80;
  --status-late-bg: rgba(234,179,8,0.15);
  --status-late-color: #facc15;
  --status-absent-bg: rgba(239,68,68,0.12);
  --status-absent-color: #f87171;
  --status-pending-bg: rgba(96,165,250,0.12);
  --status-pending-color: #60a5fa;
  --status-inactive-bg: rgba(148,163,184,0.12);
  --status-inactive-color: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 240px;
  --header-height: 56px;
}

/* Light theme */
[data-theme="light"] {
  --color-primary: #ffffff;
  --color-accent: #D4912A;
  --color-accent-light: #E5A835;
  --color-accent-dim: rgba(212, 145, 42, 0.1);
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-surface-solid: #ffffff;
  --color-surface-hover: #f1f3f5;
  --color-surface-active: #e9ecef;
  --color-border: #e5e7eb;
  --color-border-strong: #d1d5db;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-text-dim: #9ca3af;
  --status-active-bg: rgba(22,163,74,0.1);
  --status-active-color: #16a34a;
  --status-late-bg: rgba(202,138,4,0.1);
  --status-late-color: #ca8a04;
  --status-absent-bg: rgba(220,38,38,0.08);
  --status-absent-color: #dc2626;
  --status-pending-bg: rgba(37,99,235,0.08);
  --status-pending-color: #2563eb;
  --status-inactive-bg: rgba(100,116,139,0.08);
  --status-inactive-color: #64748b;
}

[data-theme="light"] .sidebar { background: #ffffff; border-right-color: #e5e7eb; }
[data-theme="light"] .login-form input { background: rgba(0,0,0,0.04); }
[data-theme="light"] .login-logo-icon,
[data-theme="light"] .sidebar-logo { color: #fff; }

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(160deg, #2d3436 0%, #1a2021 60%, #1e2526 100%);
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--color-text);
  outline: none;
  transition: border-color 200ms ease;
}

.login-form input:focus {
  border-color: var(--color-accent);
}

.login-form input::placeholder {
  color: var(--color-text-dim);
}

.login-form button {
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 200ms ease;
}

.login-form button:hover { background: var(--color-accent-light); }
.login-form button:disabled { opacity: 0.6; cursor: not-allowed; }

.login-error {
  font-size: 13px;
  color: #f87171;
  display: none;
}

.login-error.show { display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */

.dashboard-view {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(26, 32, 33, 0.95);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  backdrop-filter: blur(20px);
}

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

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all 150ms ease;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.nav-item.active {
  color: var(--color-accent);
  background: var(--color-accent-dim);
  font-weight: 600;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 150ms ease;
  width: 100%;
  text-align: left;
}

.logout-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 150ms ease;
  width: 100%;
  text-align: left;
}

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

.theme-icon-sun { color: var(--color-accent); font-size: 18px; }
.theme-icon-moon { display: none; color: #2d3436; font-size: 18px; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: inline; }

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-surface-solid);
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 150;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

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

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: 100vh;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

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

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

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

.page-actions {
  display: flex;
  align-items: center;
  z-index: 501;
  position: relative;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 150ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.btn-primary:hover { background: var(--color-accent-light); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover { border-color: var(--color-border-strong); background: var(--color-surface-hover); }

.btn-ghost {
  background: none;
  color: var(--color-text-muted);
  border: none;
  padding: 8px 12px;
}

.btn-ghost:hover { color: var(--color-text); background: var(--color-surface-hover); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border-color: rgba(239,68,68,0.2);
}

.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

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

.card-body {
  padding: 16px 24px;
}

.card-body-flush {
  padding: 0;
}

/* ============================================================
   STATS ROW
   ============================================================ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 200ms ease;
}

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

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

.stat-change.positive { color: var(--status-active-color); }
.stat-change.negative { color: var(--status-absent-color); }

/* ============================================================
   TABLE
   ============================================================ */

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

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.data-table tbody tr {
  transition: background 150ms ease;
}

.data-table tbody tr:hover {
  background: var(--color-surface-hover);
}

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

.data-table .clickable {
  cursor: pointer;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active, .badge-on-site { background: var(--status-active-bg); color: var(--status-active-color); }
.badge-late { background: var(--status-late-bg); color: var(--status-late-color); }
.badge-absent { background: var(--status-absent-bg); color: var(--status-absent-color); }
.badge-pending { background: var(--status-pending-bg); color: var(--status-pending-color); }
.badge-inactive { background: var(--status-inactive-bg); color: var(--status-inactive-color); }

/* ============================================================
   FILTERS
   ============================================================ */

.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 200ms ease;
}

.filter-btn:hover { color: var(--color-text); }

.filter-btn.active {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  margin-bottom: 16px;
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--color-text);
  outline: none;
  transition: border-color 200ms ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-dim);
}

.form-select {
  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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

/* ============================================================
   WORKER CARDS (Attendance)
   ============================================================ */

.worker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
}

.worker-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all 150ms ease;
}

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

.worker-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.avatar-initials {
  background: var(--color-accent);
}

.worker-card-info {
  flex: 1;
  min-width: 0;
}

.worker-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.worker-card-role {
  font-size: 12px;
  color: var(--color-text-muted);
}

.worker-card-meta {
  text-align: right;
  flex-shrink: 0;
}

.worker-card-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.worker-card-time-label {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ============================================================
   DATE PICKER
   ============================================================ */

.date-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-picker input[type="date"] {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--color-text);
  outline: none;
  cursor: pointer;
}

.date-picker input[type="date"]:focus {
  border-color: var(--color-accent);
}

/* ============================================================
   SCHEDULE GRID
   ============================================================ */

.schedule-container {
  overflow-x: auto;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, 1fr);
  min-width: 900px;
}

.schedule-header-cell {
  padding: 12px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.schedule-header-cell.today {
  color: var(--color-accent);
}

.schedule-header-cell:first-child {
  text-align: left;
  padding-left: 16px;
}

.schedule-worker-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
}

.schedule-cell {
  padding: 6px;
  border-bottom: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  min-height: 52px;
  cursor: pointer;
  transition: background 150ms ease;
}

.schedule-cell:hover {
  background: var(--color-surface-hover);
}

.schedule-shift-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-accent-dim);
  color: var(--color-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.schedule-shift-chip.no-shift {
  background: transparent;
  color: var(--color-text-dim);
  font-weight: 400;
}

/* ============================================================
   SHIFT TEMPLATES SIDEBAR
   ============================================================ */

.templates-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: background 150ms ease;
}

.template-item:hover {
  background: var(--color-surface-hover);
}

.template-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.template-time {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

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

.modal {
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all 150ms ease;
}

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

.modal-body {
  padding: 24px;
}

/* ============================================================
   TOAST
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: toast-in 300ms ease forwards;
  min-width: 260px;
}

.toast.success { border-left: 3px solid var(--status-active-color); }
.toast.error { border-left: 3px solid var(--status-absent-color); }
.toast.info { border-left: 3px solid var(--color-accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(12px); }
}

/* ============================================================
   ATTENDANCE CALENDAR
   ============================================================ */

/* Date picker button */
.date-picker-btn {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 150ms;
}
.date-picker-btn:hover {
  background: var(--color-bg-alt);
}

/* Dropdown container */
.cal-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 500;
  min-width: 340px;
  animation: cal-fade-in 150ms ease;
}
.cal-dropdown.show {
  display: block;
}
@keyframes cal-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.attendance-calendar {
  background: #2d3436;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
[data-theme="light"] .attendance-calendar {
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

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

.cal-month-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.cal-nav-btn {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms;
}
.cal-nav-btn:hover {
  background: var(--color-border);
}

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

.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0 8px;
}

.cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms;
  position: relative;
  padding: 10px 0;
}

.cal-cell:hover {
  background: var(--color-bg-alt);
}

.cal-cell-empty {
  cursor: default;
}
.cal-cell-empty:hover {
  background: none;
}

.cal-day-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

/* Current week highlight */
.cal-current-week {
  background: rgba(229, 168, 53, 0.08);
}
.cal-current-week:hover {
  background: rgba(229, 168, 53, 0.15);
}

/* Today */
.cal-today {
  background: rgba(229, 168, 53, 0.15);
  border: 1.5px solid var(--color-accent);
}
.cal-today .cal-day-num {
  color: var(--color-accent);
  font-weight: 700;
}
.cal-today:hover {
  background: rgba(229, 168, 53, 0.22);
}

/* Selected */
.cal-selected {
  background: var(--color-accent) !important;
  border: none !important;
}
.cal-selected .cal-day-num {
  color: #1a1a1a !important;
  font-weight: 700;
}

/* Future days */
.cal-future .cal-day-num {
  opacity: 0.35;
}
.cal-future {
  cursor: default;
}

/* Weekend */
.cal-weekend .cal-day-num {
  opacity: 0.5;
}

/* ============================================================
   DETAIL PANEL (Worker detail sidebar)
   ============================================================ */

.detail-section {
  margin-bottom: 20px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

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

.detail-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.detail-value {
  color: var(--color-text);
  font-weight: 600;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 500;
}

/* ============================================================
   LOADING
   ============================================================ */

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   INVITE CODE
   ============================================================ */

.invite-code-display {
  background: var(--color-bg);
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}

.invite-code-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: 4px;
  font-family: monospace;
}

.invite-code-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* ============================================================
   CLIENT DETAIL
   ============================================================ */

.sites-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.site-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

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

.site-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.site-meta-item {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 250ms ease;
  }

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

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

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: calc(var(--header-height) + 16px);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .modal {
    max-width: 100%;
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}

/* ============================================================
   SCHEDULE LAYOUT
   ============================================================ */

.schedule-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

@media (max-width: 1024px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SETTINGS
   ============================================================ */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MISC
   ============================================================ */

.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 12px; }
.text-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
