/* ==========================================================================
   TABLE OF CONTENTS
   1. :root Variables
   2. Dark Mode & Color Presets
   3. Base / Resets
   4. Typography & Headings
   5. Components
   6. Layout Chrome (Header, Nav, Footer, Sections)
   7. Marketing / Landing Sections
   8. Utility Overrides (Bootstrap Theme Bridge)
   ========================================================================== */

/* ==========================================================================
   1. :root Variables
   -------------------------------------------------------------------------
   Single consolidated :root block. Update values here to re-theme the
   entire site (fonts, colors, Bootstrap bridges, nav colors, design
   tokens).
   ========================================================================== */
:root {
  /* --- Fonts --- */
    --default-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      --heading-font: var(--default-font);
      --nav-font: var(--default-font);

  /* --- Global Colors ---
       The following color variables are used throughout the website.
       Updating them here will change the color scheme of the entire website */
  --background-color: #edf2f7;
  /* Page background – change this one value to re-theme the site */
  --default-color: #444444; /* Default color used for the majority of the text content across the entire website */
  --heading-color: #1A202C;
  /* Color for headings, subheadings and title throughout the website */
    --accent-color: #002776;
    /* Accent color that represents your brand on the website. It's used for buttons, links, and other elements that need to stand out */
  --surface-color: var(--background-color);
  /* Cards, tables, widgets – same as page background */
    --surface-muted-color: var(--background-color);
    /* Former bg-light / table-light areas */
    --input-background-color: var(--background-color);
    /* Form fields and input groups */
  --contrast-color: #ffffff; /* Contrast color for text, ensuring readability against backgrounds of accent, heading, or default colors. */
  --danger-color: #dc3545; /* Hot / max / error accents (e.g. weather max temp) */
  --success-color: #16a34a; /* Crisp positive / up-trend accents */
  --warning-color: #d97706; /* Amber alert accents (stale quotes, caution pills) */
  --info-color: #0dcaf0; /* Cool info accents (e.g. rain probability / volume) */
  --muted-color: #6c757d; /* Secondary / muted text used by charts and labels */
  --chart-neutral-color: #cbd5e1; /* Soft slate for unused/secondary chart segments (e.g. disponible sobregiro) */
/* --- Bootstrap bridge – keeps vendor utilities in sync with the theme --- */
  --bs-body-bg: var(--background-color);
  --bs-body-bg-rgb: 241, 247, 252;
  --bs-secondary-bg: var(--background-color);
  --bs-tertiary-bg: var(--background-color);
  --bs-card-bg: var(--background-color);
  --bs-card-cap-bg: var(--background-color);
  --bs-dropdown-bg: var(--background-color);
  --bs-modal-bg: var(--background-color);
  --bs-offcanvas-bg: var(--background-color);
  --bs-popover-bg: var(--background-color);
  --bs-toast-bg: var(--background-color);
  --bs-accordion-bg: var(--background-color);
  --bs-list-group-bg: var(--background-color);
  --bs-light: var(--background-color);
  --bs-light-bg-subtle: var(--background-color);
  /*--bs-gray-100: var(--background-color);*/

  /* --- Nav Menu Colors ---
       The following color variables are used specifically for the navigation
       menu. They are separate from the global colors to allow for more
       customization options */
  /* The default color of the main navmenu links */
  --nav-color: #002776;
    /* Applied to main navmenu links when they are hovered over or active */
    --nav-hover-color: #00277680;
  --nav-mobile-background-color: var(--surface-color);
  /* Used as the background color for mobile navigation menu */
    --nav-dropdown-background-color: var(--surface-color);
    /* Used as the background color for dropdown items that appear when hovering over primary navigation items */
  --nav-dropdown-color: #002776;
  /* Used for navigation links of the dropdown items in the navigation menu. */
    --nav-dropdown-hover-color: #00277680;
    /* Similar to --nav-hover-color, this color is applied to dropdown navigation links when they are hovered over. */
/* --- Smooth scroll --- */
  scroll-behavior: smooth;

  /* --- Design tokens: spacing / typography / radius --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --radius-sm: 0.375rem;
  --radius-pill: 50rem;

  /* --- Soft chrome (subtle icon buttons / period nav) --- */
  --chrome-control-size: 2.25rem;
  --chrome-soft-bg: color-mix(in srgb, var(--heading-color) 7%, var(--background-color));
  --chrome-soft-bg-hover: color-mix(in srgb, var(--heading-color) 12%, var(--background-color));
  --chrome-soft-fg: color-mix(in srgb, var(--heading-color) 72%, var(--muted-color));
  --chrome-soft-fg-disabled: color-mix(in srgb, var(--muted-color) 55%, var(--background-color));

  /* --- Detail list cards + interactive row selection (Movimientos / Comprobantes) ---
     --card-detail-bg: opaque elevated card surface (day groups, mobile comprobante cards).
     --list-row-active-bg: semi-transparent wash (4% heading) composited OVER --card-detail-bg
     for hover/expanded parent rows. Not the same recipe as --chrome-soft-bg. */
  --card-detail-bg: #ffffff;
  --list-row-active-bg: color-mix(in srgb, var(--heading-color), transparent 96%);

/* --- Sticky header glass (frosted shell; light vs dark opacities) --- */
  --header-glass-bg: color-mix(in srgb, var(--background-color) 50%, transparent);
  --header-glass-border: color-mix(in srgb, var(--heading-color) 18%, transparent);
  --header-glass-blur: 12px;

  /* Quotes widget panel (home cotizaciones). Light: frosted glass over the hero.
                         Dark override is opaque — see [data-bs-theme="dark"]. */
  --quotes-widget-glass-bg: color-mix(in srgb, var(--contrast-color) 38%, transparent);

  /* --- Page shell (constrained content width; not full-bleed) ---
     Matches Bootstrap .container horizontal gutters + py-4 vertical rhythm.
     --wide variant: full-bleed with stepped gutters (detail dashboards). */
  --page-shell-pad-y: 1.5rem;
  --page-shell-pad-x: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  --page-shell-wide-pad-x: 0.5rem;      /* ~ Bootstrap px-2 */
  --page-shell-wide-pad-x-md: 1rem;     /* ~ Bootstrap px-md-3 */
  --page-shell-wide-pad-x-xl: 3rem;     /* ~ Bootstrap px-xl-5 */
  --page-shell-wide-pad-y: 1.5rem;
}

body,
.header,
.header .topbar,
.footer,
.card,
.table-mobile-cards tbody tr,
.offcanvas,
.modal-content,
.dropdown-menu {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ==========================================================================
   2. Dark Mode & Color Presets
   ========================================================================== */
/* Dark mode – Bootstrap data-bs-theme on <html>; overrides custom tokens above */
[data-bs-theme="dark"] {
  --background-color: #0f1419;
  --default-color: #e2e8f0;
  --heading-color: #f7fafc;
  --accent-color: #4a7fd4;
  /* Cards / elevated surfaces: slightly lighter than page background */
  --surface-color: #151b22;
  --surface-muted-color: #151b22;
  --input-background-color: #151b22;
  --contrast-color: #ffffff;
  --danger-color: #f87171;
  --success-color: #4ade80;
  --warning-color: #fbbf24;
  --info-color: #38bdf8;
  --muted-color: #94a3b8;
  --chart-neutral-color: #a8b5c4;

  --bs-body-bg: var(--background-color);
  --bs-body-bg-rgb: 15, 20, 25;
  --bs-body-color: var(--default-color);
  --bs-body-color-rgb: 226, 232, 240;
  --bs-emphasis-color: var(--heading-color);
  --bs-emphasis-color-rgb: 247, 250, 252;
  --bs-secondary-color: rgba(226, 232, 240, 0.75);
  --bs-secondary-color-rgb: 226, 232, 240;
  --bs-tertiary-color: rgba(226, 232, 240, 0.5);
  --bs-tertiary-color-rgb: 226, 232, 240;
  --bs-heading-color: var(--heading-color);
  --bs-secondary-bg: var(--surface-color);
  --bs-tertiary-bg: var(--surface-color);
  --bs-card-bg: var(--surface-color);
  --bs-card-cap-bg: var(--surface-color);
  --bs-dropdown-bg: var(--surface-color);
  --bs-modal-bg: var(--surface-color);
  --bs-offcanvas-bg: var(--surface-color);
  --bs-popover-bg: var(--surface-color);
  --bs-toast-bg: var(--surface-color);
  --bs-accordion-bg: var(--surface-color);
  --bs-list-group-bg: var(--surface-color);
  --bs-light: var(--surface-color);
  --bs-light-bg-subtle: var(--surface-color);
  --bs-border-color: rgba(226, 232, 240, 0.2);
  --bs-border-color-translucent: rgba(226, 232, 240, 0.15);

  --nav-color: #cbd5e1;
  --nav-hover-color: #94a3b8;
  --nav-mobile-background-color: var(--surface-color);
  --nav-dropdown-background-color: var(--surface-color);
  --nav-dropdown-color: #cbd5e1;
  --nav-dropdown-hover-color: #94a3b8;

  --chrome-soft-bg: color-mix(in srgb, var(--contrast-color) 8%, var(--background-color));
  --chrome-soft-bg-hover: color-mix(in srgb, var(--contrast-color) 14%, var(--background-color));
  --chrome-soft-fg: var(--muted-color);
  --chrome-soft-fg-disabled: color-mix(in srgb, var(--muted-color) 45%, var(--background-color));

  /* Match .card-detail dark surface (Movimientos day cards) */
  --card-detail-bg: #151515;
  /* --list-row-active-bg stays the :root mix; it follows --heading-color automatically */

/* Denser glass in dark mode; soft edge (gray-700/50 feel) */
  --header-glass-bg: color-mix(in srgb, var(--background-color) 80%, transparent);
  --header-glass-border: color-mix(in srgb, var(--muted-color) 40%, transparent);

  /* Opaque elevated panel (same visual as the old 55% surface mix over page bg) */
    --quotes-widget-glass-bg: #12181e;
}

/* Color Presets - These classes override global colors when applied to any section or element, providing reuse of the sam color scheme. */

.light-background {
  color: var(--default-color);
  background-color: var(--background-color);
}

.dark-background {
  --background-color: #060606;
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --surface-color: #252525;
  --surface-muted-color: #252525;
  --input-background-color: var(--surface-color);
  --contrast-color: #ffffff;
  --bs-body-bg: var(--background-color);
  --bs-body-bg-rgb: 6, 6, 6;
  --bs-secondary-bg: var(--surface-color);
  --bs-tertiary-bg: var(--surface-color);
  --bs-card-bg: var(--surface-color);
  --bs-card-cap-bg: var(--surface-color);
  --bs-dropdown-bg: var(--surface-color);
  --bs-modal-bg: var(--surface-color);
  --bs-offcanvas-bg: var(--surface-color);
  --bs-popover-bg: var(--surface-color);
  --bs-toast-bg: var(--surface-color);
  --bs-accordion-bg: var(--surface-color);
  --bs-list-group-bg: var(--surface-color);
  --bs-light: var(--surface-color);
  --bs-light-bg-subtle: var(--surface-color);
  --bs-gray-100: var(--surface-color);
}

/* ==========================================================================
   3. Base / Resets
   ========================================================================== */
body {
  color: var(--default-color);
  background-color: var(--background-color);
  font-family: var(--default-font);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: 0.3s;
}

a:hover {
  color: color-mix(in srgb, var(--accent-color), transparent 25%);
  text-decoration: none;
}

/* ==========================================================================
   4. Typography & Headings
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--heading-color);
  font-family: var(--heading-font);
}

/*--------------------------------------------------------------
# Global Page Titles & Breadcrumbs
--------------------------------------------------------------*/
.page-title {
  color: var(--default-color);
  background-color: var(--background-color);
  position: relative;
}

.page-title .heading {
  padding: 80px 0;
  border-top: 1px solid color-mix(in srgb, var(--accent-color), transparent 80%);
}

.page-title .heading h1 {
  font-size: 38px;
  font-weight: 700;
}

.page-title nav {
  background-color: color-mix(in srgb, var(--accent-color), transparent 94%);
  padding: 20px 0;
}

.page-title nav ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.page-title nav ol li+li {
  padding-left: 10px;
}

.page-title nav ol li+li::before {
  content: "/";
  display: inline-block;
  padding-right: 10px;
  color: color-mix(in srgb, var(--default-color), transparent 70%);
}

/*--------------------------------------------------------------
# Global Section Titles
--------------------------------------------------------------*/
.section-title {
  text-align: center;
  padding-bottom: 60px;
  position: relative;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 20px;
  padding-bottom: 20px;
  position: relative;
}

.section-title h2:before {
  content: "";
  position: absolute;
  display: block;
  width: 160px;
  height: 1px;
  background: color-mix(in srgb, var(--default-color), transparent 60%);
  left: 0;
  right: 0;
  bottom: 1px;
  margin: auto;
}

.section-title h2::after {
  content: "";
  position: absolute;
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-color);
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}

