/* Coupon Rule Builder Styles */

.rule-builder-container {
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
}

/* Popular Templates Section */
.popular-templates-section .template-btn {
  padding: 1rem;
  height: 100%;
  transition: all 0.2s ease;
  border-width: 2px;
}

.popular-templates-section .template-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.popular-templates-section .template-btn i {
  opacity: 0.7;
}

/* Active Rules List */
.rules-list {
  min-height: 100px;
}

.empty-state {
  background: white;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
}

/* Rule Cards */
.rule-card {
  transition: all 0.2s ease;
  cursor: grab;
  border-left: 4px solid transparent;
}

.rule-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left-color: #0d6efd;
}

.rule-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.rule-card .drag-handle {
  font-size: 1.2rem;
  padding: 0.5rem;
  cursor: move;
}

.rule-card .drag-handle:hover {
  color: #0d6efd !important;
}

/* Rule Type Badges */
.rule-type-badge {
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
}

/* Rule Config Summary */
.rule-config-summary {
  background: #f8f9fa;
  padding: 0.5rem;
  border-radius: 4px;
  border-left: 3px solid #0d6efd;
}

/* Priority Badge */
.priority-badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
}

/* Rule Active Toggle */
.rule-active-toggle {
  cursor: pointer;
  width: 40px;
  height: 20px;
}

/* Custom Rule Form */
#custom-rule-form {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Rule Config Panel */
#rule-config-panel {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

#rule-description-alert {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Config Fields */
.config-field {
  font-size: 0.95rem;
}

.config-field:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Popular Configs Buttons */
#popular-configs-buttons .btn {
  font-size: 0.85rem;
}

#popular-configs-buttons .btn:hover {
  transform: scale(1.05);
}

/* JSON Editor */
#custom-rule-config-json {
  font-size: 0.85rem;
  line-height: 1.6;
  background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
  .rule-builder-container {
    padding: 1rem;
  }

  .popular-templates-section .template-btn {
    font-size: 0.9rem;
    padding: 0.75rem;
  }

  .rule-card .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  #rule-config-panel {
    padding: 1rem;
  }
}

/* Tooltips */
[data-bs-toggle="tooltip"] {
  cursor: help;
}

/* Required Field Indicator */
.required::after {
  content: " *";
  color: #dc3545;
}

/* Cursor Utilities */
.cursor-move {
  cursor: move;
}

.cursor-pointer {
  cursor: pointer;
}

/* Form Actions Spacing */
.form-actions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #dee2e6;
}

