/* ================================================================
   A D A P T E D   O C I S   D E S I G N   S Y S T E M
   Bootstrap 5.2 Full Override — Dark Medical UI + Persian Font
   Matches Ant Design Vue OCIS theme appearance
   ================================================================ */

/* ──────────────── Font Faces (IranSans) ──────────────── */
@import url('../fonts/iransans/400-pn.css');


/* ──────────────── CSS Variables (OCIS Token Mapping) ──────────────── */
:root {
  /* ── Background ── */
  --clr-bg:                #060a14;
  --clr-bg-elevated:       #0b1120;
  --clr-bg-sunken:         #040810;

  /* ── Primary (Blue) ── */
  --bs-primary:            #3b8df0;
  --bs-primary-rgb:        59,141,240;
  --clr-primary-light:     #5ea8ff;
  --clr-primary-dim:       rgba(59,141,240,0.12);
  --clr-primary-glow:      rgba(59,141,240,0.25);
  --clr-primary-hover:     #2a7de0;
  --clr-primary-active:    #1f6dd0;

  /* ── Accent (Deep navy) ── */
  --clr-accent:            #1e3a6e;
  --clr-accent-dim:        rgba(30,58,110,0.25);

  /* ── Secondary (Cyan) ── */
  --bs-secondary:          #22b8cf;
  --bs-secondary-rgb:      34,184,207;
  --clr-secondary-dim:     rgba(34,184,207,0.12);
  --clr-secondary-glow:    rgba(34,184,207,0.2);

  /* ── Success / Danger / Warning ── */
  --bs-success:            #2ecc71;
  --bs-success-rgb:        46,204,113;
  --clr-success-dim:       rgba(46,204,113,0.12);

  --bs-danger:             #e74c3c;
  --bs-danger-rgb:         231,76,60;
  --clr-danger-dim:        rgba(231,76,60,0.12);

  --bs-warning:            #f0a030;
  --bs-warning-rgb:        240,160,48;
  --clr-warning-dim:       rgba(240,160,48,0.12);

  --bs-info:               #3b8df0;
  --bs-info-rgb:           59,141,240;
  --clr-info-dim:          rgba(59,141,240,0.12);

  /* ── Light / Dark (utility aliases) ── */
  --bs-light:              #eaf1fb;
  --bs-light-rgb:          234,241,251;
  --bs-dark:               #040810;
  --bs-dark-rgb:           4,8,16;

  /* ── Text ── */
  --bs-body-color:         #c8d6e5;
  --theme-text:            #c8d6e5;
  --theme-text-sub:        #8899aa;
  --theme-text-muted:      #556677;
  --theme-text-bright:     #eaf1fb;
  --theme-text-dim:        rgba(200,214,229,0.45);

  /* ── Borders ── */
  --bs-border-color:       rgba(59,141,240,0.1);
  --theme-border:          rgba(59,141,240,0.1);
  --theme-border-hover:    rgba(59,141,240,0.22);
  --theme-border-focus:    rgba(59,141,240,0.4);
  --theme-border-subtle:   rgba(255,255,255,0.04);

  /* ── Surfaces / Glass ── */
  --theme-surface:         rgba(11,17,32,0.65);
  --theme-surface-solid:   #0f172a;
  --theme-surface-hover:   rgba(15,23,42,0.75);
  --theme-glass-blur:      18px;

  /* ── Border Radius ── */
  --theme-radius:          10px;
  --theme-radius-sm:       6px;
  --theme-radius-lg:       14px;
  --theme-radius-xl:       20px;
  --theme-radius-full:     9999px;

  /* ── Shadows ── */
  --theme-shadow-sm:       0 1px 3px rgba(0,0,0,0.3);
  --theme-shadow-md:       0 4px 12px rgba(0,0,0,0.35);
  --theme-shadow-lg:       0 8px 30px rgba(0,0,0,0.4);
  --theme-shadow-xl:       0 12px 48px rgba(0,0,0,0.5);
  --theme-shadow-glow:     0 0 20px var(--clr-primary-glow);

  /* ── Transitions ── */
  --theme-transition:       0.25s ease;
  --theme-transition-fast:  0.15s ease;
  --theme-transition-slow:  0.4s ease;

  /* ── Bootstrap core overrides ── */
  --bs-body-bg:            var(--clr-bg);
  --bs-body-color-rgb:     200,214,229;
  --bs-link-color:         var(--bs-primary);
  --bs-link-hover-color:   var(--clr-primary-light);
  --bs-border-radius:      var(--theme-radius);
  --bs-border-radius-sm:   var(--theme-radius-sm);
  --bs-border-radius-lg:   var(--theme-radius-lg);
  --bs-body-font-family:   'IranSans', 'Segoe UI', Tahoma, Arial, sans-serif;

  /* ── Compact Medical Spacing ── */
  --bs-body-line-height:         1.5;
  --bs-heading-margin-bottom:    0.25rem;
  --bs-paragraph-margin-bottom:  0.5rem;
  --bs-card-spacer-y:            0.75rem;
  --bs-card-spacer-x:            1rem;
  --bs-modal-padding:            1rem;
  --bs-modal-header-padding:     0.75rem 1rem;
  --bs-modal-footer-padding:     0.5rem;
  --bs-alert-padding-y:          0.65rem;
  --bs-alert-padding-x:          0.85rem;
  --bs-badge-padding-x:          0.5em;
  --bs-badge-padding-y:          0.25em;
  --bs-breadcrumb-padding-x:     0.5rem;
  --bs-list-group-item-padding-y:0.5rem;
  --bs-list-group-item-padding-x:0.75rem;
  --bs-table-cell-padding-y:     0.45rem;
  --bs-table-cell-padding-x:     0.6rem;
  --bs-btn-padding-x:            0.75rem;
  --bs-btn-padding-y:            0.4rem;
  --bs-btn-font-size:            0.875rem;
  --bs-input-btn-padding-y:      0.4rem;
  --bs-input-btn-padding-x:      0.75rem;

  color-scheme: dark;
}


