/* ============================================
   SIMPLECLICK DESIGN SYSTEM v2.0
   Florida Grand Lodge - Modern Masonic Platform
   ============================================ */

:root {
  --color-primary: #1a365d;
  --color-primary-light: #2c5282;
  --color-primary-dark: #0f2440;
  --color-accent: #d69e2e;
  --color-accent-light: #ecc94b;
  --color-accent-dark: #b7791f;
  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  --bg-base: #0f172a;
  --bg-surface: #1e293b;
  --bg-elevated: #334155;
  --bg-card: #1e293b;
  --bg-card-hover: #2d3f59;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --border-default: #334155;
  --border-light: #475569;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(214, 158, 46, 0.3);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', var(--font-sans);
  /* Accessibility: Minimum 14px for 60+ users */
  --text-xs: 0.9375rem;   /* 15px min for small text */
  --text-sm: 1rem;        /* 16px */
  --text-base: 1.125rem;  /* 18px */
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3rem;
  --text-5xl: 4rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --container-max: 1400px;
  --sidebar-width: 280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
p { margin-bottom: var(--space-4); color: var(--text-secondary); }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-accent-light); }

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-base);
}
.sidebar-header { padding: var(--space-6); border-bottom: 1px solid var(--border-default); }
.sidebar-logo { display: flex; align-items: center; gap: var(--space-3); }
.sidebar-logo img { width: 48px; height: 48px; }
.sidebar-logo-text { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }
.sidebar-logo-sub { font-size: var(--text-xs); color: var(--text-muted); }
.sidebar-nav { flex: 1; padding: var(--space-4); overflow-y: auto; }
.nav-section { margin-bottom: var(--space-6); }
.nav-section-title { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: var(--space-2) var(--space-3); }
.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(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  /* Accessibility: 44px minimum touch target */
  min-height: 44px;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active { background: var(--color-primary); color: var(--text-primary); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer { padding: var(--space-4); border-top: 1px solid var(--border-default); }

.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: var(--space-4); }
.topbar-title { font-size: var(--text-xl); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: var(--space-4); }

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-warning);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}
.env-badge.production { background: var(--color-success); }

.page-content { padding: var(--space-8); flex: 1; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}
.card:hover { border-color: var(--border-light); box-shadow: var(--shadow-md); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.card-title { font-size: var(--text-lg); font-weight: 600; display: flex; align-items: center; gap: var(--space-2); }
.card-body { padding: var(--space-6); }
.card-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-default); background: var(--bg-base); }

.metric-card { text-align: center; padding: var(--space-8); }
.metric-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  color: var(--color-accent);
}
.metric-value { font-family: var(--font-display); font-size: var(--text-4xl); font-weight: 700; color: var(--color-accent); line-height: 1; margin-bottom: var(--space-2); }
.metric-label { font-size: var(--text-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.metric-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding: var(--space-1) var(--space-2);
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
}
.metric-change.negative { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }

.status-card { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); }
.status-indicator { width: 12px; height: 12px; border-radius: var(--radius-full); flex-shrink: 0; }
.status-indicator.success { background: var(--color-success); }
.status-indicator.warning { background: var(--color-warning); }
.status-indicator.danger { background: var(--color-danger); }
.status-indicator.info { background: var(--color-info); }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  /* Accessibility: 48px minimum touch target for 60+ users */
  min-height: 48px;
  min-width: 48px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: #000 !important; }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-light); box-shadow: var(--shadow-glow); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-default); }
.btn-secondary:hover:not(:disabled) { background: var(--border-default); border-color: var(--border-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); }
.btn-danger { background: var(--color-danger); color: white; }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); min-height: 40px; }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-lg); min-height: 56px; }
/* Accessibility: Visual feedback on touch/click */
.btn:active:not(:disabled) { transform: scale(0.98); }

.form-group { margin-bottom: var(--space-5); }
.form-label { display: block; margin-bottom: var(--space-2); font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(214, 158, 46, 0.1);
}
/* Validation error state */
.form-input.input-error, .form-select.input-error, .form-textarea.input-error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.form-input.input-error:focus, .form-select.input-error:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}
.form-input::placeholder { color: var(--text-muted); }
/* Make date/time picker icons visible on dark backgrounds */
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator,
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}
.form-textarea { min-height: 120px; resize: vertical; }

.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--space-4); text-align: left; border-bottom: 1px solid var(--border-default); }
.table th { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-base); }
.table td { font-size: var(--text-sm); color: var(--text-secondary); }
.table tbody tr:hover { background: var(--bg-elevated); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--color-info); }
.badge-neutral { background: var(--bg-elevated); color: var(--text-secondary); }

