/* ============================================================
   INVASTRO — DESIGN SYSTEM OVERRIDE
   Palette: Calm Clarity  |  Indigo + Neutral
   ============================================================ */


/* ── 1. BRAND TOKENS & VARIABLE RESET ───────────────────── */
:root {
  /* Primary — Indigo */
  --vz-primary:                  #6366f1;
  --vz-primary-rgb:              99, 102, 241;
  --vz-primary-text-emphasis:    #4338ca;
  --vz-primary-bg-subtle:        #eef2ff;
  --vz-primary-border-subtle:    #c7d2fe;

  /* Secondary — Soft indigo */
  --vz-secondary:                #818cf8;
  --vz-secondary-rgb:            129, 140, 248;
  --vz-secondary-text-emphasis:  #6366f1;
  --vz-secondary-bg-subtle:      #eef2ff;
  --vz-secondary-border-subtle:  #c7d2fe;

  /* Success — Emerald */
  --vz-success:                  #10b981;
  --vz-success-rgb:              16, 185, 129;
  --vz-success-text-emphasis:    #059669;
  --vz-success-bg-subtle:        #d1fae5;
  --vz-success-border-subtle:    #6ee7b7;

  /* Danger — Red */
  --vz-danger:                   #ef4444;
  --vz-danger-rgb:               239, 68, 68;
  --vz-danger-text-emphasis:     #dc2626;
  --vz-danger-bg-subtle:         #fee2e2;
  --vz-danger-border-subtle:     #fca5a5;

  /* Warning — Amber */
  --vz-warning:                  #f59e0b;
  --vz-warning-rgb:              245, 158, 11;
  --vz-warning-text-emphasis:    #d97706;
  --vz-warning-bg-subtle:        #fef3c7;
  --vz-warning-border-subtle:    #fcd34d;

  /* Info — Blue */
  --vz-info:                     #3b82f6;
  --vz-info-rgb:                 59, 130, 246;
  --vz-info-text-emphasis:       #2563eb;
  --vz-info-bg-subtle:           #dbeafe;
  --vz-info-border-subtle:       #93c5fd;

  /* Body & layout */
  --vz-body-bg:                  #fafafa;
  --vz-body-bg-rgb:              250, 250, 250;
  --vz-body-color:               #111827;
  --vz-body-color-rgb:           17, 24, 39;
  --vz-heading-color:            #111827;
  --vz-link-color:               #6366f1;
  --vz-link-color-rgb:           99, 102, 241;
  --vz-link-hover-color:         #4f46e5;
  --vz-link-hover-color-rgb:     79, 70, 229;
  --vz-border-color:             #e5e7eb;
  --vz-border-color-translucent: rgba(0, 0, 0, 0.07);

  /* Form validation */
  --vz-form-valid-border-color:   #10b981;
  --vz-form-invalid-border-color: #ef4444;

  /* Header */
  --vz-header-bg:                #ffffff;
  --vz-header-border:            #f3f4f6;
  --vz-header-item-color:        #374151;
  --vz-header-item-bg:           rgba(99, 102, 241, 0.08);
  --vz-header-item-sub-color:    #6b7280;
  --vz-topbar-search-bg:         #f5f3ff;
  --vz-topbar-search-color:      #374151;
  --vz-topbar-user-bg:           #f5f3ff;

  /* Footer */
  --vz-footer-bg:                #ffffff;
  --vz-footer-color:             #6b7280;

  /* Inputs */
  --vz-input-bg-custom:          #ffffff;
  --vz-input-border-custom:      #d1d5db;

  /* Tables */
  --vz-table-color:              #374151;
  --vz-table-hover-bg:           rgba(99, 102, 241, 0.03);
  --vz-table-active-bg:          rgba(99, 102, 241, 0.06);
  --vz-table-border-color:       #f3f4f6;
  --vz-table-striped-bg:         rgba(0, 0, 0, 0.012);

  /* Dropdowns */
  --vz-dropdown-bg:              #ffffff;
  --vz-dropdown-border-width:    1px;
  --vz-dropdown-link-color:      #374151;
  --vz-dropdown-link-hover-bg:   rgba(99, 102, 241, 0.06);
  --vz-dropdown-link-hover-color: #6366f1;
  --vz-dropdown-link-active-bg:  #6366f1;
  --vz-dropdown-link-active-color: #ffffff;

  /* Page title */
  --vz-page-title-box-shadow:    0 1px 3px rgba(0, 0, 0, 0.05);
  --vz-page-title-border:        none;
}


/* ── 2. BODY & BASE ──────────────────────────────────────── */
body {
  background-color: #fafafa;
  color: #111827;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-content {
  background-color: #fafafa;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #111827;
}

a {
  color: #6366f1;
}
a:hover {
  color: #4f46e5;
}


