/* ===================================================
   CDP Identity Platform - Modern UI Stylesheet
   =================================================== */

/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables - Brand Colors */
:root {
  --cdp-blue: #0a1f62;
  --cdp-blue-dark: #051036;
  --cdp-blue-light: #1a3a8f;
  --cdp-red: #ca0015;
  --cdp-red-dark: #a00012;
  --cdp-gold: #ffb301;
  --cdp-gold-light: #ffc940;

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;

  /* Semantic Tokens (Light mode defaults) */
  --bg-body: var(--gray-100);
  --bg-surface: #ffffff;
  --bg-surface-hover: var(--gray-50);
  --bg-inset: var(--gray-50);
  --text-primary: var(--gray-800);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-heading: var(--cdp-blue);
  --border-default: var(--gray-200);
  --border-strong: var(--gray-300);
}

/* Base Styles */
html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Inter', sans-serif;
  color: var(--cdp-blue);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1, .h1 { font-size: 2.25rem; }
h2, .h2 { font-size: 1.875rem; }
h3, .h3 { font-size: 1.5rem; }
h4, .h4 { font-size: 1.25rem; }
h5, .h5 { font-size: 1.125rem; }
h6, .h6 { font-size: 1rem; }

a {
  color: var(--cdp-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--cdp-red);
}

/* Focus States */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(10, 31, 98, 0.15);
  border-color: var(--cdp-blue);
  outline: none;
}

/* ===================================================
   Buttons
   =================================================== */
.btn {
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  font-size: 0.9375rem;
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1.0625rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cdp-blue) 0%, var(--cdp-blue-dark) 100%);
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--cdp-blue-light) 0%, var(--cdp-blue) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background: linear-gradient(135deg, var(--cdp-red) 0%, var(--cdp-red-dark) 100%);
  border: none;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #e00018 0%, var(--cdp-red) 100%);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border: none;
}

.btn-info {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  border: none;
  color: white;
}

.btn-info:hover {
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--cdp-gold) 0%, #e5a000 100%);
  border: none;
  color: var(--gray-900);
}

.btn-secondary {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
  color: var(--gray-800);
}

.btn-outline-primary {
  color: var(--cdp-blue);
  border: 2px solid var(--cdp-blue);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--cdp-blue);
  color: white;
}

.btn-outline-secondary {
  border: 2px solid var(--gray-300);
  color: var(--gray-600);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-700);
}

/* ===================================================
   Forms
   =================================================== */
.form-control,
.form-select {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  transition: all var(--transition);
  background-color: white;
}

.form-control:hover,
.form-select:hover {
  border-color: var(--gray-400);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--cdp-blue);
  box-shadow: 0 0 0 3px rgba(10, 31, 98, 0.1);
}

.form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
}

.form-text {
  color: var(--gray-500);
  font-size: 0.8125rem;
}

.form-check-input:checked {
  background-color: var(--cdp-blue);
  border-color: var(--cdp-blue);
}

/* Form floating labels enhancement */
.form-floating > .form-control,
.form-floating > .form-select {
  height: calc(3.5rem + 2px);
  padding: 1rem 0.875rem;
}

.form-floating > label {
  padding: 1rem 0.875rem;
  color: var(--gray-500);
}

/* ===================================================
   Cards
   =================================================== */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: white;
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--cdp-blue);
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
}

/* Stat Cards */
.stat-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

/* ===================================================
   Tables
   =================================================== */
.table {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table thead th {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--gray-100);
}

.table-hover tbody tr:hover {
  background-color: var(--gray-50);
}

.table-responsive {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ===================================================
   Badges
   =================================================== */
.badge {
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
}

/* ===================================================
   Alerts
   =================================================== */
.alert {
  border: none;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  border-left: 4px solid;
}

.alert-warning {
  background: #fef3c7;
  border-left-color: var(--cdp-gold);
  color: #92400e;
}

.alert-danger {
  background: #fee2e2;
  border-left-color: var(--cdp-red);
  color: #991b1b;
}

.alert-success {
  background: #d1fae5;
  border-left-color: #059669;
  color: #065f46;
}

.alert-info {
  background: #e0f2fe;
  border-left-color: #0891b2;
  color: #0e7490;
}

/* ===================================================
   Navigation - Public Site
   =================================================== */
.navbar {
  padding: 0.75rem 0;
  transition: all var(--transition);
}

.navbar-light .navbar-nav .nav-link {
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.navbar-light .navbar-nav .nav-link:hover {
  color: var(--cdp-blue);
  background: var(--gray-100);
}

.navbar-light .navbar-nav .nav-link.active {
  color: var(--cdp-blue);
  background: rgba(10, 31, 98, 0.08);
}

.navbar-brand img {
  transition: transform var(--transition);
}

.navbar-brand:hover img {
  transform: scale(1.02);
}

/* Baseball Nav Border */
.baseball-nav-border {
  border-bottom: 4px double var(--cdp-red) !important;
  box-shadow: var(--shadow-md);
}

/* Sticky Header */
header.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: white;
}

/* Logo Shadow */
.logo-shadow {
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15));
}

