/* ──────────────────────────────────────────────────────────────────────────
   Ars Valetu — Bootstrap-compat layer (MediCare light default + dark).
   The legacy codebase still ships ~70 pages using Bootstrap 5 utilities
   (.btn, .form-control, .card, .table, .row/.col, spacing helpers, etc.).
   Class names stay; colors map to theme.css tokens for both themes.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: var(--es-control-h);
    padding: 0 0.85rem;
    border-radius: var(--es-control-radius);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    color: var(--es-text-1);
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--es-accent-soft);
}

.btn-sm { height: var(--es-control-h-sm); padding: 0 0.65rem; font-size: 0.78rem; }
.btn-lg { height: var(--es-control-h-lg); padding: 0 1.1rem; font-size: 0.95rem; }

.btn-primary { background: var(--es-accent); color: var(--es-accent-foreground); border-color: var(--es-accent); }
.btn-primary:hover { background: var(--es-accent-strong); border-color: var(--es-accent-strong); color: var(--es-accent-foreground); }

.btn-secondary { background: var(--es-bg-3); color: var(--es-text-1); border-color: var(--es-border-strong); }
.btn-secondary:hover { background: var(--es-bg-4); }

.btn-success { background: var(--es-success); color: var(--es-accent-foreground); border-color: var(--es-success); }
.btn-success:hover { filter: brightness(1.08); }

.btn-warning { background: var(--es-warning); color: var(--es-accent-foreground); border-color: var(--es-warning); }
.btn-warning:hover { filter: brightness(1.08); }

.btn-danger { background: var(--es-danger); color: #fff; border-color: var(--es-danger); }
.btn-danger:hover { filter: brightness(1.08); }

.btn-info { background: var(--es-info); color: var(--es-accent-foreground); border-color: var(--es-info); }
.btn-info:hover { filter: brightness(1.08); }

.btn-light { background: var(--es-bg-2); color: var(--es-text-1); border-color: var(--es-border); }
.btn-light:hover { background: var(--es-bg-3); }

.btn-dark { background: var(--es-bg-0); color: var(--es-text-1); border-color: var(--es-border); }
.btn-dark:hover { background: var(--es-bg-1); }

.btn-outline-primary   { color: var(--es-accent); border-color: var(--es-border-accent); }
.btn-outline-primary:hover   { background: var(--es-accent); color: var(--es-accent-foreground); border-color: var(--es-accent); }
.btn-outline-secondary { color: var(--es-text-2); border-color: var(--es-border-strong); }
.btn-outline-secondary:hover { background: var(--es-bg-3); color: var(--es-text-1); }
.btn-outline-success   { color: var(--es-success); border-color: rgba(34,197,94,.5); }
.btn-outline-success:hover   { background: var(--es-success); color: var(--es-accent-foreground); }
.btn-outline-warning   { color: var(--es-warning); border-color: rgba(245,158,11,.5); }
.btn-outline-warning:hover   { background: var(--es-warning); color: var(--es-accent-foreground); }
.btn-outline-danger    { color: var(--es-danger); border-color: rgba(239,68,68,.5); }
.btn-outline-danger:hover    { background: var(--es-danger); color: #fff; }
.btn-outline-info      { color: var(--es-info); border-color: rgba(56,189,248,.5); }
.btn-outline-info:hover      { background: var(--es-info); color: var(--es-accent-foreground); }
.btn-outline-light     { color: var(--es-text-1); border-color: var(--es-border); }
.btn-outline-light:hover     { background: var(--es-bg-3); }
.btn-outline-dark      { color: var(--es-text-2); border-color: var(--es-border-strong); }
.btn-outline-dark:hover      { background: var(--es-bg-0); color: var(--es-text-1); }

.btn-link { color: var(--es-accent); background: transparent; border: 0; }
.btn-link:hover { color: var(--es-accent-strong); text-decoration: underline; }

/* ── Forms ──────────────────────────────────────────── */
.form-control,
.form-select {
    width: 100%;
    background: var(--es-bg-1);
    color: var(--es-text-1);
    border: 1px solid var(--es-border-strong);
    border-radius: var(--es-control-radius);
    padding: 0.5rem 0.7rem;
    height: var(--es-control-h);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea.form-control { height: auto; min-height: 84px; line-height: 1.45; resize: vertical; }

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--es-accent);
    box-shadow: 0 0 0 3px var(--es-accent-soft);
}

.form-control::placeholder { color: var(--es-text-muted); }
.form-control:disabled, .form-select:disabled { opacity: 0.6; }

