/* ===========================================================
   AttOT Design System — White Paper / Professional Minimal
   Sora (display) + Inter (body) + #2563eb accent
   =========================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design Tokens --- */
:root {
  /* Backgrounds */
  --bg:            #f8f9fb;
  --bg-elevated:   #ffffff;
  --surface:       #ffffff;
  --surface-hover: #f1f3f5;
  --surface-active:#e9ecef;
  --surface-border:#e2e5ea;

  /* Text */
  --fg:            #1a1d23;
  --fg-secondary:  #5f6577;
  --fg-muted:      #9ca3b0;
  --fg-disabled:   #b8bcc6;

  /* Accent */
  --accent:        #2563eb;
  --accent-hover:  #3b82f6;
  --accent-dim:    rgba(37, 99, 235, 0.06);
  --accent-border: rgba(37, 99, 235, 0.18);

  /* Status */
  --green:         #059669;
  --green-bg:      #ecfdf5;
  --green-text:    #047857;
  --yellow:        #d97706;
  --yellow-bg:     #fffbeb;
  --yellow-text:   #b45309;
  --red:           #dc2626;
  --red-bg:        #fef2f2;
  --red-text:      #b91c1c;
  --purple:        #7c3aed;
  --purple-bg:     #f5f3ff;
  --purple-text:   #6d28d9;
  --blue:          #2563eb;
  --blue-bg:       #eff6ff;
  --blue-text:     #1d4ed8;
  --orange:        #ea580c;
  --orange-bg:     #fff7ed;
  --orange-text:   #c2410c;

  /* Typography */
  --font-display:  'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  /* Type Scale */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-md:   1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  /* Spacing */
  --space-1:  0.25rem;  /* 4px */
  --space-2:  0.5rem;   /* 8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* Radii */
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --radius-xl:  12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:   0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg:   0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl:   0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-modal:0 16px 48px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition-fast:   120ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   350ms ease;

  /* Layout */
  --sidebar-width:   260px;
  --sidebar-collapsed: 64px;
  --header-height:   60px;
  --bottom-nav-height: 64px;
  --content-max:     1400px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.03em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); font-weight: 500; }

.mono { font-family: var(--font-mono); }
.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--fg-secondary);
}

.text-muted { color: var(--fg-secondary); }
.text-dim { color: var(--fg-muted); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green-text); }
.text-yellow { color: var(--yellow-text); }
.text-red { color: var(--red-text); }

/* --- Layout: App Shell --- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Admin/Lead) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-elevated);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-5) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--surface-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.sidebar-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--fg);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--fg-secondary);
  font-size: var(--text-base);
  font-weight: 400;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: var(--space-1);
}

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

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

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

.sidebar-section-label {
  padding: var(--space-4) var(--space-4) var(--space-2);
}

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

/* Top header (Staff/Lead) */
.top-header {
  height: var(--header-height);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Top nav tabs (Staff) */
.top-nav {
  display: flex;
  gap: var(--space-1);
}

.top-nav-item {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--fg-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.top-nav-item:hover { color: var(--fg); background: var(--surface-hover); }
.top-nav-item.active { color: var(--accent); background: var(--accent-dim); }

/* Page content */
.page-content {
  flex: 1;
  padding: var(--space-6);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
}

/* --- Components: Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--transition-fast);
}

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

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

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Stat cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.stat-card-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-secondary);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-card-sub {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
  margin-top: var(--space-1);
}

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* --- Components: Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  height: 40px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }

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

.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
}
.btn-ghost:hover { color: var(--fg); background: var(--surface-hover); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #b91c1c; }

.btn-success {
  background: var(--green);
  color: #ffffff;
  font-weight: 600;
}
.btn-success:hover { background: #047857; }

.btn-lg {
  height: 48px;
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}

.btn-sm {
  height: 32px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Components: Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-green  { background: var(--green-bg);  color: var(--green-text); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow-text); }
.badge-red    { background: var(--red-bg);    color: var(--red-text); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue-text); }
.badge-purple { background: var(--purple-bg); color: var(--purple-text); }
.badge-gray   { background: var(--surface-hover); color: var(--fg-secondary); }
.badge-orange { background: var(--orange-bg); color: var(--orange-text); }

/* --- Components: Tables --- */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead th {
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
}

tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--surface-border);
  color: var(--fg);
}

tbody tr:hover {
  background: var(--surface-hover);
}

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

/* --- Components: Forms --- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast);
  height: 44px;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder { color: var(--fg-muted); }

.form-input.error { border-color: var(--red); }
.form-error {
  font-size: var(--text-xs);
  color: var(--red-text);
  margin-top: var(--space-1);
}

/* Radio / Checkbox */
.form-radio,
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--fg);
}

/* Toggle */
.toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--surface-border);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-fast);
}

.toggle-track.active { background: var(--accent); }

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-track.active::after {
  transform: translateX(20px);
}

/* --- Components: Filters Bar --- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 150px;
}

.filter-group label {
  font-size: var(--text-xs);
  color: var(--fg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-group select,
.filter-group input {
  padding: var(--space-2) var(--space-3);
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--text-sm);
  height: 36px;
}

/* --- Components: Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  cursor: pointer;
  font-size: var(--text-lg);
}

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

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--surface-border);
}

/* --- Components: Toast --- */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  animation: slideIn 0.3s ease;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--yellow); }
.toast-info    { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* --- Components: Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.pagination button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--fg-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination button:hover { background: var(--surface-hover); color: var(--fg); }
.pagination button.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }

/* --- Components: Avatar --- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-xl); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--text-3xl); }

/* --- Components: Notification Bell --- */
.bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bell-btn:hover { background: var(--surface-hover); color: var(--fg); }

.bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
}

/* --- Components: Notification Panel --- */
.notification-panel {
  position: absolute;
  top: calc(var(--header-height) - 4px);
  right: var(--space-6);
  width: 400px;
  max-height: 500px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 150;
  overflow: hidden;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--surface-border);
}

.notification-item {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--surface-border);
  transition: background var(--transition-fast);
}

.notification-item:hover { background: var(--surface-hover); }
.notification-item.unread { background: rgba(37, 99, 235, 0.03); }

/* --- Components: Punch State Banner --- */
.punch-banner {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.punch-banner.punched-in  { background: var(--green-bg); color: var(--green-text); }
.punch-banner.punched-out { background: var(--surface-hover); color: var(--fg-secondary); }
.punch-banner.auto-closed { background: var(--yellow-bg); color: var(--yellow-text); }
.punch-banner.rest-period { background: var(--orange-bg); color: var(--orange-text); }

/* --- Components: Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--fg-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  color: var(--fg-muted);
}

/* --- Components: Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--bg) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

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

/* --- Punch Button (big) --- */
.punch-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  transition: all var(--transition-base);
  margin: var(--space-8) auto;
}

.punch-btn.punch-in {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: var(--green);
}
.punch-btn.punch-in:hover {
  background: rgba(5, 150, 105, 0.12);
  transform: scale(1.03);
}

.punch-btn.punch-out {
  background: var(--red-bg);
  color: var(--red-text);
  border-color: var(--red);
}
.punch-btn.punch-out:hover {
  background: rgba(220, 38, 38, 0.12);
  transform: scale(1.03);
}

.punch-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.punch-btn .punch-label {
  font-size: var(--text-lg);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.punch-btn .punch-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }

  .page-content {
    padding: var(--space-4);
  }

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

  .filters-bar {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .modal {
    width: 95%;
    max-width: none;
    margin: var(--space-4);
  }

  .notification-panel {
    width: calc(100% - var(--space-8));
    right: var(--space-4);
  }
}

/* Mobile bottom tab bar */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-elevated);
  border-top: 1px solid var(--surface-border);
  z-index: 100;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  .main-content {
    margin-left: 0;
    padding-bottom: var(--bottom-nav-height);
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2);
  color: var(--fg-muted);
  font-size: 10px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item:hover { color: var(--fg-secondary); }

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

/* Hamburger menu button */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  cursor: pointer;
}

@media (max-width: 1024px) {
  .hamburger { display: flex; }
}

/* --- Utility Classes --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none; }

/* --- Mobile-specific --- */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .top-nav { display: none; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* Table responsive */
@media (max-width: 768px) {
  .table-wrapper table {
    font-size: var(--text-sm);
  }
  thead th, tbody td {
    padding: var(--space-2) var(--space-3);
  }
}

/* Login page centered layout */
.login-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* Google Sign-In Button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  height: 48px;
  background: white;
  color: #3c4043;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
}

.google-btn:hover {
  box-shadow: var(--shadow-md);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

/* Week timetable grid */
.timetable-grid {
  display: grid;
  grid-template-columns: 140px repeat(7, 1fr);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.timetable-cell {
  padding: var(--space-3);
  border-right: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  font-size: var(--text-sm);
  min-height: 60px;
}

.timetable-cell:last-child { border-right: none; }
.timetable-header {
  background: var(--bg);
  font-weight: 500;
  text-align: center;
}

.timetable-name {
  font-weight: 600;
  background: var(--bg);
}

.shift-morning  { background: rgba(5, 150, 105, 0.06); color: var(--green-text); }
.shift-evening  { background: rgba(37, 99, 235, 0.06); color: var(--blue-text); }
.shift-night    { background: rgba(124, 58, 237, 0.06); color: var(--purple-text); }
.shift-off      { background: var(--surface-hover); color: var(--fg-muted); }

/* Admin mobile bottom nav */
@media (max-width: 768px) {
  .admin-bottom-nav {
    display: flex !important;
    overflow-x: auto;
    gap: var(--space-1);
    padding: var(--space-2);
  }
}

/* Hamburger overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
}

@media (max-width: 1024px) {
  .sidebar-overlay.active { display: block; }
}

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--surface-border);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-day {
  background: var(--surface);
  padding: var(--space-2);
  min-height: 60px;
  font-size: var(--text-sm);
}

.calendar-day.today {
  background: var(--accent-dim);
}

.calendar-day.holiday {
  background: var(--purple-bg);
}

.calendar-day-header {
  background: var(--bg);
  text-align: center;
  padding: var(--space-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-secondary);
  font-weight: 500;
}

/* Alert/Warning banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.alert-banner.warning {
  background: var(--yellow-bg);
  color: var(--yellow-text);
  border: 1px solid rgba(217, 119, 6, 0.15);
}

.alert-banner.danger {
  background: var(--red-bg);
  color: var(--red-text);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

.alert-banner.info {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

/* Quick action buttons row */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Activity row in dashboard */
.activity-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--surface-border);
}

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

/* Status indicator dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.green  { background: var(--green); }
.status-dot.red    { background: var(--red); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.gray   { background: var(--fg-muted); }
