html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ================================
   Global Layout
================================ */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

.page-shell {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.section-spaced {
    padding: 1.5rem 0;
}

.footer {
    flex-shrink: 0;
    width: 100%;
    line-height: 1.5;
    background-color: #fff;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

/* ================================
   Global Design Tokens
================================ */
:root {
    --brand-primary: #1f4fd8;
    --brand-primary-soft: #eef2ff;
    --brand-accent: #0d6efd;
    --brand-secondary: #7c3aed;
    --brand-sunrise: #f97316;
    --brand-mint: #14b8a6;
    --surface-bg: #eef2f7; /* slightly darker than pure white to separate page vs cards */
    --surface-card: #ffffff; /* card surfaces remain white for clarity */
    --surface-subtle: #fbfdff; /* very light surface used for subtle panels */
    --border-subtle: #e2e8f0; /* slightly stronger border for separation */
    --text-muted: #6b7280;
    --text-default: #0f1724; /* default readable text color */
    
    /* Light theme enhancements for public pages - HIGH CONTRAST */
    --public-bg: #dde3ed;
    --public-card-border: #a8b5c4;
    --public-section-bg: #e4e9f1;
    --public-shadow: rgba(15, 23, 42, 0.15);
}

/* ================================
   Base Layout
================================ */
body {
    background-color: var(--surface-bg);
    font-size: 0.95rem;
}

/* ================================
   Mobile Input Zoom Prevention
   Ensures inputs don't trigger zoom on iOS
================================ */
@media (max-width: 767.98px) {
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ================================
   Public Marketing Theme
================================ */
.public-site {
    background-color: var(--public-bg);
    background-image: radial-gradient(circle at top left, rgba(124, 58, 237, 0.06), transparent 55%),
        radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.06), transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(20, 184, 166, 0.06), transparent 50%);
}

.public-site main {
    position: relative;
    z-index: 0;
}

    .public-site main::before {
        content: "";
        position: absolute;
        inset: -3rem 0 auto 0;
        height: 320px;
        background: radial-gradient(circle at 15% 40%, rgba(31, 79, 216, 0.12), transparent 55%),
            radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.12), transparent 50%);
        opacity: 0.7;
        pointer-events: none;
        z-index: -1;
    }

    .public-site main::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(120deg, rgba(15, 23, 42, 0.02) 0%, rgba(15, 23, 42, 0.02) 30%, transparent 30%, transparent 100%),
            linear-gradient(45deg, rgba(15, 23, 42, 0.02) 0%, rgba(15, 23, 42, 0.02) 25%, transparent 25%, transparent 100%);
        background-size: 120px 120px;
        opacity: 0.4;
        pointer-events: none;
        z-index: -2;
    }

.public-navbar {
    background: linear-gradient(90deg, rgba(31, 79, 216, 0.12), rgba(124, 58, 237, 0.12), rgba(20, 184, 166, 0.12));
    backdrop-filter: blur(10px);
    border-color: var(--public-card-border);
    border-bottom: 1px solid var(--public-card-border);
    position: relative;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

    .public-navbar .navbar-brand,
    .public-navbar .nav-link {
        color: #1f2937;
        font-weight: 500;
    }

    .public-navbar .nav-link:hover,
    .public-navbar .navbar-brand:hover {
        color: var(--brand-primary);
    }

.public-site .footer {
    background: linear-gradient(90deg, rgba(31, 79, 216, 0.08), rgba(124, 58, 237, 0.08), rgba(20, 184, 166, 0.08));
    background-color: #f8fafc;
    border-top: 1px solid var(--public-card-border);
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04);
}

/* Light theme bg-light enhancement for public pages */
.public-site .bg-light {
    background-color: var(--public-section-bg) !important;
    border-top: 1px solid var(--public-card-border);
    border-bottom: 1px solid var(--public-card-border);
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Step badges - ensure full circles */
.public-site .badge.rounded-circle {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(31, 79, 216, 0.25);
}

/* Images on public pages - add outline for contrast */
.public-site .page-hero img,
.public-site .feature-card img,
.public-site .hero-card img,
.public-site .cta-card img,
.public-site main img.img-fluid,
.public-site main img.rounded {
    border: 2px solid #9aa8ba;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    background-color: #ffffff;
}

/* Image placeholders on public pages */
.public-site .bg-light.rounded.border,
.public-site .text-center.p-5.bg-light.rounded.border {
    border: 2px solid #9aa8ba !important;
    background-color: #f1f5f9 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

/* ================================
   Navbar
================================ */
a.navbar-brand {
    white-space: nowrap;
    font-weight: 600;
}

.dropdown-menu {
    min-width: 220px;
    z-index: 1050;
}

.navbar img {
    transition: box-shadow .2s ease;
}

    .navbar img:hover {
        box-shadow: 0 0 0 2px rgba(0,0,0,.15);
    }

/* ================================
   Cards
================================ */
.card {
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-card);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04); /* gentle elevation to separate from page */
}

