/* ================================================================
   SALMA TEXTILES — Enterprise Admin Design System
   Inspired by Stripe, Linear, Vercel, GitHub, Supabase
   ================================================================ */

/* ---- Design Tokens ---- */
:root {
  --st-bg: #f6f8fa;
  --st-bg-card: #ffffff;
  --st-bg-subtle: #f0f2f5;
  --st-bg-hover: #f3f4f6;
  --st-bg-active: #e8eaed;

  --st-text-primary: #101214;
  --st-text-secondary: #5f6b7a;
  --st-text-tertiary: #8b95a1;
  --st-text-placeholder: #aeb6c0;
  --st-text-inverse: #ffffff;

  --st-border: #e4e7ec;
  --st-border-light: #f0f2f5;
  --st-border-focus: #700109;

  --st-accent: #700109;
  --st-accent-hover: #8a020d;
  --st-accent-light: rgba(112, 1, 9, 0.08);
  --st-accent-medium: rgba(112, 1, 9, 0.15);
  --st-accent-gradient: linear-gradient(135deg, #700109 0%, #a3050d 100%);

  --st-success: #0d9373;
  --st-success-bg: #e6f7f2;
  --st-warning: #b87503;
  --st-warning-bg: #fff8e6;
  --st-danger: #d92d20;
  --st-danger-bg: #fef3f2;
  --st-info: #175cd3;
  --st-info-bg: #eef5ff;

  --st-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --st-shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --st-shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --st-shadow-xl: 0 20px 60px rgba(0,0,0,0.12);

  --st-radius-sm: 6px;
  --st-radius-md: 10px;
  --st-radius-lg: 14px;
  --st-radius-xl: 18px;

  --st-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --st-font-mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', monospace;

  --st-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --st-transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base ---- */
body {
  font-family: var(--st-font);
  background: var(--st-bg);
  color: var(--st-text-primary);
  font-size: 0.875rem;
  line-height: 1.5715;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--st-accent-light);
  color: var(--st-accent);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---- Layout ---- */
#main-wrapper { background: var(--st-bg); }
.content-body { padding: 1.5rem 0; }
.container-fluid { padding-left: 1.5rem; padding-right: 1.5rem; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-sm);
  background: var(--st-bg-card);
  transition: box-shadow var(--st-transition);
}
.card:hover { box-shadow: var(--st-shadow-md); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--st-border-light);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-header:empty { display: none; }
.card-title,
.card-header h4,
.card-header .card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--st-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-body { padding: 1.25rem; }
.card-footer {
  background: transparent;
  border-top: 1px solid var(--st-border-light);
  padding: 0.875rem 1.25rem;
}

/* ---- Page Header ---- */
.page-titles.form-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.page-titles h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--st-text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0 0 0.5rem;
}
.breadcrumb-item { font-size: 0.8125rem; }
.breadcrumb-item a { color: var(--st-accent); text-decoration: none; font-weight: 500; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--st-text-tertiary); }

/* ================================================================
   TABLES
   ================================================================ */
.table-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-sm);
  background: var(--st-bg-card);
  overflow: hidden;
}
.table-card .tc-hdr {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--st-border-light);
}
.table-card .tc-hdr h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--st-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table {
  --bs-table-bg: transparent;
  margin: 0;
}
.table > :not(caption) > * > * {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--st-border-light);
  vertical-align: middle;
}
.table > thead > tr > * {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-text-tertiary);
  background: var(--st-bg-subtle);
  border-bottom: 1px solid var(--st-border);
  white-space: nowrap;
  padding: 0.625rem 1rem;
}
.table > tbody > tr > * {
  font-size: 0.875rem;
  color: var(--st-text-primary);
  padding: 0.75rem 1rem;
}
.table > tbody > tr:last-child > * { border-bottom: none; }
.table > tbody > tr:hover > * { background: var(--st-bg-hover); }
.table > tbody > tr.selected > * { background: var(--st-accent-light); }

/* ---- DataTables refinements ---- */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 0.75rem;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--st-border) !important;
  border-radius: var(--st-radius-md) !important;
  padding: 0.4rem 0.75rem !important;
  font-size: 0.8125rem !important;
  background: var(--st-bg-card) !important;
  color: var(--st-text-primary) !important;
}
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--st-accent) !important;
  box-shadow: 0 0 0 3px var(--st-accent-light) !important;
  outline: none !important;
}
.dataTables_wrapper .dataTables_paginate {
  margin-top: 0.75rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid var(--st-border) !important;
  border-radius: var(--st-radius-sm) !important;
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8125rem !important;
  color: var(--st-text-secondary) !important;
  background: transparent !important;
  margin: 0 1px !important;
  transition: all var(--st-transition) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--st-bg-hover) !important;
  border-color: var(--st-border) !important;
  color: var(--st-text-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--st-accent) !important;
  border-color: var(--st-accent) !important;
  color: var(--st-text-inverse) !important;
}
.dataTables_wrapper .dataTables_info {
  font-size: 0.8125rem;
  color: var(--st-text-tertiary);
  padding-top: 0.75rem;
}
table.dataTable.display tbody tr.odd > * { background: transparent; }
table.dataTable.display tbody tr:hover > * { background: var(--st-bg-hover); }
table.dataTable.display tbody tr.even > * { background: transparent; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  border-radius: var(--st-radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  transition: all var(--st-transition);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--st-accent);
  border-color: var(--st-accent);
  color: var(--st-text-inverse);
}
.btn-primary:hover {
  background: var(--st-accent-hover);
  border-color: var(--st-accent-hover);
  box-shadow: 0 2px 8px rgba(112,1,9,0.25);
  color: var(--st-text-inverse);
  transform: translateY(-1px);
}
.btn-primary:focus { box-shadow: 0 0 0 3px var(--st-accent-medium); }