/* ===================================================
   Admin Layout Grid
   =================================================== */
.admin-layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.admin-body {
  padding-top: 0 !important;
  overflow-x: hidden;
  margin: 0;
  background: var(--gray-100);
}

/* Admin Sidebar */
.admin-sidebar {
  grid-row: 1 / -1;
  grid-column: 1;
  background: linear-gradient(180deg, var(--cdp-blue) 0%, var(--cdp-blue-dark) 100%);
  color: white;
  z-index: 1001;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.admin-sidebar .sidebar-brand {
  height: 76px; /* Match admin-header height (72px navbar + 4px red piping) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
}

.admin-sidebar .sidebar-brand-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-sidebar .list-group-item {
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition);
  background: transparent;
  border-radius: 0;
  margin: 1px 0;
}

.admin-sidebar .list-group-item i {
  width: 1.5rem;
  font-size: 1.125rem;
}

.admin-sidebar .list-group-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding-left: 1.75rem;
}

.admin-sidebar .list-group-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-left: 3px solid var(--cdp-gold);
  padding-left: calc(1.5rem - 3px);
}

.admin-sidebar .sidebar-label {
  text-transform: uppercase;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 0 1.5rem;
}

/* Admin Header */
.admin-header {
  grid-row: 1;
  grid-column: 2;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  box-shadow: var(--shadow);
}

.admin-navbar {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.baseball-piping-separator {
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--cdp-red) 0%, var(--cdp-red-dark) 100%);
}

/* Admin Main Content */
.admin-main {
  grid-row: 2;
  grid-column: 2;
  padding: 2rem;
  overflow-x: hidden;
}

/* ===================================================
   Login / Auth Pages
   =================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f5f7fa;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.auth-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 3px solid var(--cdp-red);
}

.auth-header img {
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.auth-header h1 {
  color: var(--cdp-blue);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.auth-body {
  padding: 2rem;
}

.auth-body .form-floating {
  margin-bottom: 1rem;
}

.auth-footer {
  padding: 1.5rem 2rem;
  background: var(--gray-50);
  text-align: center;
  border-top: 1px solid var(--gray-200);
}

/* Login Logo for simple display */
.login-logo {
  max-width: 220px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

/* ===================================================
   Page Headers
   =================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

/* ===================================================
   Modals
   =================================================== */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  border-bottom: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
}

/* Progress Bar */
.progress {
  border-radius: var(--radius);
  background: var(--gray-200);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--cdp-blue) 0%, var(--cdp-blue-light) 100%);
  transition: width 0.3s ease;
}

/* ===================================================
   Pagination
   =================================================== */
.pagination {
  gap: 0.25rem;
}

.page-link {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  color: var(--gray-700);
  padding: 0.5rem 0.875rem;
  transition: all var(--transition);
}

.page-link:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--cdp-blue);
}

.page-item.active .page-link {
  background: var(--cdp-blue);
  border-color: var(--cdp-blue);
}

.page-item.disabled .page-link {
  background: var(--gray-50);
  color: var(--gray-400);
}

/* ===================================================
   Dropdown Menus
   =================================================== */
.dropdown-menu {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  transition: all var(--transition);
}

.dropdown-item:hover {
  background: var(--gray-100);
}

.dropdown-item.text-danger:hover {
  background: #fee2e2;
}

/* ===================================================
   Utilities
   =================================================== */
.text-cdp-blue { color: var(--cdp-blue); }
.text-cdp-red { color: var(--cdp-red); }
.text-cdp-gold { color: var(--cdp-gold); }
.bg-cdp-blue { background-color: var(--cdp-blue); }
.bg-cdp-red { background-color: var(--cdp-red); }
.bg-cdp-gold { background-color: var(--cdp-gold); }