.section-title p {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Page shell (.page-shell)
   Shared content margins for non–full-bleed app pages (lists, forms, historico).
   Use instead of repeating "container py-4". For edge-to-edge dashboards use
   .page-shell.page-shell--wide (replaces container-fluid px-2 px-md-3 px-xl-5).
   -------------------------------------------------------------------------- */
.page-shell {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding: var(--page-shell-pad-y) var(--page-shell-pad-x);
  max-width: 100%;
}

@media (min-width: 576px) {
  .page-shell:not(.page-shell--wide) {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .page-shell:not(.page-shell--wide) {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .page-shell:not(.page-shell--wide) {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .page-shell:not(.page-shell--wide) {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {
  .page-shell:not(.page-shell--wide) {
    max-width: 1320px;
  }
}

.page-shell--wide {
  max-width: none;
  padding: 0 var(--page-shell-wide-pad-x) var(--page-shell-wide-pad-y);
}

@media (min-width: 768px) {
  .page-shell--wide {
    padding-left: var(--page-shell-wide-pad-x-md);
    padding-right: var(--page-shell-wide-pad-x-md);
  }
}

@media (min-width: 992px) {
  .page-shell--wide {
    padding-top: var(--page-shell-wide-pad-y);
  }
}

@media (min-width: 1200px) {
  .page-shell--wide {
    padding-left: var(--page-shell-wide-pad-x-xl);
    padding-right: var(--page-shell-wide-pad-x-xl);
  }
}

/* --------------------------------------------------------------------------
   Page Header Bar (.page-header-bar)
   Shared by detailDashboard pages: primary title + optional muted subtitle
   + actions (e.g. back). Mobile sizing aligns with the stacked detail layout
   (same lg breakpoint as .table-mobile-cards / detail-dashboard).
   -------------------------------------------------------------------------- */
.page-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header-bar__heading {
  min-width: 0;
  flex: 1 1 auto;
}

.page-header-bar__title {
  display: flex;
  align-items: center;
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  color: var(--heading-color);
}

.page-header-bar__title > span:last-child {
  min-width: 0;
}

.page-header-bar__asset-mark {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
}

.page-header-bar__asset-mark.quotes-widget__mark svg {
  width: 1.1rem;
  height: 1.1rem;
}

.page-header-bar__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.35;
  word-break: break-word;
}

.page-header-bar__actions {
  display: flex;
  justify-content: flex-end;
  flex: 0 1 auto;
    margin-left: auto;
    max-width: 100%;
  padding-top: 0.2rem;
}

/*
 * Action buttons share one grid so columns are equal width (sized to the
 * widest label). On small screens the group goes full-width and stacks.
 */
.page-header-bar__action-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.5rem;
  width: max-content;
  max-width: 100%;
}

.page-header-bar__action-group>a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: max-content;
  white-space: nowrap;
  text-align: center;
}
.page-header-bar__back {
  white-space: nowrap;
}

/* Equalize back vs pill visual metrics in the header */
.page-header-bar__action-group .btn-back,
.page-header-bar__action-group .btn-pill,
.page-header-bar__action-group .btn-pill-dark {
  padding: 0.5rem 0.9rem;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  min-height: 2.75rem;
}
@media (max-width: 61.99875rem) {

  /* 991.98px — match Bootstrap lg / table-mobile-cards / detail-dashboard */
  .page-header-bar {
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .page-header-bar__title {
    font-size: clamp(1.25rem, 2.5vw + 0.85rem, 1.875rem);
  }

  .page-header-bar__subtitle {
    font-size: clamp(0.8125rem, 1.2vw + 0.65rem, 0.9375rem);
  }
}

@media (max-width: 575.98px) {
  .page-header-bar {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0.75rem;
  }

  .page-header-bar__actions {
    order: -1;
    flex-basis: auto;
    width: auto;
    margin-left: 0;
    padding-top: 0;
    justify-content: flex-start;
  }

  .page-header-bar__heading {
    width: 100%;
    text-align: left;
  }

  .page-header-bar__action-group {
    width: auto;
    max-width: 100%;
    grid-auto-flow: column;
    grid-auto-columns: auto;
    grid-template-columns: none;
  }

  /* Compact back / action pills — not full-bleed gray bars */
  .page-header-bar__action-group > a,
  .page-header-bar__back {
    width: auto;
    min-width: 0;
    justify-content: center;
  }
}

/* ==========================================================================
   5. Components
   ========================================================================== */

/* --- Buttons: Back (soft pill — shared Regresar baseline) --- */
.btn-back {
  --bs-btn-color: var(--heading-color);
  --bs-btn-bg: var(--chrome-soft-bg, rgba(0, 0, 0, 0.04));
  --bs-btn-border-color: color-mix(in srgb, var(--heading-color), transparent 88%);
  --bs-btn-hover-color: var(--heading-color);
  --bs-btn-hover-bg: var(--chrome-soft-bg-hover, rgba(0, 0, 0, 0.07));
  --bs-btn-hover-border-color: color-mix(in srgb, var(--heading-color), transparent 78%);
  --bs-btn-active-color: var(--heading-color);
  --bs-btn-active-bg: var(--chrome-soft-bg-hover, rgba(0, 0, 0, 0.07));
  --bs-btn-active-border-color: color-mix(in srgb, var(--heading-color), transparent 78%);
  --bs-btn-disabled-color: color-mix(in srgb, var(--heading-color), transparent 45%);
  --bs-btn-disabled-bg: var(--chrome-soft-bg, rgba(0, 0, 0, 0.04));
  --bs-btn-disabled-border-color: color-mix(in srgb, var(--heading-color), transparent 90%);
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-font-size: 0.875rem;
  --bs-btn-border-radius: var(--radius-pill, 50rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  font-weight: 500;
  line-height: 1.2;
  box-shadow: none;
}

.btn-back i {
  line-height: 0;
  font-size: 0.95rem;
}

/* --- Buttons: Table / primary action --- */
.btn-action {
  --bs-btn-color: var(--accent-color);
  --bs-btn-border-color: var(--accent-color);
  --bs-btn-hover-color: var(--background-color);
  --bs-btn-hover-bg: var(--accent-color);
  --bs-btn-hover-border-color: var(--accent-color);
  --bs-btn-active-color: var(--background-color);
  --bs-btn-active-bg: var(--accent-color);
  --bs-btn-active-border-color: var(--accent-color);
  --bs-btn-disabled-color: var(--accent-color);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--accent-color);
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.5rem;
  --bs-btn-font-size: 0.875rem;
  --bs-btn-border-radius: var(--bs-border-radius-sm, 0.25rem);
  background-color: transparent;
  border: var(--bs-btn-border-width, 1px) solid var(--bs-btn-border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-action:hover {
  color: var(--bs-btn-hover-color);
  background-color: var(--bs-btn-hover-bg);
  border-color: var(--bs-btn-hover-border-color);
}

/* --- Buttons: Fill (solid accent, rounded box — matches form fields) ---
   Use for primary CTAs that should NOT be pill-shaped or transparent.
   Example: class="btn btn-fill" */
.btn-fill {
  --bs-btn-color: var(--contrast-color);
  --bs-btn-bg: var(--accent-color);
  --bs-btn-border-color: var(--accent-color);
  --bs-btn-hover-color: var(--contrast-color);
  --bs-btn-hover-bg: color-mix(in srgb, var(--accent-color), #000 25%);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--accent-color), #000 25%);
  --bs-btn-active-color: var(--contrast-color);
  --bs-btn-active-bg: color-mix(in srgb, var(--accent-color), #000 35%);
  --bs-btn-active-border-color: color-mix(in srgb, var(--accent-color), #000 35%);
  --bs-btn-disabled-color: var(--contrast-color);
  --bs-btn-disabled-bg: var(--accent-color);
  --bs-btn-disabled-border-color: var(--accent-color);
  --bs-btn-padding-y: 0.375rem;
  --bs-btn-padding-x: 0.75rem;
  --bs-btn-font-size: var(--font-size-sm);
  --bs-btn-border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* --- Buttons: Pill (filled accent, fully rounded) ---
   Primary CTA for list/table actions. Prefer class="btn-pill".
   .btn-pill-dark is kept as an alias for existing prestamos markup. */
.btn-pill,
.btn-pill-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.25rem 1.25rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: normal;
  text-decoration: none;
  color: var(--contrast-color);
  background-color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-pill);
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.btn-pill:hover,
.btn-pill:focus,
.btn-pill-dark:hover,
.btn-pill-dark:focus {
  color: var(--contrast-color);
  background-color: color-mix(in srgb, var(--accent-color), #000 25%);
  border-color: color-mix(in srgb, var(--accent-color), #000 25%);
}

.btn-pill:active,
.btn-pill-dark:active {
  color: var(--contrast-color);
  background-color: color-mix(in srgb, var(--accent-color), #000 35%);
  border-color: color-mix(in srgb, var(--accent-color), #000 35%);
}

/* --- Universal size modifiers ---
   Compose with ANY button type (btn-back, btn-action, btn-fill, btn-pill, …).
   Only changes size — never color, fill, or shape. */
.btn-size-lg {
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-font-size: 1.25rem;
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 500;
}

.btn-size-sm {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.5rem;
  --bs-btn-font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* --- Buttons: Aligned content (icon + text) ---
   Use for buttons that have both an icon and text, ensuring proper alignment
   and spacing. */
.btn-aligned-content {
  display: grid !important;
  grid-template-columns: 24px 1fr;
  align-items: center;
  justify-content: start;
  gap: 0.5rem;
  text-align: left;
  width: 100%;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

.btn-aligned-content i {
  grid-column: 1;
  justify-self: center;
  margin: 0 !important;
}

.btn-aligned-content span {
  grid-column: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* --------------------------------------------------------------------------
   Detail Dashboard — single source for shell + full sidebar kit
   Layout, socio card, params, card-info metrics, donut/progress, capital.
   Used by prestamos detail, cuentas detail, and any future detailDashboard pages.
   Page CSS (prestamos.css / cuentas.css) should only style page-specific main content.
   -------------------------------------------------------------------------- */
.detail-dashboard {
  display: flex;
  flex-direction: column;
  width: 100%;
}

@media (min-width: 992px) {
  .detail-dashboard {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    min-height: calc(100vh - 5rem);
  }
}

.detail-dashboard__sidebar {
  flex-shrink: 0;
  width: 100%;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--background-color);
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 75%);
}

@media (min-width: 992px) {
  .detail-dashboard__sidebar {
    flex: 0 0 21rem;
    width: 21rem;
    max-width: 21rem;
    margin: 0;
    border-bottom: none;
    border-right: 1px solid color-mix(in srgb, var(--heading-color), transparent 75%);
    align-self: stretch;
  }
}

.detail-dashboard__sidebar-inner {
  padding: 1.5rem 1rem 2rem;
  text-align: center;
}

@media (min-width: 992px) {
  .detail-dashboard__sidebar-inner {
    padding: 1.5rem 1.25rem 2.5rem;
  }
}

.detail-dashboard__main {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 75%);
  padding: 1rem 0.25rem 1.5rem;
}

@media (min-width: 992px) {
  .detail-dashboard__main {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    border-top: none;
    padding: 1.5rem 1.5rem 2.5rem 1rem;
  }
}

.detail-dashboard__main-inner {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

@media (min-width: 992px) {
  .detail-dashboard__main-inner {
    padding: 1rem 1.5rem 0;
  }
}

/* Shared identity card used at the top of list pages. */
.socio-card {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  width: 100%;
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 82%);
  border-radius: 0.5rem;
  background-color: var(--surface-color);
  box-shadow: 0 0.125rem 0.25rem color-mix(in srgb, var(--heading-color), transparent 92%);
  text-align: left;
}

.socio-card__badge {
  display: flex;
  flex: 0 0 3rem;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--contrast-color);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.025em;
}

.socio-card__body {
  min-width: 0;
}

.socio-card__primary {
  color: var(--heading-color);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

.socio-card__secondary {
  color: var(--muted-color);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Socio / account identity card at top of sidebar */
.detail-dashboard__socio-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin: 0 auto 1.25rem;
  max-width: 20rem;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 80%);
  border-radius: 0.5rem;
  background-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  text-align: left;
}

.detail-dashboard__socio-badge {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--contrast-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

/* Identity text inside socio-card (account # / name) */
.detail-dashboard__socio-card .detail-dashboard__param-value {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--heading-color);
  line-height: 1.3;
  margin-bottom: 0;
}

.detail-dashboard__socio-card .detail-dashboard__param-label {
  font-size: 0.875rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: color-mix(in srgb, var(--default-color), transparent 15%);
  margin-bottom: 0;
  line-height: 1.2;
}

.detail-dashboard__socio-cuenta-nombre {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 0.1rem;
  margin-bottom: 0.15rem;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}

/* Param grid (loan stats, etc.) — available on any detail sidebar */
.detail-dashboard__params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.detail-dashboard__param {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

.detail-dashboard__param-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--contrast-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.detail-dashboard__param-value {
  font-weight: 700;
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--heading-color);
  line-height: 1.3;
}

.detail-dashboard__param-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
  margin-bottom: 0;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.detail-dashboard__descripcion {
  font-weight: 700;
  text-align: center;
  margin-top: 1rem;
  color: var(--heading-color);
}

/* Sidebar metric card (saldo, capital actual, …) */
.card-info {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.card-info__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
  margin-bottom: 0.15rem;
}

.card-info__value {
  font-size: 1.875rem;
  font-weight: 500;
  color: var(--accent-color);
  margin-bottom: 0.25rem;
  word-break: break-word;
  letter-spacing: -0.01em;
}

.card-info__secondary {
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--default-color), transparent 15%);
  margin-bottom: 0.5rem;
}

/* Donut / circular progress (sidebar widget from detailDashboard) */
.donut-chart {
  color: var(--accent-color); /* default fill via stroke="currentColor" */
}

.donut-chart--danger {
  color: var(--danger-color);
}

.donut-chart-section svg,
.donut-chart svg {
  filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.05));
}

.donut-chart--sm svg {
  width: 9.5rem;
  height: 9.5rem;
}

.donut-chart__fill {
  transition: stroke-dasharray 1.5s cubic-bezier(0.25, 0.8, 0.25, 1),
              stroke-dashoffset 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Empty tip only on danger (sobregiro) charts */
.donut-chart__empty-dot {
  display: none;
}

.donut-chart--danger .donut-chart__empty-dot {
  display: unset;
}

.donut-chart__center {
  text-align: center;
}

/* Two-metric donut hole (préstamos + cuentas disponible). Shared so both match. */
.donut-chart__center-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-chart__center-stack-label {
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #6c757d;
}

.donut-chart__center-stack-label--sub {
  font-size: 0.65rem;
  letter-spacing: normal;
}

.donut-chart__center-stack-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--heading-color);
}

.donut-chart__center-stack-value--sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: #6c757d;
}

.donut-chart__center-stack-rule {
  width: 50%;
  height: 0;
  margin: 0.5rem auto;
  border: 0;
  border-top: 1px solid #dee2e6;
  opacity: 1;
  color: inherit;
}

.donut-chart__center-value {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--heading-color);
  line-height: 1.15;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.donut-chart__center-value--sm {
  font-size: 1.5rem;
  font-weight: 600;
}

.donut-chart__center-label {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #a0aec0;
  line-height: 1.2;
  white-space: nowrap;
}

.donut-chart--sm .donut-chart__center-label {
  font-size: 0.65rem;
}

/* Sidebar legend (horizontal progress rows under donuts) */
.detail-dashboard__legend {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem auto 0;
  max-width: 18rem;
  width: 100%;
  text-align: left;
}

.detail-dashboard__legend-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) 1fr minmax(2.5rem, auto);
  align-items: center;
  gap: 0.5rem 0.65rem;
}

/* Compact sobregiro bars: label wraps on its own line; bar + amount share the row below */
.detail-dashboard__legend--bars .detail-dashboard__legend-row {
  grid-template-columns: minmax(0, 1fr) 4.75rem;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.2rem 0.5rem;
}

.detail-dashboard__legend--bars .detail-dashboard__legend-label {
  grid-column: 1 / -1;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.detail-dashboard__legend--bars .detail-dashboard__legend-track {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.detail-dashboard__legend--bars .detail-dashboard__legend-value {
  grid-column: 2;
  width: 4.75rem;
  min-width: 4.75rem;
  max-width: 4.75rem;
  box-sizing: border-box;
}

.detail-dashboard__legend-row--muted .detail-dashboard__legend-label,
.detail-dashboard__legend-row--muted .detail-dashboard__legend-value {
  color: #a0aec0;
  opacity: 0.85;
}
.detail-dashboard__legend-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #718096;
  line-height: 1.2;
  white-space: nowrap;
}

.detail-dashboard__legend-label--danger {
  color: var(--danger-color);
}

.detail-dashboard__legend-track {
  height: 0.4rem;
  border-radius: 9999px;
  background-color: #e2e8f0;
  overflow: hidden;
  min-width: 0;
}

.detail-dashboard__legend-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background-color: #a0aec0;
}

.detail-dashboard__legend-fill--danger,
.detail-dashboard__legend-fill.is-negative {
  background-color: var(--danger-color);
}

.detail-dashboard__legend-fill--accent,
.detail-dashboard__legend-fill.is-accent {
  background-color: var(--accent-color);
}

.detail-dashboard__legend-value {
  font-size: 0.7rem;
  color: #a0aec0;
  text-align: right;
  white-space: nowrap;
  min-height: 1em;
}

/* Soft meta panel under sobregiro bars (total + rates) */
.detail-dashboard__meta {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem auto 0;
  max-width: 18rem;
  width: 100%;
  padding: 1rem;
  border-radius: 0.5rem;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
  background-color: var(--chrome-soft-bg);
  text-align: left;
}

.detail-dashboard__meta-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-dashboard__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.detail-dashboard__meta-row--sub {
  padding-left: 1rem;
}

.detail-dashboard__meta-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted-color);
  line-height: 1.25;
}

.detail-dashboard__meta-label--sub {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted-color);
}

.detail-dashboard__meta-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--heading-color);
  text-align: right;
  white-space: nowrap;
}