.form-control-sm, .form-select-sm { height: var(--es-control-h-sm); font-size: 0.8rem; padding: 0.35rem 0.55rem; }
.form-control-lg, .form-select-lg { height: var(--es-control-h-lg); font-size: 1rem; padding: 0.6rem 0.85rem; }

.form-label {
    display: inline-block;
    color: var(--es-text-2);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-text { font-size: 0.78rem; color: var(--es-text-muted); }

.form-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: 0;
    min-height: auto;
    margin-bottom: 0.25rem;
    color: var(--es-text-2);
}

.form-check-input {
    margin-left: 0;
    margin-top: 0;
    width: 14px;
    height: 14px;
    accent-color: var(--es-accent);
    background-color: var(--es-bg-1);
    border: 1px solid var(--es-border-strong);
}

.form-check-label { color: var(--es-text-2); font-size: 0.86rem; cursor: pointer; }

.form-switch .form-check-input { width: 32px; height: 18px; border-radius: 999px; }

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    flex: 1 1 auto;
    border-radius: 0;
}

.input-group > :first-child { border-top-left-radius: var(--es-control-radius); border-bottom-left-radius: var(--es-control-radius); }
.input-group > :last-child  { border-top-right-radius: var(--es-control-radius); border-bottom-right-radius: var(--es-control-radius); }

.input-group-text {
    display: inline-flex;
    align-items: center;
    padding: 0 0.7rem;
    background: var(--es-bg-2);
    color: var(--es-text-2);
    border: 1px solid var(--es-border-strong);
    border-radius: 0;
    font-size: 0.85rem;
    white-space: nowrap;
}

.input-group > .input-group-text + .form-control,
.input-group > .input-group-text + .form-select { border-left: 0; }

/* ── Card (legacy) ──────────────────────────────────── */
.card {
    background: var(--es-bg-2);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    color: var(--es-text-1);
    overflow: hidden;
}

.card-body { padding: var(--es-space-4); }

.card-header {
    padding: var(--es-space-3) var(--es-space-4);
    background: var(--es-bg-3);
    border-bottom: 1px solid var(--es-border);
    color: var(--es-text-1);
    font-weight: 600;
}

.card-footer {
    padding: var(--es-space-3) var(--es-space-4);
    background: var(--es-bg-3);
    border-top: 1px solid var(--es-border);
}

.card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4rem; color: var(--es-text-1); }
.card-text { color: var(--es-text-2); }
.card-subtitle { color: var(--es-text-3); font-size: 0.86rem; }

/* ── Tables (legacy) ────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--es-text-1);
    background: transparent;
    margin-bottom: 0;
    font-size: 0.86rem;
}

.table > :not(caption) > * > * {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--es-border);
    vertical-align: middle;
    background: transparent;
    color: inherit;
}

.table > thead > tr > th {
    background: var(--es-bg-3);
    color: var(--es-text-2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.74rem;
    text-align: left;
}

.table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(255, 255, 255, 0.018); }
.table-hover    > tbody > tr:hover              > * { background: var(--es-bg-3); }

.table-sm > :not(caption) > * > * { padding: 0.4rem 0.55rem; font-size: 0.82rem; }

.table-bordered { border: 1px solid var(--es-border); }
.table-bordered > :not(caption) > * > * { border: 1px solid var(--es-border); }

.table-responsive {
    overflow-x: auto;
    border-radius: var(--es-radius-md);
}

/* ── Alerts ─────────────────────────────────────────── */
.alert {
    border-radius: var(--es-radius-md);
    padding: 0.7rem 0.95rem;
    margin-bottom: var(--es-space-3);
    font-size: 0.86rem;
    border: 1px solid transparent;
}