.card-header {
    background-color: var(--surface-card);
    font-weight: 600;
    color: var(--text-default, #0f1724); /* ensure header text is readable against the background */
    padding: 0.75rem 1rem; /* ensure consistent spacing */
    border-bottom: 1px solid rgba(15, 23, 42, 0.06); /* subtle separation from card body */
}

/* Make Bootstrap "bg-light" headers stand out slightly from the page background */
.card-header.bg-light {
    background-color: rgba(15, 23, 42, 0.03); /* slightly darker than page bg */
    color: var(--text-default, #0f1724);
}

/* Ensure small/helper text inside headers inherits the header color for contrast */
.card-header small,
.card-header .small {
    color: inherit;
    opacity: 0.85;
}

/* ================================
   Buttons
================================ */
.btn {
    border-radius: 0.5rem;
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

    .btn-primary:hover {
        background-color: #1a45c2;
    }

.public-site .btn-primary {
    background-image: linear-gradient(135deg, #1f4fd8, #7c3aed);
    border-color: transparent;
    box-shadow: 0 0.75rem 1.5rem rgba(79, 70, 229, 0.25);
}

    .public-site .btn-primary:hover {
        background-image: linear-gradient(135deg, #1a45c2, #6d28d9);
    }

/* Enhanced text contrast for public pages in light mode */
.public-site .text-muted {
    color: #4b5563 !important;
}

.public-site .lead {
    color: #374151;
}

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

.public-site .display-4, .public-site .display-5, .public-site .display-6 {
    color: #0f172a;
}

/* ================================
   Links & Buttons
================================ */
a {
    color: #0077cc;
}

    a:hover {
        color: #005fa3;
    }

.btn-outline-primary {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

    .btn-outline-primary:hover {
        background-color: var(--brand-primary);
        color: #fff;
    }

button.accept-policy {
    font-size: 1rem;
    line-height: inherit;
}

/* ================================
   Tables
================================ */
.table {
    background-color: var(--surface-card);
}

.table thead th {
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid var(--border-subtle);
    background-color: rgba(15, 23, 42, 0.03); /* subtle contrast for header row */
}

/* Slightly darker striped rows for readability */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(15, 23, 42, 0.01);
}

/* ================================
   Forms
================================ */
.form-label {
    font-weight: 500;
}

.form-control {
    border-radius: 0.5rem;
}

/* ================================
   Utility
================================ */
.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-muted {
    color: var(--text-muted);
}

.full-height-page {
    height: 100vh;
    overflow: hidden;
}

/* ================================
   Make Ready Display
================================ */
.mr-display-alert {
    border-left: 4px solid var(--brand-accent);
    background: #fff7e6;
}

/* ================================
   Sales Display
================================ */
.sales-display {
    min-height: calc(100vh - 2rem);
    height: 100%;
    padding: 1.5rem;
    border-radius: 1rem;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.85));
    border: 1px solid var(--border-subtle);
    box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.sales-display-board {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    height: 100%;
}

.sales-display-column {
    min-width: 240px;
    display: flex;
    flex-direction: column;
}

.sales-display-objectives {
    flex: 0 0 320px;
}

.sales-display-week {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.sales-display-week .row {
    height: 100%;
}

.sales-display-week .col-12.col-lg-2 {
    display: flex;
}

.sales-display-week .card {
    flex: 1;
}

@media (max-width: 992px) {
    .sales-display-board {
        flex-direction: column;
    }

    .sales-display-objectives {
        flex-basis: auto;
    }
}

.sales-display-icon img {
    max-width: 46px;
    max-height: 46px;
}

.sales-display-vehicles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.2rem 0.4rem;
    direction: ltr;
    align-content: start;
    justify-items: start;
    min-height: 12rem;
    flex: 1 1 auto;
}

.sales-display-vehicle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    direction: ltr;
    white-space: nowrap;
}

.sales-display-vehicle-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: flex-start;
}

.sales-display-vehicle-initials {
    font-weight: 600;
    letter-spacing: 0.08em;
}

.sales-display-vehicle img {
    max-width: 22px;
    max-height: 22px;
}

.sales-display-groups {
    font-size: 0.9rem;
}

.sales-display-week-summary {
    margin-top: auto;
}

.mr-alert-blink {
    animation: mr-alert-pulse 1.4s ease-in-out infinite;
}

@keyframes mr-alert-pulse {
    0% {
        box-shadow: 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 193, 7, 0.75);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 193, 7, 0.4);
    }
}