.detail-dashboard__meta-value--debt {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--danger-color);
}

/* --------------------------------------------------------------------------
   Site-wide privacy (localStorage via privacy.js → html[data-privacy])
   Mark amounts with .js-privacy-sensitive; charts/bars with .js-privacy-chart
   -------------------------------------------------------------------------- */
.privacy-toggle,
.cuentas-privacy-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm, 0.35rem);
  background: transparent;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.privacy-toggle:hover,
.privacy-toggle:focus-visible,
.cuentas-privacy-toggle:hover,
.cuentas-privacy-toggle:focus-visible {
  color: var(--heading-color);
  background-color: var(--chrome-soft-bg, rgba(0, 0, 0, 0.04));
  outline: none;
}

.card-info__heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

/* Shown only while privacy is on — plain-language escape hatch for accidental taps */
.privacy-mode-hint {
  display: none;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
}

html[data-privacy="hidden"] .privacy-mode-hint {
  display: block;
}

.js-privacy-sensitive {
  transition: filter 0.15s ease, color 0.15s ease;
}

html[data-privacy="hidden"] .js-privacy-sensitive {
  filter: blur(0.5rem);
  /* Neutral default text — no accent / danger debt signal through the blur */
  color: var(--default-color) !important;
  user-select: none;
  pointer-events: none;
}

/* Neutralize charts so fill % cannot reveal debt / overdraft usage */
html[data-privacy="hidden"] .js-privacy-chart .donut-chart__fill,
html[data-privacy="hidden"] .js-privacy-chart .donut-chart__empty-dot {
  opacity: 0;
  transition: opacity 0.15s ease;
}

html[data-privacy="hidden"] .js-privacy-chart .detail-dashboard__legend-fill {
  width: 0% !important;
  transition: width 0.15s ease;
}

html[data-privacy="hidden"] .js-privacy-chart .donut-chart svg {
  filter: none;
}

html[data-privacy="hidden"] .js-privacy-chart .detail-dashboard__legend-label--danger {
  color: var(--default-color) !important;
}

/* Optional capital / progress blocks (same sidebar kit; used when present) */
.detail-dashboard__capital-block {
  margin-bottom: 0.5rem;
}

.detail-dashboard__capital-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
  margin-bottom: 0.15rem;
}

.detail-dashboard__capital-actual {
  font-size: 1.875rem;
  font-weight: 500;
  color: var(--accent-color);
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.detail-dashboard__capital-total {
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--default-color), transparent 15%);
  margin-bottom: 0.5rem;
}

.detail-dashboard__progress-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  margin: 0 auto;
}

.detail-dashboard__progress-svg {
  display: block;
  width: 6.5rem;
  height: 6.5rem;
}

@media (min-width: 576px) {
  .detail-dashboard__progress-svg {
    width: 10rem;
    height: 10rem;
  }
}

@media (min-width: 992px) {
  .detail-dashboard__progress-svg {
    width: 12rem;
    height: 12rem;
  }
}

.detail-dashboard__progress-track {
  stroke: color-mix(in srgb, var(--heading-color), transparent 88%);
}

.detail-dashboard__progress-fill {
  transition: stroke-dasharray 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.detail-dashboard__progress-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--background-color);
  border-radius: 9999px;
  padding: 0.65rem 0.85rem;
  text-align: center;
  max-width: 72%;
  min-width: 5.5rem;
  box-shadow: 0 0 0 6px var(--background-color);
  pointer-events: none;
}

@media (min-width: 576px) {
  .detail-dashboard__progress-center {
    padding: 0.85rem 1.1rem;
    max-width: 68%;
  }
}

.detail-dashboard__progress-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
  margin: 0 0 0.2rem;
  line-height: 1.2;
}

@media (min-width: 576px) {
  .detail-dashboard__progress-label {
    font-size: 0.75rem;
  }
}

.detail-dashboard__progress-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--heading-color);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

@media (min-width: 576px) {
  .detail-dashboard__progress-value {
    font-size: 1.25rem;
  }
}

.detail-dashboard__progress-interes {
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--default-color), transparent 15%);
  margin: 0.75rem 0 0;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Detail Dashboard — mobile gutters
   Keep the stacked card list close to the screen edges below lg
   (same breakpoint as .table-mobile-cards / detail-dashboard).
   -------------------------------------------------------------------------- */