.btn-success {
  background: var(--st-success);
  border-color: var(--st-success);
  color: var(--st-text-inverse);
}
.btn-success:hover {
  background: #0b7f63;
  border-color: #0b7f63;
  box-shadow: 0 2px 8px rgba(13,147,115,0.25);
  color: var(--st-text-inverse);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--st-danger);
  border-color: var(--st-danger);
  color: var(--st-text-inverse);
}
.btn-danger:hover {
  background: #c1231a;
  border-color: #c1231a;
  box-shadow: 0 2px 8px rgba(217,45,32,0.25);
  color: var(--st-text-inverse);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--st-warning);
  border-color: var(--st-warning);
  color: var(--st-text-inverse);
}
.btn-warning:hover {
  background: #a06503;
  border-color: #a06503;
  box-shadow: 0 2px 8px rgba(184,117,3,0.25);
  color: var(--st-text-inverse);
  transform: translateY(-1px);
}

.btn-info {
  background: var(--st-info);
  border-color: var(--st-info);
  color: var(--st-text-inverse);
}
.btn-info:hover {
  background: #124ab3;
  border-color: #124ab3;
  box-shadow: 0 2px 8px rgba(23,92,211,0.25);
  color: var(--st-text-inverse);
  transform: translateY(-1px);
}

.btn-light {
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  color: var(--st-text-secondary);
}
.btn-light:hover {
  background: var(--st-bg-hover);
  border-color: var(--st-border);
  color: var(--st-text-primary);
}

.btn-outline-primary {
  border: 1px solid var(--st-accent);
  color: var(--st-accent);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--st-accent);
  color: var(--st-text-inverse);
  border-color: var(--st-accent);
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--st-radius-sm);
}
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--st-radius-sm);
  line-height: 1.5;
}
.btn-lg {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--st-radius-md);
}

.btn-rounded { border-radius: 100px; }
.btn-link {
  color: var(--st-accent);
  text-decoration: none;
  border: none;
  background: transparent;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; color: var(--st-accent-hover); }

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---- Sharp icon buttons ---- */
.btn.shadow.btn-xs.sharp,
.sharp {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--st-radius-sm);
  border: none;
}
.btn-success.sharp { background: var(--st-success-bg); color: var(--st-success); }
.btn-success.sharp:hover { background: var(--st-success); color: #fff; }
.btn-danger.sharp { background: var(--st-danger-bg); color: var(--st-danger); }
.btn-danger.sharp:hover { background: var(--st-danger); color: #fff; }
.btn-info.sharp { background: var(--st-info-bg); color: var(--st-info); }
.btn-info.sharp:hover { background: var(--st-info); color: #fff; }
.btn-warning.sharp { background: var(--st-warning-bg); color: var(--st-warning); }
.btn-warning.sharp:hover { background: var(--st-warning); color: #fff; }
.btn-secondary.sharp { background: var(--st-bg-subtle); color: var(--st-text-secondary); }
.btn-secondary.sharp:hover { background: var(--st-text-tertiary); color: #fff; }

/* ================================================================
   FORM CONTROLS
   ================================================================ */
.form-control,
.form-select {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-md);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  color: var(--st-text-primary);
  background: var(--st-bg-card);
  transition: all var(--st-transition);
  line-height: 1.5;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 3px var(--st-accent-light);
  outline: none;
}
.form-control::placeholder { color: var(--st-text-placeholder); }
.form-control:disabled,
.form-select:disabled { background: var(--st-bg-subtle); opacity: 0.6; }
.form-control-lg { padding: 0.625rem 1rem; font-size: 1rem; }
.form-control-sm { padding: 0.3rem 0.625rem; font-size: 0.8125rem; }

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--st-text-primary);
  margin-bottom: 0.375rem;
  display: block;
}
.form-text {
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
  margin-top: 0.25rem;
}

.form-check {
  min-height: 1.25rem;
  padding-left: 1.75rem;
  margin-bottom: 0.375rem;
}
.form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  margin-left: -1.75rem;
  border: 1.5px solid var(--st-border);
  border-radius: 4px;
  transition: all var(--st-transition);
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--st-accent);
  border-color: var(--st-accent);
}
.form-check-input:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 3px var(--st-accent-light);
  outline: none;
}
.form-check-label { font-size: 0.875rem; cursor: pointer; }

.form-switch .form-check-input {
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 100px;
  margin-left: -2.5rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  background-position: left center;
  border: 1px solid var(--st-border);
  background-color: var(--st-bg-subtle);
  transition: all var(--st-transition);
}
.form-switch .form-check-input:checked {
  background-position: right center;
  background-color: var(--st-accent);
  border-color: var(--st-accent);
}

