/* =================================================================
   BASE.CSS  —  Bootstrap replacement (grid + utilities + components)
   Load order: base.css → new-theme.css (new-theme wins on conflicts)
================================================================= */

/* ── Grid ── */
.container       { width: 100%; max-width: 1200px; margin-right: auto; margin-left: auto; padding-right: 12px; padding-left: 12px; }
.container-fluid { width: 100%; padding-right: 12px; padding-left: 12px; }
.row { display: flex; flex-wrap: wrap; margin-right: -12px; margin-left: -12px; }

/* base col */
[class*="col-"] { position: relative; width: 100%; padding-right: 12px; padding-left: 12px; }
.col   { flex: 1 0 0%; }
.col-1 { flex: 0 0 8.3333%;  max-width: 8.3333%;  }
.col-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
.col-3 { flex: 0 0 25%;      max-width: 25%;       }
.col-4 { flex: 0 0 33.3333%; max-width: 33.3333%;  }
.col-5 { flex: 0 0 41.6667%; max-width: 41.6667%;  }
.col-6 { flex: 0 0 50%;      max-width: 50%;        }
.col-7 { flex: 0 0 58.3333%; max-width: 58.3333%;  }
.col-8 { flex: 0 0 66.6667%; max-width: 66.6667%;  }
.col-9 { flex: 0 0 75%;      max-width: 75%;        }
.col-10{ flex: 0 0 83.3333%; max-width: 83.3333%;  }
.col-11{ flex: 0 0 91.6667%; max-width: 91.6667%;  }
.col-12{ flex: 0 0 100%;     max-width: 100%;       }

/* sm — 576px+ */
@media (min-width: 576px) {
  .col-sm-1  { flex: 0 0 8.3333%;  max-width: 8.3333%;  }
  .col-sm-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-sm-3  { flex: 0 0 25%;      max-width: 25%;       }
  .col-sm-4  { flex: 0 0 33.3333%; max-width: 33.3333%;  }
  .col-sm-6  { flex: 0 0 50%;      max-width: 50%;        }
  .col-sm-8  { flex: 0 0 66.6667%; max-width: 66.6667%;  }
  .col-sm-9  { flex: 0 0 75%;      max-width: 75%;        }
  .col-sm-10 { flex: 0 0 83.3333%; max-width: 83.3333%;  }
  .col-sm-12 { flex: 0 0 100%;     max-width: 100%;       }
}

/* md — 768px+ */
@media (min-width: 768px) {
  .col-md-1  { flex: 0 0 8.3333%;  max-width: 8.3333%;  }
  .col-md-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-md-3  { flex: 0 0 25%;      max-width: 25%;       }
  .col-md-4  { flex: 0 0 33.3333%; max-width: 33.3333%;  }
  .col-md-5  { flex: 0 0 41.6667%; max-width: 41.6667%;  }
  .col-md-6  { flex: 0 0 50%;      max-width: 50%;        }
  .col-md-7  { flex: 0 0 58.3333%; max-width: 58.3333%;  }
  .col-md-8  { flex: 0 0 66.6667%; max-width: 66.6667%;  }
  .col-md-9  { flex: 0 0 75%;      max-width: 75%;        }
  .col-md-10 { flex: 0 0 83.3333%; max-width: 83.3333%;  }
  .col-md-12 { flex: 0 0 100%;     max-width: 100%;       }
}

/* lg — 992px+ */
@media (min-width: 992px) {
  .col-lg-1  { flex: 0 0 8.3333%;  max-width: 8.3333%;  }
  .col-lg-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-lg-3  { flex: 0 0 25%;      max-width: 25%;       }
  .col-lg-4  { flex: 0 0 33.3333%; max-width: 33.3333%;  }
  .col-lg-6  { flex: 0 0 50%;      max-width: 50%;        }
  .col-lg-8  { flex: 0 0 66.6667%; max-width: 66.6667%;  }
  .col-lg-9  { flex: 0 0 75%;      max-width: 75%;        }
  .col-lg-10 { flex: 0 0 83.3333%; max-width: 83.3333%;  }
  .col-lg-12 { flex: 0 0 100%;     max-width: 100%;       }
}