/* ================================
   Page Hero + Feature Cards
================================ */
.page-hero {
    padding: 3rem 2.5rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid var(--public-card-border);
    box-shadow: 0 1rem 2.5rem var(--public-shadow), 0 0 0 1px rgba(255,255,255,0.8) inset;
    position: relative;
    overflow: hidden;
}

.public-site .page-hero {
    background: #ffffff;
    border: 2px solid #9aa8ba;
    box-shadow: 0 1rem 3rem rgba(15, 23, 42, 0.18);
}

/* Decorative accents pushed to corners, away from text */
.page-hero::before {
    content: "";
    position: absolute;
    inset: auto -150px -150px auto;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent 70%);
    pointer-events: none;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: -100px auto auto -80px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.12), transparent 70%);
    pointer-events: none;
}

.page-hero-compact {
    padding: 2.5rem;
}

.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--brand-secondary);
    margin-bottom: 0.5rem;
}

.public-site .eyebrow {
    color: #6d28d9;
}

.hero-card {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 1.5rem;
    box-shadow: 0 0.75rem 1.5rem rgba(79, 70, 229, 0.1);
}

.public-site .hero-card {
    background: #ffffff;
    border: 2px solid #818cf8;
    box-shadow: 0 0.5rem 1.5rem rgba(79, 70, 229, 0.15);
}

.feature-card {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid var(--public-card-border);
    padding: 1.75rem;
    box-shadow: 0 0.5rem 1.5rem var(--public-shadow);
    position: relative;
}

.public-site .feature-card {
    background: #ffffff;
    border: 2px solid #9aa8ba;
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.14);
}

.feature-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: 0.75rem 0.75rem 0 0;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary), var(--brand-mint));
}

.cta-card {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgba(124, 58, 237, 0.25);
    padding: 2rem;
    box-shadow: 0 1rem 2.5rem rgba(79, 70, 229, 0.1);
}

.public-site .cta-card {
    background: #ffffff;
    border: 2px solid #8b5cf6;
    box-shadow: 0 0.75rem 2rem rgba(79, 70, 229, 0.18);
}

/* ================================
   Toasts
================================ */
.toast-container {
    pointer-events: none;
}

.toast {
    pointer-events: auto;
}