/* ──────────────── Global Reset & Base ──────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--bs-body-font-family);
  background: var(--clr-bg);
  color: var(--theme-text);
  direction: rtl;
  line-height: var(--bs-body-line-height);
  min-height: 100vh;
  overflow-x: hidden;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}


/* ──────────────── Animated Mesh Background ──────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 600px 400px at 20% 20%, var(--clr-primary-dim) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 80% 80%, var(--clr-accent-dim) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 50% 50%, var(--clr-secondary-dim) 0%, transparent 70%);
  animation: mesh-drift 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes mesh-drift {
  0%   { opacity: 0.5; transform: scale(1); }
  50%  { opacity: 0.7; transform: scale(1.05); }
  100% { opacity: 0.5; transform: scale(1); }
}


/* ──────────────── Selection ──────────────── */
::selection {
  background: var(--clr-primary-dim);
  color: var(--theme-text-bright);
}

::-moz-selection {
  background: var(--clr-primary-dim);
  color: var(--theme-text-bright);
}


/* ──────────────── Scrollbar ──────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--theme-border-hover);
  border-radius: var(--theme-radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--clr-primary-dim);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--theme-border-hover) transparent;
}


/* ──────────────── Global Focus Visible ──────────────── */
:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}


/* ──────────────── Typography (compact) ──────────────── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--theme-text);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: var(--bs-heading-margin-bottom);
}
h1, .h1 { font-size: 1.85rem; }
h2, .h2 { font-size: 1.55rem; }
h3, .h3 { font-size: 1.3rem; }
h4, .h4 { font-size: 1.1rem; }
h5, .h5 { font-size: 0.95rem; }
h6, .h6 { font-size: 0.85rem; }

p {
  color: var(--theme-text-sub);
  margin-bottom: var(--bs-paragraph-margin-bottom);
  margin-top: 0;
}

a {
  color: var(--bs-primary);
  text-decoration: none;
  transition: color var(--theme-transition);
}
a:hover {
  color: var(--clr-primary-light);
}

small, .small { color: var(--theme-text-dim); }
.text-muted   { color: var(--theme-text-muted) !important; }
.lead         { color: var(--theme-text-sub); }
mark, .mark   { background: rgba(240,160,48,0.2); color: var(--bs-warning); padding: 0.1em 0.3em; border-radius: 3px; }


/* ──────────────── Glass Card (Universal) ──────────────── */
.card {
  background: var(--theme-surface) !important;
  backdrop-filter: blur(var(--theme-glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(1.3);
  border: 1px solid var(--theme-border) !important;
  border-radius: var(--theme-radius) !important;
  box-shadow: var(--theme-shadow-md);
  color: var(--theme-text);
  transition: border-color var(--theme-transition), box-shadow var(--theme-transition);
}
.card:hover {
  border-color: var(--theme-border-hover) !important;
  box-shadow: var(--theme-shadow-lg);
}

.card-header {
  background: var(--clr-bg-sunken) !important;
  border-bottom: 1px solid var(--theme-border) !important;
  color: var(--theme-text);
  font-weight: 600;
}
.card-footer {
  background: var(--clr-bg-sunken) !important;
  border-top: 1px solid var(--theme-border) !important;
  color: var(--theme-text-muted);
}
.card-title    { color: var(--theme-text); }
.card-text     { color: var(--theme-text-sub); }
.card-subtitle { color: var(--theme-text-dim) !important; }

.card-img-top,
.card-img-bottom {
  border-radius: 0 !important;
}
.card-img-overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(6,10,20,0.85) 100%);
  border-radius: var(--theme-radius) !important;
}
.card-group > .card:first-child {
  border-top-right-radius: var(--theme-radius) !important;
  border-bottom-right-radius: var(--theme-radius) !important;
}
.card-group > .card:last-child {
  border-top-left-radius: var(--theme-radius) !important;
  border-bottom-left-radius: var(--theme-radius) !important;
}