@media (max-width: 61.99875rem) {
  .detail-dashboard__main {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }

  .detail-dashboard__main-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* --- Badge Status: soft tinted status pills --- */
.badge-status {
  display: inline-block;
  font-weight: 400;
  line-height: 1.2;
  text-align: start;
  white-space: normal;
  vertical-align: baseline;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.5rem;
  max-width: 100%;
  border: 1px solid transparent;
}

.badge-status--success {
  color: var(--bs-success, #198754);
  background-color: color-mix(in srgb, var(--bs-success, #198754), transparent 90%);
  border-color: var(--bs-success, #198754);
}

.badge-status--danger {
  color: var(--bs-danger, #dc3545);
  background-color: color-mix(in srgb, var(--bs-danger, #dc3545), transparent 90%);
  border-color: var(--bs-danger, #dc3545);
}

.badge-status--warning {
  color: var(--warning-color);
  background-color: color-mix(in srgb, var(--warning-color), transparent 88%);
  border-color: color-mix(in srgb, var(--warning-color), transparent 55%);
}

.badge-status--secondary {
  color: var(--bs-secondary, #6c757d);
  background-color: color-mix(in srgb, var(--bs-secondary, #6c757d), transparent 90%);
  border-color: var(--bs-secondary, #6c757d);
}

/* --------------------------------------------------------------------------
   Quotes widget (.quotes-widget)
   Home “Panel de Cotizaciones”: frosted card, borderless financial table,
   SVG flag / commodity marks, full-row navigation with chevron cue.
   Glass lives on ::before (same pattern as mobile .header) so backdrop-filter
   is not killed by overflow clipping on the widget itself.
   -------------------------------------------------------------------------- */
.quotes-widget {
  position: relative;
  background-color: transparent;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px color-mix(in srgb, var(--heading-color), transparent 94%);
  padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.quotes-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background-color: var(--quotes-widget-glass-bg);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .quotes-widget::before {
    -webkit-backdrop-filter: saturate(1.4) blur(var(--header-glass-blur));
    backdrop-filter: saturate(1.4) blur(var(--header-glass-blur));
  }
[data-bs-theme="dark"] .quotes-widget::before {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
}

.quotes-widget > * {
  position: relative;
  z-index: 1;
}

.quotes-widget__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
}

.quotes-widget__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading-color);
}

.quotes-widget__title i {
  color: var(--accent-color);
}

/* “Ver todo” shortcut from the home widget to the full cotizaciones panel */
.quotes-widget__header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--accent-color);
}

.quotes-widget__header-link:hover,
.quotes-widget__header-link:focus-visible {
  color: color-mix(in srgb, var(--accent-color), var(--heading-color) 25%);
}

.quotes-widget__header-link i {
  font-size: 0.8rem;
}
.quotes-widget__body {
  padding: 0 0.35rem 0.25rem;
  overflow-x: hidden;
  max-width: 100%;
}

.quotes-widget__table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  border: none;
  background-color: transparent;
}

.quotes-widget__table thead th {
  padding: 0.35rem 0.75rem 0.45rem;
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-color);
  background-color: transparent;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 90%);
  white-space: nowrap;
}

.quotes-widget__table tbody td {
  padding: 0.7rem 0.75rem;
  vertical-align: middle;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
  transition: background-color 0.15s ease;
}

.quotes-widget__table tbody tr:last-child td {
  border-bottom: none;
}

.quotes-widget__row {
  cursor: pointer;
}

.quotes-widget__row:hover td,
.quotes-widget__row:focus-within td {
  background-color: var(--list-row-active-bg);
}

.quotes-widget__asset {
  text-align: left;
}

.quotes-widget__asset-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.quotes-widget__asset-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
}

/* Mobile-only date under asset name */
.quotes-widget__meta-date {
  display: none;
}

.quotes-widget__mobile-pfx {
  display: none;
}

/* Fiat flag img + commodity mark share the same footprint */
.quotes-widget__flag,
.quotes-widget__mark {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
}

.quotes-widget__flag {
  object-fit: cover;
  display: block;
}

.quotes-widget__mark {
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--chrome-soft-bg);
  color: var(--chrome-soft-fg);
  line-height: 1;
}

.quotes-widget__mark svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.quotes-widget__asset-name {
  min-width: 0;
  color: var(--heading-color);
  font-weight: 500;
  line-height: 1.25;
}

.quotes-widget__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quotes-widget__quote {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.quotes-widget__quote.is-centered {
  align-items: center;
}

.quotes-widget__price {
  font-weight: 500;
  color: var(--heading-color);
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quotes-widget__trend {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quotes-widget__trend.is-up {
  color: var(--success-color);
}

.quotes-widget__trend.is-down {
  color: var(--danger-color);
}

.quotes-widget__trend.is-flat {
  color: var(--muted-color);
}

.quotes-widget__quote.is-centered .quotes-widget__trend {
  justify-content: center;
}

.quotes-widget__date {
  font-size: var(--font-size-xs);
  color: var(--muted-color);
  white-space: nowrap;
}

/* Sit above .stretched-link::after (z-index: 1) so native title tooltips work */
.quotes-widget .badge-status {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xs);
}

.quotes-widget__nav {
  width: 1.5rem;
  padding-left: 0.25rem !important;
  padding-right: 0.5rem !important;
  text-align: center;
  color: var(--muted-color);
}

.quotes-widget__chevron {
  font-size: 0.85rem;
  line-height: 1;
  color: color-mix(in srgb, var(--muted-color), transparent 15%);
}

/* Mobile ticker layout — compact 2-line rows, no horizontal scroll */
@media (max-width: 767.98px) {
  .quotes-widget__body {
    padding: 0 0.5rem 0.35rem;
    overflow-x: hidden;
  }

  .quotes-widget__table,
  .quotes-widget__table > tbody {
    display: block;
    width: 100%;
  }

  .quotes-widget__table > thead {
    display: none;
  }

  .quotes-widget__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto;
    column-gap: 0.5rem;
    align-items: center;
    padding: 0.75rem 0.15rem;
    border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
  }

  .quotes-widget__row:last-child {
    border-bottom: none;
  }

  .quotes-widget__row > td {
    display: block;
    width: auto;
    max-width: 100%;
    padding: 0 !important;
    border: none !important;
    background-color: transparent !important;
  }

  .quotes-widget__row:hover > td,
  .quotes-widget__row:focus-within > td {
    background-color: transparent !important;
  }

  .quotes-widget__row:hover,
  .quotes-widget__row:focus-within {
    background-color: var(--list-row-active-bg);
    border-radius: var(--radius-sm);
  }

  .quotes-widget__asset {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    align-self: center;
  }

  .quotes-widget__asset-cell {
    align-items: flex-start;
    gap: 0.55rem;
  }

  .quotes-widget__flag,
  .quotes-widget__mark {
    margin-top: 0.1rem;
  }

  .quotes-widget__asset-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-sm);
  }

  .quotes-widget__meta-date {
    display: block;
    max-width: 100%;
  }

  .quotes-widget__meta-date .badge-status {
    max-width: 100%;
    white-space: nowrap;
  }

  .quotes-widget__updated {
    display: none !important;
  }

  .quotes-widget__prices-mobile,
  .quotes-widget__index {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }

  .quotes-widget__index {
    text-align: right !important;
  }

  .quotes-widget__nav {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    width: 1.25rem;
    padding: 0 !important;
  }

  /* Shared 3-col grid: prefix | price | trend (6 direct children → 2 rows) */
  .quotes-widget__price-stack {
    display: grid;
    grid-template-columns: min-content max-content min-content;
    column-gap: 0.3rem;
    row-gap: 0.2rem;
    justify-content: end;
    align-items: baseline;
  }

  .quotes-widget__mobile-pfx {
    display: block;
    color: var(--muted-color);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.2;
  }

  .quotes-widget__price-stack .quotes-widget__price {
    text-align: right;
    font-size: var(--font-size-sm);
  }

  .quotes-widget__price-stack .quotes-widget__trend {
    justify-content: flex-end;
    font-size: 0.7rem;
  }

  .quotes-widget__index .quotes-widget__quote {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.3rem;
  }

  .quotes-widget__index .quotes-widget__price {
    font-size: var(--font-size-sm);
  }

  .quotes-widget__index .quotes-widget__trend {
    font-size: 0.7rem;
  }
}

/* --------------------------------------------------------------------------
   Cotizaciones panel page (.cotizaciones-panel)
   Full-page version of the home quotes widget: one .quotes-widget card per
   category (monedas, materias primas, referencias) sharing the widget table.
   -------------------------------------------------------------------------- */
/* Sit above the site footer so calculator dropdowns are not painted under it */
.cotizaciones-panel {
  position: relative;
  z-index: 2;
}

/* Light: opaque white instead of frosted glass (dark already uses solid --quotes-widget-glass-bg) */
html:not([data-bs-theme="dark"]) .cotizaciones-panel .quotes-widget {
  --quotes-widget-glass-bg: var(--card-detail-bg);
}

.cotizaciones-panel .quotes-widget::before {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Section title sits in the body (no separate header band) to avoid a double gap above thead */
.cotizaciones-panel .quotes-widget__body--panel {
  padding: 0.65rem 0.5rem 0.35rem;
}

.cotizaciones-panel .quotes-widget__section-title {
  padding: 0 0.35rem 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
}

.cotizaciones-panel .quotes-widget__table thead th {
  padding-top: 0.4rem;
  padding-bottom: 0.45rem;
}

.cotizaciones-panel__empty {
  margin: 0;
  padding: 1.25rem 0.75rem;
  font-size: var(--font-size-sm);
  color: var(--muted-color);
}

/* --------------------------------------------------------------------------
   Currency calculator (.currency-calc)
   Mobile: stacked Tengo / Quiero (narrow, centered).
   Desktop (md+): side-by-side at full table width, horizontal swap control.
   -------------------------------------------------------------------------- */
.currency-calc {
  position: relative;
  z-index: 5;
  max-width: 30rem;
  margin-inline: auto;
  /* Let menus paint outside the card (quotes-widget__body overflow-x:hidden
     would otherwise force overflow-y:auto and clip Popper-positioned menus). */
  overflow: visible;
}

.currency-calc .quotes-widget__body,
.currency-calc .currency-calc__fields,
.currency-calc .currency-calc__slot,
.currency-calc .currency-calc__group,
.currency-calc .currency-calc__swap-zone {
  overflow: visible;
}

/* When a menu is open, lift this card above neighboring page chrome */
.currency-calc:has(.dropdown-menu.show) {
  z-index: 20;
}

.cotizaciones-panel .currency-calc .quotes-widget__body--panel {
  padding: 0.65rem 0.9rem 0.85rem;
}

.currency-calc__fields {
  display: flex;
  flex-direction: column;
  padding: var(--space-3) 0 var(--space-3);
}

.currency-calc__slot {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/*
  Spans the full space between the two input groups. The QUIERO label is
  anchored to the bottom (just above its field); the swap button uses
  top-50 so it sits on the true midpoint between the group edges.
*/
.currency-calc__swap-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(var(--chrome-control-size) + 0.85rem);
  margin-block: 0.1rem;
  overflow: visible;
}

.currency-calc__swap-zone .currency-calc__role {
  position: relative;
  z-index: 0;
  margin: 0;
  padding-bottom: 0.2rem;
}

.currency-calc__role {
  padding-inline: 0.15rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.currency-calc__group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
  border-radius: var(--radius-sm);
  /* Same wash as cuentas detail transaction-row hover (--list-row-active-bg) */
  background-color: var(--list-row-active-bg);
}

.currency-calc__group:focus-within {
  border-color: color-mix(in srgb, var(--accent-color), transparent 55%);
}

.currency-calc__picker {
  position: relative;
  flex: 0 1 auto;
  max-width: 58%;
  min-width: 5.5rem;
}

.currency-calc__picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.15rem 0.2rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--heading-color);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

/* Keep our chevron; hide Bootstrap's default dropdown caret */
.currency-calc__picker-btn.dropdown-toggle::after {
  display: none;
}

.currency-calc__picker-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-color), transparent 50%);
  outline-offset: 2px;
}

.currency-calc__picker-btn .bi-chevron-down {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--muted-color);
  transition: transform 0.15s ease;
}

.currency-calc__picker.show .bi-chevron-down {
  transform: rotate(180deg);
}

.currency-calc__picker-current {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.currency-calc__picker-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-calc__picker-flag,
.currency-calc__picker-mark {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
}

.currency-calc__picker-flag {
  display: block;
  object-fit: cover;
}

.currency-calc__picker-mark {
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--chrome-soft-bg);
  color: var(--chrome-soft-fg, var(--heading-color));
  line-height: 1;
}

.currency-calc__picker-mark svg {
  width: 0.7rem;
  height: 0.7rem;
  display: block;
}

.currency-calc__picker-menu.dropdown-menu {
  min-width: 12.5rem;
  max-width: min(18rem, 80vw);
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
  border-radius: var(--radius-sm);
  background-color: var(--quotes-widget-glass-bg, var(--background-color));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--heading-color), transparent 88%);
  z-index: 1050;
}

.currency-calc__option.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--heading-color);
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: normal;
}

.currency-calc__option.dropdown-item:hover,
.currency-calc__option.dropdown-item:focus,
.currency-calc__option.dropdown-item:focus-visible {
  background-color: var(--list-row-active-bg);
  color: var(--heading-color);
  outline: none;
}

.currency-calc__option.dropdown-item.active,
.currency-calc__option.dropdown-item.is-selected {
  background-color: color-mix(in srgb, var(--accent-color), transparent 90%);
  color: var(--heading-color);
}

.currency-calc__option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-calc__amount {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: none;
  background-color: transparent;
  color: var(--heading-color);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.currency-calc__amount:focus {
  outline: none;
}

.currency-calc__amount::placeholder {
  color: color-mix(in srgb, var(--muted-color), transparent 45%);
}

.currency-calc__amount:disabled {
  color: var(--heading-color);
  opacity: 1;
}

.currency-calc__swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--chrome-control-size);
  height: var(--chrome-control-size);
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
  border-radius: var(--radius-pill);
  /* Opaque so input borders / QUIERO label do not show through the icon */
  background-color: var(--card-detail-bg, var(--background-color));
  color: var(--default-color);
  line-height: 1;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--heading-color), transparent 90%);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.currency-calc__swap:hover,
.currency-calc__swap:focus-visible {
  background-color: var(--list-row-active-bg);
  border-color: color-mix(in srgb, var(--heading-color), transparent 80%);
  color: var(--heading-color);
}

/* Desktop: full table width, Tengo | swap | Quiero in a row */
@media (min-width: 768px) {
  .currency-calc {
    max-width: none;
    margin-inline: 0;
  }

  .currency-calc__fields {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0;
    row-gap: 0.25rem;
    align-items: stretch;
  }

  .currency-calc__slot {
    display: contents;
  }

  .currency-calc__slot[data-calc-slot="tengo"] .currency-calc__role {
    grid-column: 1;
    grid-row: 1;
  }

  .currency-calc__slot[data-calc-slot="tengo"] .currency-calc__group {
    grid-column: 1;
    grid-row: 2;
  }

  .currency-calc__slot[data-calc-slot="quiero"] .currency-calc__role {
    grid-column: 3;
    grid-row: 1;
  }

  .currency-calc__slot[data-calc-slot="quiero"] .currency-calc__group {
    grid-column: 3;
    grid-row: 2;
  }

  .currency-calc__swap-zone {
    grid-column: 2;
    grid-row: 2;
    width: calc(var(--chrome-control-size) + 1.25rem);
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    /* Fill the input-group row so absolute top-50 / start-50 is true center */
    align-self: stretch;
    justify-content: unset;
  }

  /* Vertical arrows → horizontal for the side-by-side layout */
  .currency-calc__swap-icon {
    display: inline-block;
    transform: rotate(90deg);
  }
}
/* --------------------------------------------------------------------------
   Detail list cards (.card-detail)
   Elevated surface for list rows on detail pages (cuotas, movements, …).
   Light look is fixed; dark uses [data-bs-theme="dark"] (app theme toggle).
   -------------------------------------------------------------------------- */
.card-detail {
  --card-detail-border: rgba(0, 0, 0, 0.05);
  --card-detail-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --card-detail-highlight: inset 0 1px 0 rgba(255, 255, 255, 1), inset 1px 0 0 rgba(255, 255, 255, 0.5);

  --bs-card-bg: var(--card-detail-bg);
  background-color: var(--card-detail-bg) !important; /* beats main.css .card !important */
  border: 1px solid var(--card-detail-border);
  border-radius: 0.75rem;
  box-shadow: var(--card-detail-shadow), var(--card-detail-highlight);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.card-detail:hover {
  transform: translateY(-2px);
  --card-detail-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .card-detail {
  --card-detail-border: rgba(255, 255, 255, 0.06);
  --card-detail-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
  --card-detail-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 1px 0 0 rgba(255, 255, 255, 0.01);
}

[data-bs-theme="dark"] .card-detail:hover {
  --card-detail-bg: #1c1c1c;
  --card-detail-border: rgba(255, 255, 255, 0.15);
  --card-detail-shadow:
    0 8px 20px rgba(255, 255, 255, 0.04),
    0 10px 15px -3px rgba(0, 0, 0, 0.8);
  --card-detail-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 1px 0 0 rgba(255, 255, 255, 0.03);
}

/* --- Theme toggle --- */
.theme-toggle-item {
  display: flex;
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--nav-color);
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--nav-hover-color);
}

