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

/* ============================================================
   Check-B — Premium Dark Food Service PWA
   Complete UI System v2.0
   ============================================================ */

/* --- 1. CSS Variables ---------------------------------------- */
:root {
  --bg-base: #060912;
  --bg-primary: #0d1117;
  --bg-secondary: #161b27;
  --bg-tertiary: #1e2533;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.07);
  --bg-card: #161b27;
  --bg-input: #0d1117;

  --accent-50: #eff6ff;
  --accent-100: #dbeafe;
  --accent-400: #60a5fa;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-600: #2563eb;
  --accent-700: #1d4ed8;
  --accent-light: rgba(59, 130, 246, 0.12);
  --accent-glow: rgba(59, 130, 246, 0.3);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-accent-soft: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --warning-glow: rgba(245, 158, 11, 0.25);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --danger-glow: rgba(239, 68, 68, 0.25);
  --info: #06b6d4;

  --text-primary: #f0f6ff;
  --text-secondary: #8b9ab5;
  --text-muted: #4a5568;
  --text-accent: #60a5fa;

  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(59, 130, 246, 0.4);
  --border-hover: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 0 24px rgba(59, 130, 246, 0.25);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --bottomnav-height: 70px;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-fast: all 0.15s ease;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* --- 2. Base Styles ------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-primary) 100%);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

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

a:hover {
  color: var(--accent-hover);
}

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

/* --- 3. Layout ----------------------------------------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.page {
  animation: fadeInUp 0.3s ease forwards;
}

/* --- 4. Sidebar ---------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  z-index: 1000;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

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

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

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.sidebar-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

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

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.sidebar-nav-section {
  padding: 16px 16px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  margin-bottom: 2px;
}

.sidebar-nav-item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--gradient-accent-soft);
  color: var(--text-accent);
  border-left: 2px solid var(--accent);
}

.sidebar-nav-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* --- 5. Top Bar ---------------------------------------------- */
.top-bar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- 6. Page Header ------------------------------------------ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-header-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-header-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- 7. Bottom Nav ------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  height: var(--bottomnav-height);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  position: relative;
  letter-spacing: 0.02em;
}

.nav-item-icon {
  font-size: 1.2rem;
  line-height: 1;
  transition: var(--transition);
}

.nav-item-label {
  line-height: 1;
}

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

.nav-item.active {
  color: var(--accent);
}

.nav-item.active .nav-item-icon {
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 0 0 2px 2px;
}

/* --- 8. Cards ------------------------------------------------ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

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

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

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.card-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* --- 9. Stat Cards ------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 1.25rem;
}

.stat-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.stat-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-icon.danger {
  background: var(--danger-light);
  color: var(--danger);
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.stat-total {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-trend.up,
.trend-up {
  color: var(--success);
  background: var(--success-light);
}

.stat-trend.down,
.trend-down {
  color: var(--danger);
  background: var(--danger-light);
}

/* --- 10. Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.01em;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  color: #ffffff;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

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

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.btn-success:hover {
  transform: translateY(-1px);
  color: #ffffff;
}

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

.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.btn-outline:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

.btn-icon.btn-sm {
  padding: 6px;
  width: 32px;
  height: 32px;
}

.btn-fab {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #ffffff;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
  z-index: 50;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.6);
}

.btn-fab:active {
  transform: scale(0.95);
}

/* --- 11. Forms ----------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9375rem;
  transition: var(--transition);
  outline: none;
}

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

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

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

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

/* Custom Checkbox */
.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--bg-input);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.form-checkbox input[type="checkbox"]:checked {
  background: var(--gradient-accent);
  border-color: transparent;
}

.form-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-checkbox input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Toggle Switch */
.form-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.form-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.form-switch input[type="checkbox"]:checked {
  background: var(--gradient-accent);
  border-color: transparent;
}

.form-switch input[type="checkbox"]:checked::after {
  left: calc(100% - 20px);
  background: #ffffff;
}

.form-switch input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 4px;
}

.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-glow);
}

.field-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: 6px;
  display: block;
}