.form-select {
  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='%235f6b7a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
  appearance: none;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* ---- Validation ---- */
.form-control.is-invalid,
.was-validated .form-control:invalid {
  border-color: var(--st-danger);
  box-shadow: 0 0 0 3px var(--st-danger-bg);
}
.invalid-feedback,
.text-danger {
  font-size: 0.8125rem;
  color: var(--st-danger);
  margin-top: 0.25rem;
}

/* ---- Bootstrap Select ---- */
.bootstrap-select .btn {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-md);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  background: var(--st-bg-card) !important;
  color: var(--st-text-primary) !important;
}
.bootstrap-select .btn:focus {
  border-color: var(--st-accent) !important;
  box-shadow: 0 0 0 3px var(--st-accent-light) !important;
}
.bootstrap-select .dropdown-menu {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-md);
  box-shadow: var(--st-shadow-lg);
  padding: 0.375rem;
}
.bootstrap-select .dropdown-item {
  border-radius: var(--st-radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: var(--st-text-primary);
}
.bootstrap-select .dropdown-item:hover,
.bootstrap-select .dropdown-item.active {
  background: var(--st-bg-hover);
  color: var(--st-text-primary);
}
.bootstrap-select .dropdown-item.selected { background: var(--st-accent-light); color: var(--st-accent); }
.bootstrap-select .dropdown-toggle .filter-option-inner-inner { color: var(--st-text-primary); }
.bootstrap-select .bs-ok-default::after { border-color: var(--st-accent); }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.2em 0.65em;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.4;
}
.badge-primary { background: var(--st-accent-light); color: var(--st-accent); }
.badge-success { background: var(--st-success-bg); color: var(--st-success); }
.badge-warning { background: var(--st-warning-bg); color: var(--st-warning); }
.badge-danger { background: var(--st-danger-bg); color: var(--st-danger); }
.badge-info { background: var(--st-info-bg); color: var(--st-info); }
.badge-dark { background: var(--st-bg-subtle); color: var(--st-text-primary); }
.badge-light { background: var(--st-bg-subtle); color: var(--st-text-secondary); }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  border: none;
  border-radius: var(--st-radius-md);
  padding: 0.875rem 1.125rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-success { background: var(--st-success-bg); color: #065f46; }
.alert-danger { background: var(--st-danger-bg); color: #991b1b; }
.alert-warning { background: var(--st-warning-bg); color: #92400e; }
.alert-info { background: var(--st-info-bg); color: #1e40af; }
.alert-dismissible .btn-close { padding: 1rem; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-content {
  border: none;
  border-radius: var(--st-radius-xl);
  box-shadow: var(--st-shadow-xl);
  overflow: hidden;
}
.modal-header {
  border-bottom: 1px solid var(--st-border-light);
  padding: 1.125rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header .modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--st-text-primary);
}
.modal-header .close,
.modal-header .btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--st-bg-subtle);
  border: none;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  color: var(--st-text-secondary);
  transition: all var(--st-transition);
  padding: 0;
  line-height: 1;
}
.modal-header .close:hover,
.modal-header .btn-close:hover {
  background: var(--st-bg-hover);
  color: var(--st-text-primary);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  border-top: 1px solid var(--st-border-light);
  padding: 1rem 1.5rem;
  gap: 0.5rem;
}
.modal-backdrop { background: rgba(0,0,0,0.5); }

/* ================================================================
   DROPDOWNS
   ================================================================ */
.dropdown-menu {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-lg);
  padding: 0.375rem;
  background: var(--st-bg-card);
}
.dropdown-item {
  border-radius: var(--st-radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--st-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--st-transition);
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--st-bg-hover);
  color: var(--st-text-primary);
}
.dropdown-item:active { background: var(--st-accent-light); color: var(--st-accent); }
.dropdown-divider {
  border-top: 1px solid var(--st-border-light);
  margin: 0.25rem 0;
}
.dropdown-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-text-tertiary);
  padding: 0.5rem 0.75rem;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  gap: 2px;
}
.page-link {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  background: var(--st-bg-card);
  transition: all var(--st-transition);
}
.page-link:hover {
  background: var(--st-bg-hover);
  border-color: var(--st-border);
  color: var(--st-text-primary);
}
.page-item.active .page-link {
  background: var(--st-accent);
  border-color: var(--st-accent);
  color: var(--st-text-inverse);
}
.page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
}

/* ================================================================
   NAV TABS
   ================================================================ */
.nav-tabs {
  border-bottom: 1px solid var(--st-border);
  gap: 0;
}
.nav-tabs .nav-link {
  border: none;
  color: var(--st-text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  position: relative;
  background: transparent;
  transition: color var(--st-transition);
}
.nav-tabs .nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--st-accent);
  transition: transform var(--st-transition);
}
.nav-tabs .nav-link:hover { color: var(--st-text-primary); }
.nav-tabs .nav-link:hover::after { transform: translateX(-50%) scaleX(0.6); }
.nav-tabs .nav-link.active {
  color: var(--st-accent);
  background: transparent;
}
.nav-tabs .nav-link.active::after { transform: translateX(-50%) scaleX(1); }

/* ================================================================
   SIDEBAR
   ================================================================ */
.deznav {
  background: var(--st-bg-card);
  border-right: 1px solid var(--st-border);
}

.sidebar-brand {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--st-border-light);
  margin-bottom: 0.25rem;
}