.theme-toggle-icon {
  font-size: 0.85rem;
  margin: 0 !important;
  width: auto !important;
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.theme-toggle:not(.is-dark) .theme-toggle-sun,
.theme-toggle.is-dark .theme-toggle-moon {
  opacity: 1;
  color: var(--accent-color);
}

.theme-toggle-track {
  position: relative;
  display: inline-block;
  width: 2.25rem;
  height: 1.15rem;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--nav-color), transparent 82%);
  border: 1px solid color-mix(in srgb, var(--nav-color), transparent 55%);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle.is-dark .theme-toggle-track {
  background-color: color-mix(in srgb, var(--accent-color), transparent 70%);
  border-color: color-mix(in srgb, var(--accent-color), transparent 40%);
}

.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 0.12rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background-color: var(--contrast-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transform: translateY(-50%);
  transition: left 0.2s ease;
}

.theme-toggle.is-dark .theme-toggle-thumb {
  left: calc(100% - 0.97rem);
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  background: var(--background-color);
  transition: all 0.6s ease-out;
}

#preloader:before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  border: 6px solid #ffffff;
  border-color: var(--accent-color) transparent var(--accent-color) transparent;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: animate-preloader 1.5s linear infinite;
}

@keyframes animate-preloader {
  0% {
    transform: rotate(0deg);
  }

    100% {
      transform: rotate(360deg);
    }
}

/* --- Scroll top button --- */
.scroll-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 99999;
  background-color: var(--accent-color);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgb(0 0 0 / 18%);
  transition: all 0.4s;
}

.scroll-top i {
  font-size: 24px;
  color: var(--contrast-color);
  line-height: 0;
}

.scroll-top:hover {
  background-color: color-mix(in srgb, var(--accent-color), transparent 20%);
  color: var(--contrast-color);
}

.scroll-top.active {
  visibility: visible;
  opacity: 1;
}

/* --- Overlay --- */
.overlay {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  /* Asegúrate de que esté por encima de otros elementos */
  display: block;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 1s ease;
  /* Transición de opacidad durante 0.5 segundos */
}

.overlay.hidden {
  opacity: 0;
}

/* --- Input icon --- */
.input-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  cursor: pointer;
}

.input-icon:hover {
  color: #0d6efd;
  /* azul bootstrap */
}

/* --- Table scroll fade --- */
.table-scroll-fade::-webkit-scrollbar {
  width: 8px;
  background-color: transparent;
}

.table-scroll-fade::-webkit-scrollbar-track {
  background-color: transparent;
}

.table-scroll-fade::-webkit-scrollbar-thumb {
  background-color: rgba(100, 100, 100, 0.3);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.table-scroll-fade::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 100, 100, 0.6);
}

.table-scroll-fade {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 100, 100, 0.4) transparent;
  --header-height: 45px;
  --fade-size: 40px;
  --top-fade-opacity: 1;
  --bottom-fade-opacity: 0;
  /* Hard fallback of 17px (standard Windows scrollbar) in case JS is delayed */
  --scrollbar-width: 17px;
  max-height: 400px;
  overflow-y: auto;
  position: relative;
  /* The Dual Mask */
  -webkit-mask-image:
    /* Mask 1: The fading gradient for the table content */
    linear-gradient(to bottom,
      #000 0%,
      #000 var(--header-height),
      rgba(0, 0, 0, var(--top-fade-opacity)) var(--header-height),
      #000 calc(var(--header-height) + var(--fade-size)),
      #000 calc(100% - var(--fade-size)),
      rgba(0, 0, 0, var(--bottom-fade-opacity)) 100%),
    /* Mask 2: A solid block to keep the scrollbar fully visible */
    linear-gradient(to bottom, #000 0%, #000 100%);
  -webkit-mask-size:
    calc(100% - var(--scrollbar-width)) 100%,
    var(--scrollbar-width) 100%;
  -webkit-mask-position:
    left top,
    right top;

  /* CRITICAL FIX: Must explicitly say no-repeat twice, once for each mask */
  -webkit-mask-repeat:
    no-repeat,
    no-repeat;

  /* Standard syntax for non-webkit browsers */
  mask-image:
    linear-gradient(to bottom,
      #000 0%,
      #000 var(--header-height),
      rgba(0, 0, 0, var(--top-fade-opacity)) var(--header-height),
      #000 calc(var(--header-height) + var(--fade-size)),
      #000 calc(100% - var(--fade-size)),
      rgba(0, 0, 0, var(--bottom-fade-opacity)) 100%),
    linear-gradient(to bottom, #000 0%, #000 100%);
  mask-size: calc(100% - var(--scrollbar-width)) 100%, var(--scrollbar-width) 100%;
  mask-position: left top, right top;
  mask-repeat: no-repeat, no-repeat;
}

/* --- Sticky header --- */
.sticky-header-solid th {
  position: sticky;
  top: 0;
  background-color: var(--bs-card-bg) !important;
  z-index: 2;
  box-shadow: 0 1px 0 var(--bs-card-bg);
}

/* Historico data tables: stack decimals / thousands in financial columns */
.table-historico th.text-end,
.table-historico td.text-end {
  font-variant-numeric: tabular-nums;
}

/* --- Historico chart --- */
.historico-chart {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.historico-chart-container {
  position: relative;
  height: 400px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.historico-chart-container canvas {
  display: block;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   Histórico de Cotización — quotes-widget shell + 3-col mobile table
   Outer chrome comes from .quotes-widget (same as listar cards).
   -------------------------------------------------------------------------- */

/* Light: solid elevated surface like cotizaciones-panel (not frosted hero glass) */
html:not([data-bs-theme="dark"]) .historico-cotizacion__panel.quotes-widget {
  --quotes-widget-glass-bg: var(--card-detail-bg);
}

.historico-cotizacion__panel.quotes-widget::before {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Room for filtros + chart; transparent so ::before surface shows through */
.historico-cotizacion__body {
  padding: 1rem 1rem 0.75rem;
  background-color: transparent;
}

.historico-cotizacion__content {
  flex-direction: column;
}

/* Table flush inside the premium wrapper: no outer box, only row hairlines */
.historico-cotizacion .table-historico {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: var(--list-row-active-bg);
  --bs-table-border-color: color-mix(in srgb, var(--heading-color), transparent 92%);
  width: 100%;
  margin: 0;
  border: none;
  border-collapse: collapse;
  background-color: transparent;
}

.historico-cotizacion .table-historico > :not(caption) > * > * {
  background-color: transparent;
  border-width: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
  box-shadow: none;
}

.historico-cotizacion .table-historico thead th {
  padding: 0.7rem 0.75rem 0.55rem;
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-color);
  /* Opaque sticky surface matches the quotes-widget ::before fill.
     Extra 2px shadow seals the sub-pixel gap above the scroll fade mask. */
  background-color: var(--quotes-widget-glass-bg) !important;
  border-bottom-color: color-mix(in srgb, var(--heading-color), transparent 90%);
  box-shadow: 0 2px 0 var(--quotes-widget-glass-bg);
  white-space: nowrap;
}

.historico-cotizacion .table-historico tbody td {
  padding: 0.7rem 0.75rem;
  vertical-align: middle;
}

.historico-cotizacion .table-historico tbody tr:last-child > * {
  border-bottom: none;
}

.historico-cotizacion .table-responsive.table-scroll-fade {
  border: none;
  background-color: transparent;
}

@media (max-width: 767.98px) {
  /*
   * Fullscreen viewport: page does not scroll; only the table does.
   *
   * Critical: body also has Bootstrap .min-vh-100 → min-height: 100vh !important.
   * On mobile 100vh is the *large* viewport (URL bar hidden). When the URL bar
   * is visible, that forces the layout taller than the screen and the last
   * table rows sit under browser chrome. Override min-height and size to the
   * visual viewport via --app-height (see cotizacionmoneda.js).
   */
  body.historico-cotizacion-page {
    min-height: 0 !important;
    height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    overflow: hidden;
  }

  body.historico-cotizacion-page #header {
    flex-shrink: 0;
  }

  body.historico-cotizacion-page #footer {
    display: none !important;
  }

  body.historico-cotizacion-page #scroll-top {
    display: none !important;
  }

  .historico-cotizacion {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
    padding-top: 0.5rem;
    padding-bottom: 0 !important;
  }

  /* Drop quotes-widget chrome on mobile — edge-to-edge fullscreen shell.
     Zero radius: inherited 0.75rem + overflow:hidden was clipping the scroll
     fade into rounded corners on the last visible rows. */
  .historico-cotizacion__panel.quotes-widget {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background-color: transparent !important;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .historico-cotizacion__panel.quotes-widget::before {
    display: none;
  }

  .historico-cotizacion__body {
    padding: 0 !important;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .historico-cotizacion__content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .historico-cotizacion .historico-filtros {
    flex-shrink: 0;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 0.75rem !important;
  }

  .historico-cotizacion .historico-filtros > .d-flex {
    max-width: 100%;
  }

  .historico-cotizacion .historico-filtros .btn-group {
    max-width: 100%;
  }

  .historico-cotizacion .historico-filtros .btn {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    font-size: var(--font-size-sm);
  }

  .historico-cotizacion .historico-chart {
    flex-shrink: 0;
    margin-bottom: 0.75rem !important;
  }

  .historico-cotizacion .historico-chart-container {
    height: 220px;
    max-height: 220px;
  }

  /*
   * Table fills remaining viewport; scroll + fade mask live here.
   * Bottom inset is a real ::after spacer (not padding-bottom): padding is
   * inconsistently included in scrollHeight on mobile browsers, which left
   * the last row partially unreachable under browser chrome / the fade.
   */
  .historico-cotizacion .table-responsive.table-scroll-fade {
    --fade-size: 3.5rem;
    --safe-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    flex: 1 1 auto;
    flex-shrink: 1;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
    padding-top: 0;
    padding-bottom: 0;
    max-width: 100%;
    -webkit-mask-image:
      linear-gradient(to bottom,
        #000 0%,
        #000 var(--header-height),
        rgba(0, 0, 0, var(--top-fade-opacity)) var(--header-height),
        #000 calc(var(--header-height) + var(--fade-size)),
        #000 calc(100% - var(--fade-size)),
        rgba(0, 0, 0, var(--bottom-fade-opacity)) 100%),
      linear-gradient(to bottom, #000 0%, #000 100%);
    mask-image:
      linear-gradient(to bottom,
        #000 0%,
        #000 var(--header-height),
        rgba(0, 0, 0, var(--top-fade-opacity)) var(--header-height),
        #000 calc(var(--header-height) + var(--fade-size)),
        #000 calc(100% - var(--fade-size)),
        rgba(0, 0, 0, var(--bottom-fade-opacity)) 100%),
      linear-gradient(to bottom, #000 0%, #000 100%);
  }

  .historico-cotizacion .table-responsive.table-scroll-fade::after {
    content: "";
    display: block;
    height: var(--safe-bottom);
    pointer-events: none;
  }

  /* Keep real table layout so sticky <th> + % widths align with cells */
  .historico-cotizacion .table-historico {
    table-layout: fixed;
    width: 100%;
  }

  .historico-cotizacion .table-historico thead .historico-cotizacion-head__th {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    /* Match page canvas (not the desktop quotes-widget / card-detail white) */
    background-color: var(--background-color) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 95%);
    box-shadow: none;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
    white-space: nowrap;
    vertical-align: middle;
  }

  .historico-cotizacion-row > td {
    vertical-align: middle;
    border-bottom-color: color-mix(in srgb, var(--heading-color), transparent 92%);
  }

  .historico-cotizacion-row__fecha {
    width: 34%;
    font-size: var(--font-size-sm);
    line-height: 1.25;
    overflow: hidden;
  }

  .historico-cotizacion-row__quote {
    width: 33%;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
  }

  .historico-cotizacion-row__price {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--heading-color);
    white-space: nowrap;
    line-height: 1.25;
  }

  .historico-cotizacion-row__var {
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
  }

  .historico-cotizacion-row__var .bi {
    font-size: 0.75em;
    line-height: 1;
  }
}

/* --------------------------------------------------------------------------
   Blended table / form / circle badge (shared across listados)
   Transparent table cells with thin separators; low-chrome filter inputs.
   -------------------------------------------------------------------------- */
.table-blended,
.table-blended > tbody > tr > td,
.table-blended > thead > tr > th,
.table-blended > tbody > tr,
.table-blended > thead > tr {
  background-color: transparent !important;
  --bs-table-bg: transparent;
}

.table-blended > :not(caption) > * > * {
  border-bottom-width: 0;
}

.table-blended tbody tr {
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 75%);
}

.table-blended thead th {
  color: color-mix(in srgb, var(--default-color), transparent 35%);
  font-weight: 600;
  border-bottom: 2px solid color-mix(in srgb, var(--heading-color), transparent 75%);
}

.form-blended {
  background-color: transparent !important;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 75%) !important;
  border-radius: 0.25rem;
  box-shadow: none !important;
  color: var(--default-color);
}

.form-blended:focus {
  border-color: var(--accent-color) !important;
  background-color: color-mix(in srgb, var(--background-color), var(--default-color) 3%) !important;
}

/* Historico (cotización / precio ganado): inline custom date range */
.historico-filtros__rango-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  margin: var(--space-3) 0 0;
  padding: 0;
  border: none;
  background: transparent;
  min-height: var(--chrome-control-size);
}