/* Section Titles */
.section-title {
  color: #212529;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Rule Count Badge */
#rule-count {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Bootstrap Enhancements */
.card-header {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.help-section {
  margin-bottom: 2rem;
}

.help-section h6 {
  color: #495057;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.help-list {
  list-style: none;
  padding-left: 0;
}

.help-list li {
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.help-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #0d6efd;
  font-weight: bold;
}

/* Rule Help Highlighting */
.rule-help {
  transition: all 0.3s ease;
}

.rule-help.border-primary {
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Code Blocks */
pre {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

pre code {
  color: #212529;
}

/* Details/Summary */
details {
  cursor: pointer;
}

details summary {
  user-select: none;
  outline: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "▶";
  margin-right: 0.5rem;
  display: inline-block;
  transition: transform 0.2s;
}

details[open] summary::before {
  transform: rotate(90deg);
}

/* Loading States */
.rule-card.saving {
  opacity: 0.6;
  pointer-events: none;
}

.rule-card.saving::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #0d6efd;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .rule-builder-container .drag-handle,
  .rule-builder-container .edit-rule-btn,
  .rule-builder-container .delete-rule-btn,
  #show-custom-rule-form,
  #custom-rule-form {
    display: none !important;
  }

  .rule-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
/* Coupon Management Styles */

/* General Layout */
.coupon-form-container,
.coupon-show-container,
.coupons-index-container {
  padding: 2rem 0;
}

/* Form Styling */
.coupon-form .form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.coupon-form .form-section:last-child {
  border-bottom: none;
}

.coupon-form .section-title {
  color: #495057;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 1rem;
}

.coupon-form .section-title:before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border-radius: 2px;
}

.coupon-form .form-label.required:after {
  content: '*';
  color: #dc3545;
  margin-left: 0.25rem;
}

.coupon-form .form-text.text-muted {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Field visibility based on coupon type */
.coupon-field {
  display: none;
}

.coupon-field.active {
  display: block;
}

/* Rule Cards */
.coupon-rule-card {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.coupon-rule-card:hover {
  border-color: #007bff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 123, 255, 0.075);
}

.coupon-rule-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.rule-config {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  background-color: #f8f9fa;
}

/* Help Panel */
.help-panel {
  position: sticky;
  top: 2rem;
}

.help-panel .card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.help-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f3f4;
}

.help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.help-section h6 {
  color: #495057;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.help-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.help-list li {
  padding: 0.25rem 0;
  font-size: 0.875rem;
  color: #6c757d;
}

.help-list li:before {
  content: '•';
  color: #007bff;
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-right: 0.5rem;
}

.rule-help {
  display: none;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.375rem;
  border-left: 4px solid #007bff;
}

.rule-help pre {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.5rem;
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
}

.rule-help code {
  background-color: #ffffff;
  color: #e83e8c;
}

/* Statistics Cards */
.coupons-index-container .card {
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.coupons-index-container .row .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stat-card {
  text-align: center;
  padding: 1.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Table Styling */
.table-coupon {
  margin-bottom: 0;
}

.table-coupon th {
  border-top: none;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
}

.table-coupon td {
  vertical-align: middle;
}

.coupon-code-cell {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-weight: 600;
  color: #495057;
}

.usage-progress {
  width: 100px;
  height: 6px;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Show Page Styling */
.coupon-show-container .detail-group {
  margin-bottom: 1.5rem;
}

.coupon-show-container .detail-group label {
  font-weight: 600;
  color: #6c757d;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: block;
}

.coupon-show-container .detail-value {
  font-size: 1rem;
  color: #212529;
}

.coupon-code-display {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 1.125rem;
  font-weight: bold;
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  display: inline-block;
  margin-right: 1rem;
}

.rule-item {
  background-color: #f8f9fa;
  border-radius: 0.375rem;
  padding: 1rem;
  border-left: 4px solid #007bff;
  margin-bottom: 1rem;
}

.rule-item h6 {
  margin-bottom: 0.5rem;
  color: #495057;
}

.rule-config-details {
  margin-top: 0.75rem;
}

.rule-config-details summary {
  color: #007bff;
  cursor: pointer;
  font-size: 0.875rem;
}

.rule-config-details pre {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

/* Use Case Cards */
.use-case-card {
  padding: 1.5rem;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  transition: all 0.15s ease-in-out;
}

.use-case-card:hover {
  border-color: #007bff;
  background-color: #f8f9fa;
  transform: translateY(-2px);
}

.use-case-card h6 {
  color: #495057;
  margin-bottom: 0.75rem;
}

.use-case-card h6 i {
  margin-right: 0.5rem;
}

.use-case-card p {
  margin-bottom: 0.5rem;
  color: #6c757d;
}

.use-case-card small {
  color: #495057;
}

/* Best Practices */
.best-practices-list {
  list-style: none;
  padding-left: 0;
}

.best-practices-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8f9fa;
  position: relative;
  padding-left: 1.5rem;
}

.best-practices-list li:before {
  position: absolute;
  left: 0;
  top: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
}

.text-success .best-practices-list li:before {
  content: '✓';
  color: #28a745;
}

.text-danger .best-practices-list li:before {
  content: '✗';
  color: #dc3545;
}

/* Analytics */
.analytics-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f8f9fa;
}

.analytics-item:last-child {
  border-bottom: none;
}

.analytics-item .progress {
  width: 100%;
  margin-top: 0.5rem;
}

/* Form Actions */
.form-actions {
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 2px solid #e9ecef;
  text-align: center;
}

.form-actions .btn {
  margin: 0 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .help-panel {
    position: static;
    margin-top: 2rem;
  }
  
  .coupon-form-container .row,
  .coupon-show-container .row {
    margin-left: 0;
    margin-right: 0;
  }
  
  .coupon-form-container .col-lg-8,
  .coupon-form-container .col-lg-4,
  .coupon-show-container .col-lg-8,
  .coupon-show-container .col-lg-4 {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 575.98px) {
  .coupon-form-container,
  .coupon-show-container,
  .coupons-index-container {
    padding: 1rem 0;
  }
  
  .form-actions .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
}

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

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Badge Enhancements - Only for custom styles, don't override Bootstrap defaults */
.badge-outline {
  background-color: transparent !important;
  border: 1px solid;
}

.badge-outline.badge-primary {
  color: #007bff !important;
  border-color: #007bff;
}

.badge-outline.badge-success {
  color: #28a745 !important;
  border-color: #28a745;
}

.badge-outline.badge-warning {
  color: #ffc107 !important;
  border-color: #ffc107;
}

.badge-outline.badge-danger {
  color: #dc3545 !important;
  border-color: #dc3545;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
  .help-panel,
  .form-actions,
  .btn,
  .navbar,
  .sidebar {
    display: none !important;
  }
  
  .coupon-show-container,
  .coupon-form-container {
    padding: 0;
  }
  
  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
}
/* Jobs Page Styling */

.jobs-page {
  padding: 1rem;
  background-color: #f8f9fa;
  min-height: 100vh;
}

/* Page Header */
.page-header {
  background: #2c3e50;
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.header-actions .btn-primary {
  background: #3498db;
  border: 2px solid #3498db;
  transition: all 0.3s ease;
}

.header-actions .btn-primary:hover {
  background: #2980b9;
  border-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Stats Cards */
.stats-section {
  margin-bottom: 2rem;
}

.stats-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stats-card-1::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #34495e;
}

.stats-card-2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #27ae60;
}

.stats-card-3::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #3498db;
}

.stats-card-4::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #e74c3c;
}

.stats-card-body {
  padding: 2rem;
  display: flex;
  align-items: center;
}

.stats-icon {
  background: #34495e;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1.5rem;
  font-size: 1.5rem;
}

.stats-card-2 .stats-icon {
  background: #27ae60;
}

.stats-card-3 .stats-icon {
  background: #3498db;
}

.stats-card-4 .stats-icon {
  background: #e74c3c;
}

.stats-content {
  flex: 1;
}

.stats-number {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  color: #2c3e50;
}

.stats-label {
  color: #6c757d;
  font-weight: 500;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

/* Filter Card */
.filter-card {
  background: white;
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.filter-card .card-body {
  padding: 2rem;
}

.jobs-filter-form .form-label {
  color: #495057;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.jobs-filter-form .form-control,
.jobs-filter-form .form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.jobs-filter-form .form-control:focus,
.jobs-filter-form .form-select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.advanced-filters .btn-outline-secondary {
  border-radius: 20px;
  padding: 0.5rem 1rem;
}

/* Results Summary */
.results-summary {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Page Size Selector */
.page-size-selector {
  display: flex;
  align-items: center;
}

.page-size-selector .form-select-sm {
  min-width: 100px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.page-size-selector .form-select-sm:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Jobs Table */
.jobs-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.jobs-table thead th {
  background-color: #f8f9fa;
  border: none;
  padding: 1rem;
  font-weight: 600;
  color: #2c3e50;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.jobs-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border: none;
  border-bottom: 1px solid #f1f3f4;
}

.jobs-table tbody tr:hover {
  background-color: #f8f9fa;
}

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

.table-responsive {
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.job-title-link {
  color: #2c3e50;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 6px;
  display: inline-block;
}

.job-title-link:hover {
  color: #3498db;
  background-color: #f8f9fa;
  text-decoration: none;
}

/* Action buttons in table */
.jobs-table .btn {
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Empty State */
.empty-state {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 3rem;
}

.empty-icon {
  opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .jobs-page {
    padding: 0.5rem;
  }
  
  .page-header {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .stats-card-body {
    padding: 1.5rem;
  }
  
  .stats-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
    margin-right: 1rem;
  }
  
  .stats-number {
    font-size: 2rem;
  }
  
  .filter-card .card-body {
    padding: 1.5rem;
  }
  
  .job-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
}

@media (max-width: 576px) {
  .page-header .d-flex {
    flex-direction: column;
    text-align: center;
  }
  
  .header-actions {
    margin-top: 1rem;
  }
  
  .jobs-filter-form .row {
    margin-bottom: 1rem;
  }
  
  .job-card-header .d-flex {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Animation for loading states */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Pagination Styling */
.pagination {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pagination .page-link {
  border: none;
  padding: 0.75rem 1rem;
  color: #3498db;
  font-weight: 500;
  transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
  background: #3498db;
  border-color: #3498db;
  color: white;
}

.pagination .page-link:hover {
  background-color: #f8f9fa;
  color: #2980b9;
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #fff;
}

/* Custom form styling */
.form-check-input:checked {
  background-color: #3498db;
  border-color: #3498db;
}

.btn-primary {
  background: #3498db;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-outline-secondary {
  border-radius: 20px;
  border: 2px solid #e9ecef;
  color: #6c757d;
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  background-color: #3498db;
  border-color: #3498db;
  color: white;
}
/* line 1, app/assets/stylesheets/scaffolds.scss */
body {
  background-color: #fff;
  color: #333;
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 13px;
  line-height: 18px;
  margin: 33px;
}

/* line 10, app/assets/stylesheets/scaffolds.scss */
p, ol, ul, td {
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 13px;
  line-height: 18px;
  margin: 33px;
}

/* line 17, app/assets/stylesheets/scaffolds.scss */
pre {
  background-color: #eee;
  padding: 10px;
  font-size: 11px;
}

/* line 23, app/assets/stylesheets/scaffolds.scss */
a {
  color: #000;
}

/* line 26, app/assets/stylesheets/scaffolds.scss */
a:visited {
  color: #666;
}

/* line 30, app/assets/stylesheets/scaffolds.scss */
a:hover {
  color: #fff;
  background-color: #000;
}

/* line 36, app/assets/stylesheets/scaffolds.scss */
th {
  padding-bottom: 5px;
}

/* line 40, app/assets/stylesheets/scaffolds.scss */
td {
  padding-bottom: 7px;
  padding-left: 5px;
  padding-right: 5px;
}

/* line 47, app/assets/stylesheets/scaffolds.scss */
div.field, div.actions {
  margin-bottom: 10px;
}

/* line 52, app/assets/stylesheets/scaffolds.scss */
#notice {
  color: green;
}

/* line 56, app/assets/stylesheets/scaffolds.scss */
.field_with_errors {
  padding: 2px;
  background-color: red;
  display: table;
}

/* line 62, app/assets/stylesheets/scaffolds.scss */
#error_explanation {
  width: 450px;
  border: 2px solid red;
  padding: 7px;
  padding-bottom: 0;
  margin-bottom: 20px;
  background-color: #f0f0f0;
}

/* line 70, app/assets/stylesheets/scaffolds.scss */
#error_explanation h2 {
  text-align: left;
  font-weight: bold;
  padding: 5px 5px 5px 15px;
  font-size: 12px;
  margin: -7px;
  margin-bottom: 0;
  background-color: #c00;
  color: #fff;
}

/* line 81, app/assets/stylesheets/scaffolds.scss */
#error_explanation ul li {
  font-size: 12px;
  list-style: square;
}

/* line 87, app/assets/stylesheets/scaffolds.scss */
label {
  display: block;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Custom application styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f8f9fa;
}

.navbar-brand {
  font-weight: bold;
}

/* Card styling */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1rem;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
}

/* Stats cards with subtle colors */
.stats-card-1 { border-left: 4px solid #007bff; }
.stats-card-2 { border-left: 4px solid #28a745; }  
.stats-card-3 { border-left: 4px solid #ffc107; }
.stats-card-4 { border-left: 4px solid #dc3545; }

.stats-card-1 .card-title { color: #007bff; }
.stats-card-2 .card-title { color: #28a745; }
.stats-card-3 .card-title { color: #ffc107; }
.stats-card-4 .card-title { color: #dc3545; }

/* ============================================================
   SIDEBAR
   ============================================================ */
:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1e2538;
  --sidebar-header-bg: #161c2d;
  --sidebar-footer-bg: #161c2d;
  --sidebar-text: #b0b8d0;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: rgba(255,255,255,0.12);
  --sidebar-active-color: #ffffff;
  --sidebar-section-label: #5a6478;
  --sidebar-icon-color: #6c7a96;
  --sidebar-icon-active: #4f9cf9;
  --navbar-height: 56px;
}

.sidebar-wrapper {
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background-color: var(--sidebar-bg);
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, margin-left 0.3s ease;
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

/* Sidebar Header */
.sidebar-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  background-color: var(--sidebar-header-bg);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-brand i {
  color: var(--sidebar-icon-active);
  font-size: 1rem;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}

.sidebar-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* Scrollable Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0 0.5rem;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* Section groups */
.sidebar-section {
  margin-bottom: 0.25rem;
}

.sidebar-section-label {
  padding: 0.6rem 1.1rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sidebar-section-label);
  user-select: none;
}

/* Nav links */
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  border-radius: 6px;
  margin: 1px 8px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link:hover {
  background-color: rgba(255,255,255,0.08);
  color: var(--sidebar-text-hover);
  text-decoration: none;
}

.sidebar-link.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-color);
  font-weight: 500;
}

.sidebar-link.active .sidebar-icon {
  color: var(--sidebar-icon-active);
}

.sidebar-icon {
  width: 18px;
  text-align: center;
  margin-right: 0.65rem;
  font-size: 0.85rem;
  color: var(--sidebar-icon-color);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.sidebar-link:hover .sidebar-icon {
  color: var(--sidebar-text-hover);
}

@keyframes sidebar-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.sidebar-spin {
  animation: sidebar-spin 3s linear infinite;
}

/* Sidebar Footer */
.sidebar-footer {
  flex-shrink: 0;
  padding: 0.75rem 1.1rem;
  background-color: var(--sidebar-footer-bg);
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  color: var(--sidebar-text);
  font-size: 0.8rem;
  overflow: hidden;
}

.sidebar-user-info i {
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--sidebar-icon-active);
}

/* Main content offset */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
  min-height: 100vh;
}

/* No sidebar (not logged in) */
.no-sidebar .main-content {
  margin-left: 0;
}

/* Collapsed state (desktop toggle) */
#wrapper.sidebar-collapsed .sidebar-wrapper {
  margin-left: calc(-1 * var(--sidebar-width));
}

#wrapper.sidebar-collapsed .main-content {
  margin-left: 0;
}

/* Bootstrap Badge Enhancements */
.badge {
  font-weight: 600;
  font-size: 0.75em;
  padding: 0.35em 0.65em;
  border-radius: 0.375rem;
}

.badge-primary {
  color: #fff;
  background-color: #007bff;
}

.badge-success {
  color: #fff;
  background-color: #28a745;
}

.badge-warning {
  color: #212529;
  background-color: #ffc107;
}

.badge-danger {
  color: #fff;
  background-color: #dc3545;
}

.badge-secondary {
  color: #fff;
  background-color: #6c757d;
}

.badge-info {
  color: #fff;
  background-color: #17a2b8;
}

.badge-light {
  color: #212529;
  background-color: #f8f9fa;
}

.badge-dark {
  color: #fff;
  background-color: #343a40;
}

/* Badge sizes */
.badge-sm {
  font-size: 0.7em;
  padding: 0.25em 0.5em;
}

.badge-lg {
  font-size: 0.875em;
  padding: 0.5em 0.75em;
}

/* Ensure Bootstrap classes work properly */
.table .badge {
  font-size: 0.75em;
}

/* Button styling */
.btn {
  border-radius: 0.375rem;
  font-weight: 400;
}

/* Progress bar styling */
.progress {
  border-radius: 0.375rem;
  overflow: hidden;
}

/* Alert styling */
.alert {
  border: none;
  border-radius: 0.375rem;
}

/* Form control styling */
.form-control, .form-select {
  border-radius: 0.375rem;
}

/* ============================================================
   MOBILE / RESPONSIVE STYLES
   ============================================================ */

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* Mobile-first sidebar: on small screens, sidebar is always an overlay */
@media (max-width: 767.98px) {
  /* Sidebar slides in over content (not pushing it) */
  .sidebar-wrapper {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    margin-left: 0 !important;
    width: 280px;
  }

  /* When sidebar is open on mobile (wrapper NOT collapsed) */
  #wrapper:not(.sidebar-collapsed) .sidebar-wrapper {
    transform: translateX(0);
  }

  /* Main content always fills full width on mobile */
  .main-content {
    margin-left: 0 !important;
  }

  /* Navbar brand: truncate long names */
  .navbar-brand {
    font-size: 1rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Page headers: stack on mobile */
  .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }

  /* Stat cards: 2 per row on mobile */
  .col-md-3, .col-md-4 {
    margin-bottom: 0.75rem;
  }

  /* Make filter forms stack on mobile */
  .row.g-3 > [class*="col-md-"] {
    min-width: 100%;
  }

  /* Tables: ensure horizontal scroll */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  /* Reduce container padding on mobile */
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Cards: reduce padding on mobile */
  .card-body {
    padding: 1rem;
  }

  /* Buttons in page headers: full width on mobile */
  .page-header .btn,
  .d-flex.justify-content-between .btn {
    width: 100%;
  }

  /* Pagination: reduce size on mobile */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-link {
    padding: 0.375rem 0.65rem;
    font-size: 0.875rem;
  }

  /* Footer: adjust margin */
  footer {
    margin-left: 0 !important;
  }
}

/* Tablet breakpoint (768px - 991px): sidebar visible but content adjusts */
@media (min-width: 768px) and (max-width: 991.98px) {
  :root {
    --sidebar-width: 200px;
  }
}

/* Stats cards: 2-per-row on small tablets */
@media (max-width: 575.98px) {
  .stats-card-1,
  .stats-card-2,
  .stats-card-3,
  .stats-card-4 {
    font-size: 0.9rem;
  }

  h1.h2 {
    font-size: 1.3rem;
  }

  h1.h3 {
    font-size: 1.1rem;
  }

  /* Shrink table font on very small screens */
  .table {
    font-size: 0.8rem;
  }

  .table td, .table th {
    padding: 0.4rem 0.5rem;
  }

  /* btn-group stacks vertically on xs */
  .btn-group {
    flex-wrap: wrap;
    gap: 2px;
  }

  .btn-group .btn {
    border-radius: 0.375rem !important;
  }
}