.deznav .metismenu {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.deznav .metismenu > li {
  padding: 0 0.625rem;
  margin-bottom: 1px;
}

.deznav .metismenu > li > a {
  border-radius: var(--st-radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  transition: all var(--st-transition);
  display: flex;
  align-items: center;
  gap: 0;
}

.deznav .metismenu > li > a:hover {
  color: var(--st-accent);
  background: var(--st-accent-light);
}
.deznav .metismenu > li > a:hover > i {
  color: var(--st-text-inverse);
  background: var(--st-accent);
  border-color: var(--st-accent);
}

.deznav .metismenu > li.mm-active > a {
  color: var(--st-accent);
  background: var(--st-accent-light);
  font-weight: 600;
}
.deznav .metismenu > li.mm-active > a > i {
  color: var(--st-text-inverse);
  background: var(--st-accent);
  border-color: var(--st-accent);
}

.deznav .metismenu > li a > i {
  font-size: 1rem;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: var(--st-radius-sm);
  background: transparent;
  margin-right: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--st-text-tertiary);
  transition: all var(--st-transition);
  border: 1px solid transparent;
}

.deznav .metismenu > li > a .nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deznav .metismenu .nav-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-text-tertiary);
  padding: 1.25rem 1.25rem 0.35rem;
  margin-top: 0.125rem;
}

.deznav .metismenu .has-arrow::after {
  right: 0.75rem;
  opacity: 0.3;
  font-size: 0.625rem;
  transition: transform var(--st-transition);
}
.deznav .metismenu .has-arrow[aria-expanded="true"]::after,
.deznav .metismenu .mm-active > .has-arrow::after {
  transform: rotate(-180deg);
}

.deznav .metismenu ul {
  background: transparent;
  padding: 0.125rem 0 0.375rem 1.75rem;
}
.deznav .metismenu ul a {
  border-radius: var(--st-radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  transition: all var(--st-transition);
  padding-left: 3.25rem;
  position: relative;
}
.deznav .metismenu ul a::before {
  content: '';
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--st-text-tertiary);
  transition: all var(--st-transition);
}
.deznav .metismenu ul a:hover,
.deznav .metismenu ul a.mm-active {
  color: var(--st-accent);
  background: var(--st-accent-light);
}
.deznav .metismenu ul a:hover::before,
.deznav .metismenu ul a.mm-active::before {
  background: var(--st-accent);
  transform: translateY(-50%) scale(1.5);
}

.copyright {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--st-border-light);
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
  text-align: center;
}

/* ================================================================
   HEADER / TOPBAR
   ================================================================ */
.nav-header {
  height: 64px;
  border-bottom: 1px solid var(--st-border);
  background: var(--st-bg-card);
}
.nav-header .brand-logo {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.25rem;
}
.nav-header .brand-logo img { height: 36px; }

.header {
  height: 64px;
  background: var(--st-bg-card);
  border-bottom: 1px solid var(--st-border);
}
.header-content { height: 100%; }
.header .navbar { height: 100%; }

.search-area {
  background: var(--st-bg-subtle);
  border-radius: var(--st-radius-md);
  overflow: hidden;
  border: 1px solid transparent;
  transition: all var(--st-transition);
}
.search-area:focus-within {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 3px var(--st-accent-light);
  background: var(--st-bg-card);
}
.search-area .input-group-text {
  background: transparent;
  border: none;
  padding-left: 0.875rem;
  color: var(--st-text-tertiary);
}
.search-area .form-control {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  min-width: 240px;
  font-size: 0.875rem;
  box-shadow: none;
}
.search-area .form-control:focus { box-shadow: none; }

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--st-radius-md);
  background: var(--st-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: var(--st-text-secondary);
  transition: all var(--st-transition);
  position: relative;
  cursor: pointer;
}
.header-icon-btn:hover {
  background: var(--st-bg-hover);
  color: var(--st-text-primary);
}
.header-icon-btn .icon-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--st-accent);
  color: var(--st-text-inverse);
  font-size: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
}

.header-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  border-radius: var(--st-radius-md);
  background: var(--st-bg-subtle);
  border: none;
  cursor: pointer;
  transition: all var(--st-transition);
  text-decoration: none;
  color: inherit;
}
.header-profile-btn:hover {
  background: var(--st-bg-hover);
}
.header-profile-btn .avatar-initial {
  width: 32px;
  height: 32px;
  border-radius: var(--st-radius-sm);
  background: var(--st-accent);
  color: var(--st-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  flex-shrink: 0;
}
.header-profile-btn .avatar-img {
  width: 32px;
  height: 32px;
  border-radius: var(--st-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.header-profile-btn .profile-info {
  line-height: 1.3;
}
.header-profile-btn .profile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--st-text-primary);
  display: block;
}
.header-profile-btn .profile-role {
  font-size: 0.6875rem;
  color: var(--st-text-tertiary);
  display: block;
}

/* Notification dropdown */
.notif-dropdown {
  width: 340px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-xl);
  box-shadow: var(--st-shadow-xl);
  padding: 0;
  overflow: hidden;
}
.notif-dropdown .notif-header {
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--st-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-dropdown .notif-header h6 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  color: var(--st-text-primary);
}
.notif-dropdown .notif-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.125rem;
  text-decoration: none;
  color: inherit;
  transition: background var(--st-transition);
  border-bottom: 1px solid var(--st-border-light);
}
.notif-dropdown .notif-item:last-of-type { border-bottom: none; }
.notif-dropdown .notif-item:hover { background: var(--st-bg-hover); }
.notif-dropdown .notif-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--st-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.notif-dropdown .notif-text { flex: 1; min-width: 0; }
.notif-dropdown .notif-text p {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--st-text-primary);
  line-height: 1.4;
}
.notif-dropdown .notif-text small {
  font-size: 0.6875rem;
  color: var(--st-text-tertiary);
}
.notif-dropdown .notif-footer {
  display: block;
  padding: 0.75rem 1.125rem;
  border-top: 1px solid var(--st-border-light);
  text-align: center;
  color: var(--st-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--st-transition);
}
.notif-dropdown .notif-footer:hover { background: var(--st-accent-light); }