.historico-filtros__rango-panel.d-none {
  display: none !important;
}

.historico-filtros__rango-input {
  box-sizing: border-box;
  width: 14rem;
  max-width: 55vw;
  height: var(--chrome-control-size);
  background-color: var(--background-color) !important;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 75%) !important;
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-size: var(--font-size-sm);
  color: var(--chrome-soft-fg, var(--default-color));
  padding: 0 var(--space-3);
}

.historico-filtros__rango-input:focus {
  border-color: var(--accent-color) !important;
  background-color: color-mix(in srgb, var(--background-color), var(--default-color) 3%) !important;
  color: var(--heading-color);
  box-shadow: none;
}

.historico-filtros__rango-search {
  flex-shrink: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--chrome-control-size);
  height: var(--chrome-control-size);
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--chrome-soft-bg);
  color: var(--chrome-soft-fg, var(--default-color));
  font-size: var(--font-size-sm);
  line-height: 1;
  cursor: pointer;
}

.historico-filtros__rango-search:hover {
  background-color: var(--chrome-soft-bg-hover);
  color: var(--heading-color);
}

#btn-custom.is-open {
  color: var(--accent-color);
}

.badge-circle-dark {
  background-color: var(--accent-color);
  color: var(--contrast-color);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Paginator (.paginator)
   Rounded, token-based pagination that wraps cleanly on narrow screens.
   -------------------------------------------------------------------------- */
.paginator {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 0.25rem;
  box-sizing: border-box;
}

.paginator__list.pagination {
  --bs-pagination-padding-x: 0.7rem;
  --bs-pagination-padding-y: 0.4rem;
  --bs-pagination-font-size: 0.875rem;
  --bs-pagination-color: var(--default-color);
  --bs-pagination-bg: transparent;
  --bs-pagination-border-width: 0;
  --bs-pagination-border-color: transparent;
  --bs-pagination-border-radius: var(--radius-pill);
  --bs-pagination-hover-color: var(--accent-color);
  --bs-pagination-hover-bg: color-mix(in srgb, var(--accent-color), transparent 90%);
  --bs-pagination-hover-border-color: transparent;
  --bs-pagination-focus-color: var(--accent-color);
  --bs-pagination-focus-bg: color-mix(in srgb, var(--accent-color), transparent 88%);
  --bs-pagination-focus-box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--accent-color), transparent 75%);
  --bs-pagination-active-color: var(--contrast-color);
  --bs-pagination-active-bg: var(--accent-color);
  --bs-pagination-active-border-color: var(--accent-color);
  --bs-pagination-disabled-color: color-mix(in srgb, var(--default-color), transparent 45%);
  --bs-pagination-disabled-bg: transparent;
  --bs-pagination-disabled-border-color: transparent;

  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  row-gap: 0.35rem;
  max-width: 100%;
  margin: 0;
  padding: 0.35rem 0.4rem;
  list-style: none;
  background-color: color-mix(in srgb, var(--surface-color), #ffffff 55%);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
  border-radius: var(--radius-pill);
  box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.paginator__list > .page-item {
  margin: 0;
}

.paginator__list > .page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  min-height: 2.15rem;
  margin: 0;
  padding: var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  background-color: transparent !important;
  color: var(--default-color);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.paginator__list > .page-item .page-link:hover,
.paginator__list > .page-item .page-link:focus {
  background-color: color-mix(in srgb, var(--accent-color), transparent 90%) !important;
  color: var(--accent-color);
  z-index: 1;
}

.paginator__list > .page-item.active .page-link,
.paginator__list > .page-item.active .page-link:hover,
.paginator__list > .page-item.active .page-link:focus {
  background-color: var(--accent-color) !important;
  color: var(--contrast-color) !important;
  font-weight: 600;
  box-shadow: 0 0.1rem 0.35rem color-mix(in srgb, var(--accent-color), transparent 55%);
}

.paginator__list > .page-item.disabled .page-link,
.paginator__list > .page-item.disabled .page-link:hover {
  background-color: transparent !important;
  color: color-mix(in srgb, var(--default-color), transparent 45%);
  opacity: 1;
  pointer-events: none;
}

.paginator__label-compact {
  display: none;
}

.paginator__label-full {
  display: inline;
}

@media (max-width: 35.99875rem) {
  /* ~576px — compact edge labels so Primera/Última don’t overflow */
  .paginator__list.pagination {
    --bs-pagination-padding-x: 0.45rem;
    --bs-pagination-padding-y: 0.35rem;
    --bs-pagination-font-size: 0.8125rem;
    gap: 0.12rem;
    padding: 0.3rem;
    border-radius: 1.25rem;
  }

  .paginator__list > .page-item .page-link {
    min-width: 1.9rem;
    min-height: 1.9rem;
  }

  .paginator__label-full {
    display: none;
  }

  .paginator__label-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

[data-bs-theme="dark"] .paginator__list.pagination {
  background-color: color-mix(in srgb, var(--surface-color), #000000 12%);
  border-color: color-mix(in srgb, var(--heading-color), transparent 70%);
  box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   Table-to-Card (.table-mobile-cards)
   Single <table> morphs into stacked cards below Bootstrap's lg breakpoint.
   Each <td> needs data-label="Column Name" for the mobile label.
   -------------------------------------------------------------------------- */
.table-mobile-cards__stack {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 0.15rem;
}

.table-mobile-cards__nested-label {
  font-size: 0.75rem;
}

/* Primary id stack (e.g. circle badge + full loan number) — centered on desktop */
.table-mobile-cards__header-id {
  display: inline-flex;
  align-items: center;
}

.table-mobile-cards__header-sub {
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.15;
}
@media (max-width: 61.99875rem) {

  /* 991.98px at 16px root — match Bootstrap lg */
  .table-responsive:has(.table-mobile-cards) {
    overflow: visible;
  }

    .table.table-mobile-cards {
      font-size: 0.875rem;
      border: 0;
    }

    /* Direct children only — nested tables (e.g. expand panels) must stay tabular */
    .table.table-mobile-cards > thead {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .table.table-mobile-cards,
    .table.table-mobile-cards > tbody {
      display: block;
      width: 100%;
    }

    .table.table-mobile-cards > tbody > tr {
      display: grid;
      grid-template-columns: 1fr auto;
      margin-bottom: 1rem;
      border: 1px solid color-mix(in srgb, var(--heading-color), transparent 85%);
      border-radius: 0.375rem;
      background-color: var(--surface-color);
      box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
      overflow: hidden;
    }

    .table.table-mobile-cards.table-hover > tbody > tr:hover > * {
      --bs-table-bg-state: transparent;
    }
  
    .table.table-mobile-cards > tbody > tr > td {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 0.75rem;
      grid-column: 1 / -1;
      width: 100%;
      border-bottom: 1px solid #eee;
      padding: 0.75rem;
      text-align: right;
    }
  
    .table.table-mobile-cards > tbody > tr > td::before {
      content: attr(data-label);
      font-weight: 700;
      text-transform: uppercase;
      font-size: 0.75rem;
      letter-spacing: 0.02em;
      color: color-mix(in srgb, var(--default-color), transparent 15%);
      text-align: left;
      flex-shrink: 0;
      max-width: 45%;
    }
  
    .table.table-mobile-cards > tbody > tr > td:last-child {
      border-bottom: none;
    }
  
    /* Primary identifier → card header (left) */
    .table.table-mobile-cards > tbody > tr > td:first-child {
      grid-column: 1;
      grid-row: 1;
      width: auto;
      min-width: 0;
      justify-content: flex-start;
      gap: 0.75rem;
      background-color: color-mix(in srgb, var(--accent-color), transparent 92%);
      font-weight: 600;
      font-size: 0.9375rem;
      text-align: left;
      border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
    }
    /* Optional badge/pill slotted into the card header (right) — no mobile label */
    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__header-badge {
      grid-column: 2;
      grid-row: 1;
      width: auto;
      justify-content: flex-end;
      align-items: center;
      gap: 0;
      padding-left: 0.25rem;
      background-color: color-mix(in srgb, var(--accent-color), transparent 92%);
      border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
    }
    .table.table-mobile-cards > tbody > tr > td:first-child::before {
      max-width: none;
    }

    /* Header id: label + full nro (left), optional circle badge (right); tight vertical packing */
    .table.table-mobile-cards > tbody > tr > td:first-child:has(.table-mobile-cards__header-id) {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-rows: auto auto;
      align-items: center;
      column-gap: 0.75rem;
      row-gap: 0.1rem;
      padding-top: 0.55rem;
      padding-bottom: 0.3rem;
      gap: unset;
    }

    .table.table-mobile-cards > tbody > tr > td:first-child:has(.table-mobile-cards__header-id)::before {
      grid-column: 1;
      grid-row: 1;
      align-self: end;
    }

    .table.table-mobile-cards > tbody > tr > td:first-child > .table-mobile-cards__header-id {
      display: contents;
    }

    .table.table-mobile-cards > tbody > tr > td:first-child .badge-circle-dark {
      grid-column: 2;
      grid-row: 1 / -1;
      align-self: center;
    }

    .table.table-mobile-cards > tbody > tr > td:first-child .table-mobile-cards__header-sub {
      grid-column: 1;
      grid-row: 2;
      justify-self: start;
      text-align: left;
    }
    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__header-badge::before {
      content: none;
      display: none;
    }
    /* Nested label (e.g. "Próxima Cuota") is redundant with data-label on mobile */
    .table.table-mobile-cards .table-mobile-cards__nested-label {
      display: none;
    }

    .table.table-mobile-cards > tbody > tr > td > .table-mobile-cards__stack {
      text-align: right;
      align-items: flex-end;
    }

    /* Acciones: full-width button stack at card bottom */
    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__actions {
      flex-direction: column;
      align-items: stretch;
      text-align: left;
      gap: 0.5rem;
    }

    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__actions::before {
      max-width: none;
      margin-bottom: 0.15rem;
    }

    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__actions > * {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__actions .btn-pill,
    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__actions .btn-pill-dark,
    .table.table-mobile-cards > tbody > tr > td.table-mobile-cards__actions a {
      width: 100%;
      justify-content: center;
    }

    [data-bs-theme="dark"] .table.table-mobile-cards > tbody > tr > td {
      border-bottom-color: rgba(226, 232, 240, 0.12);
    }

    [data-bs-theme="dark"] .table.table-mobile-cards > tbody > tr {
      box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.35);
    }
    }

/* ==========================================================================
   6. Layout Chrome (Header, Nav, Footer, Sections)
   ========================================================================== */

/*--------------------------------------------------------------
# Global Header
--------------------------------------------------------------*/
.header {
  color: var(--default-color);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  z-index: 997;
  background-color: var(--background-color);
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
    /* iOS / PWA notch — 0 on desktop & browsers without inset */
    padding-top: env(safe-area-inset-top, 0px);
  }
  
  /*
               * Frosted glass on mobile via ::before — NOT on .header itself.
               * backdrop-filter on .header creates a containing block that traps
               * position:fixed mobile-nav overlays (menu collapses into the bar + stuck X).
               */
  @media (max-width: 767.98px) {
    .header {
      background-color: transparent;
      border-bottom-color: transparent;
    }
  
    .header::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background-color: var(--header-glass-bg);
      border-bottom: 1px solid var(--header-glass-border);
    }
  
    @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
      .header::before {
        -webkit-backdrop-filter: saturate(1.8) blur(var(--header-glass-blur));
        backdrop-filter: saturate(1.8) blur(var(--header-glass-blur));
      }
    }
  
    .header>* {
      position: relative;
      z-index: 1;
    }
  }
  
  /* --------------------------------------------------------------------------
                 Context-aware sticky navbar — deep mode (mobile only)
                 Back + centered title replace the logo below the md breakpoint.
                 Desktop keeps the logo; page headers remain the desktop back/title source.
                 -------------------------------------------------------------------------- */
  .header-back {
    flex-shrink: 0;
    box-sizing: border-box;
    width: var(--chrome-control-size);
    height: var(--chrome-control-size);
    margin-left: calc(var(--space-2) * -1);
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--heading-color);
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  
  .header-back:hover,
  .header-back:focus-visible {
    background-color: var(--chrome-soft-bg-hover);
    color: var(--heading-color);
  }
  
  .header-back i {
    font-size: 1.25rem;
    line-height: 1;
  }
  
  .header-page-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    max-width: min(72%, 18rem);
    margin: 0;
    padding: 0 var(--space-2);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--heading-color);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
  }

  .header-page-title--with-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    overflow: visible;
    text-overflow: unset;
  }

  .header-page-title__mark {
    flex: 0 0 1.375rem;
    width: 1.375rem;
    height: 1.375rem;
  }

  .header-page-title__mark.quotes-widget__mark {
    flex-basis: 1.375rem;
  }

  .header-page-title__mark.quotes-widget__mark svg {
    width: 0.75rem;
    height: 0.75rem;
  }

  .header-page-title__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  @media (max-width: 767.98px) {
    .header.header--context .branding {
      min-height: 3.5rem;
      padding: var(--space-2) 0;
    }
  
    .header.header--context .branding > .container,
    .header.header--context .branding > .container-fluid {
      /* Room for absolute title between back and hamburger */
      min-height: var(--chrome-control-size);
    }

    /*
     * Deep-mode pages: navbar owns title + Regresar on mobile.
     * Keep other actions (Create, PDF pills, view switches).
     */
    body:has(#header.header--context) .page-header-bar__heading {
      display: none;
    }

    body:has(#header.header--context) a.btn-back {
      display: none !important;
    }

    body:has(#header.header--context) .prestamos-listado__regresar--mobile {
      display: none !important;
    }

    /* Collapse actions that only held Regresar (keep Create / PDF / switches). */
    body:has(#header.header--context) .page-header-bar__actions:not(:has(a:not(.btn-back))) {
      display: none;
    }

    /* No leftover gap when the bar is title+back only. */
    body:has(#header.header--context) .page-header-bar:not(:has(.page-header-bar__actions a:not(.btn-back))) {
      margin-bottom: 0;
      min-height: 0;
    }

    body:has(#header.header--context) .page-header-bar:has(.page-header-bar__actions a:not(.btn-back)) {
      margin-bottom: 0.75rem;
    }

    /*
     * Match cuentas-detail mobile top gap (~0.75rem under sticky shell).
     * Detail dashboards use pt-0 + sidebar padding — leave them alone.
     */
    body:has(#header.header--context) > .container,
    body:has(#header.header--context) > section.flex-grow-1:not(.cuentas-detail):not(.prestamos-detail) {
      padding-top: 0.75rem;
    }
}

.header .topbar {
  background-color: var(--accent-color);
  height: 40px;
  padding: 0;
  font-size: 14px;
  transition: all 0.3s;
}

.header .topbar .contact-info i {
  font-style: normal;
  color: var(--contrast-color);
}

.header .topbar .contact-info i a,
.header .topbar .contact-info i span {
  padding-left: 5px;
  color: var(--contrast-color);
}

@media (max-width: 575px) {

  .header .topbar .contact-info i a,
  .header .topbar .contact-info i span {
    font-size: 13px;
  }
}

.header .topbar .contact-info i a {
  line-height: 0;
  transition: 0.3s;
}

.header .topbar .contact-info i a:hover {
  color: var(--contrast-color);
  text-decoration: underline;
}

.header .topbar .social-links a {
  color: color-mix(in srgb, var(--contrast-color), transparent 40%);
  line-height: 0;
  transition: 0.3s;
  margin-left: 20px;
}

.header .topbar .social-links a:hover {
  color: var(--contrast-color);
}

.header .branding {
  min-height: 60px;
  padding: 10px 0;
}

/* Smooth transition for when the user toggles themes */
.neuland-dynamic-logo {
  transition: filter 0.3s ease; 
}

/* Dark Mode: Make the logo brighter */
[data-bs-theme="dark"] .neuland-dynamic-logo {

  filter: brightness(2.12);
}

.fading-img-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;

  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 0%, black 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 0%, black 65%, transparent 100%);
}