/* ──────────────── Navbar ──────────────── */
.navbar {
  background: rgba(6,10,20,0.85) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow-md);
  padding: 0.4rem 0.75rem;
  z-index: 1030;
}

.navbar-brand {
  color: var(--theme-text) !important;
  font-weight: 700;
  font-size: 1.05rem;
  transition: color var(--theme-transition);
}
.navbar-brand:hover {
  color: var(--bs-primary) !important;
}

.navbar-dark .navbar-nav .nav-link,
.navbar .navbar-nav .nav-link {
  color: var(--theme-text-muted) !important;
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--theme-radius-sm);
  transition: color var(--theme-transition), background var(--theme-transition);
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link:hover {
  color: var(--bs-primary) !important;
  background: var(--clr-primary-dim);
}
.navbar-dark .navbar-nav .nav-link.active,
.navbar .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .show > .nav-link,
.navbar .navbar-nav .show > .nav-link {
  color: var(--bs-primary) !important;
  background: var(--clr-accent-dim);
}

.navbar-toggler {
  border-color: var(--theme-border) !important;
  padding: 0.3rem 0.55rem;
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 2px var(--clr-primary-dim);
}
.navbar-toggler-icon {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(160deg);
}


/* ──────────────── Buttons (Ant Design style) ──────────────── */
.btn {
  font-weight: 500;
  font-size: var(--bs-btn-font-size);
  border-radius: var(--theme-radius-sm);
  padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
  transition: all var(--theme-transition);
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}

/* Primary */
.btn-primary {
  background: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px var(--clr-primary-dim);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--clr-primary-hover) !important;
  border-color: var(--clr-primary-hover) !important;
  box-shadow: 0 4px 14px var(--clr-primary-glow);
  color: #fff !important;
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px var(--clr-primary-dim) !important;
}

/* Outline Primary (ghost style) */
.btn-outline-primary {
  color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  background: transparent !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
  background: var(--clr-primary-dim) !important;
  border-color: var(--bs-primary) !important;
  color: var(--clr-primary-light) !important;
  box-shadow: none;
}

/* Secondary / Default */
.btn-secondary {
  background: var(--clr-bg-elevated) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text) !important;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--theme-surface-hover) !important;
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}

/* Outline Secondary */
.btn-outline-secondary {
  color: var(--theme-text-sub) !important;
  border-color: var(--theme-border) !important;
  background: transparent !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  background: var(--clr-primary-dim) !important;
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}

/* Success */
.btn-success {
  background: var(--bs-success) !important;
  border-color: var(--bs-success) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px var(--clr-success-dim);
}
.btn-success:hover,
.btn-success:focus-visible {
  background: #27ae60 !important;
  border-color: #27ae60 !important;
  box-shadow: 0 4px 14px var(--clr-success-dim);
  transform: translateY(-1px);
}
.btn-outline-success {
  color: var(--bs-success) !important;
  border-color: var(--bs-success) !important;
  background: transparent !important;
}
.btn-outline-success:hover {
  background: var(--clr-success-dim) !important;
}

/* Danger */
.btn-danger {
  background: var(--bs-danger) !important;
  border-color: var(--bs-danger) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px var(--clr-danger-dim);
}
.btn-danger:hover,
.btn-danger:focus-visible {
  background: #c0392b !important;
  border-color: #c0392b !important;
  box-shadow: 0 4px 14px var(--clr-danger-dim);
  transform: translateY(-1px);
}
.btn-outline-danger {
  color: var(--bs-danger) !important;
  border-color: var(--bs-danger) !important;
  background: transparent !important;
}
.btn-outline-danger:hover {
  background: var(--clr-danger-dim) !important;
}