.second-text {
  color: var(--gray-700);
}

/* ===================================================
   Responsive Design
   =================================================== */
@media (max-width: 991.98px) {
  .admin-layout-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: -280px;
    width: 280px;
    height: 100vh;
    transition: left var(--transition-slow);
  }

  .admin-sidebar.show {
    left: 0;
  }

  .admin-header,
  .admin-main {
    grid-column: 1;
  }
}

@media (max-width: 767.98px) {
  .auth-card {
    margin: 1rem;
    max-width: 100%;
  }

  .auth-header {
    padding: 2rem 1.5rem;
  }

  .auth-body {
    padding: 1.5rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .stat-card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 575.98px) {
  .btn-toolbar {
    flex-direction: column;
    width: 100%;
  }

  .btn-toolbar .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .table-responsive {
    font-size: 0.875rem;
  }
}

/* ===================================================
   Animations
   =================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
}

.fade-in-up-active {
  animation: fadeInUp 0.4s ease forwards;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===================================================
   Skeleton Loaders
   =================================================== */
.cdp-skeleton-loading {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.cdp-skeleton-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 25%, rgba(255, 255, 255, 0.5) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  z-index: 1;
}

.skeleton-line {
  height: 1rem;
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-25 { width: 25%; }

.skeleton-circle {
  width: 3rem;
  height: 3rem;
  background: var(--gray-200);
  border-radius: 50%;
}

/* ===================================================
   Stat Card Enhancements
   =================================================== */
.stat-card {
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-value {
  transition: opacity 0.2s ease;
}

/* ===================================================
   Toast Enhancements
   =================================================== */
.cdp-toast {
  border-radius: var(--radius) !important;
  min-width: 300px;
}

.cdp-toast-success { background: linear-gradient(135deg, #059669 0%, #047857 100%) !important; color: white !important; }
.cdp-toast-danger { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important; color: white !important; }
.cdp-toast-warning { background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important; color: white !important; }
.cdp-toast-info { background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important; color: white !important; }

/* ===================================================
   Breadcrumbs
   =================================================== */
.cdp-breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
}

.cdp-breadcrumb .breadcrumb-item a {
  color: var(--gray-500);
  text-decoration: none;
  transition: color var(--transition);
}

.cdp-breadcrumb .breadcrumb-item a:hover {
  color: var(--cdp-blue);
}

.cdp-breadcrumb .breadcrumb-item.active {
  color: var(--gray-700);
  font-weight: 500;
}

.cdp-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: '\F285';
  font-family: 'bootstrap-icons';
  font-size: 0.625rem;
  color: var(--gray-400);
}

/* ===================================================
   Empty States
   =================================================== */
.cdp-empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.cdp-empty-state .empty-icon {
  font-size: 4rem;
  color: var(--gray-300);
  margin-bottom: 1rem;
  display: block;
}

.cdp-empty-state h5 {
  color: var(--gray-600);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cdp-empty-state p {
  color: var(--gray-500);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ===================================================
   Login Page Enhanced — matches landing-hero background
   =================================================== */
.auth-wrapper {
  background: linear-gradient(135deg, var(--cdp-blue-dark) 0%, var(--cdp-blue) 50%, var(--cdp-blue-light) 100%);
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255, 179, 1, 0.1) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(202, 0, 21, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.5s ease;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.5);
}

.auth-header {
  background: white;
  position: relative;
  padding: 2rem 2rem 1.5rem;
}

.auth-header img {
  max-width: 160px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.auth-header h1 {
  color: var(--cdp-blue);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.75rem;
  margin-bottom: 0;
  letter-spacing: 0.02em;
}

.auth-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cdp-red), var(--cdp-gold), var(--cdp-red));
}

.auth-body .btn-primary {
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* ===================================================
   Admin Sidebar Enhanced
   =================================================== */

/* ===================================================
   Confirm Modal (Danger Zone)
   =================================================== */
.cdp-danger-zone {
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: #fef2f2;
}

.cdp-danger-zone h6 {
  color: var(--cdp-red);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cdp-danger-zone p {
  color: #991b1b;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ===================================================
   Page Transition
   =================================================== */
.admin-main {
  animation: fadeIn 0.25s ease;
}

/* ===================================================
   Table Row Actions
   =================================================== */
.table .btn-group .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

/* ===================================================
   Card Hover Effects
   =================================================== */
.card.card-hoverable {
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.card.card-hoverable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===================================================
   Landing Page
   =================================================== */
.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--cdp-blue-dark) 0%, var(--cdp-blue) 50%, var(--cdp-blue-light) 100%);
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255, 179, 1, 0.1) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(202, 0, 21, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.landing-content {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.landing-logo {
  max-width: 280px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
  animation: fadeInUp 0.6s ease;
}

.landing-title {
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.landing-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 500px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.landing-actions {
  animation: fadeInUp 0.6s ease 0.3s both;
}

.landing-feature-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: white;
  transition: transform var(--transition), background var(--transition);
}

.landing-feature-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
}

.landing-feature-card .feature-icon {
  font-size: 1.75rem;
  color: var(--cdp-gold);
  margin-bottom: 0.75rem;
  display: block;
}

.landing-feature-card h6 {
  color: white;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.landing-feature-card p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
  margin: 0;
}

.landing-footer {
  padding: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8125rem;
  position: relative;
  z-index: 1;
}

/* ===================================================
   Error Pages
   =================================================== */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  text-align: center;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--gray-200);
  line-height: 1;
  letter-spacing: -0.05em;
}

.error-page h2 {
  color: var(--gray-700);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.error-page p {
  color: var(--gray-500);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ===================================================
   Footer
   =================================================== */
.footer {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer a {
  color: var(--gray-600);
}

.footer a:hover {
  color: var(--cdp-blue);
}

/* ===================================================
   Dark Mode
   =================================================== */
[data-theme="dark"] {
  --bg-body: #0f1117;
  --bg-surface: #1a1d27;
  --bg-surface-hover: #232736;
  --bg-inset: #151821;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-heading: #93b4ff;
  --border-default: #2d3148;
  --border-strong: #3d4260;

  --gray-50: #1a1d27;
  --gray-100: #0f1117;
  --gray-200: #2d3148;
  --gray-300: #3d4260;
  --gray-400: #6b7280;
  --gray-500: #9ca3af;
  --gray-600: #d1d5db;
  --gray-700: #e5e7eb;
  --gray-800: #f3f4f6;
  --gray-900: #f9fafb;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

[data-theme="dark"] body,
[data-theme="dark"] .admin-body {
  background-color: var(--bg-body);
  color: var(--text-primary);
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
[data-theme="dark"] .h1, [data-theme="dark"] .h2, [data-theme="dark"] .h3,
[data-theme="dark"] .h4, [data-theme="dark"] .h5, [data-theme="dark"] .h6 {
  color: var(--text-heading);
}

[data-theme="dark"] a {
  color: #93b4ff;
}

[data-theme="dark"] a:hover {
  color: var(--cdp-gold);
}

[data-theme="dark"] .text-muted {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .text-dark {
  color: var(--text-primary) !important;
}

/* Cards */
[data-theme="dark"] .card {
  background: var(--bg-surface);
  border-color: var(--border-default);
}

[data-theme="dark"] .card:hover {
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card-header {
  background: var(--bg-inset);
  border-bottom-color: var(--border-default);
  color: var(--text-heading);
}

[data-theme="dark"] .card-footer {
  background: var(--bg-inset);
  border-top-color: var(--border-default);
}

/* Tables */
[data-theme="dark"] .table {
  background: var(--bg-surface);
  color: var(--text-primary);
}

[data-theme="dark"] .table thead th {
  background: var(--bg-inset);
  border-bottom-color: var(--border-default);
  color: var(--text-secondary);
}

[data-theme="dark"] .table tbody td {
  border-bottom-color: var(--border-default);
}

[data-theme="dark"] .table-hover tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

[data-theme="dark"] .table-responsive {
  box-shadow: var(--shadow);
}

/* Forms */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--bg-inset);
  border-color: var(--border-default);
  color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: var(--bg-surface);
  border-color: #93b4ff;
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(147, 180, 255, 0.15);
}

[data-theme="dark"] .form-control::placeholder {
  color: var(--text-muted);
}

[data-theme="dark"] .form-floating > label {
  color: var(--text-muted);
}

[data-theme="dark"] .input-group-text {
  background-color: var(--bg-inset);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

/* Navbar & Header */
[data-theme="dark"] .admin-header {
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .admin-navbar,
[data-theme="dark"] .navbar-light .bg-white,
[data-theme="dark"] .bg-white {
  background-color: var(--bg-surface) !important;
}

[data-theme="dark"] .admin-sidebar {
  background: linear-gradient(180deg, #0d1526 0%, #060a16 100%);
}

/* Alerts */
[data-theme="dark"] .alert-warning {
  background: rgba(255, 179, 1, 0.12);
  color: #ffc940;
}

[data-theme="dark"] .alert-danger {
  background: rgba(202, 0, 21, 0.12);
  color: #ff6b7a;
}

[data-theme="dark"] .alert-success {
  background: rgba(5, 150, 105, 0.12);
  color: #6ee7b7;
}

[data-theme="dark"] .alert-info {
  background: rgba(8, 145, 178, 0.12);
  color: #67e8f9;
}

/* Modals */
[data-theme="dark"] .modal-content {
  background: var(--bg-surface);
  border-color: var(--border-default);
}

[data-theme="dark"] .modal-header {
  border-bottom-color: var(--border-default);
}

[data-theme="dark"] .modal-footer {
  border-top-color: var(--border-default);
}

/* Dropdowns */
[data-theme="dark"] .dropdown-menu {
  background: var(--bg-surface);
  border-color: var(--border-default);
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--bg-surface-hover);
}

/* Badges */
[data-theme="dark"] .badge.bg-secondary {
  background-color: #3d4260 !important;
}

[data-theme="dark"] .badge.bg-light {
  background-color: var(--bg-inset) !important;
  color: var(--text-primary) !important;
}

/* Code */
[data-theme="dark"] code {
  background: var(--bg-inset);
  color: #93b4ff;
}

[data-theme="dark"] .bg-light {
  background-color: var(--bg-inset) !important;
}

/* Breadcrumbs */
[data-theme="dark"] .cdp-breadcrumb .breadcrumb-item a {
  color: var(--text-muted);
}

[data-theme="dark"] .cdp-breadcrumb .breadcrumb-item.active {
  color: var(--text-primary);
}

/* Page Header */
[data-theme="dark"] .page-header {
  border-bottom-color: var(--border-default);
}

/* Progress */
[data-theme="dark"] .progress {
  background: var(--bg-inset);
}

/* Pagination */
[data-theme="dark"] .page-link {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
}

[data-theme="dark"] .page-link:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

[data-theme="dark"] .page-item.disabled .page-link {
  background: var(--bg-inset);
  color: var(--text-muted);
}

/* Empty State */
[data-theme="dark"] .cdp-empty-state .empty-icon {
  color: var(--border-strong);
}

/* Danger Zone */
[data-theme="dark"] .cdp-danger-zone {
  background: rgba(202, 0, 21, 0.08);
  border-color: rgba(202, 0, 21, 0.3);
}

/* Footer */
[data-theme="dark"] .footer {
  background: var(--bg-surface);
  border-top-color: var(--border-default);
}

/* Error Pages */
[data-theme="dark"] .error-page {
  background: var(--bg-body);
}

[data-theme="dark"] .error-code {
  color: var(--border-default);
}

/* Auth pages - keep light for login visibility */

/* Dark mode toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.theme-toggle .bi {
  font-size: 1.125rem;
}

/* ===================================================
   Accessibility
   =================================================== */
/* Skip to content link */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip-to-content:focus {
  position: fixed;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  background: var(--cdp-blue);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  z-index: 9999;
}

/* Focus visible - enhanced keyboard focus indicators */
:focus-visible {
  outline: 2px solid var(--cdp-blue);
  outline-offset: 2px;
}

[data-theme="dark"] :focus-visible {
  outline-color: #93b4ff;
}

.btn:focus-visible {
  outline: 2px solid var(--cdp-blue);
  outline-offset: 2px;
  box-shadow: none;
}

/* Screen reader only */
.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;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in-up {
    opacity: 1;
    transform: none;
  }

  .stat-card {
    transition: none;
  }

  .progress-bar {
    transition: none;
  }
}

/* High contrast mode */
@media (forced-colors: active) {
  .stat-card {
    border: 2px solid ButtonText;
  }

  .badge {
    border: 1px solid ButtonText;
  }
}