/* ── 3. CARDS ────────────────────────────────────────────── */
.card {
  background-color: #ffffff;
  border: 1px solid #f3f4f6 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04),
              0 1px 2px rgba(0, 0, 0, 0.03) !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid #f3f4f6;
  border-radius: 12px 12px 0 0 !important;
}
.card-footer {
  background-color: #ffffff;
  border-top: 1px solid #f3f4f6;
  border-radius: 0 0 12px 12px !important;
}
.card-animate:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.10),
              0 3px 10px rgba(0, 0, 0, 0.06) !important;
}


/* ── 4. BUTTONS ──────────────────────────────────────────── */
.btn {
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.18s ease;
}

/* Primary */
.btn-primary {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
}
.btn-primary:active,
.btn-primary.active {
  background-color: #4338ca !important;
  border-color: #4338ca !important;
}

/* Soft Primary */
.btn-soft-primary {
  background-color: #eef2ff !important;
  color: #6366f1 !important;
  border-color: transparent !important;
}
.btn-soft-primary:hover,
.btn-soft-primary:focus {
  background-color: #6366f1 !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
}

/* Success */
.btn-success {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
}
.btn-success:hover { background-color: #059669 !important; border-color: #059669 !important; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important; }

.btn-soft-success { background-color: #d1fae5 !important; color: #059669 !important; border-color: transparent !important; }
.btn-soft-success:hover { background-color: #10b981 !important; color: #fff !important; }

/* Danger */
.btn-danger {
  background-color: #ef4444 !important;
  border-color: #ef4444 !important;
}
.btn-danger:hover { background-color: #dc2626 !important; border-color: #dc2626 !important; box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important; }

.btn-soft-danger { background-color: #fee2e2 !important; color: #dc2626 !important; border-color: transparent !important; }
.btn-soft-danger:hover { background-color: #ef4444 !important; color: #fff !important; }

/* Warning */
.btn-warning {
  background-color: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
}
.btn-warning:hover { background-color: #d97706 !important; border-color: #d97706 !important; }

.btn-soft-warning { background-color: #fef3c7 !important; color: #d97706 !important; border-color: transparent !important; }
.btn-soft-warning:hover { background-color: #f59e0b !important; color: #fff !important; }

/* Info */
.btn-info {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}
.btn-info:hover { background-color: #2563eb !important; border-color: #2563eb !important; box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35) !important; }

.btn-soft-info { background-color: #dbeafe !important; color: #2563eb !important; border-color: transparent !important; }
.btn-soft-info:hover { background-color: #3b82f6 !important; color: #fff !important; }

/* Light */
.btn-light {
  background-color: #f9fafb !important;
  border-color: #e5e7eb !important;
  color: #374151 !important;
}
.btn-light:hover { background-color: #f3f4f6 !important; border-color: #d1d5db !important; }

/* Ghost (topbar icon buttons) */
.btn-ghost-secondary {
  color: #6b7280;
  transition: all 0.15s ease;
}
.btn-ghost-secondary:hover,
.btn-ghost-secondary:focus {
  background-color: rgba(99, 102, 241, 0.08) !important;
  color: #6366f1 !important;
}


/* ── 5. BADGES ───────────────────────────────────────────── */
.badge {
  border-radius: 6px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.badge.bg-primary,
.badge.rounded-pill.bg-primary   { background-color: #6366f1 !important; }
.badge.bg-success                { background-color: #10b981 !important; }
.badge.bg-danger                 { background-color: #ef4444 !important; }
.badge.bg-warning                { background-color: #f59e0b !important; }
.badge.bg-info                   { background-color: #3b82f6 !important; }

.badge.bg-primary-subtle,
.bg-primary-subtle               { background-color: #eef2ff !important; }
.badge.bg-success-subtle,
.bg-success-subtle               { background-color: #d1fae5 !important; }
.badge.bg-danger-subtle,
.bg-danger-subtle                { background-color: #fee2e2 !important; }
.badge.bg-warning-subtle,
.bg-warning-subtle               { background-color: #fef3c7 !important; }
.badge.bg-info-subtle,
.bg-info-subtle                  { background-color: #dbeafe !important; }

.text-primary   { color: #6366f1 !important; }
.text-success   { color: #10b981 !important; }
.text-danger    { color: #ef4444 !important; }
.text-warning   { color: #d97706 !important; }
.text-info      { color: #3b82f6 !important; }
.text-muted     { color: #6b7280 !important; }


/* ── 6. AVATAR / ICON CONTAINERS ─────────────────────────── */
.avatar-title {
  background-color: #6366f1;
  color: #ffffff;
}
.avatar-title.bg-primary      { background-color: #6366f1 !important; color: #fff !important; }
.avatar-title.bg-success      { background-color: #10b981 !important; color: #fff !important; }
.avatar-title.bg-danger       { background-color: #ef4444 !important; color: #fff !important; }
.avatar-title.bg-warning      { background-color: #f59e0b !important; color: #fff !important; }
.avatar-title.bg-info         { background-color: #3b82f6 !important; color: #fff !important; }
.avatar-title.bg-secondary    { background-color: #818cf8 !important; color: #fff !important; }

.avatar-title.bg-primary-subtle  { background-color: #eef2ff !important; }
.avatar-title.bg-success-subtle  { background-color: #d1fae5 !important; }
.avatar-title.bg-danger-subtle   { background-color: #fee2e2 !important; }
.avatar-title.bg-warning-subtle  { background-color: #fef3c7 !important; }
.avatar-title.bg-info-subtle     { background-color: #dbeafe !important; }


/* ── 7. FORMS ────────────────────────────────────────────── */
.form-control,
.form-select {
  border-color: #e5e7eb;
  border-radius: 8px;
  color: #111827;
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background-color: #ffffff;
  color: #111827;
}
.form-control::placeholder { color: #9ca3af; }
.form-label { color: #374151; font-weight: 500; }
.form-text  { color: #6b7280; }

.input-group-text {
  background-color: #f9fafb;
  border-color: #e5e7eb;
  color: #6b7280;
  border-radius: 8px;
}

/* Checkbox & radio */
.form-check-input:checked {
  background-color: #6366f1;
  border-color: #6366f1;
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  border-color: #6366f1;
}

/* Switch */
.form-switch .form-check-input:checked {
  background-color: #6366f1;
  border-color: #6366f1;
}


/* ── 8. TABLES ───────────────────────────────────────────── */
.table > :not(caption) > * > * {
  border-bottom-color: #f3f4f6;
  color: #374151;
}
.table > thead > tr > th {
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb !important;
}
.table-hover > tbody > tr:hover > * {
  background-color: rgba(99, 102, 241, 0.035);
}


/* ── 9. NAVIGATION TABS ──────────────────────────────────── */
.nav-tabs .nav-link.active,
.nav-tabs-custom .nav-link.active {
  color: #6366f1 !important;
  font-weight: 600;
}
.nav-tabs-custom .nav-link.active::after {
  background-color: #6366f1 !important;
}
/* All the hardcoded tab variants */
.nav-primary .nav-link.active,
.nav-primary.arrow-navtabs .nav-link.active {
  color: #6366f1 !important;
}
.nav-primary.arrow-navtabs .nav-link.active::before {
  border-top-color: #6366f1 !important;
}
.nav-tabs .nav-link:hover { color: #6366f1; }


/* ── 10. HEADER ──────────────────────────────────────────── */
#page-topbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid #f3f4f6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

.app-search .form-control {
  background-color: #f5f3ff;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #374151;
}
.app-search .form-control:focus {
  background-color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.app-search .search-widget-icon {
  color: #9ca3af;
}

.topbar-user .dropdown-menu {
  min-width: 200px;
}


/* ── 11. SIDEBAR ─────────────────────────────────────────── */
[data-sidebar="dark"] .app-menu,
[data-sidebar="dark"] .navbar-brand-box {
  background-color: #1e1e2e !important;
}

/* Nav links */
[data-sidebar="dark"] .navbar-menu .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.58) !important;
  border-radius: 8px;
  margin: 1px 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
[data-sidebar="dark"] .navbar-menu .navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.92) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}
[data-sidebar="dark"] .navbar-menu .navbar-nav .nav-link.active {
  color: #a5b4fc !important;
  background-color: rgba(99, 102, 241, 0.18) !important;
  font-weight: 500;
}
/* Collapse arrow color */
[data-sidebar="dark"] .navbar-menu .navbar-nav .nav-link[data-bs-toggle="collapse"]::after {
  color: rgba(255, 255, 255, 0.35) !important;
}

/* Sub-menu items */
[data-sidebar="dark"] .navbar-menu .navbar-nav .nav-item .collapse .nav-link {
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.48) !important;
  border-radius: 6px;
  padding-left: 44px;
}
[data-sidebar="dark"] .navbar-menu .navbar-nav .nav-item .collapse .nav-link:hover {
  color: rgba(255, 255, 255, 0.88) !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}
[data-sidebar="dark"] .navbar-menu .navbar-nav .nav-item .collapse .nav-link.active {
  color: #a5b4fc !important;
  background-color: rgba(99, 102, 241, 0.12) !important;
}

/* Section labels */
[data-sidebar="dark"] .menu-title {
  color: rgba(255, 255, 255, 0.25) !important;
  font-size: 10px !important;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700 !important;
  margin: 18px 20px 6px !important;
  padding: 0 !important;
}

/* Custom scrollbar in sidebar */
[data-sidebar="dark"] .simplebar-scrollbar::before {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* Sidebar border right separator */
[data-sidebar="dark"] .app-menu {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}


/* ── 12. DROPDOWNS ───────────────────────────────────────── */
.dropdown-menu {
  background-color: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08),
              0 2px 8px rgba(0, 0, 0, 0.04);
}
.dropdown-item {
  color: #374151;
  border-radius: 6px;
  margin: 1px 4px;
  padding: 7px 12px;
  width: calc(100% - 8px);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: rgba(99, 102, 241, 0.07) !important;
  color: #6366f1 !important;
}
.dropdown-item.active,
.dropdown-item:active {
  background-color: #6366f1 !important;
  color: #ffffff !important;
}
.dropdown-divider { border-color: #f3f4f6; }
.dropdown-header  { color: #9ca3af; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; }


/* ── 13. ALERTS ──────────────────────────────────────────── */
.alert { border-radius: 10px; border: 0; }
.alert-primary  { background-color: #eef2ff; color: #4338ca; border-left: 4px solid #6366f1; }
.alert-success  { background-color: #d1fae5; color: #059669; border-left: 4px solid #10b981; }
.alert-danger   { background-color: #fee2e2; color: #dc2626; border-left: 4px solid #ef4444; }
.alert-warning  { background-color: #fef3c7; color: #d97706; border-left: 4px solid #f59e0b; }
.alert-info     { background-color: #dbeafe; color: #2563eb; border-left: 4px solid #3b82f6; }


/* ── 14. PAGINATION ──────────────────────────────────────── */
.page-link {
  color: #6366f1;
  border-color: #e5e7eb;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.page-link:hover {
  color: #4f46e5;
  background-color: #eef2ff;
  border-color: #c7d2fe;
}
.page-item.active .page-link {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
}
.page-item.disabled .page-link { color: #d1d5db; border-color: #f3f4f6; }


/* ── 15. MODALS ──────────────────────────────────────────── */
.modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12),
              0 8px 24px rgba(0, 0, 0, 0.06);
}
.modal-header {
  border-bottom: 1px solid #f3f4f6;
  border-radius: 14px 14px 0 0;
  padding: 20px 24px;
}
.modal-body   { padding: 20px 24px; }
.modal-footer {
  border-top: 1px solid #f3f4f6;
  border-radius: 0 0 14px 14px;
  padding: 16px 24px;
}


/* ── 16. FOOTER ──────────────────────────────────────────── */
.footer {
  background-color: #ffffff;
  border-top: 1px solid #f3f4f6;
  color: #6b7280;
}


/* ── 17. BACK TO TOP ─────────────────────────────────────── */
#back-to-top {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
  border-radius: 8px;
}
#back-to-top:hover {
  background-color: #4f46e5 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}


/* ── 18. PROGRESS BARS ───────────────────────────────────── */
.progress { background-color: #f3f4f6; border-radius: 99px; }
.progress-bar                    { background-color: #6366f1; border-radius: 99px; }
.progress-bar.bg-success         { background-color: #10b981 !important; }
.progress-bar.bg-danger          { background-color: #ef4444 !important; }
.progress-bar.bg-warning         { background-color: #f59e0b !important; }
.progress-bar.bg-info            { background-color: #3b82f6 !important; }


/* ── 19. MISC UTILITY OVERRIDES ──────────────────────────── */
/* Dividers */
.border, [class*="border-"] { border-color: #e5e7eb !important; }
.border-top    { border-top-color:    #e5e7eb !important; }
.border-bottom { border-bottom-color: #e5e7eb !important; }
.border-start  { border-left-color:   #e5e7eb !important; }
.border-end    { border-right-color:  #e5e7eb !important; }

/* Subtle background utility */
.bg-light       { background-color: #f9fafb !important; }
.bg-light-subtle { background-color: #f5f3ff !important; }

/* Preloader */
.spinner-border.text-primary { color: #6366f1 !important; }


/* ── 20. PAGE TITLE BAR ──────────────────────────────────── */
.page-title-box {
  background-color: #ffffff;
  border-bottom: 1px solid #f3f4f6;
}
.page-title-box h4 { color: #111827; font-weight: 600; }


/* ── 21. SWEETALERT2 ─────────────────────────────────────── */
.swal2-confirm.btn-primary {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
}
.swal2-confirm.btn-primary:hover {
  background-color: #4f46e5 !important;
}


/* ── 22. CHOICES.JS SELECT ───────────────────────────────── */
.choices__inner {
  border-color: #e5e7eb !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices[data-type*="select-one"] .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: rgba(99, 102, 241, 0.07) !important;
  color: #6366f1 !important;
}


/* ── 23. NOTIFICATION BADGE ──────────────────────────────── */
#notification-badge.bg-danger {
  background-color: #ef4444 !important;
}


/* ── 24. SCROLLBAR (Webkit) ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