.progress { height: 8px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--color-accent); border-radius: var(--radius-full); transition: width var(--transition-slow); }
.progress-bar.success { background: var(--color-success); }
.progress-bar.warning { background: var(--color-warning); }
.progress-bar.danger { background: var(--color-danger); }
.progress-labeled { display: flex; align-items: center; gap: var(--space-4); }
.progress-labeled .progress { flex: 1; }
.progress-labeled .progress-value { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); min-width: 50px; text-align: right; }

.status-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.status-tile:hover { border-color: var(--border-light); background: var(--bg-card-hover); }
.status-tile-info { display: flex; align-items: center; gap: var(--space-3); }
.status-tile-name { font-weight: 600; color: var(--text-primary); }
.status-tile-meta { font-size: var(--text-xs); color: var(--text-muted); }

.education-requirement {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.education-requirement:last-child { border-bottom: none; }
.requirement-check {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.requirement-check.complete { background: var(--color-success); color: white; }
.requirement-check.incomplete { background: var(--bg-elevated); border: 2px solid var(--border-light); color: var(--text-muted); }
.requirement-check.mandatory { border-color: var(--color-accent); }
.requirement-info { flex: 1; }
.requirement-name { font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: var(--space-2); }
.requirement-name .mandatory-tag { font-size: var(--text-xs); color: var(--color-accent); font-weight: 600; }
.requirement-desc { font-size: var(--text-xs); color: var(--text-muted); }
.requirement-points { text-align: right; }
.requirement-points-earned { font-size: var(--text-lg); font-weight: 700; color: var(--color-accent); }
.requirement-points-max { font-size: var(--text-xs); color: var(--text-muted); }

.qr-display { background: white; padding: var(--space-6); border-radius: var(--radius-lg); text-align: center; display: inline-block; }
.qr-display img, .qr-display canvas { max-width: 200px; height: auto; }
.qr-display-label { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-inverse); font-weight: 500; }

.empty-state { text-align: center; padding: var(--space-12); }
.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}
.empty-state-title { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-2); }
.empty-state-desc { color: var(--text-muted); max-width: 400px; margin: 0 auto var(--space-6); }

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}
.modal-overlay.hidden { display: none; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex !important; }
}
@media (max-width: 768px) {
  :root { --text-4xl: 2.5rem; --text-5xl: 3rem; }
  .page-content { padding: var(--space-4); }
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.hidden { display: none; }
.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; }

/* ============================================
   ACCESSIBILITY ENHANCEMENTS FOR 60+ USERS
   Added: February 2026
   ============================================ */

/* --- IMPROVED COLOR CONTRAST --- */
/* Override text-muted with higher contrast color (was #64748b, now #8b9fb8 for 5.04:1 ratio) */
.text-muted, .nav-section-title, .sidebar-logo-sub, .status-tile-meta,
.requirement-desc, .form-input::placeholder { color: #8b9fb8 !important; }

/* Table headers need better contrast */
.table th { color: var(--text-secondary) !important; }

/* Badge text contrast improvements - use darker variants */
.badge-danger { color: #fca5a5 !important; }
.badge-warning { color: #fcd34d !important; }
.badge-success { color: #6ee7b7 !important; }

/* --- FOCUS STYLES FOR KEYBOARD NAVIGATION --- */
/* Button focus - visible gold outline */
.btn:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.btn:focus:not(:focus-visible) { outline: none; }
.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Navigation item focus */
.nav-item:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  background: var(--bg-elevated);
}
.nav-item:focus:not(:focus-visible) { outline: none; }
.nav-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* Link focus */
a:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
a:focus:not(:focus-visible) { outline: none; }

/* --- TOUCH TARGET IMPROVEMENTS --- */
/* Small buttons must be at least 44px for WCAG */
.btn-sm { min-height: 44px; padding: var(--space-3) var(--space-4); }

/* Checkbox wrapper for 44px touch target */
.checkbox-wrapper, .radio-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

/* Larger checkboxes and radio buttons */
input[type="checkbox"], input[type="radio"] {
  min-width: 20px;
  min-height: 20px;
  cursor: pointer;
}

/* Checkbox/radio label with proper spacing */
label:has(input[type="checkbox"]), label:has(input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  cursor: pointer;
  padding: var(--space-2);
}

/* Modal close button - minimum 44px touch target */
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 12px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
.modal-close:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- TABLE IMPROVEMENTS --- */
/* Better row hover for visibility */
.table tbody tr:hover {
  background: rgba(214, 158, 46, 0.1) !important;
  outline: 1px solid rgba(214, 158, 46, 0.3);
}

/* Table row focus for keyboard navigation */
.table tbody tr:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
}

/* Empty state rows - better visibility */
.table tbody tr.empty-state-row td {
  padding: var(--space-8);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* --- SKIP LINK (KEYBOARD NAVIGATION) --- */
.skip-to-main {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-accent);
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-to-main:focus {
  top: var(--space-4);
  outline: none;
}

/* --- BADGE SIZE IMPROVEMENTS (min 14px text) --- */
.badge {
  font-size: 0.875rem; /* 14px minimum */
  padding: var(--space-2) var(--space-3);
}

/* Status badges - larger for readability */
.status-badge {
  font-size: 0.875rem;
  padding: var(--space-2) var(--space-4);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

/* --- CONFIRMATION MODAL STYLES --- */
.confirm-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.confirm-modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}
.confirm-modal-message {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}
.confirm-modal-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}
.confirm-modal-actions .btn {
  min-width: 120px;
}

/* --- SESSION TIMEOUT WARNING MODAL --- */
.timeout-warning {
  background: var(--bg-surface);
  border: 2px solid var(--color-warning);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 420px;
  width: 90%;
  text-align: center;
}
.timeout-warning-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}
.timeout-warning-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-warning);
  margin-bottom: var(--space-3);
}
.timeout-warning-countdown {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: var(--space-4) 0;
}