.alert-primary   { background: var(--es-accent-soft);  color: #93c5fd; border-color: var(--es-border-accent); }
.alert-secondary { background: var(--es-bg-3);         color: var(--es-text-2); border-color: var(--es-border); }
.alert-success   { background: var(--es-success-soft); color: #86efac; border-color: rgba(34,197,94,.45); }
.alert-warning   { background: var(--es-warning-soft); color: #fcd34d; border-color: rgba(245,158,11,.45); }
.alert-danger    { background: var(--es-danger-soft);  color: #fca5a5; border-color: rgba(239,68,68,.45); }
.alert-info      { background: var(--es-info-soft);    color: #7dd3fc; border-color: rgba(56,189,248,.45); }
.alert-light     { background: var(--es-bg-2);         color: var(--es-text-1); border-color: var(--es-border); }
.alert-dark      { background: var(--es-bg-0);         color: var(--es-text-1); border-color: var(--es-border-strong); }

/* ── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 999px;
    color: var(--es-text-1);
    background: var(--es-bg-3);
    border: 1px solid var(--es-border);
    line-height: 1;
}

.bg-primary,   .text-bg-primary   { background: var(--es-accent)  !important; color: var(--es-accent-foreground) !important; }
.bg-secondary, .text-bg-secondary { background: var(--es-bg-3)    !important; color: var(--es-text-1) !important; }
.bg-success,   .text-bg-success   { background: var(--es-success) !important; color: var(--es-accent-foreground) !important; }
.bg-warning,   .text-bg-warning   { background: var(--es-warning) !important; color: var(--es-accent-foreground) !important; }
.bg-danger,    .text-bg-danger    { background: var(--es-danger)  !important; color: #fff !important; }
.bg-info,      .text-bg-info      { background: var(--es-info)    !important; color: var(--es-accent-foreground) !important; }
.bg-light,     .text-bg-light     { background: var(--es-bg-2)    !important; color: var(--es-text-1) !important; }
.bg-dark,      .text-bg-dark      { background: var(--es-bg-0)    !important; color: var(--es-text-1) !important; }

/* ── Text colors ────────────────────────────────────── */
.text-primary   { color: var(--es-accent)  !important; }
.text-secondary { color: var(--es-text-3)  !important; }
.text-success   { color: var(--es-success) !important; }
.text-warning   { color: var(--es-warning) !important; }
.text-danger    { color: var(--es-danger)  !important; }
.text-info      { color: var(--es-info)    !important; }
.text-light     { color: var(--es-text-1)  !important; }
.text-dark      { color: var(--es-text-1)  !important; }
.text-muted     { color: var(--es-text-3)  !important; }
.text-body      { color: var(--es-text-1)  !important; }
.text-white     { color: #ffffff           !important; }

/* ── Bootstrap grid ─────────────────────────────────── */
.container,
.container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--es-space-3);
    padding-left: var(--es-space-3);
}

.container { max-width: 1280px; }

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.row > * {
    box-sizing: border-box;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    width: 100%;
}

.col, .col-auto { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }

.col-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
.col-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3  { flex: 0 0 25%;        max-width: 25%; }
.col-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6  { flex: 0 0 50%;        max-width: 50%; }
.col-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9  { flex: 0 0 75%;        max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%;       max-width: 100%; }

@media (min-width: 576px) {
    .col-sm-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
    .col-sm-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-sm-3  { flex: 0 0 25%;        max-width: 25%; }
    .col-sm-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-6  { flex: 0 0 50%;        max-width: 50%; }
    .col-sm-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-sm-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-sm-9  { flex: 0 0 75%;        max-width: 75%; }
    .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-sm-12 { flex: 0 0 100%;       max-width: 100%; }
}

@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
    .col-md-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3  { flex: 0 0 25%;        max-width: 25%; }
    .col-md-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6  { flex: 0 0 50%;        max-width: 50%; }
    .col-md-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9  { flex: 0 0 75%;        max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-12 { flex: 0 0 100%;       max-width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
    .col-lg-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-3  { flex: 0 0 25%;        max-width: 25%; }
    .col-lg-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-6  { flex: 0 0 50%;        max-width: 50%; }
    .col-lg-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-9  { flex: 0 0 75%;        max-width: 75%; }
    .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-lg-12 { flex: 0 0 100%;       max-width: 100%; }
}

@media (min-width: 1200px) {
    .col-xl-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
    .col-xl-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-xl-3  { flex: 0 0 25%;        max-width: 25%; }
    .col-xl-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xl-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-xl-6  { flex: 0 0 50%;        max-width: 50%; }
    .col-xl-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-xl-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-xl-9  { flex: 0 0 75%;        max-width: 75%; }
    .col-xl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-xl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-xl-12 { flex: 0 0 100%;       max-width: 100%; }
}

/* ── Display utilities ──────────────────────────────── */
.d-none         { display: none !important; }
.d-inline       { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block        { display: block !important; }
.d-flex         { display: flex !important; }
.d-inline-flex  { display: inline-flex !important; }
.d-grid         { display: grid !important; }

@media (min-width: 768px) {
    .d-md-none         { display: none !important; }
    .d-md-block        { display: block !important; }
    .d-md-inline       { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-flex         { display: flex !important; }
    .d-md-grid         { display: grid !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-grid         { display: grid !important; }
}

/* ── Flex utilities ─────────────────────────────────── */
.flex-row       { flex-direction: row !important; }
.flex-row-reverse { flex-direction: row-reverse !important; }
.flex-column    { flex-direction: column !important; }
.flex-column-reverse { flex-direction: column-reverse !important; }
.flex-wrap      { flex-wrap: wrap !important; }
.flex-nowrap    { flex-wrap: nowrap !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; }
.flex-fill      { flex: 1 1 auto !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; }

.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-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; }

/* ── Spacing (margin / padding) — 0..5 → 0,4,8,12,16,24 ── */
.m-0  { margin: 0 !important; }
.m-1  { margin: 0.25rem !important; }
.m-2  { margin: 0.5rem !important; }
.m-3  { margin: 0.75rem !important; }
.m-4  { margin: 1rem !important; }
.m-5  { margin: 1.5rem !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: 0.75rem !important; } .mt-4 { margin-top: 1rem !important; } .mt-5 { margin-top: 1.5rem !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: 0.75rem !important; } .mb-4 { margin-bottom: 1rem !important; } .mb-5 { margin-bottom: 1.5rem !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: 0.75rem !important; }   .ms-4 { margin-left: 1rem !important; }   .ms-5 { margin-left: 1.5rem !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: 0.75rem !important; }  .me-4 { margin-right: 1rem !important; }  .me-5 { margin-right: 1.5rem !important; }  .me-auto { margin-right: auto !important; }
.mx-0 { margin-left: 0 !important; margin-right: 0 !important; } .mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; } .mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; } .mx-3 { margin-left: 0.75rem !important; margin-right: 0.75rem !important; } .mx-4 { margin-left: 1rem !important; margin-right: 1rem !important; } .mx-5 { margin-left: 1.5rem !important; margin-right: 1.5rem !important; } .mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; } .my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; } .my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; } .my-3 { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; } .my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; } .my-5 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.p-5 { padding: 1.5rem !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: 0.75rem !important; } .pt-4 { padding-top: 1rem !important; } .pt-5 { padding-top: 1.5rem !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: 0.75rem !important; } .pb-4 { padding-bottom: 1rem !important; } .pb-5 { padding-bottom: 1.5rem !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: 0.75rem !important; } .ps-4 { padding-left: 1rem !important; } .ps-5 { padding-left: 1.5rem !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: 0.75rem !important; } .pe-4 { padding-right: 1rem !important; } .pe-5 { padding-right: 1.5rem !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; } .px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; } .px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; } .px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; } .px-4 { padding-left: 1rem !important; padding-right: 1rem !important; } .px-5 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; } .py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; } .py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; } .py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; } .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; } .py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.5rem !important; }

