/* ===================================
   PROPULSE - Shared Components
   Dashboard-wide reusable patterns
   =================================== */

/* Note: Each section (landing, auth, dashboard) has its own button styles.
   - Landing: .btn / .btn-primary (deep-teal bg)
   - Auth: .btn-primary (terracotta gradient), .btn-secondary (deep-teal border)
   - Dashboard: .btn-primary (deep-teal bg), .btn-secondary (mahogany border)
   These are intentionally different and live in their respective CSS files. */

/* Shared spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Page loading overlay — shown conditionally while assets load */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: #F8F7F4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-slow, 300ms) ease,
              visibility var(--transition-slow, 300ms) ease;
}

.page-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.page-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gold-100, #f5ecd7);
  border-top-color: var(--gold-500, #C9A961);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

/* -------------------- Stats Grid -------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: white;
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  transition: background var(--transition-base), box-shadow 300ms ease, transform 300ms ease;
}

.stat-card:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.terracotta {
  background: var(--terracotta-10);
  color: var(--terracotta-warmth);
}

.stat-icon.teal {
  background: var(--mahogany-10);
  color: var(--deep-teal);
}

.stat-icon.eucalyptus {
  background: var(--color-success-light);
  color: var(--warm-eucalyptus);
}

.stat-icon.gold {
  background: rgba(201, 169, 97, 0.12);
  color: var(--gold-primary, #C9A961);
}

.stat-icon.bronze {
  background: var(--terracotta-10);
  color: var(--bronze-glow);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  /* no entrance animation */
  color: var(--mahogany-dark);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-trend.positive {
  color: var(--color-success);
}

.stat-trend.negative {
  color: var(--color-error);
}

.stat-trend.neutral {
  color: var(--text-secondary);
}

.stat-card--empty {
  opacity: 0.5;
  pointer-events: none;
}

.stat-card--empty .stat-icon {
  filter: grayscale(0.5);
}

.stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mahogany-dark);
}

/* -------------------- Buttons -------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  background: var(--navy-900);
  color: white;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(12, 35, 64, 0.15);
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--navy-800);
  box-shadow: 0 4px 16px rgba(12, 35, 64, 0.2);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--navy-800);
  transform: translateY(0);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-primary-large {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  background: var(--terracotta-warmth);
  color: white;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.btn-primary-large:hover {
  background: var(--terracotta-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary-large svg {
  width: 20px;
  height: 20px;
}

.btn-primary-large kbd {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
  margin-left: var(--space-sm);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  background: var(--brand-light);
  color: var(--navy-900);
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.btn-secondary:hover {
  background: rgba(201, 169, 97, 0.12);
  color: var(--navy-900);
  border-color: var(--gold-500);
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.15);
}

.btn-secondary:active {
  background: rgba(201, 169, 97, 0.15);
  color: var(--brand-primary-hover);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--mahogany-60);
  transition: color var(--transition-fast);
}

.btn-text:hover {
  color: var(--rich-mahogany);
}

.btn-text.danger {
  color: var(--color-error);
}

.btn-text.danger:hover {
  color: #B91C1C;
}

.btn-link {
  background: none;
  border: none;
  color: var(--deep-teal);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--deep-teal-light);
}

/* -------------------- Forms -------------------- */
.form-section {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--mahogany-10);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  margin-bottom: var(--space-lg);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mahogany-50);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-grid-2 .full-width {
  grid-column: 1 / -1;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="search"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-input);
  background: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.form-group input:disabled {
  background: var(--soft-clay);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-group input[readonly] {
  background: var(--bg-secondary, #F0EDE8);
  cursor: default;
  opacity: 0.85;
  border-style: dashed;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  appearance: none;
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%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;
  padding: 12px 36px 12px 16px;
  cursor: pointer;
}

.form-group select:hover {
  border-color: var(--border-medium);
  background-color: var(--bg-hover);
}

.form-group select:focus {
  background-color: white;
}

.form-actions {
  display: flex;
  gap: var(--space-md);
  padding-top: var(--space-lg);
}

.help-text {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--mahogany-40);
  margin-top: var(--space-xs);
}

.help-text svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.char-counter {
  text-align: right;
  font-size: 0.75rem;
  color: var(--mahogany-40);
  margin-top: var(--space-xs);
}

.checkbox-custom {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--mahogany-70);
}