/* Warning */
.btn-warning {
  background: var(--bs-warning) !important;
  border-color: var(--bs-warning) !important;
  color: #1a1a2e !important;
  box-shadow: 0 2px 8px var(--clr-warning-dim);
}
.btn-warning:hover,
.btn-warning:focus-visible {
  background: #d68d20 !important;
  border-color: #d68d20 !important;
  color: #1a1a2e !important;
  transform: translateY(-1px);
}
.btn-outline-warning {
  color: var(--bs-warning) !important;
  border-color: var(--bs-warning) !important;
}
.btn-outline-warning:hover {
  background: var(--clr-warning-dim) !important;
}

/* Info */
.btn-info {
  background: var(--bs-info) !important;
  border-color: var(--bs-info) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px var(--clr-info-dim);
}
.btn-info:hover,
.btn-info:focus-visible {
  background: var(--clr-primary-hover) !important;
  border-color: var(--clr-primary-hover) !important;
  transform: translateY(-1px);
}
.btn-outline-info {
  color: var(--bs-info) !important;
  border-color: var(--bs-info) !important;
}
.btn-outline-info:hover {
  background: var(--clr-info-dim) !important;
}

/* Dark / Light overrides */
.btn-dark {
  background: var(--clr-bg-elevated) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text) !important;
}
.btn-dark:hover {
  background: var(--theme-surface-hover) !important;
  border-color: var(--theme-border-hover) !important;
}
.btn-light {
  background: rgba(234,241,251,0.08) !important;
  border: 1px solid rgba(234,241,251,0.12) !important;
  color: var(--theme-text) !important;
}
.btn-light:hover {
  background: rgba(234,241,251,0.15) !important;
}

/* Link */
.btn-link {
  color: var(--bs-primary) !important;
  text-decoration: none !important;
  padding: 0 !important;
}
.btn-link:hover,
.btn-link:focus-visible {
  color: var(--clr-primary-light) !important;
}

/* Sizes */
.btn-lg { padding: 0.55rem 1.5rem; font-size: 0.95rem; border-radius: var(--theme-radius); }
.btn-sm { padding: 0.25rem 0.7rem; font-size: 0.8rem; border-radius: 4px; }

/* Disabled */
.btn:disabled, .btn.disabled {
  opacity: 0.45 !important;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

/* Button group radii */
.btn-group > .btn:first-child {
  border-start-start-radius: var(--theme-radius-sm) !important;
  border-end-start-radius: var(--theme-radius-sm) !important;
}
.btn-group > .btn:last-child {
  border-start-end-radius: var(--theme-radius-sm) !important;
  border-end-end-radius: var(--theme-radius-sm) !important;
}


/* ──────────────── Form Controls ──────────────── */
.form-control,
.form-select {
  background-color: var(--clr-bg-elevated) !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: var(--theme-radius-sm) !important;
  color: var(--theme-text) !important;
  font-size: 0.875rem;
  padding: var(--bs-input-btn-padding-y) var(--bs-input-btn-padding-x);
  transition: border-color var(--theme-transition), box-shadow var(--theme-transition);
}
.form-control:focus,
.form-select:focus {
  background-color: var(--clr-bg-elevated) !important;
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 2px var(--clr-primary-dim) !important;
  color: var(--theme-text) !important;
  outline: none;
}
.form-control::placeholder {
  color: var(--theme-text-muted) !important;
}
.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background-color: var(--clr-bg-sunken) !important;
  color: var(--theme-text-muted) !important;
  opacity: 0.6;
}

.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='%238899aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: left 0.6rem center !important;
  background-size: 16px 12px !important;
  padding-left: 2rem !important;
}
.form-select option {
  background: var(--clr-bg-elevated);
  color: var(--theme-text);
}
.form-select option:checked {
  background: var(--clr-primary-dim);
  color: var(--bs-primary);
}
.form-select option:disabled {
  color: var(--theme-text-muted);
}

.form-control-plaintext {
  color: var(--theme-text) !important;
  background: transparent !important;
  border-color: transparent !important;
}

/* Input Group */
.input-group-text {
  background: var(--clr-bg-sunken) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text-sub) !important;
  font-size: 0.875rem;
}