/* ── Sizing utilities ───────────────────────────────── */
.w-25  { width: 25% !important; }
.w-50  { width: 50% !important; }
.w-75  { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.mw-100 { max-width: 100% !important; }
.h-25  { height: 25% !important; }
.h-50  { height: 50% !important; }
.h-75  { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

.min-vh-100 { min-height: 100vh !important; }
.vh-100     { height: 100vh !important; }

/* ── Borders / radius / shadows ─────────────────────── */
.border         { border: 1px solid var(--es-border) !important; }
.border-0       { border: 0 !important; }
.border-top     { border-top: 1px solid var(--es-border) !important; }
.border-bottom  { border-bottom: 1px solid var(--es-border) !important; }
.border-start   { border-left: 1px solid var(--es-border) !important; }
.border-end     { border-right: 1px solid var(--es-border) !important; }
.border-primary { border-color: var(--es-border-accent) !important; }
.border-success { border-color: rgba(34,197,94,.45) !important; }
.border-danger  { border-color: rgba(239,68,68,.45) !important; }
.border-warning { border-color: rgba(245,158,11,.45) !important; }
.border-info    { border-color: rgba(56,189,248,.45) !important; }

.rounded         { border-radius: var(--es-radius-md) !important; }
.rounded-0       { border-radius: 0 !important; }
.rounded-1       { border-radius: var(--es-radius-sm) !important; }
.rounded-2       { border-radius: var(--es-radius-md) !important; }
.rounded-3       { border-radius: var(--es-radius-lg) !important; }
.rounded-pill    { border-radius: 999px !important; }
.rounded-circle  { border-radius: 50% !important; }
.rounded-top     { border-top-left-radius: var(--es-radius-md) !important; border-top-right-radius: var(--es-radius-md) !important; }
.rounded-bottom  { border-bottom-left-radius: var(--es-radius-md) !important; border-bottom-right-radius: var(--es-radius-md) !important; }

.shadow         { box-shadow: var(--es-shadow-1) !important; }
.shadow-sm      { box-shadow: 0 1px 2px rgba(0,0,0,.4) !important; }
.shadow-lg      { box-shadow: var(--es-shadow-2) !important; }
.shadow-none    { box-shadow: none !important; }

/* ── Text utilities ─────────────────────────────────── */
.text-start  { text-align: left !important; }
.text-end    { text-align: right !important; }
.text-center { text-align: center !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }

.fs-1 { font-size: 1.75rem !important; }
.fs-2 { font-size: 1.45rem !important; }
.fs-3 { font-size: 1.2rem !important; }
.fs-4 { font-size: 1.05rem !important; }
.fs-5 { font-size: 0.95rem !important; }
.fs-6 { font-size: 0.86rem !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; }

.lh-1 { line-height: 1 !important; }
.lh-sm { line-height: 1.25 !important; }
.lh-base { line-height: 1.5 !important; }
.lh-lg { line-height: 1.7 !important; }

.fst-italic { font-style: italic !important; }
.fst-normal { font-style: normal !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 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0  { left: 0 !important; }
.end-0    { right: 0 !important; }

/* ── Misc ───────────────────────────────────────────── */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }
.overflow-scroll { overflow: scroll !important; }
.overflow-visible{ overflow: visible !important; }

.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: .25 !important; }
.opacity-50 { opacity: .5 !important; }
.opacity-75 { opacity: .75 !important; }
.opacity-100 { opacity: 1 !important; }

.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

.user-select-none { user-select: none !important; }

.cursor-pointer { cursor: pointer !important; }

/* ── Modal-like compatibility ───────────────────────── */
.bg-white  { background: var(--es-bg-2) !important; color: var(--es-text-1) !important; }
.bg-body   { background: var(--es-bg-1) !important; }
.bg-light  { background: var(--es-bg-2) !important; color: var(--es-text-1) !important; }
.bg-dark   { background: var(--es-bg-0) !important; color: var(--es-text-1) !important; }
.bg-transparent { background: transparent !important; }

/* ── List group ────────────────────────────────────── */
.list-group {
    display: flex;
    flex-direction: column;
    border-radius: var(--es-radius-md);
    overflow: hidden;
    border: 1px solid var(--es-border);
    background: var(--es-bg-2);
}

.list-group-item {
    padding: 0.6rem 0.85rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--es-border);
    color: var(--es-text-1);
    font-size: 0.86rem;
}