.fading-img-mask img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.header .logo {
  line-height: 1;
}

.header .logo img {
  max-height: 36px;
  margin-right: 8px;
}

.header .logo h1 {
  font-size: 30px;
  margin: 0;
  font-weight: 700;
  color: var(--heading-color);
}

.header .cta-btn,
.header .cta-btn:focus {
  color: var(--contrast-color);
  background: var(--accent-color);
  font-size: 14px;
  padding: 8px 25px;
  margin: 0 0 0 30px;
  border-radius: 50px;
  transition: 0.3s;
}

.header .cta-btn:hover,
.header .cta-btn:focus:hover {
  color: var(--contrast-color);
  background: color-mix(in srgb, var(--accent-color), transparent 15%);
}

@media (max-width: 1200px) {
  .header .logo {
    order: 1;
  }

  .header .cta-btn {
    order: 2;
    margin: 0 15px 0 0;
    padding: 6px 15px;
  }

  .header .navmenu {
    order: 3;
  }
}

.scrolled .header {
  box-shadow: 0px 0 18px rgba(0, 0, 0, 0.1);
}

.scrolled .header .topbar {
  height: 0;
  visibility: hidden;
  overflow: hidden;
}

/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
/* Desktop Navigation */
@media (min-width: 1200px) {
  .navmenu {
    padding: 0;
  }

  .navmenu ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    align-items: center;
  }

  .navmenu li {
    position: relative;
  }

  .navmenu>ul>li {
    white-space: nowrap;
    padding: 15px 14px;
  }

  .navmenu>ul>li:last-child {
    padding-right: 0;
  }

  /* Separate destination links from language / theme / account utilities */
  .navmenu>ul>li.navmenu-util--lang {
    margin-left: 0.5rem;
  }

  .navmenu a,
  .navmenu a:focus {
    color: var(--nav-color);
    font-size: 15px;
    padding: 0 2px;
    font-family: var(--nav-font);
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    transition: 0.3s;
    position: relative;
  }

  .navmenu a i,
  .navmenu a:focus i {
    font-size: 12px;
    line-height: 0;
    margin-left: 5px;
    transition: 0.3s;
  }

  .navmenu>ul>li>a:before {
    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -6px;
    left: 0;
    background-color: var(--nav-hover-color);
    visibility: hidden;
    width: 0px;
    transition: all 0.3s ease-in-out 0s;
  }

  .navmenu a:hover:before,
  .navmenu li:hover>a:before,
  .navmenu .active:before {
    visibility: visible;
    width: 100%;
  }

  .navmenu li:hover>a,
  .navmenu .active,
  .navmenu .active:focus {
    color: var(--nav-hover-color);
  }

  .navmenu .dropdown ul {
    margin: 0;
    padding: 10px 0;
    background: var(--nav-dropdown-background-color);
    display: block;
    position: absolute;
    visibility: hidden;
    left: 14px;
    top: 130%;
    opacity: 0;
    transition: 0.3s;
    border-radius: 4px;
    z-index: 99;
    box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.1);
  }

  .navmenu .dropdown ul li {
    min-width: 200px;
  }

  .innerli {
    min-width: unset !important; 
  }

  .navmenu .dropdown ul a {
    padding: 10px 20px;
    font-size: 15px;
    text-transform: none;
    color: var(--nav-dropdown-color);
  }

  .navmenu .dropdown ul a i {
    font-size: 12px;
  }

  .navmenu .dropdown ul a:hover,
  .navmenu .dropdown ul .active:hover,
  .navmenu .dropdown ul li:hover>a {
    color: var(--nav-dropdown-hover-color);
  }

  .navmenu .dropdown:hover>ul {
    opacity: 1;
    top: 100%;
    visibility: visible;
  }

  .navmenu .dropdown .dropdown ul {
    top: 0;
    left: -90%;
    visibility: hidden;
  }

  .navmenu .dropdown .dropdown:hover>ul {
    opacity: 1;
    top: 0;
    left: -100%;
    visibility: visible;
  }
  .ul-account-nav {
    min-width: 100%;
    width: max-content;
  }

  /* Keep account dropdown inside the viewport on full-width nav */
  .navmenu>ul>li.navmenu-util--account>ul {
    left: auto;
    right: 0;
  }
}

/* Mobile Navigation */
@media (max-width: 1199px) {
  .mobile-nav-toggle {
    color: var(--nav-color);
    font-size: 28px;
    line-height: 0;
    margin-right: 10px;
    cursor: pointer;
    transition: color 0.3s;
  }

  .navmenu {
    padding: 0;
    z-index: 9997;
  }

  .navmenu ul {
    display: none;
    list-style: none;
    position: absolute;
    inset: 60px 20px 20px 20px;
    padding: 10px 0;
    margin: 0;
    border-radius: 6px;
    background-color: var(--nav-mobile-background-color);
    border: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
    box-shadow: none;
    overflow-y: auto;
    transition: 0.3s;
    z-index: 9998;
  }

  .navmenu a,
  .navmenu a:focus {
    color: var(--nav-dropdown-color);
    padding: 10px 20px;
    font-family: var(--nav-font);
    font-size: 17px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    transition: 0.3s;
  }

  .navmenu a i,
  .navmenu a:focus i {
    font-size: 12px;
    line-height: 0;
    margin-left: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
    background-color: color-mix(in srgb, var(--accent-color), transparent 90%);
  }

  .navmenu a i:hover,
  .navmenu a:focus i:hover {
    background-color: var(--accent-color);
    color: var(--contrast-color);
  }

  .navmenu a:hover,
  .navmenu .active,
  .navmenu .active:focus {
    color: var(--nav-dropdown-hover-color);
  }

  .navmenu .active i,
  .navmenu .active:focus i {
    background-color: var(--accent-color);
    color: var(--contrast-color);
    transform: rotate(180deg);
  }

  .navmenu .dropdown ul {
    position: static;
    display: none;
    z-index: 99;
    padding: 10px 0;
    margin: 10px 20px;
    background-color: var(--nav-dropdown-background-color);
    transition: all 0.3s ease-in-out;
  }

  .navmenu .dropdown ul ul {
    background-color: rgba(33, 37, 41, 0.1);
  }

  .navmenu .dropdown>.dropdown-active {
    display: block;
    background-color: rgba(33, 37, 41, 0.03);
  }

  .mobile-nav-active {
    overflow: hidden;
  }

  .mobile-nav-active .mobile-nav-toggle {
    color: #fff;
    position: absolute;
    font-size: 32px;
    top: 15px;
    right: 15px;
    margin-right: 0;
    z-index: 9999;
  }

  .mobile-nav-active .navmenu {
    position: fixed;
    overflow: hidden;
    inset: 0;
    background: rgba(33, 37, 41, 0.8);
    transition: 0.3s;
  }

  .mobile-nav-active .navmenu>ul {
    display: block;
  }
}

/*--------------------------------------------------------------
# Global Footer
--------------------------------------------------------------*/
.footer {
  color: var(--default-color);
  background-color: var(--background-color);
  border-top: 1px solid color-mix(in srgb, var(--accent-color), transparent 75%);
  font-size: 14px;
  position: relative;
}

.footer .footer-top {
  padding-top: 50px;
}

.footer .footer-about .logo {
  line-height: 1;
  margin-bottom: 25px;
}

.footer .footer-about .logo img {
  max-height: 100px;
  margin-right: 6px;
}

.footer .footer-about .logo span {
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}

.footer .footer-about p {
  font-size: 14px;
  font-family: var(--heading-font);
}

.footer .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 50%);
  font-size: 16px;
  color: color-mix(in srgb, var(--default-color), transparent 20%);
  margin-right: 10px;
  transition: 0.3s;
}

.footer .social-links a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.footer h4 {
  font-size: 16px;
  font-weight: bold;
  position: relative;
  padding-bottom: 12px;
}

.footer .footer-links {
  margin-bottom: 30px;
}

.footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer .footer-links ul i {
  padding-right: 2px;
  font-size: 12px;
  line-height: 0;
}

.footer .footer-links ul li {
  padding: 10px 0;
  display: flex;
  align-items: center;
}

.footer .footer-links ul li:first-child {
  padding-top: 0;
}

.footer .footer-links ul a {
  color: color-mix(in srgb, var(--default-color), transparent 30%);
  display: inline-block;
  line-height: 1;
}

.footer .footer-links ul a:hover {
  color: var(--accent-color);
}

.footer .footer-contact p {
  margin-bottom: 5px;
}

.footer .copyright {
  padding-top: 25px;
  padding-bottom: 25px;
  border-top: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
}

.footer .copyright p {
  margin-bottom: 0;
}

.footer .credits {
  margin-top: 8px;
  font-size: 13px;
}

/*--------------------------------------------------------------
# Global Sections
--------------------------------------------------------------*/
section,
.section {
  color: var(--default-color);
  background-color: var(--background-color);
  padding: 40px 0;
  scroll-margin-top: 72px;
  overflow: clip;
}

@media (max-width: 1199px) {

  section,
  .section {
    scroll-margin-top: 40px;
  }
}

/* ==========================================================================
   7. Marketing / Landing Sections
   ========================================================================== */

/*--------------------------------------------------------------
# Hero Section — Split-Hero / Embedded Login
--------------------------------------------------------------*/
.hero {
  width: 100%;
  min-height: calc(100vh - 112px);
  padding: 80px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* .hero>img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

*/
/* Subtle dark overlay for readable welcome text over the photo */
.fading-img-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg,
      rgba(0, 20, 50, 0.72) 0%,
      rgba(0, 20, 50, 0.45) 55%,
      rgba(0, 20, 50, 0.35) 100%);
  pointer-events: none;
}
.hero .container {
  z-index: 3;
}