.input-group > :not(:first-child):not(.dropdown-menu) {
  border-start-start-radius: 0 !important;
  border-end-start-radius: 0 !important;
}
.input-group > :not(:last-child):not(.dropdown-toggle) {
  border-start-end-radius: 0 !important;
  border-end-end-radius: 0 !important;
}

/* Validation */
.form-control.is-invalid,
.was-validated .form-control:invalid,
.form-select.is-invalid,
.was-validated .form-select:invalid {
  border-color: var(--bs-danger) !important;
  box-shadow: 0 0 0 2px var(--clr-danger-dim) !important;
}
.form-control.is-valid,
.was-validated .form-control:valid,
.form-select.is-valid,
.was-validated .form-select:valid {
  border-color: var(--bs-success) !important;
  box-shadow: 0 0 0 2px var(--clr-success-dim) !important;
}
.invalid-feedback { color: var(--bs-danger) !important; font-size: 0.8rem; }
.valid-feedback   { color: var(--bs-success) !important; font-size: 0.8rem; }


/* ──────────────── Checkboxes, Radios, Switches ──────────────── */
.form-check-input {
  background-color: var(--clr-bg-elevated) !important;
  border: 1.5px solid var(--theme-border) !important;
  transition: all var(--theme-transition);
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 8px var(--clr-primary-dim);
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--clr-primary-dim) !important;
  border-color: var(--bs-primary) !important;
}
.form-check-input:indeterminate {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}
.form-check-label {
  color: var(--theme-text-sub);
  font-size: 0.875rem;
  cursor: pointer;
}

/* Switch */
.form-switch .form-check-input {
  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='%238899aa'/%3e%3c/svg%3e") !important;
}
.form-switch .form-check-input:checked {
  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") !important;
}


/* ──────────────── Range Input ──────────────── */
.form-range::-webkit-slider-runnable-track {
  background: var(--theme-border);
  border-radius: 10px;
  height: 6px;
}
.form-range::-moz-range-track {
  background: var(--theme-border);
  border-radius: 10px;
  height: 6px;
  border: none;
}
.form-range::-webkit-slider-thumb {
  background: var(--bs-primary);
  border: 2px solid var(--clr-bg);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  box-shadow: 0 0 8px var(--clr-primary-dim);
  -webkit-appearance: none;
}
.form-range::-moz-range-thumb {
  background: var(--bs-primary);
  border: 2px solid var(--clr-bg);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  box-shadow: 0 0 8px var(--clr-primary-dim);
}
.form-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--clr-primary-dim);
}
.form-range:disabled::-webkit-slider-thumb { opacity: 0.5; }
.form-range:disabled::-moz-range-thumb { opacity: 0.5; }


/* ──────────────── Tables (Ant Design style) ──────────────── */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--theme-text);
  --bs-table-border-color: var(--theme-border-subtle);
  --bs-table-striped-bg: rgba(255,255,255,0.01);
  --bs-table-striped-color: var(--theme-text);
  --bs-table-hover-bg: var(--clr-primary-dim);
  --bs-table-hover-color: var(--theme-text);
  --bs-table-active-bg: var(--clr-accent-dim);
  font-size: 0.875rem;
  color: var(--theme-text);
  border-color: var(--theme-border-subtle);
}

.table > thead {
  background: var(--clr-bg-sunken);
}
.table > thead th {
  color: var(--theme-text-sub) !important;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--theme-border) !important;
  padding: 0.5rem 0.6rem;
  white-space: nowrap;
}
.table > tbody td {
  padding: 0.45rem 0.6rem;
  vertical-align: middle;
  border-bottom-color: var(--theme-border-subtle);
}
.table-hover > tbody > tr:hover > * {
  --bs-table-hover-bg: var(--clr-primary-dim);
  background-color: var(--clr-primary-dim) !important;
}

.table-group-divider {
  border-top: 2px solid var(--theme-border) !important;
}