.list-group-item:last-child { border-bottom: 0; }

.list-group-item-action { cursor: pointer; transition: background .14s ease; }
.list-group-item-action:hover { background: var(--es-bg-3); }
.list-group-item.active { background: var(--es-accent-soft); color: var(--es-text-1); }

/* ── Spinner ───────────────────────────────────────── */
.spinner-border {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--es-accent-soft);
    border-top-color: var(--es-accent);
    border-radius: 50%;
    animation: spinner-border 0.8s linear infinite;
}

.spinner-border-sm { width: 0.85rem; height: 0.85rem; border-width: 1.5px; }

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* ── Modal-like inputs (input-group with btn) ───────── */
.input-group .btn { border-radius: 0; }
.input-group > .btn:first-child { border-top-left-radius: var(--es-control-radius); border-bottom-left-radius: var(--es-control-radius); }
.input-group > .btn:last-child  { border-top-right-radius: var(--es-control-radius); border-bottom-right-radius: var(--es-control-radius); }

/* ── Nav / pills (legacy) ───────────────────────────── */
.nav { display: flex; flex-wrap: wrap; padding-left: 0; margin: 0; list-style: none; }
.nav-item { }
.nav-link {
    display: block;
    padding: 0.45rem 0.85rem;
    color: var(--es-text-2);
    text-decoration: none;
    border-radius: var(--es-radius-sm);
    transition: background .15s ease, color .15s ease;
}

.nav-link:hover { color: var(--es-text-1); background: var(--es-bg-3); text-decoration: none; }
.nav-link.active { color: var(--es-text-1); background: var(--es-accent-soft); }

.nav-tabs { border-bottom: 1px solid var(--es-border); }
.nav-tabs .nav-link { border-radius: var(--es-radius-sm) var(--es-radius-sm) 0 0; border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--es-text-1); background: transparent; border-bottom-color: var(--es-accent); }

/* ── Modal (in case any leak through) ───────────────── */
.modal-content {
    background: var(--es-bg-2);
    color: var(--es-text-1);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
}

.modal-header {
    background: var(--es-bg-3);
    border-bottom: 1px solid var(--es-border);
}

.modal-footer { border-top: 1px solid var(--es-border); }

/* ── Misc Bootstrap helpers ─────────────────────────── */
.invalid-feedback { color: var(--es-danger); font-size: 0.78rem; margin-top: 0.2rem; }
.is-invalid { border-color: var(--es-danger) !important; }
.is-valid   { border-color: var(--es-success) !important; }