.checkbox-custom input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--deep-teal);
  cursor: pointer;
}

/* -------------------- Badges -------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--brand-light);
  border: none;
  color: var(--brand-primary);
}

.badge-completed {
  background: var(--color-success-light);
  color: var(--color-success);
}

.badge-draft {
  background: var(--bg-muted);
  color: var(--text-muted);
}

.badge-processing {
  background: var(--color-info-light);
  color: var(--color-info);
}

.badge-failed {
  background: var(--color-error-light);
  color: var(--color-error);
}

.badge-elite {
  background: var(--brand-primary);
  color: white;
  font-size: 0.6875rem;
}

/* -------------------- Alerts -------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-warning {
  background: var(--color-warning-light);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #92400E;
}

.alert-info {
  background: var(--color-info-light);
  border: 1px solid rgba(201, 169, 97, 0.2);
  color: var(--deep-teal);
}

.alert-success {
  background: var(--color-success-light);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: #15803D;
}

/* -------------------- Section Cards -------------------- */
.section-card {
  background: white;
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-card-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--mahogany-dark);
}

/* -------------------- Filters Bar -------------------- */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filters-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-dropdown {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--mahogany-15);
  border-radius: var(--radius-input);
  background: white;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--mahogany-dark);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filter-dropdown:focus {
  border-color: var(--deep-teal);
  outline: none;
  box-shadow: var(--shadow-focus);
}

.filter-search {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--mahogany-15);
  border-radius: var(--radius-input);
  background: white;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  width: 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238B4513' stroke-width='2' opacity='0.4'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  transition: all var(--transition-fast);
}

.filter-search:focus {
  border-color: var(--deep-teal);
  outline: none;
  box-shadow: var(--shadow-focus);
  width: 280px;
}

.view-options {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.view-toggle {
  display: flex;
  background: white;
  border: 1px solid var(--mahogany-15);
  border-radius: var(--radius-input);
  overflow: hidden;
}

.view-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mahogany-40);
  transition: all var(--transition-fast);
}

.view-btn:hover {
  color: var(--mahogany-dark);
}

.view-btn.active {
  background: var(--deep-teal);
  color: white;
}

.view-btn svg {
  width: 16px;
  height: 16px;
}

.sort-dropdown {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--mahogany-15);
  border-radius: var(--radius-input);
  background: white;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--mahogany-dark);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* -------------------- Empty State -------------------- */
.empty-state[hidden] { display: none !important; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-lg);
  text-align: center;
  background: var(--white-pure);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-light);
  margin-top: var(--space-lg);
}

.empty-illustration {
  width: 180px;
  height: 180px;
  margin-bottom: var(--space-xl);
  opacity: 0.5;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  max-width: 360px;
  line-height: 1.5;
}

/* -------------------- Pagination -------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--mahogany-10);
}

.page-btn {
  padding: 8px 16px;
  border: 1px solid var(--mahogany-15);
  border-radius: 9999px;
  background: white;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--mahogany-60);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--deep-teal);
  color: var(--deep-teal);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-number {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--mahogany-60);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.page-number:hover {
  background: var(--bg-hover);
}

.page-number.active {
  background: var(--deep-teal);
  color: white;
  border-color: var(--deep-teal);
}

.page-numbers span {
  color: var(--mahogany-40);
  padding: 0 4px;
}

/* -------------------- Page Header -------------------- */
.page-header {
  margin-bottom: var(--space-xl, 32px);
}

.page-header h1 {
  font-family: var(--font-heading, 'Inter', sans-serif);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  margin: 0 0 var(--space-xs, 4px);
}

.page-header .page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary, #64748B);
  margin: 0;
}

