/* Progress Bar Colors */
.progress-bar.bg-green-600 { background-color: #059669 !important; }
.progress-bar.bg-yellow-500 { background-color: #eab308 !important; }
.progress-bar.bg-red-500 { background-color: #ef4444 !important; }

/* Dark mode variables */
:root {
  --primary: #4299e1;
  --primary-dark: #2c5282;
  --primary-light: #63b3ed;
  --primary-rgb: 66, 153, 225;
  --secondary: #718096;
  --secondary-rgb: 113, 128, 150;

  --success: #38a169;
  --success-rgb: 56, 161, 105;
  --warning: #ed8936;
  --warning-rgb: 237, 137, 54;
  --danger: #e53e3e;
  --danger-rgb: 229, 62, 62;
  --info: #4299e1;
  --info-rgb: 66, 153, 225;

  --bg-primary: #ffffff;
  --bg-secondary: #f7fafc;
  --bg-accent: #edf2f7;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --card-border: #e2e8f0;
  --card-hover: #f7fafc;
  --input-bg: #ffffff;
  --input-text: #1a202c;
  --input-border: #e2e8f0;
  --input-placeholder: #a0aec0;
  --sidebar-bg: #ffffff;
  --sidebar-text: #4a5568;
  --sidebar-hover: rgba(66, 153, 225, 0.1);
  --sidebar-active: #2563eb;
  --table-header: #f7fafc;
  --table-border: #e2e8f0;
  --table-row-hover: #f7fafc;

  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;
  --spacing-12: 3rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --primary: #63b3ed;
  --primary-dark: #4299e1;
  --primary-light: #7ab8f0;
  --primary-rgb: 99, 179, 237;
  --secondary: #a0aec0;
  --secondary-rgb: 160, 174, 192;

  --success: #48bb78;
  --success-rgb: 72, 187, 120;
  --warning: #f6ad55;
  --warning-rgb: 246, 173, 85;
  --danger: #f56565;
  --danger-rgb: 245, 101, 101;
  --info: #63b3ed;
  --info-rgb: 99, 179, 237;

  --bg-primary: #1a202c;
  --bg-secondary: #2d3748;
  --bg-accent: #4a5568;
  --text-primary: #f7fafc;
  --text-secondary: #e2e8f0;
  --border-color: #4a5568;
  --card-bg: #2d3748;
  --card-shadow: rgba(0, 0, 0, 0.3);
  --card-border: #4a5568;
  --card-hover: #374151;
  --input-bg: #2d3748;
  --input-text: #f7fafc;
  --input-border: #4a5568;
  --input-placeholder: #a0aec0;
  --sidebar-bg: #1a202c;
  --sidebar-text: #e2e8f0;
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --sidebar-active: #4299e1;
  --table-header: #4a5568;
  --table-border: #4a5568;
  --table-row-hover: #374151;

  /* Same spacing variables as light mode */

  /* Shadow adjustments for dark mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.14);
}

/* Base styles */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 0.9rem; /* Reduce base font size by 10% */
}

/* Cards */
.card,
.bg-white {
  background-color: var(--card-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem; /* Slightly rounded corners */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* Sidebar */
.sidebar {
  background-color: var(--sidebar-bg);
  border-color: var(--border-color);
  color: var(--sidebar-text);
}

/* Tables */
table {
  background-color: var(--card-bg);
  color: var(--text-primary);
}

table thead {
  background-color: var(--table-header);
}

table th {
  color: var(--text-secondary);
}

table td {
  border-color: var(--table-border);
}

tr:hover {
  background-color: var(--table-row-hover);
}

/* Forms */
input,
select,
textarea {
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--input-border);
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}

/* Text colors */
.text-gray-600,
.text-gray-700,
.text-gray-800,
.text-gray-900 {
  color: var(--text-primary) !important;
}

.text-gray-500 {
  color: var(--text-secondary) !important;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

/* Dropdowns */
.dropdown-menu {
  background-color: var(--card-bg);
  border-color: var(--border-color);
}

.dropdown-item:hover {
  background-color: var(--bg-accent);
}

/* Links */
a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-dark);
}

/* Modals */
.modal {
  background-color: var(--card-bg);
  color: var(--text-primary);
}

/* Borders */
.border,
.border-t,
.border-r,
.border-b,
.border-l {
  border-color: var(--border-color) !important;
}

/* Success/Error states */
.bg-green-50 {
  background-color: rgba(39, 103, 73, 0.1) !important;
}

.bg-red-50 {
  background-color: rgba(197, 48, 48, 0.1) !important;
}

.bg-yellow-50 {
  background-color: rgba(192, 86, 33, 0.1) !important;
}

.bg-blue-50 {
  background-color: rgba(43, 108, 176, 0.1) !important;
}

/* Dark mode specific text colors - multiple selectors for compatibility */
html.dark .text-gray-600,
html.dark .text-gray-700,
html.dark .text-gray-800,
html.dark .text-gray-900,
.dark .text-gray-600,
.dark .text-gray-700,
.dark .text-gray-800,
.dark .text-gray-900,
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-900,
body.dark-mode .text-gray-600,
body.dark-mode .text-gray-700,
body.dark-mode .text-gray-800,
body.dark-mode .text-gray-900 {
  color: #f3f4f6 !important;
}

html.dark .text-blue-800,
html.dark .text-green-800,
html.dark .text-yellow-800,
html.dark .text-red-800,
.dark .text-blue-800,
.dark .text-green-800,
.dark .text-yellow-800,
.dark .text-red-800,
[data-theme="dark"] .text-blue-800,
[data-theme="dark"] .text-green-800,
[data-theme="dark"] .text-yellow-800,
[data-theme="dark"] .text-red-800,
body.dark-mode .text-blue-800,
body.dark-mode .text-green-800,
body.dark-mode .text-yellow-800,
body.dark-mode .text-red-800 {
  color: #e2e8f0 !important;
}

/* Dark mode background colors for cards */
html.dark .bg-white,
.dark .bg-white,
[data-theme="dark"] .bg-white,
body.dark-mode .bg-white {
  background-color: #1f2937 !important;
}

html.dark .bg-gray-50,
.dark .bg-gray-50,
[data-theme="dark"] .bg-gray-50,
body.dark-mode .bg-gray-50 {
  background-color: #374151 !important;
}

/* Dark mode border colors */
html.dark .border-gray-200,
.dark .border-gray-200,
[data-theme="dark"] .border-gray-200,
body.dark-mode .border-gray-200 {
  border-color: #374151 !important;
}

/* Hover states */
.hover\:bg-gray-100:hover {
  background-color: var(--bg-accent) !important;
}

/* Theme Transitions */
.theme-transition,
.theme-transition *,
.theme-transition-enabled,
.theme-transition-enabled * {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              fill 0.3s ease,
              stroke 0.3s ease !important;
}

/* Theme toggle button animations */
.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle-active {
  transform: scale(0.95);
}

.theme-toggle-active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.5s ease-out;
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* Removed redundant dark mode styles from original file */

/* Enhanced UI Components */

/* Card Enhancements - improved for zoom compatibility */
.card {
  border-radius: clamp(0.5rem, 2vw, 0.75rem);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Disable transform on hover for devices that might have performance issues */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  }
}

.card-header {
  padding: clamp(0.75rem, 2vw, 1.25rem) clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.card-header h2, 
.card-header h3 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.1rem, 3vw, 1.25rem);
  line-height: 1.3;
}

.card-body {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.card-footer {
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 2vw, 1.5rem);
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Card grid system for responsive layouts - improved for zoom compatibility */
.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  width: 100%;
  box-sizing: border-box;
}

/* More fluid breakpoints using min-width and max-width */
@media (min-width: 640px) and (max-width: 1023px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Special grid layout for dashboard cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: clamp(0.75rem, 2vw, 1.25rem);
  width: 100%;
}

@media (min-width: 640px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Flex-based card layout for when Grid isn't ideal */
.card-flex-container {
  display: flex;
  flex-wrap: wrap;
  margin: calc(clamp(0.5rem, 1.5vw, 1rem) * -1);
  width: calc(100% + (clamp(0.5rem, 1.5vw, 1rem) * 2));
}

.card-flex-item {
  flex: 1 1 calc(100% - clamp(1rem, 3vw, 2rem));
  margin: clamp(0.5rem, 1.5vw, 1rem);
  min-width: 250px;
}

@media (min-width: 640px) {
  .card-flex-item {
    flex: 1 1 calc(50% - clamp(1rem, 3vw, 2rem));
  }
}

@media (min-width: 1024px) {
  .card-flex-item {
    flex: 1 1 calc(33.333% - clamp(1rem, 3vw, 2rem));
  }
}

/* Feature card with icon */
.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.feature-card .icon {
  background-color: rgba(66, 153, 225, 0.1);
  color: var(--primary);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Button enhancements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-align: center;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-align: center;
}

.btn-secondary:hover {
  background-color: rgba(66, 153, 225, 0.1);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: #e53e3e;
  color: white;
}

.btn-danger:hover {
  background-color: #c53030;
}

.btn-success {
  background-color: #38a169;
  color: white;
}

.btn-success:hover {
  background-color: #2f855a;
}

/* Table Improvements */
.table-container {
  overflow-x: auto;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

table td {
  padding: 1rem;
  vertical-align: middle;
}

table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

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

table tbody tr:hover {
  background-color: var(--table-row-hover);
}

/* Form improvements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--input-border);
  border-radius: 0.375rem;
  background-color: var(--input-bg);
  color: var(--input-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.badge-primary {
  background-color: rgba(66, 153, 225, 0.1);
  color: var(--primary);
}

.badge-success {
  background-color: rgba(56, 161, 105, 0.1);
  color: #38a169;
}

.badge-warning {
  background-color: rgba(246, 173, 85, 0.1);
  color: #ed8936;
}

.badge-danger {
  background-color: rgba(229, 62, 62, 0.1);
  color: #e53e3e;
}

/* Animation utilities */
.animate-fade-in {
  animation: fadeIn 0.5s ease-in;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Dashboard improvements - optimized for various zoom levels */
.stats-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 1.5rem);
  height: 100%;
  box-sizing: border-box;
  min-width: 0; /* Prevents flex items from overflowing */
}

.stats-card .stats-value {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  margin-bottom: clamp(0.25rem, 1vw, 0.5rem);
  color: var(--primary);
  line-height: 1.2;
  word-break: break-word; /* Ensures long numbers don't overflow */
}

.stats-card .stats-label {
  font-size: clamp(0.75rem, 2vw, 0.875rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
  line-height: 1.4;
}

.stats-card .stats-icon {
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
  color: var(--primary);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.stats-trend {
  display: flex;
  align-items: center;
  font-size: clamp(0.75rem, 2vw, 0.875rem);
  line-height: 1.4;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.stats-trend-up {
  color: #38a169;
  display: flex;
  align-items: center;
}

.stats-trend-down {
  color: #e53e3e;
  display: flex;
  align-items: center;
}

/* Alternative stats card layouts */
.stats-card-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.5rem);
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.stats-card-horizontal .stats-icon {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 0;
}

.stats-card-horizontal .stats-content {
  flex: 1;
  min-width: 0; /* Prevents content from overflowing */
}

/* Modern progress bars */
.progress-container {
  width: 100%;
  height: 0.5rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-bar {
  height: 100%;
  border-radius: 1rem;
  transition: width 0.5s ease;
}

.progress-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.progress-success {
  background: linear-gradient(90deg, #48bb78, #38a169) !important;
}

.progress-warning {
  background: linear-gradient(90deg, #ed8936, #dd6b20) !important;
}

.progress-danger {
  background: linear-gradient(90deg, #f56565, #e53e3e) !important;
}

/* Ensure progress bars are visible in dark mode */
[data-theme="dark"] .progress-container,
.dark .progress-container,
html.dark .progress-container {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .progress-success,
.dark .progress-success,
html.dark .progress-success {
  background: linear-gradient(90deg, #4ade80, #22c55e) !important;
}

[data-theme="dark"] .progress-warning,
.dark .progress-warning,
html.dark .progress-warning {
  background: linear-gradient(90deg, #fbbf24, #f59e0b) !important;
}

[data-theme="dark"] .progress-danger,
.dark .progress-danger,
html.dark .progress-danger {
  background: linear-gradient(90deg, #f87171, #ef4444) !important;
}

/* Modal enhancements */
.modal-content {
  border-radius: 0.75rem;
  overflow: hidden;
  border: none;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.02);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.02);
}

/* Page section containers - improved for better zoom support */
.page-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.25rem;
  box-sizing: border-box;
}

/* Responsive section wrapper with better zoom support */
.section-wrapper {
  width: 100%;
  max-width:1200px;
  margin: 0 auto;
  padding: 0 0.875rem;
  box-sizing: border-box;
}

/* Responsive section padding that scales well at various zoom levels */
.section-padding {
  padding: clamp(1.25rem, 3.5vw, 2.5rem) 0;
}

.section-title {
  font-size: clamp(1.125rem, 3.5vw, 1.375rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.section-subtitle {
  font-size: clamp(0.8125rem, 2.75vw, 0.9375rem);
  font-weight: 500;
  margin-bottom: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Equal height cards */
.equal-height-cards {
  display: flex;
  flex-wrap: wrap;
}

.equal-height-cards .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.25s ease-in-out;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.equal-height-cards .card:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.09);
  transform: translateY(-1px);
}

.equal-height-cards .card-body {
  flex: 1 1 auto;
}

/* Modern card styling with subtle gradient */
.card {
  border-radius: 0.375rem;
  background: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(250,250,252,0.9));
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* Fix any font issues */
body, 
input, 
button, 
select, 
textarea {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Form element improvements */
input.form-control, 
select.form-control, 
textarea.form-control {
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  background-color: #f9fafb;
  font-size: 0.875rem;
}

input.form-control:focus, 
select.form-control:focus, 
textarea.form-control:focus {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
  outline: none;
  background-color: white;
}

/* Form labels */
label.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

/* Compact form groups */
.form-group {
  margin-bottom: 1rem;
}

/* Custom checkboxes and radios */
.form-check-input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.25rem;
  vertical-align: top;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  appearance: none;
  background-color: #fff;
  transition: all 0.2s ease;
}

.form-check-input:checked {
  background-color: var(--color-primary-500);
  border-color: var(--color-primary-500);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8l2 2 6-6'/%3e%3c/svg%3e");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.75rem;
}

/* Additional utility classes for zoom-friendly layouts */
/* Responsive margins and paddings that work well at different zoom levels */
.my-responsive {
  margin-top: clamp(0.75rem, 2vw, 1.5rem);
  margin-bottom: clamp(0.75rem, 2vw, 1.5rem);
}

.mx-responsive {
  margin-left: clamp(0.75rem, 2vw, 1.5rem);
  margin-right: clamp(0.75rem, 2vw, 1.5rem);
}

.py-responsive {
  padding-top: clamp(0.75rem, 2vw, 1.5rem);
  padding-bottom: clamp(0.75rem, 2vw, 1.5rem);
}

.px-responsive {
  padding-left: clamp(0.75rem, 2vw, 1.5rem);
  padding-right: clamp(0.75rem, 2vw, 1.5rem);
}

/* Responsive fonts that scale with zoom */
.text-responsive-sm {
  font-size: clamp(0.6875rem, 1.75vw, 0.8125rem);
  line-height: 1.3;
}

.text-responsive {
  font-size: clamp(0.8125rem, 2.25vw, 0.9375rem);
  line-height: 1.4;
}

.text-responsive-lg {
  font-size: clamp(0.9375rem, 2.75vw, 1.125rem);
  line-height: 1.3;
}

.text-responsive-xl {
  font-size: clamp(1.125rem, 3.5vw, 1.375rem);
  line-height: 1.2;
}

/* Responsive gap for flex layouts */
.gap-responsive {
  gap: clamp(0.5rem, 2vw, 1rem);
}

.gap-responsive-lg {
  gap: clamp(0.75rem, 3vw, 1.5rem);
}

/* Viewport-relative sizing utility for better zoom compatibility */
.w-vw-90 {
  width: 90vw;
  max-width: 100%;
}

.w-vw-80 {
  width: 80vw;
  max-width: 100%;
}

.w-vw-70 {
  width: 70vw;
  max-width: 100%;
}

/* Prevent mobile zoom issues with form inputs */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px; /* Prevents iOS zoom on input focus */
  }
}

/* Modernize buttons with gradients and better hover effects */
.btn-primary, button.bg-primary-600, a.bg-primary-600 {
  background-image: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-500));
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover, button.bg-primary-600:hover, a.bg-primary-600:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.btn-secondary, button.bg-gray-500, a.bg-gray-500 {
  background-image: linear-gradient(135deg, #64748b, #94a3b8);
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn-secondary:hover, button.bg-gray-500:hover, a.bg-gray-500:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

/* Improve table appearance */
table {
  border-radius: 0.375rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

table th {
  background-color: rgba(243, 244, 246, 0.8);
  font-weight: 600;
}

table tr:hover td {
  background-color: rgba(249, 250, 251, 0.8);
}

/* Sidebar styling improvements */
aside.hidden.md\:flex nav {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Make sidebar menu items more compact */
aside.hidden.md\:flex nav a, 
aside.hidden.md\:flex nav button {
    padding-top: 0.25rem !important; 
    padding-bottom: 0.25rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-size: 0.85rem !important;
}

/* Reduce margin between sidebar items */
aside.hidden.md\:flex nav .space-y-0.5 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Minimize sidebar padding */
aside.hidden.md\:flex nav {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

/* Dropdown menu items */
aside.hidden.md\:flex nav div[x-show="open"] a,
aside.hidden.md\:flex nav div[x-show="automationOpen"] a {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    font-size: 0.8125rem !important;
}

/* Reduce space between menu items */
aside.hidden.md\:flex nav.space-y-0.5 > * {
    margin-top: 0.125rem !important;
    margin-bottom: 0.125rem !important;
}

/* Reduce space in dropdown sections */
aside.hidden.md\:flex nav div.mt-4 {
    margin-top: 0.5rem !important;
}

/* Make border separators more compact */
aside.hidden.md\:flex nav div.my-4 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.footer {
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Mobile sidebar fix, no need to adjust footer anymore */
@media (max-width: 768px) {
    /* Sidebar collapses on mobile */
}

/* Modal improvements */
.modal-content {
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: none;
  background: linear-gradient(to bottom right, #fff, #fafafa);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
}

.modal-header .modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-header .btn-close {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.modal-header .btn-close:hover {
  opacity: 0.75;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0.75rem 1.25rem;
}

/* Form inside modals */
.modal-body .form-group:last-child {
  margin-bottom: 0;
}