/* --- 12. Tables ---------------------------------------------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-primary);
}

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

.table tr:hover td {
  background: var(--bg-glass);
}

/* --- 13. Lists ----------------------------------------------- */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.list-item:hover {
  background: var(--bg-glass);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.list-item-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.list-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* --- 14. Badges ---------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
  background: rgba(6, 182, 212, 0.12);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-neutral {
  background: rgba(139, 154, 181, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-default {
  background: rgba(139, 154, 181, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* --- 15. Progress -------------------------------------------- */
.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.success {
  background: linear-gradient(90deg, var(--success), #059669);
}

.progress-fill.warning {
  background: linear-gradient(90deg, var(--warning), #d97706);
}

.progress-fill.danger {
  background: linear-gradient(90deg, var(--danger), #dc2626);
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8125rem;
}

.progress-label-text {
  color: var(--text-secondary);
}

.progress-label-value {
  color: var(--text-primary);
  font-weight: 700;
}

/* Progress Ring */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.progress-ring-text {
  position: absolute;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* --- 16. Modals ---------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.125rem;
}

.modal-close:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

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

.modal-lg {
  max-width: 700px;
}

.modal-sm {
  max-width: 380px;
}

/* --- 17. Toasts --------------------------------------------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 16px 44px 16px 16px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  position: relative;
  overflow: hidden;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-info {
  border-left-color: var(--accent);
}

.toast-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.toast-close:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  animation: shrink 4s linear forwards;
}

.toast-success .toast-progress {
  background: var(--success);
}

.toast-error .toast-progress {
  background: var(--danger);
}

.toast-warning .toast-progress {
  background: var(--warning);
}

/* --- 18. Skeleton Loading ------------------------------------ */
.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text.w-75 {
  width: 75%;
}

.skeleton-text.w-50 {
  width: 50%;
}

.skeleton-text.w-25 {
  width: 25%;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-card {
  height: 120px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-avatar.lg {
  width: 64px;
  height: 64px;
}

.skeleton-btn {
  width: 100px;
  height: 40px;
}

.skeleton-line {
  display: block;
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  overflow: hidden;
  position: relative;
}

.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-title {
  display: block;
  height: 20px;
  width: 50%;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  overflow: hidden;
  position: relative;
}

.skeleton-title::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-value {
  display: block;
  height: 40px;
  width: 70%;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  overflow: hidden;
  position: relative;
}

.skeleton-value::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-rect {
  display: block;
  height: 200px;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  overflow: hidden;
  position: relative;
}

.skeleton-rect::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

/* --- 19. Task / Checklist Specific --------------------------- */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.task-item:last-child {
  border-bottom: none;
}

.task-item:hover {
  background: var(--bg-glass);
}

.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
}

.task-checkbox:checked {
  background: var(--gradient-accent);
  border-color: transparent;
  box-shadow: 0 0 12px var(--accent-glow);
}

.task-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.task-checkbox:focus {
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
}

.task-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-completed .task-title {
  text-decoration: line-through;
  opacity: 0.4;
  color: var(--text-muted);
}

.task-completed .task-subtitle {
  opacity: 0.3;
}

.task-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Checklist Progress */
.checklist-progress {
  margin-bottom: 16px;
}

.checklist-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.checklist-progress-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.checklist-progress-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-thumb {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.photo-thumb:hover {
  opacity: 0.8;
  transform: scale(1.03);
}

.photo-add {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.5rem;
  background: transparent;
}

.photo-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Urgency Dot */
.urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

.urgency-dot.warning {
  background: var(--warning);
}

.urgency-dot.ok {
  background: var(--success);
  animation: none;
}

/* Shift Badges */
.shift-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.shift-badge.morning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.shift-badge.afternoon {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.2);
}

.shift-badge.night {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* --- 20. Gamification --------------------------------------- */
.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fbbf24;
  font-size: 0.8125rem;
  font-weight: 700;
}

.xp-badge-icon {
  font-size: 1rem;
}

.ranking-list {
  list-style: none;
  padding: 0;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item:hover {
  background: var(--bg-glass);
}

.ranking-position {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  flex-shrink: 0;
}

.ranking-crown {
  font-size: 1rem;
}

.ranking-crown.gold {
  color: #fbbf24;
}

.ranking-crown.silver {
  color: #9ca3af;
}

.ranking-crown.bronze {
  color: #d97706;
}

.ranking-position.top-1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0d1117;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.3);
}

.ranking-position.top-2 {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #0d1117;
}

.ranking-position.top-3 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0d1117;
}

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

.ranking-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.ranking-xp {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.ranking-bar {
  flex-shrink: 0;
  width: 100px;
}

.ranking-bar .progress-bar {
  height: 6px;
}

/* Level Up */
@keyframes levelUp {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 20px 8px rgba(251, 191, 36, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
  }
}

.level-up {
  animation: levelUp 0.6s ease;
}

/* --- 21. Dashboard Specific ---------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.dashboard-page {
  padding: 0;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.chart-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.schedule-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.ranking-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.alerts-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.alerts-card.has-alerts {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 24px var(--danger-glow);
}

.actions-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

/* Schedule */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.schedule-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.schedule-item:last-child {
  border-bottom: none;
}

.schedule-time {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-accent);
  min-width: 48px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

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

.schedule-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.schedule-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.schedule-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.schedule-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-progress .progress-bar {
  flex: 1;
  height: 4px;
}

.schedule-progress .progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Ranking (dashboard variant) */
.ranking-pos {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.ranking-pos.pos-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0d1117;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.3);
}

.ranking-pos.pos-silver {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #0d1117;
}

.ranking-pos.pos-bronze {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0d1117;
}

.ranking-pos.pos-default {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.ranking-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.ranking-bar-container {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.ranking-bar-fill {
  height: 6px;
  background: var(--gradient-accent);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* Alerts */
.alert-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 8px;
  animation: pulse-glow 2s infinite;
}

.alert-count {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.alert-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--danger);
  line-height: 1;
}

.alert-label {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: var(--transition);
  width: 100%;
  font-family: var(--font);
  text-align: left;
}

.btn-action-primary {
  background: var(--gradient-accent-soft);
  color: var(--text-accent);
  border-color: var(--border-accent);
}

.btn-action-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.btn-action-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.btn-action-secondary:hover {
  background: var(--bg-glass-hover);
}

/* --- 22. Empty States --------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  font-size: 56px;
  color: var(--text-muted);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 8px;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 16px;
  color: var(--text-primary);
}

.empty-state-text {
  color: var(--text-secondary);
  margin: 8px 0 24px;
  max-width: 320px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- 23. Login Page ----------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #060912 0%, #0d1117 50%, #060912 100%);
  padding: 24px;
}

.login-card {
  max-width: 420px;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}

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

.login-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin: 12px 0 4px;
}

.login-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  font-family: var(--font);
}

.login-tab:hover {
  color: var(--text-secondary);
}

.login-tab.active {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.login-form {
  display: none;
}

.login-form.active {
  display: block;
}

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

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--gradient-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  letter-spacing: 0.01em;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

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

/* --- 24. Tab Bar -------------------------------------------- */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-item {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: var(--transition);
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  font-family: var(--font);
}

.tab-item:hover {
  color: var(--text-secondary);
}

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

/* --- 25. Charts --------------------------------------------- */
.chart-container {
  position: relative;
  width: 100%;
  padding: 16px 0;
}

.chart-container canvas {
  width: 100% !important;
  height: auto !important;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

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

/* --- 26. Animations ----------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shrink {
  from { width: 100%; }
  to { width: 0%; }
}

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

/* --- 27. Responsive ----------------------------------------- */
@media (min-width: 768px) {
  .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
  }

  .main-content {
    margin-left: var(--sidebar-width);
  }

  .top-bar {
    margin-left: var(--sidebar-width);
  }

  .bottom-nav {
    display: none;
  }

  .btn-fab {
    bottom: 32px;
    right: 32px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    flex-direction: row;
  }

  .toast-container {
    top: 24px;
    right: 24px;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 32px;
    margin-left: var(--sidebar-width);
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 767px) {
  .main-content {
    padding: 16px;
    padding-bottom: 84px;
  }

  .top-bar {
    padding: 10px 16px;
  }

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

  .card {
    padding: 16px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .modal {
    width: calc(100% - 16px);
    max-height: 85vh;
  }

  .toast {
    min-width: unset;
    max-width: calc(100vw - 32px);
  }

  .toast-container {
    left: 16px;
    right: 16px;
    top: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .ranking-bar {
    display: none;
  }

  .table th,
  .table td {
    padding: 10px 12px;
    font-size: 0.8125rem;
  }

  .login-card {
    padding: 24px;
  }

  .dashboard-row,
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* --- 28. Utilities ------------------------------------------ */
.flex           { display: flex; }
.flex-col       { display: flex; flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.flex-1         { flex: 1; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.gap-4          { gap: 4px; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.gap-16         { gap: 16px; }
.gap-24         { gap: 24px; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.mt-4           { margin-top: 4px; }
.mt-8           { margin-top: 8px; }
.mt-16          { margin-top: 16px; }
.mt-24          { margin-top: 24px; }
.mb-4           { margin-bottom: 4px; }
.mb-8           { margin-bottom: 8px; }
.mb-16          { margin-bottom: 16px; }
.mb-24          { margin-bottom: 24px; }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--text-accent); }
.text-sm        { font-size: 0.8125rem; }
.text-lg        { font-size: 1.125rem; }
.font-bold      { font-weight: 700; }
.font-medium    { font-weight: 500; }
.hidden         { display: none !important; }
.visible        { display: block !important; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full         { width: 100%; }
.relative       { position: relative; }
.overflow-hidden { overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

.spinner.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner.lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

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

/* --- 29. Print Styles --------------------------------------- */
@media print {
  .sidebar,
  .top-bar,
  .bottom-nav,
  .btn-fab,
  .toast-container,
  .modal-overlay,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-ghost,
  .btn-outline,
  .btn-icon,
  .btn-action {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 12pt;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .card,
  .stat-card,
  .chart-card,
  .schedule-card,
  .ranking-card,
  .alerts-card,
  .actions-card {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .card::before,
  .stat-card::before,
  .modal::before,
  .login-card::before,
  .chart-card::before {
    display: none !important;
  }

  .page-title,
  .card-title,
  .stat-value,
  .task-title,
  .ranking-name {
    color: #111111 !important;
  }

  .text-secondary,
  .stat-label,
  .task-subtitle,
  .page-subtitle {
    color: #555555 !important;
  }

  .badge,
  .shift-badge {
    border: 1px solid #cccccc !important;
    background: #f5f5f5 !important;
    color: #333333 !important;
  }

  .progress-bar {
    border: 1px solid #cccccc;
    background: #f0f0f0 !important;
  }

  .progress-fill {
    background: #3b82f6 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .table th {
    background: #f5f5f5 !important;
    color: #333333 !important;
    border-bottom: 2px solid #cccccc !important;
  }

  .table td {
    color: #111111 !important;
    border-bottom: 1px solid #eeeeee !important;
  }

  .task-checkbox:checked {
    background: #3b82f6 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  a {
    color: #3b82f6 !important;
    text-decoration: underline;
  }

  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
}