/* -------------------- Tab Patterns -------------------- */
/* Pill tabs (used in settings, informes) */
.tabs-pill {
  display: flex;
  gap: var(--space-xs, 4px);
  padding: var(--space-xs, 4px);
  background: var(--bg-app, #F8FAFC);
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border-light, #E2E8F0);
}

.tab-pill {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 8px);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, #64748B);
  cursor: pointer;
  transition: all var(--transition-fast, 150ms ease);
}

.tab-pill:hover {
  color: var(--text-primary, #0F172A);
  background: var(--bg-hover, #F1F5F9);
}

.tab-pill.active {
  background: var(--bg-surface, #FFFFFF);
  color: var(--brand-primary, #0C2340);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

/* Underline tabs (used in acm details, monitoreo) */
.tabs-underline {
  display: flex;
  gap: var(--space-lg, 24px);
  border-bottom: 2px solid var(--border-light, #E2E8F0);
  padding-bottom: 0;
}

.tab-underline {
  padding: var(--space-sm, 8px) var(--space-xs, 4px);
  border: none;
  background: transparent;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #64748B);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast, 150ms ease);
}

.tab-underline:hover {
  color: var(--text-primary, #0F172A);
}

.tab-underline.active {
  color: var(--brand-primary, #0C2340);
}

.tab-underline.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-primary, #0C2340);
  border-radius: 1px;
}

/* -------------------- Status Badges (Unified) -------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge-active,
.status-badge-completed {
  background: var(--color-success-light, rgba(16, 185, 129, 0.1));
  color: var(--color-success, #10B981);
}

.status-badge-active::before,
.status-badge-completed::before {
  background: var(--color-success, #10B981);
}

.status-badge-pending,
.status-badge-draft {
  background: var(--color-warning-light, rgba(245, 158, 11, 0.1));
  color: #B45309;
}

.status-badge-pending::before,
.status-badge-draft::before {
  background: var(--color-warning, #F59E0B);
}

.status-badge-inactive,
.status-badge-failed {
  background: var(--color-error-light, rgba(239, 68, 68, 0.1));
  color: var(--color-error, #EF4444);
}

.status-badge-inactive::before,
.status-badge-failed::before {
  background: var(--color-error, #EF4444);
}

.status-badge-processing {
  background: var(--color-info-light, rgba(201, 169, 97, 0.12));
  color: var(--brand-primary, #0C2340);
}

.status-badge-processing::before {
  background: var(--brand-primary, #0C2340);
}

/* -------------------- Card Hover -------------------- */
.card-hoverable {
  transition: box-shadow var(--transition-base, 200ms ease),
              transform var(--transition-base, 200ms ease);
}

.card-hoverable:hover {
  box-shadow: var(--shadow-hover, 0 10px 25px rgba(15, 23, 42, 0.1));
  transform: translateY(-2px);
}

/* -------------------- Button Ripple (disabled in Swiss) -------------------- */
.btn-ripple {
  display: none;
}

/* -------------------- Action Tooltips -------------------- */
.action-btn[title] {
  position: relative;
}

.action-btn[title]::before {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--mahogany-dark);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 10;
}

.action-btn[title]:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* -------------------- Notification Toggles -------------------- */
.notification-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--mahogany-10);
}

.notification-toggle-info h4 {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
}

.notification-toggle-info p {
  font-size: 0.75rem;
  color: var(--mahogany-40);
}

/* -------------------- Toggle Switch -------------------- */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--mahogany-15);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--deep-teal);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* -------------------- Shimmer / Skeleton -------------------- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--mahogany-10) 25%, var(--cream-elegance) 50%, var(--mahogany-10) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.h-6 { height: 6px; }
.skeleton-line.h-20 { height: 20px; }

/* -------------------- Responsive -------------------- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-group {
    flex-direction: column;
  }

  .filter-dropdown,
  .filter-search {
    width: 100%;
  }

  .filter-search:focus {
    width: 100%;
  }

  .view-options {
    justify-content: space-between;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn-primary,
  .form-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}