/* xl — 1200px+ */
@media (min-width: 1200px) {
  .col-xl-1  { flex: 0 0 8.3333%;  max-width: 8.3333%;  }
  .col-xl-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-xl-3  { flex: 0 0 25%;      max-width: 25%;       }
  .col-xl-4  { flex: 0 0 33.3333%; max-width: 33.3333%;  }
  .col-xl-5  { flex: 0 0 41.6667%; max-width: 41.6667%;  }
  .col-xl-6  { flex: 0 0 50%;      max-width: 50%;        }
  .col-xl-7  { flex: 0 0 58.3333%; max-width: 58.3333%;  }
  .col-xl-8  { flex: 0 0 66.6667%; max-width: 66.6667%;  }
  .col-xl-9  { flex: 0 0 75%;      max-width: 75%;        }
  .col-xl-10 { flex: 0 0 83.3333%; max-width: 83.3333%;  }
  .col-xl-12 { flex: 0 0 100%;     max-width: 100%;       }
  .d-xl-none  { display: none  !important; }
  .d-xl-block { display: block !important; }
  .d-xl-flex  { display: flex  !important; }
  .d-xl-inline-flex { display: inline-flex !important; }
}

/* ── Display ── */
.d-none         { display: none         !important; }
.d-block        { display: block        !important; }
.d-inline       { display: inline       !important; }
.d-inline-block { display: inline-block !important; }
.d-flex         { display: flex         !important; }
.d-inline-flex  { display: inline-flex  !important; }
.d-grid         { display: grid         !important; }
.d-table        { display: table        !important; }
.d-table-cell   { display: table-cell   !important; }