/* Profile dropdown */
.profile-dropdown {
  min-width: 230px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-xl);
  box-shadow: var(--st-shadow-xl);
  padding: 0;
  overflow: hidden;
}
.profile-dropdown .dropdown-item {
  border-radius: var(--st-radius-sm);
  margin: 1px 0;
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
}
.profile-dropdown .dropdown-item i {
  font-size: 0.9375rem;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  border-top: 1px solid var(--st-border-light);
  padding: 0.875rem 1.5rem;
  background: var(--st-bg-card);
}
.footer .copyright {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: none;
  padding: 0;
  margin: 0;
}
.footer .copyright p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-tertiary);
}
.footer .copyright a {
  color: var(--st-accent);
  text-decoration: none;
  font-weight: 500;
}
.footer .copyright a:hover { text-decoration: underline; }

/* ================================================================
   PRELOADER
   ================================================================ */
#preloader { background: var(--st-bg-card); }

/* ================================================================
   RESPONSIVE & UTILITY REFINEMENTS
   ================================================================ */

/* Page title action buttons */
.page-titles .btn i { font-size: 0.875rem; }

/* Image in tables */
.table img[style*="50px"],
.table img[width="50"] {
  border-radius: var(--st-radius-sm);
  object-fit: cover;
}

/* Avatar initials in tables */
.user-avatar-initial {
  width: 32px;
  height: 32px;
  border-radius: var(--st-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--st-text-inverse);
  flex-shrink: 0;
}

/* Badge-style status indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge.status-completed,
.status-badge.status-approved { background: var(--st-success-bg); color: var(--st-success); }
.status-badge.status-pending { background: var(--st-warning-bg); color: var(--st-warning); }
.status-badge.status-rejected,
.status-badge.status-failed { background: var(--st-danger-bg); color: var(--st-danger); }

/* Sweetalert2 overrides */
.swal2-popup {
  border-radius: var(--st-radius-xl) !important;
  padding: 1.5rem !important;
}
.swal2-title { font-size: 1.125rem !important; color: var(--st-text-primary) !important; }
.swal2-confirm { border-radius: var(--st-radius-md) !important; }
.swal2-cancel { border-radius: var(--st-radius-md) !important; }

/* Toastr overrides */
.toast { border-radius: var(--st-radius-md) !important; }
.toast-success { background: var(--st-success) !important; }
.toast-error { background: var(--st-danger) !important; }

/* Responsive sidebar tweaks */
@media (max-width: 1199px) {
  .deznav .metismenu > li a > i {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 0.875rem;
  }
  .deznav .metismenu ul a { padding-left: 2.75rem; }
}
@media (max-width: 767px) {
  .container-fluid { padding-left: 1rem; padding-right: 1rem; }
  .content-body { padding: 1rem 0; }
  .card-body { padding: 1rem; }
  .table > :not(caption) > * > * { padding: 0.5rem 0.75rem; }
  .page-titles h2 { font-size: 1.125rem; }
}

/* ---- Minimal scrollbar for dropdowns ---- */
.dropdown-menu.dz-scroll {
  scrollbar-width: thin;
}

/* ================================================================
   DARK MODE (Night Mode) — [data-theme-version="dark"]
   ================================================================ */