/* ──────────────── Alerts ──────────────── */
.alert {
  border-radius: var(--theme-radius-sm) !important;
  font-size: 0.875rem;
  border: 1px solid;
  padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.alert-primary {
  background: var(--clr-primary-dim) !important;
  border-color: rgba(59,141,240,0.3) !important;
  color: var(--bs-primary) !important;
}
.alert-secondary {
  background: var(--clr-secondary-dim) !important;
  border-color: rgba(34,184,207,0.3) !important;
  color: var(--bs-secondary) !important;
}
.alert-success {
  background: var(--clr-success-dim) !important;
  border-color: rgba(46,204,113,0.3) !important;
  color: var(--bs-success) !important;
}
.alert-danger {
  background: var(--clr-danger-dim) !important;
  border-color: rgba(231,76,60,0.3) !important;
  color: var(--bs-danger) !important;
}
.alert-warning {
  background: var(--clr-warning-dim) !important;
  border-color: rgba(240,160,48,0.3) !important;
  color: var(--bs-warning) !important;
}
.alert-info {
  background: var(--clr-info-dim) !important;
  border-color: rgba(59,141,240,0.3) !important;
  color: var(--bs-primary) !important;
}
.alert-dark {
  background: rgba(6,10,20,0.6) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}
.alert-light {
  background: rgba(234,241,251,0.06) !important;
  border-color: rgba(234,241,251,0.12) !important;
  color: var(--theme-text) !important;
}

.alert a, .alert .alert-link {
  font-weight: 700;
  text-decoration: underline;
}
.alert-primary .alert-link  { color: var(--clr-primary-light) !important; }
.alert-success .alert-link  { color: #27ae60 !important; }
.alert-danger .alert-link   { color: #c0392b !important; }
.alert-warning .alert-link  { color: #d68d20 !important; }

.alert .btn-close {
  filter: invert(0.7) sepia(1) saturate(2) hue-rotate(160deg);
}


/* ──────────────── Badges ──────────────── */
.badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.badge.rounded-pill { border-radius: 50rem; }

.badge.bg-primary   { background: var(--clr-primary-dim) !important; color: var(--bs-primary) !important; border: 1px solid rgba(59,141,240,0.2); }
.badge.bg-secondary { background: var(--clr-secondary-dim) !important; color: var(--bs-secondary) !important; border: 1px solid rgba(34,184,207,0.2); }
.badge.bg-success   { background: var(--clr-success-dim) !important; color: var(--bs-success) !important; border: 1px solid rgba(46,204,113,0.2); }
.badge.bg-danger    { background: var(--clr-danger-dim) !important; color: var(--bs-danger) !important; border: 1px solid rgba(231,76,60,0.2); }
.badge.bg-warning   { background: var(--clr-warning-dim) !important; color: var(--bs-warning) !important; border: 1px solid rgba(240,160,48,0.2); }
.badge.bg-info      { background: var(--clr-info-dim) !important; color: var(--bs-primary) !important; border: 1px solid rgba(59,141,240,0.2); }
.badge.bg-dark      { background: rgba(6,10,20,0.7) !important; color: var(--theme-text) !important; }
.badge.bg-light     { background: rgba(234,241,251,0.08) !important; color: var(--theme-text) !important; }


/* ──────────────── Background Utilities Override ──────────────── */
.bg-primary:not(.badge)   { background: var(--clr-primary-dim) !important; color: var(--bs-primary) !important; }
.bg-secondary:not(.badge) { background: var(--clr-secondary-dim) !important; color: var(--bs-secondary) !important; }
.bg-success:not(.badge)   { background: var(--clr-success-dim) !important; color: var(--bs-success) !important; }
.bg-danger:not(.badge)    { background: var(--clr-danger-dim) !important; color: var(--bs-danger) !important; }
.bg-warning:not(.badge)   { background: var(--clr-warning-dim) !important; color: var(--bs-warning) !important; }
.bg-info:not(.badge)      { background: var(--clr-info-dim) !important; color: var(--bs-primary) !important; }
.bg-dark:not(.badge)      { background: rgba(6,10,20,0.7) !important; color: var(--theme-text) !important; }
.bg-light:not(.badge)     { background: rgba(234,241,251,0.06) !important; color: var(--theme-text) !important; }
.bg-body                 { background: var(--clr-bg) !important; }
.bg-body-secondary       { background: var(--clr-bg-elevated) !important; }
.bg-transparent          { background: transparent !important; }
.bg-body-tertiary        { background: var(--theme-surface) !important; }

.text-bg-primary   { background: var(--clr-primary-dim) !important; color: var(--bs-primary) !important; }
.text-bg-secondary { background: var(--clr-secondary-dim) !important; color: var(--bs-secondary) !important; }
.text-bg-success   { background: var(--clr-success-dim) !important; color: var(--bs-success) !important; }
.text-bg-danger    { background: var(--clr-danger-dim) !important; color: var(--bs-danger) !important; }
.text-bg-warning   { background: var(--clr-warning-dim) !important; color: var(--bs-warning) !important; }
.text-bg-info      { background: var(--clr-info-dim) !important; color: var(--bs-primary) !important; }
.text-bg-light     { background: rgba(234,241,251,0.08) !important; color: var(--theme-text) !important; }
.text-bg-dark      { background: rgba(6,10,20,0.8) !important; color: var(--theme-text) !important; }


/* ──────────────── Modals ──────────────── */
.modal-content {
  background: var(--theme-surface-solid) !important;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--theme-border) !important;
  border-radius: var(--theme-radius-lg) !important;
  box-shadow: var(--theme-shadow-xl);
  color: var(--theme-text);
}
.modal-header {
  border-bottom: 1px solid var(--theme-border) !important;
}
.modal-header .btn-close {
  filter: invert(0.7) sepia(1) saturate(2) hue-rotate(160deg);
  opacity: 0.6;
  transition: opacity var(--theme-transition);
}
.modal-header .btn-close:hover { opacity: 1; }
.modal-footer {
  border-top: 1px solid var(--theme-border) !important;
}


/* ──────────────── Dropdowns ──────────────── */
.dropdown-menu {
  background: var(--theme-surface-solid) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--theme-border) !important;
  border-radius: var(--theme-radius) !important;
  box-shadow: var(--theme-shadow-lg);
  padding: 0.4rem;
}
.dropdown-item {
  color: var(--theme-text-sub) !important;
  font-size: 0.875rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  transition: background var(--theme-transition-fast);
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--clr-primary-dim) !important;
  color: var(--theme-text) !important;
}
.dropdown-item.active,
.dropdown-item:active {
  background: var(--clr-accent-dim) !important;
  color: var(--bs-primary) !important;
}
.dropdown-divider { border-color: var(--theme-border) !important; }
.dropdown-header  { color: var(--theme-text-muted) !important; font-size: 0.72rem !important; }


/* ──────────────── Accordion ──────────────── */
.accordion-item {
  background: var(--theme-surface) !important;
  border: 1px solid var(--theme-border) !important;
}
.accordion-button {
  background: var(--clr-bg-elevated) !important;
  color: var(--theme-text) !important;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
  background: var(--clr-primary-dim) !important;
  color: var(--bs-primary) !important;
}
.accordion-button:focus {
  box-shadow: 0 0 0 3px var(--clr-primary-dim) !important;
}
.accordion-body {
  background: transparent;
  color: var(--theme-text-sub);
}


/* ──────────────── List Group ──────────────── */
.list-group-item {
  background: var(--theme-surface) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text) !important;
  transition: background var(--theme-transition-fast);
}
.list-group-item:hover {
  background: var(--theme-surface-hover) !important;
}
.list-group-item.active {
  background: var(--clr-accent-dim) !important;
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}