@media (min-width: 576px) {
  .d-sm-none         { display: none         !important; }
  .d-sm-block        { display: block        !important; }
  .d-sm-flex         { display: flex         !important; }
  .d-sm-inline-flex  { display: inline-flex  !important; }
  .d-sm-inline-block { display: inline-block !important; }
}
@media (min-width: 768px) {
  .d-md-none         { display: none         !important; }
  .d-md-block        { display: block        !important; }
  .d-md-flex         { display: flex         !important; }
  .d-md-inline-flex  { display: inline-flex  !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-inline       { display: inline       !important; }
}
@media (min-width: 992px) {
  .d-lg-none         { display: none         !important; }
  .d-lg-block        { display: block        !important; }
  .d-lg-flex         { display: flex         !important; }
  .d-lg-inline-flex  { display: inline-flex  !important; }
  .d-lg-inline-block { display: inline-block !important; }
}

/* ── Flexbox ── */
.flex-row          { flex-direction: row            !important; }
.flex-column       { flex-direction: column         !important; }
.flex-row-reverse  { flex-direction: row-reverse    !important; }
.flex-wrap         { flex-wrap: wrap                !important; }
.flex-nowrap       { flex-wrap: nowrap              !important; }
.flex-fill         { flex: 1 1 auto                 !important; }
.flex-grow-0       { flex-grow: 0                   !important; }
.flex-grow-1       { flex-grow: 1                   !important; }
.flex-shrink-0     { flex-shrink: 0                 !important; }
.flex-shrink-1     { flex-shrink: 1                 !important; }

.align-items-start    { align-items: flex-start  !important; }
.align-items-end      { align-items: flex-end    !important; }
.align-items-center   { align-items: center      !important; }
.align-items-baseline { align-items: baseline    !important; }
.align-items-stretch  { align-items: stretch     !important; }

.align-self-auto    { align-self: auto       !important; }
.align-self-start   { align-self: flex-start !important; }
.align-self-end     { align-self: flex-end   !important; }
.align-self-center  { align-self: center     !important; }
.align-self-stretch { align-self: stretch    !important; }

.justify-content-start   { justify-content: flex-start    !important; }
.justify-content-end     { justify-content: flex-end      !important; }
.justify-content-center  { justify-content: center        !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around  !important; }
.justify-content-evenly  { justify-content: space-evenly  !important; }

@media (min-width: 768px) {
  .align-items-md-center   { align-items: center      !important; }
  .flex-md-row             { flex-direction: row       !important; }
  .flex-md-column          { flex-direction: column    !important; }
  .justify-content-md-end  { justify-content: flex-end !important; }
}

/* ── Gap ── */
.gap-0  { gap: 0       !important; }
.gap-1  { gap: 0.25rem !important; }
.gap-2  { gap: 0.5rem  !important; }
.gap-3  { gap: 1rem    !important; }
.gap-4  { gap: 1.5rem  !important; }
.gap-5  { gap: 3rem    !important; }
.gy-1   { row-gap: 0.25rem !important; }
.gy-2   { row-gap: 0.5rem  !important; }
.gy-3   { row-gap: 1rem    !important; }
.gy-4   { row-gap: 1.5rem  !important; }
.gy-5   { row-gap: 3rem    !important; }
.gx-1   { column-gap: 0.25rem !important; }
.gx-2   { column-gap: 0.5rem  !important; }
.gx-3   { column-gap: 1rem    !important; }
.gx-4   { column-gap: 1.5rem  !important; }
.gx-5   { column-gap: 3rem    !important; }

/* ── Spacing ── */
/* scale: 0=0  1=0.25rem  2=0.5rem  3=1rem  4=1.5rem  5=3rem */
.m-0  { margin:         0       !important; }
.m-1  { margin:         0.25rem !important; }
.m-2  { margin:         0.5rem  !important; }
.m-3  { margin:         1rem    !important; }
.m-4  { margin:         1.5rem  !important; }
.m-5  { margin:         3rem    !important; }
.m-auto { margin:       auto    !important; }

.mt-0  { margin-top:    0       !important; }
.mt-1  { margin-top:    0.25rem !important; }
.mt-2  { margin-top:    0.5rem  !important; }
.mt-3  { margin-top:    1rem    !important; }
.mt-4  { margin-top:    1.5rem  !important; }
.mt-5  { margin-top:    3rem    !important; }
.mt-auto { margin-top:  auto    !important; }

.mb-0  { margin-bottom: 0       !important; }
.mb-1  { margin-bottom: 0.25rem !important; }
.mb-2  { margin-bottom: 0.5rem  !important; }
.mb-3  { margin-bottom: 1rem    !important; }
.mb-4  { margin-bottom: 1.5rem  !important; }
.mb-5  { margin-bottom: 3rem    !important; }
.mb-auto { margin-bottom: auto  !important; }

.ms-0  { margin-left:   0       !important; }
.ms-1  { margin-left:   0.25rem !important; }
.ms-2  { margin-left:   0.5rem  !important; }
.ms-3  { margin-left:   1rem    !important; }
.ms-4  { margin-left:   1.5rem  !important; }
.ms-5  { margin-left:   3rem    !important; }
.ms-auto { margin-left: auto    !important; }

.me-0  { margin-right:  0       !important; }
.me-1  { margin-right:  0.25rem !important; }
.me-2  { margin-right:  0.5rem  !important; }
.me-3  { margin-right:  1rem    !important; }
.me-4  { margin-right:  1.5rem  !important; }
.me-5  { margin-right:  3rem    !important; }
.me-auto { margin-right: auto   !important; }

.mx-0  { margin-left: 0;       margin-right: 0       !important; }
.mx-1  { margin-left: 0.25rem; margin-right: 0.25rem !important; }
.mx-2  { margin-left: 0.5rem;  margin-right: 0.5rem  !important; }
.mx-3  { margin-left: 1rem;    margin-right: 1rem    !important; }
.mx-4  { margin-left: 1.5rem;  margin-right: 1.5rem  !important; }
.mx-5  { margin-left: 3rem;    margin-right: 3rem    !important; }
.mx-auto { margin-left: auto;  margin-right: auto    !important; }

.my-0  { margin-top: 0;       margin-bottom: 0       !important; }
.my-1  { margin-top: 0.25rem; margin-bottom: 0.25rem !important; }
.my-2  { margin-top: 0.5rem;  margin-bottom: 0.5rem  !important; }
.my-3  { margin-top: 1rem;    margin-bottom: 1rem    !important; }
.my-4  { margin-top: 1.5rem;  margin-bottom: 1.5rem  !important; }
.my-5  { margin-top: 3rem;    margin-bottom: 3rem    !important; }
.my-auto { margin-top: auto;  margin-bottom: auto    !important; }

.p-0  { padding:         0       !important; }
.p-1  { padding:         0.25rem !important; }
.p-2  { padding:         0.5rem  !important; }
.p-3  { padding:         1rem    !important; }
.p-4  { padding:         1.5rem  !important; }
.p-5  { padding:         3rem    !important; }

.pt-0  { padding-top:    0       !important; }
.pt-1  { padding-top:    0.25rem !important; }
.pt-2  { padding-top:    0.5rem  !important; }
.pt-3  { padding-top:    1rem    !important; }
.pt-4  { padding-top:    1.5rem  !important; }
.pt-5  { padding-top:    3rem    !important; }

.pb-0  { padding-bottom: 0       !important; }
.pb-1  { padding-bottom: 0.25rem !important; }
.pb-2  { padding-bottom: 0.5rem  !important; }
.pb-3  { padding-bottom: 1rem    !important; }
.pb-4  { padding-bottom: 1.5rem  !important; }
.pb-5  { padding-bottom: 3rem    !important; }

.ps-0  { padding-left:   0       !important; }
.ps-1  { padding-left:   0.25rem !important; }
.ps-2  { padding-left:   0.5rem  !important; }
.ps-3  { padding-left:   1rem    !important; }
.ps-4  { padding-left:   1.5rem  !important; }
.ps-5  { padding-left:   3rem    !important; }

.pe-0  { padding-right:  0       !important; }
.pe-1  { padding-right:  0.25rem !important; }
.pe-2  { padding-right:  0.5rem  !important; }
.pe-3  { padding-right:  1rem    !important; }
.pe-4  { padding-right:  1.5rem  !important; }
.pe-5  { padding-right:  3rem    !important; }

.px-0  { padding-left: 0;       padding-right: 0       !important; }
.px-1  { padding-left: 0.25rem; padding-right: 0.25rem !important; }
.px-2  { padding-left: 0.5rem;  padding-right: 0.5rem  !important; }
.px-3  { padding-left: 1rem;    padding-right: 1rem    !important; }
.px-4  { padding-left: 1.5rem;  padding-right: 1.5rem  !important; }
.px-5  { padding-left: 3rem;    padding-right: 3rem    !important; }

.py-0  { padding-top: 0;       padding-bottom: 0       !important; }
.py-1  { padding-top: 0.25rem; padding-bottom: 0.25rem !important; }
.py-2  { padding-top: 0.5rem;  padding-bottom: 0.5rem  !important; }
.py-3  { padding-top: 1rem;    padding-bottom: 1rem    !important; }
.py-4  { padding-top: 1.5rem;  padding-bottom: 1.5rem  !important; }
.py-5  { padding-top: 3rem;    padding-bottom: 3rem    !important; }

/* responsive spacing */
@media (min-width: 768px) {
  .mt-md-0  { margin-top:    0       !important; }
  .mt-md-3  { margin-top:    1rem    !important; }
  .mt-md-4  { margin-top:    1.5rem  !important; }
  .mb-md-0  { margin-bottom: 0       !important; }
  .mb-md-3  { margin-bottom: 1rem    !important; }
  .mb-md-4  { margin-bottom: 1.5rem  !important; }
  .p-md-4   { padding:       1.5rem  !important; }
  .p-md-5   { padding:       3rem    !important; }
  .px-md-4  { padding-left: 1.5rem; padding-right: 1.5rem !important; }
  .px-md-5  { padding-left: 3rem;   padding-right: 3rem   !important; }
  .py-md-4  { padding-top: 1.5rem;  padding-bottom: 1.5rem !important; }
  .py-md-5  { padding-top: 3rem;    padding-bottom: 3rem   !important; }
}
@media (min-width: 992px) {
  .mt-lg-0  { margin-top:    0      !important; }
  .mb-lg-0  { margin-bottom: 0      !important; }
  .p-lg-5   { padding:       3rem   !important; }
}

/* ── Width / Height ── */
.w-25   { width: 25%  !important; }
.w-50   { width: 50%  !important; }
.w-75   { width: 75%  !important; }
.w-100  { width: 100% !important; }
.mw-100 { max-width: 100% !important; }
.h-100  { height: 100% !important; }
.min-vh-100 { min-height: 100vh !important; }
.vw-100 { width: 100vw !important; }
.img-fluid { max-width: 100%; height: auto; }

/* ── Text ── */
.text-left   { text-align: left   !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right  !important; }
.text-start  { text-align: left   !important; }
.text-end    { text-align: right  !important; }

.text-muted   { color: #6c757d !important; }   /* overridden by new-theme.css to use --text-muted */
.text-white   { color: #ffffff !important; }
.text-dark    { color: #212529 !important; }
.text-body    { color: inherit  !important; }
.text-danger  { color: #dc3545 !important; }   /* overridden by new-theme.css --danger */
.text-success { color: #198754 !important; }
.text-warning { color: #ffc107 !important; }
.text-primary { color: #0d6efd !important; }   /* overridden by new-theme.css */
.text-info    { color: #0dcaf0 !important; }
.text-secondary { color: #6c757d !important; }

.fw-lighter  { font-weight: 200 !important; }
.fw-light    { font-weight: 300 !important; }
.fw-normal   { font-weight: 400 !important; }
.fw-medium   { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold     { font-weight: 700 !important; }
.fw-bolder   { font-weight: 800 !important; }

.fst-italic  { font-style: italic !important; }
.fst-normal  { font-style: normal !important; }

.text-uppercase    { text-transform: uppercase  !important; }
.text-lowercase    { text-transform: lowercase  !important; }
.text-capitalize   { text-transform: capitalize !important; }
.text-nowrap       { white-space: nowrap        !important; }
.text-wrap         { white-space: normal        !important; }
.text-truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-decoration-none { text-decoration: none !important; }

.small  { font-size: 0.875em  !important; }
.fs-1   { font-size: 2.5rem   !important; }
.fs-2   { font-size: 2rem     !important; }
.fs-3   { font-size: 1.75rem  !important; }
.fs-4   { font-size: 1.5rem   !important; }
.fs-5   { font-size: 1.25rem  !important; }
.fs-6   { font-size: 1rem     !important; }
.font-monospace { font-family: monospace !important; }
.lh-1   { line-height: 1     !important; }
.lh-sm  { line-height: 1.25  !important; }
.lh-base{ line-height: 1.5   !important; }
.lh-lg  { line-height: 2     !important; }

/* ── Border ── */
.border          { border: 1px solid #dee2e6 !important; }
.border-0        { border: 0                 !important; }
.border-top      { border-top:    1px solid #dee2e6 !important; }
.border-bottom   { border-bottom: 1px solid #dee2e6 !important; }
.border-start    { border-left:   1px solid #dee2e6 !important; }
.border-end      { border-right:  1px solid #dee2e6 !important; }
.border-top-0    { border-top:    0 !important; }
.border-bottom-0 { border-bottom: 0 !important; }
.border-start-0  { border-left:   0 !important; }
.border-end-0    { border-right:  0 !important; }

.rounded        { border-radius: 0.375rem !important; }
.rounded-0      { border-radius: 0        !important; }
.rounded-1      { border-radius: 0.25rem  !important; }
.rounded-2      { border-radius: 0.375rem !important; }
.rounded-3      { border-radius: 0.5rem   !important; }
.rounded-4      { border-radius: 1rem     !important; }
.rounded-5      { border-radius: 2rem     !important; }
.rounded-circle { border-radius: 50%      !important; }
.rounded-pill   { border-radius: 100px    !important; }
.rounded-top    { border-bottom-left-radius: 0  !important; border-bottom-right-radius: 0 !important; }
.rounded-bottom { border-top-left-radius: 0     !important; border-top-right-radius: 0    !important; }
.rounded-start  { border-top-right-radius: 0    !important; border-bottom-right-radius: 0 !important; }
.rounded-end    { border-top-left-radius: 0     !important; border-bottom-left-radius: 0  !important; }
.rounded-start-0{ border-top-left-radius: 0    !important; border-bottom-left-radius: 0   !important; }
.rounded-end-0  { border-top-right-radius: 0   !important; border-bottom-right-radius: 0  !important; }

/* ── Position ── */
.position-static   { position: static   !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed    { position: fixed    !important; }
.position-sticky   { position: sticky  !important; top: 0; }
.top-0    { top:    0 !important; }
.top-50   { top:    50% !important; }
.top-100  { top:    100% !important; }
.bottom-0 { bottom: 0 !important; }
.start-0  { left:   0 !important; }
.start-50 { left:   50% !important; }
.end-0    { right:  0 !important; }
.end-50   { right:  50% !important; }
.translate-middle { transform: translate(-50%, -50%) !important; }

/* ── Overflow ── */
.overflow-auto    { overflow:   auto    !important; }
.overflow-hidden  { overflow:   hidden  !important; }
.overflow-visible { overflow:   visible !important; }
.overflow-scroll  { overflow:   scroll  !important; }
.overflow-x-auto  { overflow-x: auto    !important; }
.overflow-y-auto  { overflow-y: auto    !important; }

/* ── Shadow ── */
.shadow-none { box-shadow: none !important; }
.shadow-sm   { box-shadow: 0 1px 2px rgba(0,0,0,0.075) !important; }
.shadow      { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important; }
.shadow-lg   { box-shadow: 0 1rem 3rem rgba(0,0,0,0.175) !important; }

/* ── Background ── */
.bg-transparent { background-color: transparent !important; }
.bg-white       { background-color: #ffffff     !important; }
.bg-light       { background-color: #f8f9fa     !important; }
.bg-dark        { background-color: #212529     !important; }
.bg-primary     { background-color: #0d6efd     !important; }
.bg-success     { background-color: #198754     !important; }
.bg-danger      { background-color: #dc3545     !important; }
.bg-warning     { background-color: #ffc107     !important; }

/* ── List ── */
.list-unstyled { padding-left: 0; margin-bottom: 0; list-style: none; }
.list-inline   { padding-left: 0; list-style: none; }
.list-inline-item { display: inline-block; }
.list-inline-item:not(:last-child) { margin-right: 0.5rem; }

/* ── Float / float utils ── */
.float-start   { float: left  !important; }
.float-end     { float: right !important; }
.float-none    { float: none  !important; }
.pull-right    { float: right !important; }
.pull-left     { float: left  !important; }
.clearfix::after { display: block; clear: both; content: ""; }

/* ── Misc ── */
.cursor-pointer   { cursor: pointer    !important; }
.pe-none          { pointer-events: none !important; }
.pe-auto          { pointer-events: auto !important; }
.user-select-none { user-select: none  !important; }
.user-select-all  { user-select: all   !important; }
.invisible        { visibility: hidden  !important; }
.visible          { visibility: visible !important; }
.opacity-0        { opacity: 0   !important; }
.opacity-25       { opacity: 0.25 !important; }
.opacity-50       { opacity: 0.5 !important; }
.opacity-75       { opacity: 0.75 !important; }
.opacity-100      { opacity: 1   !important; }
.visually-hidden,
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ── NAV / Tabs ── */
.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}
.nav-tabs {
  border-bottom: 2px solid var(--border, #dee2e6);
  gap: 2px;
}
.nav-tabs .nav-item { margin-bottom: -2px; }
.nav-tabs .nav-link {
  display: block;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted, #6c757d);
  border: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 150ms, border-color 150ms;
  background: none;
  white-space: nowrap;
}
.nav-tabs .nav-link:hover {
  color: var(--text, #212529);
  border-color: transparent transparent var(--border, #dee2e6);
}
.nav-tabs .nav-link.active {
  color: var(--brand-navy, #002F86);
  border-bottom-color: var(--brand-navy, #002F86);
  font-weight: 600;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
  color: var(--brand-gold, #D5A716);
  border-bottom-color: var(--brand-gold, #D5A716);
}
.nav-tabs .nav-link.disabled { color: #adb5bd; pointer-events: none; cursor: default; }
.tab-content { padding-top: 20px; }
.tab-pane { display: none; }
.tab-pane.active,
.tab-pane.show.active { display: block; }
.fade { opacity: 1; }   /* suppress Bootstrap's opacity animation — instant show */

/* ── Modal (Bootstrap-compatible) ── */
body.modal-open { overflow: hidden; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1055;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}
.modal.show { display: block; }
/* .fade on .modal does nothing — instant open */

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
}
.modal-dialog.modal-sm  { max-width: 300px; }
.modal-dialog.modal-md  { max-width: 500px; }
.modal-dialog.modal-lg  { max-width: 800px; }
.modal-dialog.modal-xl  { max-width: 1140px; }
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 3.5rem); overflow-y: auto; }
.modal.show .modal-dialog { pointer-events: auto; }

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background: var(--bg-elev, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.2));
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.25);
  outline: 0;
  color: var(--text, #212529);
}
.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.175));
  border-radius: 12px 12px 0 0;
}
.modal-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--text, #212529); }
.modal-body  { position: relative; flex: 1 1 auto; padding: 1rem; color: var(--text, #212529); }
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid var(--border, rgba(0,0,0,0.175));
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0,0,0,0.5);
}

.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  border: 0;
  border-radius: 4px;
  opacity: 0.5;
  cursor: pointer;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat;
  color: var(--text-muted, #6c757d);
}
.btn-close:hover { opacity: 1; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

/* ── Dropdown ── */
.dropdown          { position: relative; }
.dropup            { position: relative; }
.dropend           { position: relative; }
.dropstart         { position: relative; }

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 10rem;
  margin-top: 4px;
  list-style: none;
}
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-menu-start { left: 0; right: auto; }
.dropdown-divider { height: 0; margin: 4px 0; overflow: hidden; border-top: 1px solid var(--border, rgba(0,0,0,0.1)); }
.dropdown-header { padding: 6px 14px; font-size: 12px; color: var(--text-muted, #6c757d); white-space: nowrap; }
.dropdown-item:focus { outline: 0; }

/* ── Form checks / switches ── */
.form-group   { margin-bottom: 1rem; }
.form-label   { display: inline-block; margin-bottom: 0.5rem; }
.form-text    { display: block; margin-top: 0.25rem; font-size: 0.875em; color: #6c757d; }

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
  margin-bottom: 0.125rem;
}
.form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  margin-left: -1.5em;
  vertical-align: top;
  float: left;
}
.form-check-label { display: inline-block; cursor: pointer; }
.form-switch { padding-left: 2.5em; }
.form-switch .form-check-input { width: 2em; margin-left: -2.5em; }
.form-select {
  display: block; width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 1rem; font-weight: 400; line-height: 1.5;
  color: var(--text, #212529);
  background-color: var(--bg-elev, #fff);
  border: 1px solid var(--border, #ced4da);
  border-radius: 6px;
  appearance: none;
  transition: border-color 150ms;
}
.form-select:focus { outline: 0; border-color: var(--brand-navy, #002F86); box-shadow: 0 0 0 3px rgba(0,47,134,0.15); }

/* ── Input group ── */
.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}
.input-group > .form-control,
.input-group > .form-select { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  background-color: var(--bg-sunken, #e9ecef);
  border: 1px solid var(--border, #ced4da);
  color: var(--text-muted, #6c757d);
}
.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* ── Alert ── */
.alert {
  position: relative;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
}
.alert-primary   { background: rgba(13,110,253,0.1);  border-color: rgba(13,110,253,0.3);  color: #084298; }
.alert-secondary { background: rgba(108,117,125,0.1); border-color: rgba(108,117,125,0.3); color: #41464b; }
.alert-success   { background: rgba(25,135,84,0.1);   border-color: rgba(25,135,84,0.3);   color: #0a3622; }
.alert-danger    { background: rgba(220,53,69,0.1);   border-color: rgba(220,53,69,0.3);   color: #842029; }
.alert-warning   { background: rgba(255,193,7,0.1);   border-color: rgba(255,193,7,0.3);   color: #664d03; }
.alert-info      { background: rgba(13,202,240,0.1);  border-color: rgba(13,202,240,0.3);  color: #055160; }
.alert-light     { background: #fefefe; border-color: #fdfdfe; color: #636464; }
.alert-dark      { background: rgba(33,37,41,0.1);    border-color: rgba(33,37,41,0.3);    color: #141619; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}
.rounded-pill.badge { border-radius: 100px; }
.badge.bg-primary   { background: #0d6efd; color: #fff; }
.badge.bg-success   { background: #198754; color: #fff; }
.badge.bg-danger    { background: #dc3545; color: #fff; }
.badge.bg-warning   { background: #ffc107; color: #000; }
.badge.bg-secondary { background: #6c757d; color: #fff; }

/* ── Table base ── */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: inherit;
  vertical-align: top;
  border-color: var(--border, #dee2e6);
  border-collapse: collapse;
}
.table > :not(caption) > * > * {
  padding: 12px 16px;
  border-bottom-width: 1px;
}
.table > thead { vertical-align: bottom; }
.table > tbody > tr > th { font-weight: 600; }
.table-bordered > :not(caption) > * { border-width: 1px 0; }
.table-bordered > :not(caption) > * > * { border-width: 0 1px; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(0,0,0,0.025); }
.table-hover > tbody > tr:hover > * { background-color: rgba(0,0,0,0.04); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Pagination ── */
.pagination { display: flex; padding-left: 0; list-style: none; gap: 4px; }
.page-item {}
.page-link {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-muted, #6c757d);
  background: var(--bg-elev, #fff);
  border: 1px solid var(--border, #dee2e6);
  border-radius: 6px;
  text-decoration: none;
  transition: color 150ms, border-color 150ms, background-color 150ms;
  cursor: pointer;
}
.page-link:hover   { color: var(--brand-navy, #002F86); border-color: var(--brand-navy, #002F86); }
.page-item.active .page-link { background: var(--brand-navy, #002F86); color: #fff; border-color: var(--brand-navy, #002F86); }
.page-item.disabled .page-link { opacity: 0.5; pointer-events: none; }

/* ── Spinner ── */
.spinner-border {
  display: inline-block;
  width: 2rem; height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.2em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tooltip (basic native-title fallback) ── */
[data-bs-toggle="tooltip"] { cursor: default; }
