:root {
  /* Modern Color Palette - Enhanced */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #4338ca;

  --secondary-color: #8b5cf6;
  --accent-color: #ec4899;

  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;

  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --surface-hover: #f9fafb;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Enhanced Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-pill: 9999px;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 2.5rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Chart Colors */
  --chart-1: #6366f1;
  /* Indigo */
  --chart-2: #8b5cf6;
  /* Violet */
  --chart-3: #ec4899;
  /* Pink */
  --chart-4: #06b6d4;
  /* Cyan */
  --chart-5: #10b981;
  /* Emerald */
  --chart-6: #f59e0b;
  /* Amber */
  --chart-grid: #e2e8f0;
  --chart-text: #64748b;
}

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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Admin Layout (Sidebar) Styles --- */

.admin-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  padding: 2rem;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-slow);
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.sidebar h3 {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.sidebar-logo {
  max-width: 150px;
  height: auto;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

.sidebar li {
  margin-bottom: 0.375rem;
}

.sidebar a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.sidebar a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.sidebar a:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  color: var(--primary-color);
  transform: translateX(4px);
}

.sidebar a:hover::before {
  transform: scaleY(1);
}

.sidebar a.active {
  font-weight: 600;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  color: var(--primary-color);
  box-shadow: var(--shadow-xs);
}

.sidebar a.active::before {
  transform: scaleY(1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background-color: var(--bg-color);
  position: relative;
}

/* Mobile Responsive Sidebar */
.mobile-header {
  display: none;
  padding: 1rem 1.5rem;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-xs);
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

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

.close-sidebar-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.close-sidebar-btn:hover {
  color: var(--text-primary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 40;
  animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

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

  .admin-content {
    padding: 1.5rem;
  }

  .mobile-header {
    display: flex;
  }

  .close-sidebar-btn {
    display: block;
  }

  .sidebar-overlay {
    display: block;
  }
}

/* --- Shared Components --- */

.page-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-2xl);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

/* Cards */
.card,
.dashboard-card {
  background: var(--surface-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all var(--transition-base);
  margin-bottom: var(--spacing-md);
}

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

.card-header {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.card-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.card-body {
  padding: var(--spacing-xl);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xl);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.dashboard-card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  color: var(--primary-color);
  transition: all var(--transition-base);
}

.dashboard-card:hover .card-icon {
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.card-link {
  margin-top: auto;
  padding-top: var(--spacing-md);
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.card-link:hover {
  color: var(--primary-hover);
  transform: translateX(4px);
}

/* Stats */
.stats-section {
  margin-top: var(--spacing-xl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.stat-item {
  background: var(--surface-color);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  text-align: center;
  transition: all var(--transition-base);
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

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

/* Forms & Inputs */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background-color: var(--surface-color);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.form-control:hover {
  border-color: var(--text-light);
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background-color: #ffffff;
}

.form-control::placeholder {
  color: var(--text-light);
}

.form-row {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.form-group.col-md-4 {
  width: calc(33.333% - var(--spacing-md));
}

.form-group.col-md-6 {
  width: calc(50% - var(--spacing-md) / 2);
}

.form-group.col-md-2 {
  width: calc(16.666% - var(--spacing-md));
}

.form-group.col-md-12 {
  width: 100%;
}

/* Buttons - Modern Design */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary {
  background-color: var(--surface-color);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--text-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn-outline-primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn:disabled:hover {
  box-shadow: var(--shadow-sm);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

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

thead {
  background: linear-gradient(180deg, #fafbfc 0%, #f8f9fa 100%);
}

th {
  text-align: left;
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-light);
}

td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9375rem;
  color: var(--text-primary);
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.02);
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

.badge-success {
  color: #065f46;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.badge-warning {
  color: #92400e;
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

.badge-danger {
  color: #b91c1c;
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
}

.badge-info {
  color: #1e40af;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

/* Login */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: float 20s infinite ease-in-out;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-20px, -20px);
  }
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-color);
  padding: 2.5rem;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

/* Misc */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-secondary);
}

.error-message {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1.5px solid #fecaca;
  color: var(--error-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.success-message {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid #bbf7d0;
  color: var(--success-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: var(--primary-color);
}

/* --- Charts --- */
.chart-container {
  background: var(--surface-color);
  padding: var(--spacing-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  height: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.chart-header {
  margin-bottom: var(--spacing-lg);
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

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

.chart-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  /* Bar spacing */
  padding-top: var(--spacing-md);
  gap: var(--spacing-sm);
}

/* Simple CSS Bar Chart */
.bar-chart-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  flex: 1;
  height: 100%;
  position: relative;
  transition: all var(--transition-base);
}

.bar-chart-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 1s ease-out, background-color var(--transition-base);
  position: relative;
  cursor: pointer;
  min-height: 4px;
  /* Ensure visibility for 0 values if needed, or 0 */
}

.bar-chart-bar:hover {
  background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary-color) 100%);
  filter: brightness(1.1);
}

.bar-chart-label {
  margin-top: var(--spacing-xs);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

.bar-chart-value {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: var(--surface-color);
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: var(--shadow-xs);
  pointer-events: none;
}

.bar-chart-column:hover .bar-chart-value {
  opacity: 1;
}

/* Dashboard Grid Enhancements */
.dashboard-grid-multi {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.span-col-12 {
  grid-column: span 12;
}

.span-col-8 {
  grid-column: span 8;
}

.span-col-4 {
  grid-column: span 4;
}

.span-col-6 {
  grid-column: span 6;
}

.span-col-3 {
  grid-column: span 3;
}

@media (max-width: 1024px) {

  .span-col-8,
  .span-col-4,
  .span-col-6,
  .span-col-3 {
    grid-column: span 12;
  }
}

/* Tabs */
.tabs {
  border-bottom: 2px solid var(--border-light);
}

.tabs button {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-base);
  position: relative;
}

.tabs button:hover {
  color: var(--primary-color);
}

.tabs button.active,
.tabs button[class*="active"] {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

/* Modal Enhancements */
.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-10 {
  z-index: 10;
}

.z-20 {
  z-index: 20;
}

.z-40 {
  z-index: 40;
}

.z-50 {
  z-index: 50;
}

.overflow-y-auto {
  overflow-y: auto;
}

.min-h-screen {
  min-height: 100vh;
}

/* Mobile Tweaks */
@media (max-width: 640px) {
  .page-header h1 {
    font-size: 1.5rem;
  }

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

  .form-group.col-md-4,
  .form-group.col-md-2,
  .form-group.col-md-6 {
    width: 100%;
  }

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

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

  .btn {
    width: 100%;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
  }
}

/* Utility Classes */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.75rem;
}

.col-md-12 {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0 0.75rem;
}

.w-full {
  width: 100%;
}

.w-24 {
  width: 6rem;
}

.w-20 {
  width: 5rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.divide-y>*+* {
  border-top: 1px solid var(--border-light);
}

.divide-gray-200>*+* {
  border-color: var(--border-color);
}

.border-r {
  border-right: 1px solid var(--border-light);
}

.border-b {
  border-bottom: 1px solid var(--border-light);
}

.sticky {
  position: sticky;
}

.left-0 {
  left: 0;
}

.bg-clip-padding {
  background-clip: padding-box;
}

.inline-flex {
  display: inline-flex;
}

.align-bottom {
  vertical-align: bottom;
}

.align-middle {
  vertical-align: middle;
}

.transform {
  transform: translateZ(0);
}

.transition-all {
  transition: all var(--transition-base);
}

.transition-opacity {
  transition: opacity var(--transition-base);
}

.opacity-75 {
  opacity: 0.75;
}

.opacity-50 {
  opacity: 0.5;
}

/* Focus Styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--border-light);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Additional Utility Classes */
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wide {
  letter-spacing: 0.025em;
}

.tracking-wider {
  letter-spacing: 0.05em;
}

.tracking-tight {
  letter-spacing: -0.025em;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

/* Color Classes */
.text-white {
  color: #ffffff;
}

.text-gray-300 {
  color: #cbd5e1;
}

.text-gray-400 {
  color: #94a3b8;
}

.text-gray-500 {
  color: #64748b;
}

.text-gray-600 {
  color: #475569;
}

.text-gray-700 {
  color: #334155;
}

.text-gray-800 {
  color: #1e293b;
}

.text-gray-900 {
  color: #0f172a;
}

.text-indigo-500 {
  color: #6366f1;
}

.text-indigo-600 {
  color: #4f46e5;
}

.text-indigo-700 {
  color: #4338ca;
}

.text-indigo-900 {
  color: #312e81;
}

.text-red-400 {
  color: #f87171;
}

.text-red-500 {
  color: #ef4444;
}

.text-red-600 {
  color: #dc2626;
}

.text-red-700 {
  color: #b91c1c;
}

.text-red-900 {
  color: #7f1d1d;
}

.text-green-600 {
  color: #16a34a;
}

.text-green-700 {
  color: #15803d;
}

.text-blue-600 {
  color: #2563eb;
}

.text-blue-900 {
  color: #1e3a8a;
}

.text-yellow-800 {
  color: #854d0e;
}

.hover\\:text-indigo-600:hover {
  color: #4f46e5;
}

.hover\\:text-indigo-900:hover {
  color: #312e81;
}

.hover\\:text-red-900:hover {
  color: #7f1d1d;
}

.hover\\:text-blue-900:hover {
  color: #1e3a8a;
}

/* Background Colors */
.bg-white {
  background-color: #ffffff;
}

.bg-gray-50 {
  background-color: #f8fafc;
}

.bg-gray-100 {
  background-color: #f1f5f9;
}

.bg-gray-200 {
  background-color: #e2e8f0;
}

.bg-red-50 {
  background-color: #fef2f2;
}

.bg-red-100 {
  background-color: #fee2e2;
}

.bg-red-600 {
  background-color: #dc2626;
}

.bg-indigo-50 {
  background-color: #eef2ff;
}

.bg-indigo-100 {
  background-color: #e0e7ff;
}

.bg-green-50 {
  background-color: #f0fdf4;
}

.bg-green-100 {
  background-color: #dcfce7;
}

.bg-yellow-50 {
  background-color: #fefce8;
}

.bg-yellow-100 {
  background-color: #fef9c3;
}

.hover\\:bg-gray-50:hover {
  background-color: #f8fafc;
}

.hover\\:bg-gray-100:hover {
  background-color: #f1f5f9;
}

.hover\\:bg-red-700:hover {
  background-color: #b91c1c;
}

/* Borders */
.border {
  border-width: 1px;
  border-style: solid;
  border-color: var(--border-color);
}

.border-2 {
  border-width: 2px;
}

.border-t {
  border-top-width: 1px;
  border-style: solid;
  border-color: var(--border-color);
}

.border-b {
  border-bottom-width: 1px;
  border-style: solid;
  border-color: var(--border-color);
}

.border-r {
  border-right-width: 1px;
  border-style: solid;
  border-color: var(--border-color);
}

.border-transparent {
  border-color: transparent;
}

.border-gray-100 {
  border-color: #f1f5f9;
}

.border-gray-200 {
  border-color: #e2e8f0;
}

.border-gray-300 {
  border-color: #cbd5e1;
}

.rounded {
  border-radius: var(--radius-md);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

/* Skeleton Loading */
.skeleton {
  background-color: var(--surface-hover);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0.4) 20%,
      rgba(255, 255, 255, 0.7) 60%,
      rgba(255, 255, 255, 0));
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-text {
  height: 1em;
  width: 100%;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
}

.skeleton-rect {
  width: 100%;
  height: 100%;
}

.skeleton-circle {
  border-radius: 50%;
  width: 100%;
  aspect-ratio: 1/1;
}

/* Skeleton Card Specifics */
.skeleton-card {
  padding: var(--spacing-xl);
  background: var(--surface-color);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: var(--radius-pill);
}

/* Shadows */
.shadow {
  box-shadow: var(--shadow-sm);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

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

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Spacing */
.p-0 {
  padding: 0;
}

.p-1 {
  padding: 0.25rem;
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-5 {
  padding: 1.25rem;
}

.p-6 {
  padding: 1.5rem;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.m-0 {
  margin: 0;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.mr-4 {
  margin-right: 1rem;
}

.ml-2 {
  margin-left: 0.5rem;
}

/* Scroll and Width Utilities */
.overflow-x-auto {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.min-w-full {
  min-width: 100%;
}

.min-w-max {
  min-width: max-content;
}

.w-20 {
  width: 5rem;
}

.w-24 {
  width: 6rem;
}

.text-xxs {
  font-size: 0.625rem;
}

.ml-3 {
  margin-left: 0.75rem;
}

.ml-4 {
  margin-left: 1rem;
}

/* Flexbox */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-col {
  flex-direction: column;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

/* Grid */
.grid {
  display: grid;
}

.sm\\:flex-row-reverse {
  flex-direction: row-reverse;
}

/* Focus */
.focus\\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus\\:ring-2:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.focus\\:ring-offset-2:focus {
  outline-offset: 2px;
}

.focus\\:ring-indigo-500:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.focus\\:ring-red-500:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Responsive */
@media (min-width: 640px) {
  .sm\\:inline-block {
    display: inline-block;
  }

  .sm\\:align-middle {
    vertical-align: middle;
  }

  .sm\\:h-screen {
    height: 100vh;
  }

  .sm\\:my-8 {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }

  .sm\\:max-w-lg {
    max-width: 32rem;
  }

  .sm\\:w-full {
    width: 100%;
  }

  .sm\\:w-auto {
    width: auto;
  }

  .sm\\:text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .sm\\:flex {
    display: flex;
  }

  .sm\\:flex-row-reverse {
    flex-direction: row-reverse;
  }

  .sm\\:px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .sm\\:p-6 {
    padding: 1.5rem;
  }

  .sm\\:pb-4 {
    padding-bottom: 1rem;
  }

  .sm\\:ml-3 {
    margin-left: 0.75rem;
  }

  .sm\\:mt-0 {
    margin-top: 0;
  }

  .sm\\:mx-0 {
    margin-left: 0;
    margin-right: 0;
  }

  .sm\\:h-10 {
    height: 2.5rem;
  }

  .sm\\:w-10 {
    width: 2.5rem;
  }

  .sm\\:ml-4 {
    margin-left: 1rem;
  }

  .sm\\:text-left {
    text-align: left;
  }

  .sm\\:block {
    display: block;
  }
}

.h-12 {
  height: 3rem;
}

.w-12 {
  width: 3rem;
}

.h-6 {
  height: 1.5rem;
}

.w-6 {
  width: 1.5rem;
}

.leading-6 {
  line-height: 1.5rem;
}

/* Icon Button Styles */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  background: transparent;
}

.icon-btn:hover {
  transform: scale(1.1);
}

.icon-btn svg {
  transition: all var(--transition-base);
}

.icon-btn-primary {
  color: var(--primary-color);
}

.icon-btn-primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: var(--primary-hover);
}

.icon-btn-edit {
  color: #6366f1;
}

.icon-btn-edit:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

.icon-btn-delete {
  color: #ef4444;
}

.icon-btn-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.icon-btn-view {
  color: #3b82f6;
}

.icon-btn-view:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

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

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.icon-btn:disabled:hover {
  background: transparent;
  transform: none;
}

/* Utility Classes */
.w-4 {
  width: 1rem;
}

.h-4 {
  height: 1rem;
}

.w-5 {
  width: 1.25rem;
}

.h-5 {
  height: 1.25rem;
}

.w-6 {
  width: 1.5rem;
}

.h-6 {
  height: 1.5rem;
}

.mr-1 {
  margin-right: 0.25rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.ml-1 {
  margin-left: 0.25rem;
}

.ml-2 {
  margin-left: 0.5rem;
}