/* --- LOADING SPINNER STYLES --- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}
@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Button loading state */
.btn.loading {
  position: relative;
  color: transparent !important;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}
.btn-primary.loading::after { border-color: rgba(0,0,0,0.2); border-top-color: #000; }

/* --- IMPROVED FORM VALIDATION FEEDBACK --- */
.form-error {
  color: #fca5a5;
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.form-error::before {
  content: '⚠';
  font-size: 1rem;
}

/* Required field indicator */
.required { color: #fca5a5; margin-left: 2px; }

/* --- MOBILE MENU BUTTON --- */
.mobile-menu-btn {
  display: none;
  min-width: 44px;
  min-height: 44px;
}
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex !important; }
}
.mobile-menu-btn:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- ADDITIONAL ACCESSIBILITY FOR 60+ USERS --- */

/* Quarter tabs need 44px minimum height */
.quarter-tab, .tab-btn, [role="tab"] {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
}

/* Info icons need to be larger for touch */
.info-icon {
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  cursor: help;
}

/* Event chips in calendar need touch target */
.event-chip {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}

/* Calendar navigation buttons */
#prevMonth, #nextMonth, #todayBtn {
  min-width: 44px;
  min-height: 44px;
}

/* Reduced motion for users with vestibular disorders */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode for low vision users */
@media (prefers-contrast: more) {
  .text-muted, .nav-section-title { color: #b0c4d8 !important; }
  .badge { border: 1px solid currentColor; }
  .card { border: 2px solid var(--border-default); }
}

/* --- MOBILE NAVIGATION ACCESSIBILITY --- */
/* Ensure mobile nav text is at least 14px for 60+ users */
@media (max-width: 1024px) {
  .nav-item {
    font-size: 1rem !important; /* 16px minimum on mobile */
    padding: var(--space-4) !important;
    min-height: 48px !important;
  }
  .nav-section-title {
    font-size: 0.875rem !important; /* 14px minimum */
  }
  .sidebar {
    width: 85vw;
    max-width: 320px;
  }
}

/* --- METRIC CARD HOVER STATES --- */
/* Visual feedback on metric cards for better UX */
.metric-card {
  cursor: default;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.metric-card:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Clickable metric cards */
a.metric-card, .metric-card[onclick], .metric-card.clickable {
  cursor: pointer;
}
a.metric-card:hover, .metric-card[onclick]:hover, .metric-card.clickable:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

/* --- LOADING OVERLAY FOR FORMS --- */
.form-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.form-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}

/* --- PASSWORD FIELD TOGGLE --- */
.password-field {
  position: relative;
  display: flex;
  align-items: stretch;
}
.password-field .form-input {
  flex: 1;
  padding-right: 70px;
}
.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: transparent;
  border: none;
  padding: 0 var(--space-3);
  color: var(--color-accent);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle:hover {
  color: var(--color-accent-light);
}
.password-toggle:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