/* ──────────────── Breadcrumb ──────────────── */
.breadcrumb {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-sm);
  padding: 0.4rem var(--bs-breadcrumb-padding-x);
}
.breadcrumb-item a { color: var(--bs-primary); }
.breadcrumb-item.active { color: var(--theme-text-muted); }


/* ──────────────── Pagination ──────────────── */
.page-link {
  background: var(--clr-bg-elevated) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text-sub) !important;
  border-radius: var(--theme-radius-sm) !important;
  transition: all var(--theme-transition);
}
.page-link:hover {
  background: var(--clr-primary-dim) !important;
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}
.page-item.active .page-link {
  background: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px var(--clr-primary-dim);
}
.page-item.disabled .page-link {
  background: var(--clr-bg-sunken) !important;
  color: var(--theme-text-muted) !important;
  opacity: 0.5;
}


/* ──────────────── Tabs & Pills ──────────────── */
.nav-tabs {
  border-bottom: 2px solid var(--theme-border) !important;
}
.nav-tabs .nav-link {
  color: var(--theme-text-sub) !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  transition: color var(--theme-transition), border-color var(--theme-transition);
}
.nav-tabs .nav-link.active {
  color: var(--bs-primary) !important;
  border-bottom-color: var(--bs-primary) !important;
}
.nav-pills .nav-link {
  color: var(--theme-text-sub) !important;
  border-radius: var(--theme-radius-sm) !important;
}
.nav-pills .nav-link.active {
  background: var(--bs-primary) !important;
  color: #fff !important;
}