.hero .welcome h2 {
  margin: 0;
  font-family: var(--heading-font);
    font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--contrast-color);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.hero .welcome p {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  margin: 0;
  color: var(--contrast-color);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
    max-width: 36rem;
    opacity: 0.95;
  }
  
  .hero-login-card {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.75rem !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28) !important;
  }
  
  [data-bs-theme="dark"] .hero-login-card {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55) !important;
  }
  
  .hero-login-card .form-control {
    background-color: var(--input-background-color) !important;
  }

  .hero-login-card .d-flex.flex-column.align-items-center {
    gap: 0.6rem;
    margin-bottom: 0.75rem;
  }

  .hero-login-card .d-flex.flex-column.align-items-center .mb-3 {
    margin-bottom: 0 !important;
  }

  .hero-login-card .d-flex.flex-column.align-items-center h3 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .hero-login-card .neuland-dynamic-logo {
    max-width: 165px;
    margin: 0 auto 0;
    display: block;
  }
  
  @media (max-width: 991.98px) {
    .hero {
      min-height: auto;
      padding: 56px 0 64px;
    }
  
    .hero .welcome {
      text-align: center;
    }

    .hero .welcome p {
      margin-left: auto;
      margin-right: auto;
    }

    .hero-login-card {
      margin-top: 0.5rem;
    }
  }
  
    /*--------------------------------------------------------------
  # Institutional / About cards (below hero)
  --------------------------------------------------------------*/
    .about-institutional {
      padding: 60px 0;
    }
  
    .about-institutional .why-box {
  color: var(--contrast-color);
  background: var(--accent-color);
  padding: 30px;
  border-radius: 4px;
}

.about-institutional .why-box h3 {
  color: var(--contrast-color);
  font-weight: 700;
  font-size: 34px;
  margin-bottom: 30px;
}

.about-institutional .why-box p {
  margin-bottom: 30px;
}

.about-institutional .why-box .more-btn {
  color: var(--contrast-color);
  background: color-mix(in srgb, var(--contrast-color), transparent 80%);
  display: inline-block;
  padding: 6px 30px 8px 30px;
  border-radius: 50px;
  transition: all ease-in-out 0.4s;
}

.about-institutional .why-box .more-btn i {
  font-size: 14px;
}

.about-institutional .why-box .more-btn:hover {
  background: var(--surface-color);
  color: var(--accent-color);
}

.about-institutional .icon-box {
  text-align: center;
  border-radius: 10px;
  background: var(--surface-color);
  box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.1);
  padding: 40px 30px;
  width: 100%;
}

[data-bs-theme="dark"] .about-institutional .icon-box {
  box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.35);
}

.about-institutional .icon-box i {
  font-size: 40px;
  color: var(--accent-color);
}

.about-institutional .icon-box h4 {
  font-size: 20px;
  font-weight: 700;
  margin: 10px 0 20px 0;
  color: var(--heading-color);
}

.about-institutional .icon-box p {
  font-size: 15px;
  color: var(--default-color);
}

/*--------------------------------------------------------------
# Stats Section
--------------------------------------------------------------*/
.stats i {
  color: var(--contrast-color);
  background-color: var(--accent-color);
  box-shadow: 0px 2px 25px rgba(0, 0, 0, 0.1);
  width: 54px;
  height: 54px;
  font-size: 24px;
  border-radius: 50px;
  border: 2px solid var(--background-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.stats .stats-item {
  background-color: var(--surface-color);
  margin-top: -27px;
  padding: 30px 30px 25px 30px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0px 2px 35px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  z-index: 0;
}

.stats .stats-item span {
  font-size: 32px;
  display: block;
  margin: 10px 0;
  font-weight: 700;
  color: var(--heading-color);
}

/*--------------------------------------------------------------
# Services Section
--------------------------------------------------------------*/
.services .service-item {
  background-color: var(--surface-color);
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
  padding: 30px 10px 20px;
  transition: all ease-in-out 0.3s;
  height: 100%;
}

.services .service-item .icon {
  margin: 0 auto;
  width: 64px;
  height: 64px;
  background: var(--accent-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: 0.3s;
  transform-style: preserve-3d;
}

.services .service-item .icon i {
  color: var(--contrast-color);
  font-size: 28px;
  transition: ease-in-out 0.3s;
}

.services .service-item .icon::before {
  position: absolute;
  content: "";
  left: -8px;
  top: -8px;
  height: 100%;
  width: 100%;
  background: color-mix(in srgb, var(--accent-color), transparent 80%);
  border-radius: 5px;
  transition: all 0.3s ease-out 0s;
  transform: translateZ(-1px);
}

.services .service-item h3 {
  font-weight: 700;
  margin: 10px 0 15px 0;
  font-size: 22px;
}

.services .service-item p {
  line-height: 24px;
  font-size: 14px;
  margin-bottom: 0;
}

.services .service-item:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.services .service-item:hover .icon {
  background: var(--surface-color);
}

.services .service-item:hover .icon i {
  color: var(--accent-color);
}

.services .service-item:hover .icon::before {
  background: color-mix(in srgb, var(--background-color), transparent 70%);
}

.services .service-item:hover h3,
.services .service-item:hover p {
  color: var(--contrast-color);
}

.services .service-item table {
  line-height: 24px;
  font-size: 14px;
  margin-bottom: 0;
}

/*--------------------------------------------------------------
# Doctors Section
--------------------------------------------------------------*/
.doctors .team-member {
  background-color: var(--surface-color);
  box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  border-radius: 5px;
  transition: 0.3s;
  padding: 30px;
  height: 100%;
}

@media (max-width: 468px) {
  .doctors .team-member {
    flex-direction: column;
    justify-content: center !important;
    align-items: center !important;
  }
}

.doctors .team-member .pic {
  overflow: hidden;
  width: 150px;
  border-radius: 50%;
  flex-shrink: 0;
}

.doctors .team-member .pic img {
  transition: ease-in-out 0.3s;
}

.doctors .team-member:hover {
  transform: translateY(-10px);
}

.doctors .team-member .member-info {
  padding-left: 30px;
}

@media (max-width: 468px) {
  .doctors .team-member .member-info {
    padding: 30px 0 0 0;
    text-align: center;
  }
}

.doctors .team-member h4 {
  font-weight: 700;
  margin-bottom: 5px;
  font-size: 20px;
}

.doctors .team-member span {
  display: block;
  font-size: 15px;
  padding-bottom: 10px;
  position: relative;
  font-weight: 500;
}

.doctors .team-member span::after {
  content: "";
  position: absolute;
  display: block;
  width: 50px;
  height: 1px;
  background: color-mix(in srgb, var(--default-color), transparent 85%);
  bottom: 0;
  left: 0;
}

@media (max-width: 468px) {
  .doctors .team-member span::after {
    left: calc(50% - 25px);
  }
}

.doctors .team-member p {
  margin: 10px 0 0 0;
  font-size: 14px;
}

.doctors .team-member .social {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: start;
  width: 100%;
}

@media (max-width: 468px) {
  .doctors .team-member .social {
    justify-content: center;
  }
}

.doctors .team-member .social a {
  background: color-mix(in srgb, var(--default-color), transparent 94%);
  transition: ease-in-out 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50px;
  width: 36px;
  height: 36px;
}

.doctors .team-member .social a i {
  color: color-mix(in srgb, var(--default-color), transparent 20%);
  font-size: 16px;
  margin: 0 2px;
}

.doctors .team-member .social a:hover {
  background: var(--accent-color);
}

.doctors .team-member .social a:hover i {
  color: var(--contrast-color);
}

.doctors .team-member .social a+a {
  margin-left: 8px;
}

/*--------------------------------------------------------------
# Gallery Section
--------------------------------------------------------------*/
.gallery .gallery-item {
  overflow: hidden;
  border-right: 3px solid var(--background-color);
  border-bottom: 3px solid var(--background-color);
}

.gallery .gallery-item img {
  transition: all ease-in-out 0.4s;
}

.gallery .gallery-item:hover img {
  transform: scale(1.1);
}

/*--------------------------------------------------------------
# Contact Section
--------------------------------------------------------------*/
.contact .info-item+.info-item {
  margin-top: 40px;
}

.contact .info-item i {
  color: var(--contrast-color);
  background: var(--accent-color);
  font-size: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50px;
  transition: all 0.3s ease-in-out;
  margin-right: 15px;
}

.contact .info-item h3 {
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
}

.contact .info-item p {
  padding: 0;
  margin-bottom: 0;
  font-size: 14px;
}

/* ==========================================================================
   8. Utility Overrides (Bootstrap Theme Bridge)
   ========================================================================== */
.bg-white,
.bg-body,
.bg-body-secondary,
.bg-body-tertiary,
.bg-surface {
  background-color: var(--background-color) !important;
}

.bg-light,
.bg-light-subtle,
.text-bg-light,
.bg-surface-muted {
  background-color: var(--background-color) !important;
}

.text-bg-light {
  color: var(--default-color) !important;
}

/* Literal Bootstrap color utilities stay dark by design; remap them for dark mode */
[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-black {
  color: var(--heading-color) !important;
}

[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-body-secondary {
  color: color-mix(in srgb, var(--default-color), transparent 25%) !important;
}

[data-bs-theme="dark"] .text-body,
[data-bs-theme="dark"] .text-body-emphasis {
  color: var(--default-color) !important;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
  border-color: var(--bs-border-color) !important;
}

.table {
  --bs-table-color: var(--default-color);
  --bs-table-striped-color: var(--default-color);
  --bs-table-active-color: var(--default-color);
  --bs-table-hover-color: var(--default-color);
  --bs-table-bg: transparent;
  --bs-table-accent-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-active-bg: transparent;
  --bs-table-hover-bg: transparent;
  color: var(--default-color);
}

.table> :not(caption)>*>* {
  top: 0;
  background-color: var(--bs-card-bg) !important;
  z-index: 2;
  box-shadow: 0 1px 0 var(--bs-card-bg);
}

.table-light {
  --bs-table-color: var(--heading-color);
  --bs-table-striped-color: var(--heading-color);
  --bs-table-active-color: var(--heading-color);
  --bs-table-hover-color: var(--heading-color);
  --bs-table-bg: var(--background-color);
  --bs-table-striped-bg: var(--background-color);
  --bs-table-active-bg: var(--background-color);
  --bs-table-hover-bg: var(--background-color);
  color: var(--heading-color);
}

.table-light> :not(caption)>*>* {
  --bs-table-bg-type: var(--background-color);
  --bs-table-bg-state: var(--background-color);
  color: var(--heading-color);
  background-color: var(--background-color) !important;
  box-shadow: inset 0 0 0 9999px var(--background-color) !important;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
  --bs-table-bg-type: var(--background-color);
  --bs-table-bg-state: var(--background-color);
}

.table-hover>tbody>tr:hover>* {
  --bs-table-bg-state: color-mix(in srgb, var(--background-color), var(--default-color) 4%);
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--background-color), var(--default-color) 4%) !important;
}

.card {
  --bs-card-bg: var(--background-color);
  --bs-card-cap-bg: var(--background-color);
  background-color: var(--background-color) !important;
}

/* Floating hero login card — surface token so it lifts off the photo in both themes */
.card.hero-login-card {
  --bs-card-bg: var(--surface-color);
  --bs-card-cap-bg: var(--surface-color);
  background-color: var(--surface-color) !important;
}

.card.hero-login-card .form-control {
  background-color: var(--input-background-color) !important;
}
.card-body,
.card-footer {
  background-color: var(--background-color) !important;
}

.card-header:not([class*="bg-"]):not([style*="background"]) {
  background-color: var(--background-color) !important;
}

.form-control,
.form-select,
.input-group-text {
  background-color: var(--background-color) !important;
  color: var(--default-color) !important;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--background-color) !important;
  color: var(--default-color) !important;
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--default-color), transparent 45%);
}

.list-group-item,
.modal-content,
.dropdown-menu,
.offcanvas,
.popover,
.toast,
.accordion-item,
.page-link,
.border.rounded {
  background-color: var(--background-color) !important;
  color: var(--default-color);
}

.dropdown-item,
.list-group-item,
.page-link,
.accordion-button,
.modal-title,
.card,
.card-body,
.card-header,
.card-footer,
.card-title,
.card-text {
  color: var(--default-color);
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--heading-color);
}

canvas {
  background-color: transparent !important;
}

.btn-outline-primary {
  --bs-btn-color: var(--accent-color);
  --bs-btn-border-color: var(--accent-color);
  --bs-btn-hover-color: var(--background-color);
  --bs-btn-hover-bg: var(--accent-color);
  --bs-btn-hover-border-color: var(--accent-color);
  --bs-btn-active-color: var(--background-color);
  --bs-btn-active-bg: var(--accent-color);
  --bs-btn-active-border-color: var(--accent-color);
}

@media (max-width: 768px) {
  .services .service-item {
    padding: 5px 10px;
  }
    .services .service-item .icon-container {
      padding-top: 1rem !important;
  }
    .services .service-item .icon-container .icon {
      margin-bottom: 10px;
  }

    .text-left {
      text-align: left !important
  }
    .service-item-box {
      margin-top: .25rem !important
    }
}

/*--------------------------------------------------------------
# Disable aos animation delay on mobile devices
--------------------------------------------------------------*/
@media screen and (max-width: 768px) {
  [data-aos-delay] {
    transition-delay: 0 !important;
  }
}