/* ================================
   Auth / Login Layout
================================ */
.auth-page {
    height: 100vh;
    overflow: hidden;
    background-color: var(--surface-bg);
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Login card */
.login-card {
    background: var(--surface-card);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 1rem 2.5rem rgba(0,0,0,0.08);
}

.navbar-brand-img {
    height: 36px;
    width: auto;
    display: block;
    border-radius: 0.4rem;
}

/* Login visual placeholder */
.login-visual {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.65rem;
    background: rgba(248, 250, 252, 0.7);
    padding: 0.5rem;
}


.login-visual-img {
    display: block;
    width: 100%;
    min-height: 120px;
    border-radius: 0.4rem;
    object-fit: contain;
    background-color: rgba(15, 23, 42, 0.03);
    filter: none !important;
    mix-blend-mode: normal !important;
}

.login-visual-hint {
    line-height: 1.4;
    font-size: 0.85rem;
}

/* Password toggle */
.password-toggle {
    cursor: pointer;
    color: #6b7280;
}

    .password-toggle:hover {
        color: #111827;
    }

/* Caps lock warning */
.caps-warning {
    font-size: 0.85rem;
    color: #dc3545;
    display: none;
}

/* ================================
   Home Page
================================ */
.vendor-card:hover {
    transform: translateY(-2px);
    transition: all 0.15s ease-in-out;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

.vendor-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Objectives container + thinner progress bars
   Append these rules near the bottom of site.css (or merge into the existing sections).
*/

:root {
    /* progress control -- tweak to adjust thinness globally */
    --progress-height: 6px; /* smaller, crisp progress bars */
    --objectives-max-height: 420px; /* max height for the objectives column */
}

/* thin progress variant */
.progress.thin-progress {
    height: var(--progress-height);
    border-radius: 999px;
    background-color: rgba(14, 165, 233, 0.06);
    overflow: hidden;
}

.progress.thin-progress .progress-bar {
    height: 100%;
    border-radius: 999px;
    box-shadow: none;
    transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

/* Objectives container: constrain height and allow internal scrolling */
.objectives-container {
    max-height: var(--objectives-max-height);
    overflow-y: auto;
    padding-right: 0.5rem; /* account for scrollbar */
    margin-bottom: 0.5rem;
}

/* Small, unobtrusive scrollbar (WebKit) */
.objectives-container::-webkit-scrollbar {
    width: 8px;
}
.objectives-container::-webkit-scrollbar-track {
    background: transparent;
}
.objectives-container::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 6px;
}

/* For Firefox: slimmer scrollbar */
@supports (scrollbar-width: thin) {
    .objectives-container { scrollbar-width: thin; scrollbar-color: rgba(15,23,42,0.08) transparent; }
}

/* Tighten vertical spacing for objective rows so more fit without feeling crowded */
.objectives-container .mb-3 {
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.25rem;
}

/* Slightly reduce icon size inside objective rows on compact view */
.objectives-container img {
    height: 26px;
    width: 26px;
}

/* Responsive tweak: reduce max height on small screens */
@media (max-width: 992px) {
    :root { --objectives-max-height: 320px; }
}

/* ================================
   KPI tiles (polish)
   Append this block to the end of site.css
   ================================ */

.kpi-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,247,249,0.98));
    transition: transform .12s ease, box-shadow .12s ease;
    min-height: 68px;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 .9rem 1.8rem rgba(15, 23, 42, 0.07);
}

/* icon container */
.kpi-icon {
    width: var(--kpi-icon-size, 48px);
    height: var(--kpi-icon-size, 48px);
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    color: white;
    flex: 0 0 auto;
    box-shadow: 0 6px 18px rgba(31, 41, 55, .06);
    font-size: 1.05rem;
}

/* Hide KPI icons (visual removal without changing markup) */
.kpi-card .kpi-icon,
.kpi-card .kpi-icon *,
.kpi-card i,
.kpi-card svg,
.kpi-card .fa,
.kpi-card .bi {
    display: none !important;
}

/* when icons are hidden, slightly tighten spacing */
.kpi-card { gap: 0.5rem; }