/* ──────────────── Progress ──────────────── */
.progress {
  background: var(--theme-border) !important;
  border-radius: 20px !important;
  height: 8px;
}
.progress-bar {
  background: var(--bs-primary) !important;
  border-radius: 20px;
  box-shadow: 0 0 10px var(--clr-primary-dim);
}
.progress-bar-striped {
  background-image: linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.08) 75%, transparent 75%, transparent) !important;
}


/* ──────────────── Tooltips ──────────────── */
.tooltip-inner {
  background: var(--theme-surface-solid) !important;
  border: 1px solid var(--theme-border);
  color: var(--theme-text) !important;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  box-shadow: var(--theme-shadow-md);
}

.bs-tooltip-top .tooltip-arrow::before    { border-top-color: var(--theme-surface-solid) !important; }
.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: var(--theme-surface-solid) !important; }
.bs-tooltip-start .tooltip-arrow::before  { border-left-color: var(--theme-surface-solid) !important; }
.bs-tooltip-end .tooltip-arrow::before    { border-right-color: var(--theme-surface-solid) !important; }


/* ──────────────── Popovers ──────────────── */
.popover {
  background: var(--theme-surface-solid) !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: var(--theme-radius) !important;
  box-shadow: var(--theme-shadow-lg);
}
.popover-header {
  background: var(--clr-bg-sunken) !important;
  border-bottom: 1px solid var(--theme-border) !important;
  color: var(--theme-text) !important;
}
.popover-body {
  color: var(--theme-text-sub) !important;
}

.bs-popover-top > .popover-arrow::after    { border-top-color: var(--theme-surface-solid) !important; }
.bs-popover-bottom > .popover-arrow::after { border-bottom-color: var(--clr-bg-sunken) !important; }
.bs-popover-start > .popover-arrow::after  { border-left-color: var(--theme-surface-solid) !important; }
.bs-popover-end > .popover-arrow::after    { border-right-color: var(--theme-surface-solid) !important; }


/* ──────────────── Toasts / Offcanvas ──────────────── */
.toast {
  background: var(--theme-surface-solid) !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: var(--theme-radius) !important;
  box-shadow: var(--theme-shadow-lg);
}
.offcanvas {
  background: var(--theme-surface-solid) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text);
}


/* ──────────────── Close Button ──────────────── */
.btn-close {
  filter: invert(0.7) sepia(1) saturate(2) hue-rotate(160deg);
  opacity: 0.6;
}
.btn-close:hover { opacity: 1; }


/* ──────────────── Figures, Blockquote, Code ──────────────── */
.blockquote {
  border-inline-end: 3px solid var(--bs-primary);
  padding-inline-end: 1rem;
  color: var(--theme-text);
}
code {
  background: var(--clr-primary-dim);
  color: var(--bs-primary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}
pre {
  background: var(--clr-bg-elevated);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-sm);
  padding: 0.75rem;
  color: var(--theme-text-muted);
  direction: ltr;
  text-align: left;
}


/* ──────────────── Custom Utilities (OCIS) ──────────────── */
.glass {
  background: var(--theme-surface);
  backdrop-filter: blur(var(--theme-glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(1.3);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
}
.glass-strong {
  background: rgba(11,17,32,0.7);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--theme-border-hover);
  border-radius: var(--theme-radius);
}
.gradient-text {
  background: linear-gradient(135deg, #3b8df0, #22b8cf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.divider-glow {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,141,240,0.25), transparent);
  border: none;
  margin: 0.75rem 0;
}
.auth-card {
  background: var(--theme-surface);
  backdrop-filter: blur(var(--theme-glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(1.3);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-lg);
  box-shadow: var(--theme-shadow-md);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.otp-input {
  width: 46px;
  height: 50px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bs-primary);
  background: var(--clr-bg-elevated);
  border: 1.5px solid var(--theme-border);
  border-radius: var(--theme-radius-sm);
  transition: all var(--theme-transition);
  caret-color: var(--bs-primary);
}
.otp-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-dim);
  outline: none;
}


/* ──────────────── Responsive ──────────────── */
@media (max-width: 767.98px) {
  .navbar-collapse {
    background: var(--theme-surface-solid);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    padding: 0.75rem;
    margin-top: 0.5rem;
    box-shadow: var(--theme-shadow-lg);
  }
}

/* ──────────────── Reduced Motion ──────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ──────────────── Print ──────────────── */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .card, .auth-card, .glass {
    background: #fff !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   END OF OCIS DARK THEME — Bootstrap 5.2 Complete Override
   ══════════════════════════════════════════════════════════════ */