[data-theme-version="dark"] {
  --st-bg: #0f1115;
  --st-bg-card: #161a20;
  --st-bg-subtle: #1d222a;
  --st-bg-hover: #20262e;
  --st-bg-active: #262d36;

  --st-text-primary: #e6e9ee;
  --st-text-secondary: #a3adba;
  --st-text-tertiary: #6b7684;
  --st-text-placeholder: #4d5663;
  --st-text-inverse: #ffffff;

  --st-border: #262d36;
  --st-border-light: #1d222a;
  --st-border-focus: #c20a12;

  --st-accent: #e0454e;
  --st-accent-hover: #f0575f;
  --st-accent-light: rgba(224, 69, 78, 0.12);
  --st-accent-medium: rgba(224, 69, 78, 0.22);
  --st-accent-gradient: linear-gradient(135deg, #700109 0%, #c20a12 100%);

  --st-success: #2fbf8f;
  --st-success-bg: rgba(47, 191, 143, 0.12);
  --st-warning: #e6a23c;
  --st-warning-bg: rgba(230, 162, 60, 0.12);
  --st-danger: #f0524a;
  --st-danger-bg: rgba(240, 82, 74, 0.12);
  --st-info: #5b8ef2;
  --st-info-bg: rgba(91, 142, 242, 0.12);

  --st-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --st-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --st-shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --st-shadow-xl: 0 20px 60px rgba(0,0,0,0.6);
}

[data-theme-version="dark"] body,
[data-theme-version="dark"] #main-wrapper { background: var(--st-bg); }

[data-theme-version="dark"] ::-webkit-scrollbar-thumb { background: #3a4350; }
[data-theme-version="dark"] ::-webkit-scrollbar-thumb:hover { background: #4d5663; }

/* Cards */
[data-theme-version="dark"] .card,
[data-theme-version="dark"] .table-card,
[data-theme-version="dark"] .modal-content { background: var(--st-bg-card); border-color: var(--st-border); }
[data-theme-version="dark"] .card-header,
[data-theme-version="dark"] .card-footer,
[data-theme-version="dark"] .table-card .tc-hdr { background: transparent; border-color: var(--st-border-light); }

/* Tables */
[data-theme-version="dark"] .table { --bs-table-bg: transparent; color: var(--st-text-primary); }
[data-theme-version="dark"] .table > thead > tr > * {
  background: var(--st-bg-subtle);
  color: var(--st-text-tertiary);
  border-color: var(--st-border);
}
[data-theme-version="dark"] .table > tbody > tr > * { color: var(--st-text-primary); border-color: var(--st-border-light); }
[data-theme-version="dark"] .table > tbody > tr:hover > * { background: var(--st-bg-hover); }
[data-theme-version="dark"] .dataTables_wrapper .dataTables_length select,
[data-theme-version="dark"] .dataTables_wrapper .dataTables_filter input { background: var(--st-bg-card) !important; color: var(--st-text-primary) !important; border-color: var(--st-border) !important; }
[data-theme-version="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button { color: var(--st-text-secondary) !important; border-color: var(--st-border) !important; }
[data-theme-version="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--st-bg-hover) !important; color: var(--st-text-primary) !important; }

/* Buttons */
[data-theme-version="dark"] .btn-light { background: var(--st-bg-subtle); border-color: var(--st-border); color: var(--st-text-secondary); }
[data-theme-version="dark"] .btn-light:hover { background: var(--st-bg-hover); color: var(--st-text-primary); }
[data-theme-version="dark"] .btn-outline-secondary { color: var(--st-text-secondary); border-color: var(--st-border); }
[data-theme-version="dark"] .btn-outline-secondary:hover { background: var(--st-bg-hover); color: var(--st-text-primary); border-color: var(--st-border); }
[data-theme-version="dark"] .btn-secondary.sharp { background: var(--st-bg-subtle); color: var(--st-text-secondary); }

/* Forms */
[data-theme-version="dark"] .form-control,
[data-theme-version="dark"] .form-select {
  background: var(--st-bg-card);
  border-color: var(--st-border);
  color: var(--st-text-primary);
}
[data-theme-version="dark"] .form-control:focus,
[data-theme-version="dark"] .form-select:focus { border-color: var(--st-accent); box-shadow: 0 0 0 3px var(--st-accent-light); }
[data-theme-version="dark"] .form-control::placeholder { color: var(--st-text-placeholder); }
[data-theme-version="dark"] .form-control:disabled,
[data-theme-version="dark"] .form-select:disabled { background: var(--st-bg-subtle); }
[data-theme-version="dark"] .form-check-input { background-color: var(--st-bg-subtle); border-color: var(--st-border); }
[data-theme-version="dark"] .input-group-text { background: var(--st-bg-subtle); border-color: var(--st-border); color: var(--st-text-tertiary); }

/* Dropdowns */
[data-theme-version="dark"] .dropdown-menu { background: var(--st-bg-card); border-color: var(--st-border); }
[data-theme-version="dark"] .dropdown-item { color: var(--st-text-primary); }
[data-theme-version="dark"] .dropdown-item:hover,
[data-theme-version="dark"] .dropdown-item:focus { background: var(--st-bg-hover); color: var(--st-text-primary); }
[data-theme-version="dark"] .dropdown-item:active { background: var(--st-accent-light); color: var(--st-accent); }
[data-theme-version="dark"] .dropdown-divider { border-color: var(--st-border-light); }
[data-theme-version="dark"] .dropdown-header { color: var(--st-text-tertiary); }

/* Bootstrap select */
[data-theme-version="dark"] .bootstrap-select .btn { background: var(--st-bg-card) !important; border-color: var(--st-border) !important; color: var(--st-text-primary) !important; }
[data-theme-version="dark"] .bootstrap-select .dropdown-menu { background: var(--st-bg-card) !important; }
[data-theme-version="dark"] .bootstrap-select .dropdown-item { color: var(--st-text-primary) !important; }
[data-theme-version="dark"] .bootstrap-select .dropdown-item:hover,
[data-theme-version="dark"] .bootstrap-select .dropdown-item.active { background: var(--st-bg-hover) !important; color: var(--st-text-primary) !important; }

/* Alerts */
[data-theme-version="dark"] .alert-success { background: var(--st-success-bg); color: #6ee7bd; }
[data-theme-version="dark"] .alert-danger { background: var(--st-danger-bg); color: #fca5a0; }
[data-theme-version="dark"] .alert-warning { background: var(--st-warning-bg); color: #f4c27a; }
[data-theme-version="dark"] .alert-info { background: var(--st-info-bg); color: #a8c3f7; }

/* Badges */
[data-theme-version="dark"] .badge-primary { background: var(--st-accent-light); color: var(--st-accent); }
[data-theme-version="dark"] .badge-success { background: var(--st-success-bg); color: #4ade80; }
[data-theme-version="dark"] .badge-warning { background: var(--st-warning-bg); color: var(--st-warning); }
[data-theme-version="dark"] .badge-danger { background: var(--st-danger-bg); color: var(--st-danger); }
[data-theme-version="dark"] .badge-info { background: var(--st-info-bg); color: var(--st-info); }
[data-theme-version="dark"] .badge-dark,
[data-theme-version="dark"] .badge-light { background: var(--st-bg-subtle); color: var(--st-text-secondary); }

/* Modals */
[data-theme-version="dark"] .modal-header,
[data-theme-version="dark"] .modal-footer { border-color: var(--st-border-light); }
[data-theme-version="dark"] .modal-title { color: var(--st-text-primary); }
[data-theme-version="dark"] .modal-header .close,
[data-theme-version="dark"] .modal-header .btn-close { background: var(--st-bg-subtle); color: var(--st-text-secondary); }
[data-theme-version="dark"] .modal-header .close:hover,
[data-theme-version="dark"] .modal-header .btn-close:hover { background: var(--st-bg-hover); color: var(--st-text-primary); }

/* Pagination */
[data-theme-version="dark"] .page-link { background: var(--st-bg-card); border-color: var(--st-border); color: var(--st-text-secondary); }
[data-theme-version="dark"] .page-link:hover { background: var(--st-bg-hover); color: var(--st-text-primary); border-color: var(--st-border); }

/* Nav tabs */
[data-theme-version="dark"] .nav-tabs { border-color: var(--st-border); }
[data-theme-version="dark"] .nav-tabs .nav-link { color: var(--st-text-secondary); }
[data-theme-version="dark"] .nav-tabs .nav-link:hover { color: var(--st-text-primary); }

/* Sidebar & header */
[data-theme-version="dark"] .deznav,
[data-theme-version="dark"] .nav-header,
[data-theme-version="dark"] .header,
[data-theme-version="dark"] .footer { background: var(--st-bg-card); border-color: var(--st-border); }
[data-theme-version="dark"] .sidebar-brand { border-color: var(--st-border-light); }
[data-theme-version="dark"] .deznav .metismenu > li > a { color: var(--st-text-secondary); }
[data-theme-version="dark"] .deznav .metismenu > li > a:hover { color: var(--st-accent); background: var(--st-accent-light); }
[data-theme-version="dark"] .deznav .metismenu > li.mm-active > a { color: var(--st-accent); background: var(--st-accent-light); }
[data-theme-version="dark"] .deznav .metismenu .nav-label { color: var(--st-text-tertiary); }
[data-theme-version="dark"] .deznav .metismenu ul a { color: var(--st-text-secondary); }
[data-theme-version="dark"] .deznav .metismenu ul a:hover,
[data-theme-version="dark"] .deznav .metismenu ul a.mm-active { color: var(--st-accent); background: var(--st-accent-light); }
[data-theme-version="dark"] .copyright { border-color: var(--st-border-light); color: var(--st-text-tertiary); }

/* Search & header controls */
[data-theme-version="dark"] .search-area { background: var(--st-bg-subtle); }
[data-theme-version="dark"] .search-area:focus-within { background: var(--st-bg-card); border-color: var(--st-accent); box-shadow: 0 0 0 3px var(--st-accent-light); }
[data-theme-version="dark"] .header-icon-btn { background: var(--st-bg-subtle); color: var(--st-text-secondary); }
[data-theme-version="dark"] .header-icon-btn:hover { background: var(--st-bg-hover); color: var(--st-text-primary); }
[data-theme-version="dark"] .header-profile-btn { background: var(--st-bg-subtle); }
[data-theme-version="dark"] .header-profile-btn:hover { background: var(--st-bg-hover); }
[data-theme-version="dark"] .header-profile-btn .profile-name { color: var(--st-text-primary); }
[data-theme-version="dark"] .header-profile-btn .profile-role { color: var(--st-text-tertiary); }

/* Notification & profile dropdowns */
[data-theme-version="dark"] .notif-dropdown,
[data-theme-version="dark"] .profile-dropdown { background: var(--st-bg-card); border-color: var(--st-border); }
[data-theme-version="dark"] .notif-dropdown .notif-header,
[data-theme-version="dark"] .notif-dropdown .notif-item,
[data-theme-version="dark"] .notif-dropdown .notif-footer { border-color: var(--st-border-light); }
[data-theme-version="dark"] .notif-dropdown .notif-item:hover { background: var(--st-bg-hover); }
[data-theme-version="dark"] .notif-dropdown .notif-text p { color: var(--st-text-primary); }
[data-theme-version="dark"] .notif-dropdown .notif-footer:hover { background: var(--st-accent-light); }

/* Text & utility */
[data-theme-version="dark"] .text-black { color: var(--st-text-primary) !important; }
[data-theme-version="dark"] .text-muted { color: var(--st-text-tertiary) !important; }
[data-theme-version="dark"] .text-primary { color: var(--st-accent) !important; }
[data-theme-version="dark"] .bg-white { background: var(--st-bg-card) !important; }
[data-theme-version="dark"] .bg-light { background: var(--st-bg-subtle) !important; }

/* Bootstrap component fixes for dark mode */
[data-theme-version="dark"] .table.table-striped > tbody > tr:nth-of-type(odd) > * { background: var(--st-bg-subtle); color: var(--st-text-primary); }
[data-theme-version="dark"] .table.table-hover > tbody > tr:hover > * { background: var(--st-bg-hover); color: var(--st-text-primary); }
[data-theme-version="dark"] .form-select option { background: var(--st-bg-card); color: var(--st-text-primary); }
[data-theme-version="dark"] select.form-select { color: var(--st-text-primary); }
[data-theme-version="dark"] .form-select:focus { border-color: var(--st-accent); box-shadow: 0 0 0 3px var(--st-accent-light); }
[data-theme-version="dark"] .input-group .form-control { border-color: var(--st-border); }
[data-theme-version="dark"] .list-group-item { background: var(--st-bg-card); border-color: var(--st-border); color: var(--st-text-primary); }
[data-theme-version="dark"] .progress { background: var(--st-bg-subtle); }
[data-theme-version="dark"] .card .text-secondary { color: var(--st-text-secondary) !important; }

/* ================================================================
   SIDEBAR SMOOTH TOGGLE ANIMATIONS
   ================================================================ */
#main-wrapper .deznav,
#main-wrapper .content-body,
#main-wrapper .header,
#main-wrapper .footer {
  transition: margin var(--st-transition-slow), width var(--st-transition-slow), transform var(--st-transition-slow), left var(--st-transition-slow);
}

#main-wrapper[data-sidebar-style="full"] .deznav { transition: margin var(--st-transition-slow), width var(--st-transition-slow); }
#main-wrapper .deznav .metismenu ul { transition: height var(--st-transition-slow); }

[data-sidebar-style="full"] .deznav { animation: sidebarIn var(--st-transition-slow) both; }
[data-sidebar-style="mini"] .deznav { animation: sidebarOut var(--st-transition-slow) both; }

@keyframes sidebarIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes sidebarOut {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* Hamburger animation */
.nav-control .hamburger { cursor: pointer; transition: transform var(--st-transition); }
.nav-control .hamburger.active { transform: rotate(180deg); }
.nav-control .hamburger .line { transition: all var(--st-transition); }
.nav-control .hamburger.active .line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-control .hamburger.active .line:nth-child(2) { opacity: 0; }
.nav-control .hamburger.active .line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Overlay sidebar on mobile */
body[data-sidebar-style="overlay"] .deznav { box-shadow: 0 0 60px rgba(0,0,0,0.25); }

/* Theme toggle button icon visibility */
.dz-theme-mode #icon-light { display: none; }
body[data-theme-version="dark"] .dz-theme-mode #icon-light { display: inline-block; }
body[data-theme-version="dark"] .dz-theme-mode #icon-dark { display: none; }

/* ================================================================
   DASHBOARD DARK MODE (home.blade.php custom design system)
   ================================================================ */
[data-theme-version="dark"] {
  --cr-gray-50: #161a20 !important;
  --cr-gray-100: #1d222a !important;
  --cr-gray-200: #262d36 !important;
  --cr-gray-400: #6b7684 !important;
  --cr-gray-500: #8b95a1 !important;
  --cr-gray-700: #c6ccd4 !important;
  --cr-gray-900: #e6e9ee !important;
}
[data-theme-version="dark"] .stat-card {
  background: var(--st-bg-card);
  border-color: var(--st-border);
}
[data-theme-version="dark"] .stat-label { color: var(--st-text-tertiary); }
[data-theme-version="dark"] .stat-value { color: var(--st-text-primary); }
[data-theme-version="dark"] .stat-body { background: transparent; }
[data-theme-version="dark"] .chart-card,
[data-theme-version="dark"] .table-card { background: var(--st-bg-card); border-color: var(--st-border); }
[data-theme-version="dark"] .quick-action {
  background: var(--st-bg-subtle);
  border-color: var(--st-border);
  color: var(--st-text-secondary);
}
[data-theme-version="dark"] .quick-action:hover { background: var(--st-bg-hover); color: var(--st-text-primary); }
[data-theme-version="dark"] .activity-item { border-color: var(--st-border-light); }
[data-theme-version="dark"] .act-text { color: var(--st-text-primary); }
[data-theme-version="dark"] .act-time { color: var(--st-text-tertiary); }
[data-theme-version="dark"] .qa-text { color: var(--st-text-primary); }
[data-theme-version="dark"] .section-title { color: var(--st-text-primary); }
[data-theme-version="dark"] .badge-date { background: var(--st-bg-subtle); color: var(--st-text-secondary); }

/* ================================================================
   EXTRA DARK MODE HARDCODED COLOR FIXES (common in admin views)
   ================================================================ */
[data-theme-version="dark"] .card .card-body { color: var(--st-text-primary); }
[data-theme-version="dark"] .dt-buttons .btn { background: var(--st-bg-subtle); border-color: var(--st-border); color: var(--st-text-secondary); }
[data-theme-version="dark"] .btn-group .btn { background: var(--st-bg-subtle); border-color: var(--st-border); color: var(--st-text-secondary); }
[data-theme-version="dark"] .btn-group .btn:hover { background: var(--st-bg-hover); color: var(--st-text-primary); }
[data-theme-version="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme-version="dark"] .dataTables_wrapper .dataTables_length select {
  background: var(--st-bg-subtle) !important;
  border-color: var(--st-border) !important;
  color: var(--st-text-primary) !important;
}
[data-theme-version="dark"] .sidebar-right { background: var(--st-bg-card); }
[data-theme-version="dark"] .nav-header .nav-control { background: transparent; }
[data-theme-version="dark"] .hamburger .line { background: var(--st-text-secondary); }

/* ---- Header profile enhancements ---- */
.header-profile-btn .profile-caret {
  font-size: 0.625rem;
  color: var(--st-text-tertiary);
  transition: transform var(--st-transition);
}
.header-profile-btn.show .profile-caret { transform: rotate(180deg); }
.profile-dropdown .dropdown-item {
  padding: 0.55rem 0.75rem;
  border-radius: var(--st-radius-md);
  margin: 1px 0;
}
.profile-dropdown .dropdown-item i { font-size: 0.9375rem; }
.profile-dropdown .dropdown-item:hover { background: var(--st-bg-hover); }
.profile-dropdown .dropdown-header { padding: 0; border-radius: var(--st-radius-xl) var(--st-radius-xl) 0 0; }