/* icon color variants */
.kpi-icon.primary { background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); }
.kpi-icon.success { background: linear-gradient(135deg, #10b981, #06b6d4); }
.kpi-icon.warn { background: linear-gradient(135deg, #f59e0b, #fb923c); color: #111827; }
.kpi-icon.danger { background: linear-gradient(135deg, #ef4444, #f97316); }

/* text */
.kpi-label { display: block; font-size: 0.78rem; color: var(--text-muted, #6b7280); margin-bottom: 0.15rem; }
.kpi-value { font-size: 1.2rem; font-weight: 700; color: var(--text-default, #0f1724); line-height: 1; }

/* optional small trend / delta */
.kpi-trend {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.kpi-trend .up { color: #16a34a; }
.kpi-trend .down { color: #dc2626; }

/* compact layout for very small screens */
@media (max-width: 576px) {
    .kpi-card { padding: 0.6rem; min-height: 60px; gap: 0.5rem; }
    .kpi-icon { width: 40px; height: 40px; font-size: 0.9rem; border-radius: 10px; }
    .kpi-value { font-size: 1rem; }
}

/* utility to align KPI content when used inside .card */
.kpi-card > div:last-child { min-width: 0; }

/* ensure KPI cards don't stretch the header row */
.kpi-row { display: flex; gap: 1rem; align-items: stretch; }

/* ================================
   Table UI enhancements
   Use class "table-enhanced" alongside Bootstrap table classes
================================ */
.table-enhanced {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-card);
    box-shadow: 0 6px 18px rgba(15,23,42,0.03);
    border-radius: .6rem;
    overflow: hidden;
}
.table-enhanced th,
.table-enhanced td {
    padding: .55rem .9rem;
    vertical-align: middle;
    white-space: nowrap;
}
.table-enhanced thead th {
    background: rgba(15,23,42,0.03);
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 1px solid var(--border-subtle);
}
.table-enhanced tbody tr:hover {
    background: rgba(31,41,55,0.03);
}
.table-enhanced tbody tr.selected {
    background: rgba(31,41,55,0.05);
    font-weight: 600;
}
.table-enhanced.table-sm th, .table-enhanced.table-sm td {
    padding: .35rem .6rem;
}
.table-enhanced .actions-col { width: 110px; white-space: nowrap; text-align: right; }
.table-responsive { border-radius: .6rem; overflow: auto; }

/* Responsive: switch to card-style rows on very small screens */
@media (max-width: 576px) {
    .table-enhanced thead { display: none; }
    .table-enhanced tbody tr { display: block; margin-bottom: .6rem; background: var(--surface-subtle); border-radius: .5rem; padding: .6rem; }
    .table-enhanced tbody td { display: flex; justify-content: space-between; padding: .45rem .6rem; white-space: normal; }
}

/* End Table UI enhancements */
/* ================================
   Select2 Customization
================================ */
.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
    border-radius: 0.5rem;
    min-height: 38px;
}

.select2-container--bootstrap-5 .select2-selection--single {
    padding: 0.375rem 0.75rem;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-radius: 0.5rem;
    border-color: var(--border-subtle);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    border-radius: 0.375rem;
    border-color: var(--border-subtle);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--brand-primary);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Ensure Select2 plays nice with Bootstrap form-floating */
.form-floating .select2-container {
    height: calc(3.5rem + 2px);
}

.form-floating .select2-selection {
    height: 100% !important;
    padding-top: 1.625rem !important;
    padding-bottom: 0.625rem !important;
}

/* Loading state */
.select2-container--bootstrap-5.select2-container--open .select2-dropdown {
    animation: fadeIn 0.15s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================
   Welcome Banner
================================ */
.welcome-banner {
    background: linear-gradient(135deg, rgba(31, 79, 216, 0.05), rgba(124, 58, 237, 0.05));
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.welcome-banner h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-default);
}

@media (max-width: 768px) {
    .welcome-banner {
        padding: 1.5rem;
    }
    .welcome-banner h1 {
        font-size: 1.5rem;
    }
}

/* ================================
   Icon Boxes for Quick Actions
================================ */
.icon-box {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1.25rem;
}

/* ================================
   Vendor Card Enhancements
================================ */
.vendor-card {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.vendor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.vendor-card:hover::before {
    transform: scaleX(1);
}

.vendor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

.vendor-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(31, 79, 216, 0.08), rgba(124, 58, 237, 0.08));
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.vendor-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.vendor-name {
    font-size: 0.95rem;
    line-height: 1.3;
}

/* ================================
   Quick Actions List
================================ */
.list-group-item-action:hover .icon-box {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.list-group-item-action:hover i.bi-chevron-right {
    transform: translateX(4px);
    transition: transform 0.2s ease;
}

/* ================================
   Gradient Card Header
================================ */
.card-header.bg-gradient {
    background: linear-gradient(135deg, rgba(31, 79, 216, 0.08), rgba(124, 58, 237, 0.08));
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

/* ================================
   Subtle Gradient Background
================================ */
.bg-gradient-subtle {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(238, 242, 255, 0.7), 
        rgba(255, 247, 237, 0.8));
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ================================
   Responsive Adjustments
================================ */
@media (max-width: 576px) {
    .icon-box {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .vendor-icon-wrapper {
        width: 40px;
        height: 40px;
    }

    .vendor-icon {
        width: 28px;
        height: 28px;
    }
}

/* ================================
   Platform Area Mobile Enhancements
================================ */

/* Platform navbar mobile improvements */
.platform-navbar .navbar-brand-img {
    height: 32px;
}

@media (max-width: 991.98px) {
    .platform-navbar .navbar-brand-img {
        height: 28px;
    }

    .platform-navbar .navbar-collapse {
        background: var(--bg-card);
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        padding: 0.75rem;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
    }

    .platform-navbar .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 0.375rem;
    }

    .platform-navbar .nav-link:hover {
        background: rgba(31, 79, 216, 0.08);
    }

    [data-theme="dark"] .platform-navbar .nav-link:hover {
        background: rgba(110, 168, 254, 0.12);
    }
}

/* Platform page header - stack on mobile */
.platform-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.platform-header-title {
    flex: 1 1 100%;
}

.platform-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .platform-header-title {
        flex: 1 1 auto;
    }

    .platform-header-actions {
        flex: 0 0 auto;
    }
}

/* Platform health score card - mobile layout */
.platform-health-card .border-end {
    border-right: 1px solid var(--border-color) !important;
}

@media (max-width: 767.98px) {
    .platform-health-card .border-end {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .platform-health-card .display-3 {
        font-size: 2.5rem;
    }
}

/* Platform tables - mobile card view */
.platform-table-responsive {
    border-radius: 0.6rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .platform-table thead {
        display: none;
    }

    .platform-table tbody tr {
        display: block;
        background: var(--bg-card);
        border-radius: 0.5rem;
        padding: 1rem;
        margin-bottom: 0.75rem;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
    }

    .platform-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none !important;
        white-space: normal;
        background: transparent !important;
    }

    .platform-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.85rem;
        flex: 0 0 40%;
        padding-right: 0.5rem;
    }

    .platform-table tbody td:first-child {
        padding-top: 0;
        font-weight: 600;
        font-size: 1rem;
    }

    .platform-table tbody td:last-child {
        padding-bottom: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .platform-table tbody td:first-child::before,
    .platform-table tbody td:last-child::before {
        display: none;
    }

    /* Table row status indicators */
    .platform-table tbody tr.table-danger {
        border-left: 4px solid #dc3545;
        background: var(--bg-card);
    }

    .platform-table tbody tr.table-warning {
        border-left: 4px solid #ffc107;
        background: var(--bg-card);
    }

    .platform-table tbody tr.table-secondary {
        border-left: 4px solid #6c757d;
        background: var(--bg-card);
    }
}

/* Filter forms - mobile stacking */
.platform-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.platform-filters .form-group {
    flex: 1 1 100%;
}

.platform-filters .btn-group-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (min-width: 576px) {
    .platform-filters .form-group {
        flex: 1 1 calc(50% - 0.375rem);
    }
}

@media (min-width: 768px) {
    .platform-filters .form-group {
        flex: 1 1 auto;
        max-width: 200px;
    }
}

/* Nav tabs - horizontal scroll on mobile */
.platform-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 1rem;
    padding-bottom: 2px;
}

.platform-tabs::-webkit-scrollbar {
    display: none;
}

.platform-tabs .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Alert layouts - mobile friendly */
.platform-alert-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.platform-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

@media (min-width: 768px) {
    .platform-alert-row {
        flex-direction: row;
        align-items: center;
    }

    .platform-alert-icon {
        flex: 0 0 auto;
        width: 80px;
    }
}

/* Button groups - wrap on mobile */
@media (max-width: 575.98px) {
    .btn-group-responsive {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group-responsive .btn {
        width: 100%;
    }

    /* Fix bootstrap btn-group on mobile */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    /* Make action buttons full width on mobile */
    .platform-header-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* Badge display improvements */
@media (max-width: 575.98px) {
    .badge {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
    }
}

/* Dashboard stats grid - mobile improvements */
.platform-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .platform-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 992px) {
    .platform-stats-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Card body padding adjustments for mobile */
@media (max-width: 575.98px) {
    .card-body {
        padding: 1rem;
    }

    .platform-health-card .card-body {
        padding: 1rem;
    }

    /* Reduce main container padding on mobile */
    .container-xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Dropdown menus - full width on mobile */
@media (max-width: 575.98px) {
    .dropdown-menu {
        width: calc(100vw - 2rem);
        max-width: 300px;
    }
}

/* User/Store details page - mobile layout */
@media (max-width: 767.98px) {
    .detail-header {
        text-align: left;
    }

    .detail-header h1 {
        font-size: 1.5rem;
        word-break: break-word;
    }

    .detail-header .badge {
        margin-top: 0.5rem;
    }

    .detail-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
    }

    .detail-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Info/metadata text - mobile wrapping */
.platform-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.platform-meta-separator {
    display: none;
}

@media (min-width: 576px) {
    .platform-meta-separator {
        display: inline;
    }
}

/* Billing tiers grid - mobile layout */
@media (max-width: 767.98px) {
    .billing-tiers-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .billing-tier-card {
        padding: 1rem !important;
    }
}

/* Quick action cards - mobile grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Toast container - mobile positioning */
@media (max-width: 575.98px) {
    .toast-container {
        width: calc(100% - 1rem);
        right: 0.5rem !important;
        left: 0.5rem !important;
    }

    .toast {
        width: 100%;
    }
}
