/* ================================================================
   VetNow Design Tokens
   Смени тук — важи навсякъде в сайта.
   ================================================================

   СТРУКТУРА:
     1. Brand palette   — основните цветове на марката
     2. Hero section    — тъмен фон, overlay, stat bar
     3. Tables          — thead нюанс и неактивни редове
     4. UI components   — sidebar active, emergency pulse

   Светла тема (:root) и тъмна тема ([data-bs-theme="dark"])
   са отделени — всеки токен присъства и в двете.
   ================================================================ */

:root {
    /* --- Bootstrap primary override → пастелно лилаво --- */
    --bs-primary:            #6f42c1;
    --bs-primary-rgb:        111, 66, 193;
    --bs-link-color:         #6f42c1;
    --bs-link-color-rgb:     111, 66, 193;
    --bs-link-hover-color:   #5a35a0;
    --bs-link-hover-color-rgb: 90, 53, 160;

    /* --- Brand --- */
    --vb-brand-primary:        #6f42c1;   /* основен акцент */
    --vb-brand-primary-dark:   #5a35a0;   /* hover */
    --vb-brand-primary-darker: #4e2d8c;   /* active/pressed */
    --vb-brand-primary-light:  #f3e8ff;   /* light bg tint */
    --vb-brand-accent:         #a07de0;   /* светъл акцент — focus, highlight */
    --vb-brand-danger:         #dc3545;   /* червено — emergency, изтриване */

    /* --- Hero section --- */
    --vb-hero-bg:            #0a1628;
    --vb-hero-overlay-r:     10;
    --vb-hero-overlay-g:     22;
    --vb-hero-overlay-b:     40;
    --vb-stats-bar-bg:       rgba(var(--bs-primary-rgb),0.07);
    --vb-stats-bar-border:   rgba(var(--bs-primary-rgb),0.12);
    --vb-stats-number-color: var(--vb-brand-primary);
    --vb-stats-label-color:  #7b6e8e;

    /* --- Page background --- */
    --vb-page-bg-from:       rgba(var(--bs-primary-rgb),0.02);
    --vb-page-bg-to:         rgba(var(--bs-primary-rgb),0.06);

    /* --- Trust section --- */
    --vb-trust-section-bg:   linear-gradient(135deg, var(--vb-brand-primary-light) 0%, rgba(var(--bs-primary-rgb),0.06) 100%);

    /* --- Hero search card (light) --- */
    --vb-search-card-bg:     rgba(255,255,255,0.75);
    --vb-search-card-border: rgba(var(--bs-primary-rgb),0.25);
    --vb-search-input-bg:    #ffffff;
    --vb-search-input-color: #1a1a2e;
    --vb-search-input-focus: #ffffff;
    --vb-search-focus-ring:  rgba(var(--bs-primary-rgb),0.30);
    --vb-city-btn-border:    rgba(var(--bs-primary-rgb),0.35);
    --vb-city-btn-color:     var(--vb-brand-primary-dark);
    --vb-city-btn-hover-bg:  rgba(var(--bs-primary-rgb),0.55);

    /* --- Light Hero --- */
    --vb-hero-light-bg-from: var(--vb-brand-primary-light);
    --vb-hero-light-bg-to:   rgba(var(--bs-primary-rgb),0.04);
    --vb-hero-light-title:   #1a1a2e;
    --vb-hero-light-subtitle:#4a4a6a;
    --vb-hero-light-trust:   #888888;

    /* --- Tables --- */
    --vb-thead-bg:           rgba(var(--bs-primary-rgb),0.13);
    --vb-thead-color:        var(--vb-brand-primary-darker);
    --vb-row-inactive-bg:    rgba(var(--bs-primary-rgb),0.03);
    --vb-row-inactive-color: #8a96a3;

    /* --- Booking widget tokens --- */
    --vb-slot-border:        var(--vb-brand-primary);
    --vb-slot-color:         var(--vb-brand-primary-dark);
    --vb-slot-hover-bg:      var(--vb-brand-primary-light);
    --vb-slot-active-bg:     var(--vb-brand-primary);
    --vb-slot-active-color:  #ffffff;
    --vb-slot-day-center-bg: var(--vb-brand-primary-light);
    --vb-slot-earliest-bg:   var(--vb-brand-primary-light);
    --vb-slot-earliest-border: var(--vb-brand-accent);
    --vb-slot-earliest-icon: rgba(var(--bs-primary-rgb),0.08);
    --vb-slot-nav-color:     var(--vb-brand-primary);
}

[data-bs-theme="dark"] {
    /* --- Bootstrap primary override (dark) --- */
    --bs-primary:            #a07de0;
    --bs-primary-rgb:        160, 125, 224;
    --bs-link-color:         #a07de0;
    --bs-link-color-rgb:     160, 125, 224;
    --bs-link-hover-color:   #c4a8e8;

    /* --- Brand --- */
    --vb-brand-primary:        #a07de0;
    --vb-brand-primary-dark:   #8a64cc;
    --vb-brand-primary-darker: #7550b8;
    --vb-brand-primary-light:  #2a1a45;
    --vb-brand-accent:         #c4a8e8;
    --vb-brand-danger:         #dc3545;

    /* --- Hero section --- */
    --vb-hero-bg:            #0a1628;
    --vb-hero-overlay-r:     10;
    --vb-hero-overlay-g:     22;
    --vb-hero-overlay-b:     40;
    --vb-stats-bar-bg:       rgba(var(--bs-primary-rgb),0.08);
    --vb-stats-bar-border:   rgba(var(--bs-primary-rgb),0.15);
    --vb-stats-number-color: var(--vb-brand-accent);
    --vb-stats-label-color:  rgba(var(--bs-primary-rgb),0.55);

    /* --- Page background --- */
    --vb-page-bg-from:       #0f0f14;
    --vb-page-bg-to:         rgba(var(--bs-primary-rgb),0.05);

    /* --- Trust section --- */
    --vb-trust-section-bg:   linear-gradient(135deg, rgba(var(--bs-primary-rgb),0.06) 0%, rgba(var(--bs-primary-rgb),0.03) 100%);

    /* --- Hero search card --- */
    --vb-search-card-bg:     rgba(255,255,255,0.06);
    --vb-search-card-border: rgba(255,255,255,0.13);
    --vb-search-input-bg:    rgba(15,28,52,0.88);
    --vb-search-input-color: #ffffff;
    --vb-search-input-focus: rgba(20,36,65,0.95);
    --vb-search-focus-ring:  rgba(var(--bs-primary-rgb),0.35);
    --vb-city-btn-border:    rgba(255,255,255,0.28);
    --vb-city-btn-color:     rgba(255,255,255,0.82);
    --vb-city-btn-hover-bg:  rgba(255,255,255,0.35);

    /* --- Light Hero (dark mode вариант) --- */
    --vb-hero-light-bg-from: #0d1b2e;
    --vb-hero-light-bg-to:   #1a1030;
    --vb-hero-light-title:   #e8eaf6;
    --vb-hero-light-subtitle:#9090b8;
    --vb-hero-light-trust:   #666666;

    /* --- Tables --- */
    --vb-thead-bg:           rgba(var(--bs-primary-rgb),0.22);
    --vb-thead-color:        var(--vb-brand-accent);
    --vb-row-inactive-bg:    rgba(var(--bs-primary-rgb),0.05);
    --vb-row-inactive-color: #6b7685;

    /* --- Booking widget tokens (dark) --- */
    --vb-slot-border:        var(--vb-brand-primary);
    --vb-slot-color:         var(--vb-brand-accent);
    --vb-slot-hover-bg:      var(--vb-brand-primary-light);
    --vb-slot-active-bg:     var(--vb-brand-primary);
    --vb-slot-active-color:  #ffffff;
    --vb-slot-day-center-bg: rgba(106, 58, 168, 0.25);
    --vb-slot-earliest-bg:   var(--vb-brand-primary-light);
    --vb-slot-earliest-border: var(--vb-brand-primary-dark);
    --vb-slot-earliest-icon: var(--vb-brand-primary-light);
    --vb-slot-nav-color:     var(--vb-brand-primary);
}

/* --- TomSelect dark mode fix --- */
[data-bs-theme="dark"] .ts-wrapper .ts-control,
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown {
    background: var(--bs-body-bg, #212529);
    color: var(--bs-body-color, #dee2e6);
    border-color: var(--bs-border-color, #495057);
}
[data-bs-theme="dark"] .ts-wrapper .ts-control input {
    color: var(--bs-body-color, #dee2e6);
}
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown .option,
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown .optgroup-header {
    color: var(--bs-body-color, #dee2e6);
}
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown .option.active,
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown .option:hover {
    background: var(--bs-primary);
    color: #fff;
}
[data-bs-theme="dark"] .ts-wrapper .ts-control .item {
    color: var(--bs-body-color, #dee2e6);
}


/* ================================================================
   Компоненти
   ================================================================ */

/* ---- Light Hero Section ---- */
.hero-light-section {
    background: linear-gradient(135deg, var(--vb-hero-light-bg-from) 0%, var(--vb-hero-light-bg-to) 100%);
    overflow: visible;
}

.min-vh-hero {
    min-height: 480px;
}

@media (max-width: 991.98px) {
    .min-vh-hero { min-height: auto; }
}

.hero-light-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--vb-hero-light-title);
    letter-spacing: -0.02em;
}

.hero-light-subtitle {
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    color: var(--vb-hero-light-subtitle);
    line-height: 1.5;
}

@media (max-width: 575px) {
    .hero-light-subtitle {
        white-space: normal;
        font-size: 0.9rem;
    }
}

.hero-light-cta {
    border-radius: 0.6rem;
    padding: 0.75rem 1.75rem;
    font-size: 1.05rem;
    box-shadow: 0 4px 18px rgba(var(--bs-primary-rgb),0.3);
}

.hero-light-trust {
    font-size: 0.82rem;
    color: var(--vb-hero-light-trust);
    letter-spacing: 0.04em;
}

.hero-light-img-col {
    position: relative;
    z-index: 0;
}

.hero-light-pets-img {
    width: 100%;
    max-width: 540px;
    height: auto;
    display: block;
    /* Леко изрязване отдолу — животните "стоят" на базата */
    margin-bottom: -4px;
    filter: drop-shadow(0 8px 32px rgba(0,0,0,0.12));
}

@media (max-width: 991.98px) {
    .hero-light-pets-img {
        max-width: 320px;
        margin: 0 auto;
        filter: drop-shadow(0 4px 16px rgba(0,0,0,0.10));
    }
    .hero-light-text {
        text-align: center;
    }
    .hero-light-subtitle {
        margin: 0 auto 1.5rem;
    }
    .hero-light-cta {
        width: 100%;
    }
}

/* ---- Sticky navbar background ---- */
.navbar {
    background-color: var(--bs-body-bg) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--bs-border-color);
    z-index: 1050;
}

/* Navbar links — white in dark mode */
[data-bs-theme="dark"] .navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
}
[data-bs-theme="dark"] .navbar .nav-link:hover {
    color: #fff !important;
}

/* Navbar secondary buttons (BG/EN, theme toggle, profile dropdown) — white border + text */
[data-bs-theme="dark"] .navbar .btn-outline-secondary {
    --bs-btn-color:              rgba(255,255,255,0.85);
    --bs-btn-border-color:       rgba(255,255,255,0.35);
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           rgba(255,255,255,0.10);
    --bs-btn-hover-border-color: rgba(255,255,255,0.60);
    --bs-btn-active-color:       #fff;
    --bs-btn-active-bg:          rgba(255,255,255,0.15);
}

/* Navbar primary outline button (Вход) — stays brand but legible */
[data-bs-theme="dark"] .navbar .btn-outline-primary {
    --bs-btn-color:              var(--vb-brand-accent);
    --bs-btn-border-color:       var(--vb-brand-accent);
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           var(--vb-brand-primary-darker);
    --bs-btn-hover-border-color: var(--vb-brand-primary-darker);
}

/* Navbar "Начало" text and brand */
[data-bs-theme="dark"] .navbar-brand,
[data-bs-theme="dark"] .navbar .text-muted {
    color: rgba(255,255,255,0.75) !important;
}

/* ---- Hero Section ---- */
.hero-section {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--vb-hero-bg);
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: auto;
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
}

/* Overlay — по-тъмен вляво за четимост на текст */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(var(--vb-hero-overlay-r),var(--vb-hero-overlay-g),var(--vb-hero-overlay-b),0.97) 0%,
        rgba(var(--vb-hero-overlay-r),var(--vb-hero-overlay-g),var(--vb-hero-overlay-b),0.82) 40%,
        rgba(var(--vb-hero-overlay-r),var(--vb-hero-overlay-g),var(--vb-hero-overlay-b),0.35) 70%,
        rgba(var(--vb-hero-overlay-r),var(--vb-hero-overlay-g),var(--vb-hero-overlay-b),0.15) 100%
    );
    z-index: 1;
}

@media (max-width: 767.98px) {
    .hero-section::after {
        background: rgba(var(--vb-hero-overlay-r),var(--vb-hero-overlay-g),var(--vb-hero-overlay-b),0.80);
    }
}

.hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% center;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Search card — glassmorphism */
.hero-search-card {
    background: var(--vb-search-card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--vb-search-card-border);
    border-radius: 1rem;
    position: relative;
    z-index: 10;
}

.hero-search-card input.form-control {
    background: var(--vb-search-input-bg);
    color: var(--vb-search-input-color);
    border: 1px solid var(--vb-search-card-border);
}

.hero-search-card input.form-control:focus {
    background: var(--vb-search-input-focus) !important;
    color: var(--vb-search-input-color) !important;
    box-shadow: 0 0 0 2px var(--vb-search-focus-ring);
    border-color: var(--vb-brand-primary);
}

[data-bs-theme="dark"] .hero-search-card input.form-control {
    color-scheme: dark;
    -webkit-text-fill-color: #ffffff;
    caret-color: #ffffff;
}

[data-bs-theme="dark"] .hero-search-card input.form-control:focus {
    background-color: rgba(20,36,65,0.95) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.city-btn-grid-wrap {
    container-type: inline-size;
    container-name: city-grid-ctr;
}

/* 1 ред по подразбиране */
.city-btn-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4rem;
}

.hero-search-card .city-btn {
    border: 1px solid var(--vb-city-btn-border);
    color: var(--vb-city-btn-color);
    background: transparent;
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-btn-grid .dropdown {
    width: 100%;
}

/* Когато контейнерът е твърде тесен → скок директно на 3+3 */
@container city-grid-ctr (max-width: 460px) {
    .city-btn-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.hero-search-card .city-btn:hover {
    background: var(--vb-city-btn-hover-bg);
    border-color: var(--vb-brand-primary);
    color: #fff;
    transform: scale(1.05);
    transition: all 0.15s ease;
}

.hero-search-card .city-btn.active-city {
    background: var(--vb-brand-primary);
    border-color: var(--vb-brand-primary);
    color: #fff;
}

/* ---- Trust / "Защо VetNow" section ---- */
.vb-trust-section {
    background: var(--vb-trust-section-bg);
}

/* Feature icons — flat style for home page cards */
.vb-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: var(--bs-border-radius);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-size: 1.75rem;
    line-height: 1;
}

[data-bs-theme="dark"] .vb-feature-icon {
    background-color: rgba(var(--bs-primary-rgb), 0.18);
}

/* Stats bar */
.stats-bar {
    background: var(--vb-stats-bar-bg);
    border-top: 1px solid var(--vb-stats-bar-border);
    border-bottom: 1px solid var(--vb-stats-bar-border);
}

.stat-item .stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--vb-stats-number-color);
    line-height: 1;
}

.stat-item .stat-label {
    font-size: 0.72rem;
    color: var(--vb-stats-label-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 3px;
}

/* ---- Page background gradient ---- */
body {
    background: linear-gradient(135deg, var(--vb-page-bg-from) 0%, var(--vb-page-bg-to) 100%) fixed;
}

@media (max-width: 575.98px) {
    .stat-item .stat-number { font-size: 1.3rem; }
}

.search-box {
    max-width: 860px;
    margin: 0 auto;
}

/* ---- Emergency button pulse ---- */
.btn-emergency {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0   rgba(220,53,69,0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(220,53,69,0);   }
    100% { box-shadow: 0 0 0 0   rgba(220,53,69,0);   }
}

/* ---- Bootstrap btn-primary → brand ---- */
.btn-primary {
    --bs-btn-color:              #fff;
    --bs-btn-bg:                 var(--vb-brand-primary);
    --bs-btn-border-color:       var(--vb-brand-primary);
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           var(--vb-brand-primary-dark);
    --bs-btn-hover-border-color: var(--vb-brand-primary-dark);
    --bs-btn-active-color:       #fff;
    --bs-btn-active-bg:          var(--vb-brand-primary-darker);
    --bs-btn-active-border-color:var(--vb-brand-primary-darker);
    --bs-btn-disabled-color:     #fff;
    --bs-btn-disabled-bg:        var(--vb-brand-primary);
    --bs-btn-disabled-border-color: var(--vb-brand-primary);
}
.btn-outline-primary {
    --bs-btn-color:        var(--vb-brand-primary);
    --bs-btn-border-color: var(--vb-brand-primary);
    --bs-btn-hover-bg:           var(--vb-brand-primary);
    --bs-btn-hover-border-color: var(--vb-brand-primary);
    --bs-btn-active-bg:          var(--vb-brand-primary-dark);
    --bs-btn-active-border-color:var(--vb-brand-primary-dark);
}
.text-primary    { color: var(--vb-brand-primary) !important; }
.bg-primary      { background-color: var(--vb-brand-primary) !important; }
.border-primary  { border-color: var(--vb-brand-primary) !important; }
.badge.bg-primary { background-color: var(--vb-brand-primary) !important; }
.bg-primary.bg-opacity-10 { background-color: rgba(var(--bs-primary-rgb),.10) !important; }
.text-primary.border.border-primary.border-opacity-25 { border-color: rgba(var(--bs-primary-rgb),.25) !important; }
a:not(.btn) { color: var(--vb-brand-primary); }
a:not(.btn):hover { color: var(--vb-brand-primary-dark); }

/* Focus rings */
.form-control:focus,
.form-select:focus {
    border-color: var(--vb-brand-accent);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb),.25);
}

/* Sidebar active */
.sidebar .nav-link.active {
    background-color: var(--vb-brand-primary) !important;
}

/* Dark mode btn-primary */
[data-bs-theme="dark"] .btn-primary {
    --bs-btn-color:              #fff;
    --bs-btn-bg:                 var(--vb-brand-primary-darker);
    --bs-btn-border-color:       var(--vb-brand-primary-darker);
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           var(--vb-brand-primary-dark);
    --bs-btn-hover-border-color: var(--vb-brand-primary-dark);
    --bs-btn-active-color:       #fff;
    --bs-btn-active-bg:          var(--vb-brand-primary);
    --bs-btn-active-border-color:var(--vb-brand-primary);
    --bs-btn-disabled-color:     #fff;
    --bs-btn-disabled-bg:        var(--vb-brand-primary-darker);
}
[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color:              var(--vb-brand-accent);
    --bs-btn-border-color:       var(--vb-brand-accent);
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           var(--vb-brand-primary-darker);
    --bs-btn-hover-border-color: var(--vb-brand-primary-darker);
}
[data-bs-theme="dark"] .text-primary   { color: var(--vb-brand-primary) !important; }
[data-bs-theme="dark"] .bg-primary     { background-color: var(--vb-brand-primary) !important; }
[data-bs-theme="dark"] a:not(.btn) { color: var(--vb-brand-primary); }
[data-bs-theme="dark"] a:not(.btn):hover { color: var(--vb-brand-accent); }

/* ---- Clinic / Doctor cards ---- */
.card-clinic:hover,
.card-doctor:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* ---- Sidebar dashboards ---- */
.sidebar {
    min-height: calc(100vh - 56px);
    border-right: 1px solid var(--bs-border-color);
}

.sidebar .nav-link {
    border-radius: 0.375rem;
    margin-bottom: 2px;
}

.sidebar .nav-link.active {
    background-color: var(--vb-brand-primary);
    color: #fff !important;
}

/* ---- Responsive sidebar (offcanvas-lg) ---- */
@media (min-width: 992px) {
    .vb-sidebar {
        /* Desktop: inline, fixed width */
        width: 240px;
        min-width: 240px;
        flex-shrink: 0;
    }
}

@media (max-width: 991.98px) {
    /* Mobile: flex column so toggle + main stack vertically without gaps */
    .d-flex.vb-dashboard-wrap {
        flex-direction: column;
    }
    /* Offcanvas sidebar: Bootstrap handles visibility via position:fixed */
    .vb-sidebar .sidebar {
        min-height: auto;
        border-right: none;
    }
    /* Main content takes full width when sidebar hidden */
    .d-flex > main {
        min-width: 0;
        width: 100%;
    }
    /* Toggle bar: compact, full width */
    .vb-sidebar-toggle {
        width: 100%;
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
        border-top: none;
        padding: 0.35rem 1rem;
        text-align: left;
        background: var(--bs-body-bg);
        border-bottom: 1px solid var(--bs-border-color);
        font-weight: 600;
        font-size: 0.8rem;
        margin: 0 !important;
        line-height: 1.2;
    }
    .vb-sidebar-toggle i {
        font-size: 1rem;
    }
}

@media (min-width: 992px) {
    /* Desktop: hide the toggle, show sidebar inline */
    .vb-sidebar-toggle { display: none !important; }
}

/* Dashboard main padding — smaller on mobile */
@media (max-width: 575.98px) {
    .d-flex > main.flex-grow-1 {
        padding: 0.75rem !important;
    }
}
@media (min-width: 576px) and (max-width: 991.98px) {
    .d-flex > main.flex-grow-1 {
        padding: 1rem !important;
    }
}

/* TomSelect clinic dropdown: full width on mobile, auto on desktop */
@media (max-width: 991.98px) {
    .w-100.w-lg-auto { width: 100% !important; }
    .w-100.w-lg-auto select,
    .w-100.w-lg-auto .ts-wrapper { min-width: 100% !important; width: 100% !important; }
}
@media (min-width: 992px) {
    .w-lg-auto { width: auto !important; }
}

/* ---- Table header ---- */
.vb-thead th {
    background-color: var(--vb-thead-bg) !important;
    color: var(--vb-thead-color) !important;
    border-bottom-color: var(--bs-border-color) !important;
}

/* ---- Inactive / closed row ---- */
tr.vb-row-inactive {
    background-color: var(--vb-row-inactive-bg) !important;
    color: var(--vb-row-inactive-color) !important;
}
tr.vb-row-inactive td {
    color: var(--vb-row-inactive-color) !important;
}
tr.vb-row-inactive input,
tr.vb-row-inactive select {
    opacity: 0.45;
}


/* ---- Custom badge colors ---- */
.bg-purple {
    background-color: #7c3aed !important;
    color: #fff !important;
}
.bg-pink {
    background-color: #db2777 !important;
    color: #fff !important;
}

/* ---- Booking widget — 3-day slot picker ---- */

/* Navigation arrows */
.vb-nav-arrow {
    color: var(--vb-slot-nav-color);
    font-weight: 600;
    line-height: 1;
    transition: opacity .15s;
    user-select: none;
}
.vb-nav-arrow:hover { opacity: .7; }
.vb-nav-arrow.disabled { color: #adb5bd; pointer-events: none; }

/* Center day highlight */
.vb-day-center {
    background-color: var(--vb-slot-day-center-bg);
}

/* Hatched background for days with no slots */
.vb-day-hatched {
    background: repeating-linear-gradient(
        135deg,
        var(--bs-tertiary-bg, #f8f9fa) 0px, var(--bs-tertiary-bg, #f8f9fa) 8px,
        var(--bs-secondary-bg, #e9ecef) 8px, var(--bs-secondary-bg, #e9ecef) 16px
    );
}

/* Individual slot button */
.vb-slot-btn {
    font-size: .78rem;
    padding: 5px 2px;
    border: 1.5px solid var(--vb-slot-border);
    border-radius: 8px;
    color: var(--vb-slot-color);
    background: var(--bs-body-bg);
    transition: background .12s, color .12s, border-color .12s;
}
.vb-slot-btn:hover {
    background: var(--vb-slot-hover-bg);
    border-color: var(--vb-brand-primary-dark);
    color: var(--vb-brand-primary-dark);
}
.vb-slot-btn--active {
    background: var(--vb-slot-active-bg) !important;
    border-color: var(--vb-slot-active-bg) !important;
    color: var(--vb-slot-active-color) !important;
}

/* Earliest slot card */
.vb-earliest-card {
    background: var(--vb-slot-earliest-bg);
    border: 1px solid var(--vb-slot-earliest-border);
}
.vb-earliest-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--vb-slot-earliest-icon);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Soft primary/info/success badge/icon-circle — readable in both themes */
.vb-badge-primary {
    background-color: rgba(var(--bs-primary-rgb),0.12) !important;
    color: var(--vb-brand-primary-dark) !important;
    border-color: rgba(var(--bs-primary-rgb),0.25) !important;
}
[data-bs-theme="dark"] .vb-badge-primary {
    background-color: rgba(var(--bs-primary-rgb),0.18) !important;
    color: var(--vb-brand-accent) !important;
    border-color: rgba(var(--bs-primary-rgb),0.30) !important;
}

/* Fix Bootstrap bg-opacity-10 icon circles in dark mode */
[data-bs-theme="dark"] .bg-info.bg-opacity-10    { background-color: rgba(13,202,240,0.18) !important; }
[data-bs-theme="dark"] .bg-success.bg-opacity-10 { background-color: rgba(25,135,84,0.22)  !important; }
[data-bs-theme="dark"] .bg-warning.bg-opacity-10 { background-color: rgba(255,193,7,0.18)  !important; }
[data-bs-theme="dark"] .text-info    { color: #6edff6 !important; }
[data-bs-theme="dark"] .text-success { color: #75b798 !important; }

/* Booked slot — hatched background, grayed text, not interactive */
.vb-slot-booked {
    font-size: .78rem;
    padding: 5px 2px;
    border: 1.5px solid rgba(var(--bs-primary-rgb),0.25);
    border-radius: 8px;
    color: rgba(var(--bs-primary-rgb),0.4);
    background: repeating-linear-gradient(
        135deg,
        var(--vb-brand-primary-light) 0px, var(--vb-brand-primary-light) 5px,
        var(--vb-slot-earliest-icon) 5px, var(--vb-slot-earliest-icon) 10px
    );
    text-align: center;
    user-select: none;
    pointer-events: none;
    cursor: default;
}

.vb-slot-empty {
    font-size: .78rem;
    padding: 5px 2px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
}

[data-bs-theme="dark"] .vb-slot-booked {
    border-color: rgba(var(--bs-primary-rgb),0.25);
    color: rgba(var(--bs-primary-rgb),0.35);
    background: repeating-linear-gradient(
        135deg,
        var(--vb-row-inactive-bg) 0px, var(--vb-row-inactive-bg) 5px,
        var(--vb-brand-primary-light) 5px, var(--vb-brand-primary-light) 10px
    );
}


/* Dashboard slot management buttons */
.vb-slot-blocked {
    opacity: 0.55;
    background: repeating-linear-gradient(
        135deg,
        rgba(var(--bs-primary-rgb),0.06) 0px, rgba(var(--bs-primary-rgb),0.06) 4px,
        transparent 4px, transparent 8px
    ) !important;
    text-decoration: none;
}
.vb-slot-blocked:hover {
    opacity: 0.8;
}
[data-bs-theme="dark"] .vb-slot-blocked {
    background: repeating-linear-gradient(
        135deg,
        rgba(var(--bs-primary-rgb),0.1) 0px, rgba(var(--bs-primary-rgb),0.1) 4px,
        transparent 4px, transparent 8px
    ) !important;
}
.vb-slot-taken {
    background: repeating-linear-gradient(
        135deg,
        var(--vb-brand-primary-light) 0px, var(--vb-brand-primary-light) 5px,
        var(--vb-slot-earliest-icon) 5px, var(--vb-slot-earliest-icon) 10px
    ) !important;
    border-color: rgba(var(--bs-primary-rgb),0.25) !important;
    color: rgba(var(--bs-primary-rgb),0.5) !important;
}
[data-bs-theme="dark"] .vb-slot-taken {
    background: repeating-linear-gradient(
        135deg,
        var(--vb-row-inactive-bg) 0px, var(--vb-row-inactive-bg) 5px,
        var(--vb-brand-primary-light) 5px, var(--vb-brand-primary-light) 10px
    ) !important;
    border-color: rgba(var(--bs-primary-rgb),0.25) !important;
    color: rgba(var(--bs-primary-rgb),0.4) !important;
}

.vetnow-map-lock-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    backdrop-filter: blur(2px);
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
    cursor: default;
}
[data-bs-theme="dark"] .vetnow-map-lock-overlay {
    background: rgba(30,30,30,0.6);
}

/* ---- Nav pills/tabs → brand color ---- */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--vb-brand-primary);
    color: #fff;
}
.nav-pills .nav-link {
    color: var(--vb-brand-primary);
}
.nav-pills .nav-link:hover:not(.active) {
    color: var(--vb-brand-primary-dark);
    background-color: var(--vb-brand-primary-light);
}
.nav-tabs .nav-link.active {
    color: var(--vb-brand-primary);
    border-bottom-color: var(--vb-brand-primary);
}

/* ---- Dropdown items → brand hover ---- */
.dropdown-menu {
    --bs-dropdown-link-hover-bg: rgba(var(--bs-primary-rgb),0.08);
    --bs-dropdown-link-hover-color: var(--vb-brand-primary-dark);
    --bs-dropdown-link-active-bg: var(--vb-brand-primary);
    --bs-dropdown-link-active-color: #fff;
}
[data-bs-theme="dark"] .dropdown-menu {
    --bs-dropdown-link-hover-bg: rgba(var(--bs-primary-rgb),0.15);
    --bs-dropdown-link-hover-color: var(--vb-brand-accent);
}

[data-bs-theme="dark"] .btn-outline-dark {
    --bs-btn-color: #dee2e6;
    --bs-btn-border-color: #dee2e6;
    --bs-btn-hover-color: #212529;
    --bs-btn-hover-bg: #dee2e6;
    --bs-btn-hover-border-color: #dee2e6;
}

.grecaptcha-badge { visibility: hidden; }

/* ── Task Activity Timeline ─────────────────────────────────────────────── */
.task-timeline {
    padding: 0.5rem 1rem 0.25rem;
}
.task-timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}
.task-timeline-item:last-child {
    border-bottom: none;
}
.task-timeline-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-top: 2px;
}
.tl-created    { background: #d1e7dd; color: #0a3622; }
.tl-status     { background: #cfe2ff; color: #084298; }
.tl-edited     { background: #fff3cd; color: #664d03; }
.tl-comment    { background: #e2e3e5; color: #383d41; }
.tl-attachment { background: #f8d7da; color: #58151c; }
.task-timeline-body {
    flex: 1;
    min-width: 0;
}

/* PIN input — masks text like password field without triggering password managers */
.vb-pin-input {
    -webkit-text-security: disc;
    text-security: disc;
}

/* Workstation / Daily grid */
.vb-workstation-grid {
    table-layout: fixed;
    width: 100%;
}
.vb-workstation-grid th,
.vb-workstation-grid td {
    vertical-align: middle;
    min-width: 100px;
    max-width: 180px;
    overflow: hidden;
}
.vb-workstation-grid th:first-child,
.vb-workstation-grid td:first-child {
    min-width: 58px;
    max-width: 58px;
    width: 58px;
}
/* Slot cell inner wrapper */
.vb-slot {
    font-size: 0.75rem;
    line-height: 1.3;
    word-break: break-word;
    position: relative;
}
.vb-slot .vb-slot-name {
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 0;
}
.vb-slot .vb-slot-pet {
    font-size: 0.68rem;
    color: var(--bs-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vb-slot .vb-slot-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.vb-slot .vb-slot-actions a {
    padding: 0;
    line-height: 1;
    font-size: 0.7rem;
}
.vb-slot .vb-cg-complete-btn {
    position: absolute;
    bottom: 2px;
    right: 3px;
    padding: 0;
    line-height: 1;
    font-size: 0.8rem;
    opacity: 0.7;
}
.vb-slot .vb-cg-complete-btn:hover {
    opacity: 1;
}
@media (max-width: 575.98px) {
    .vb-workstation-grid th,
    .vb-workstation-grid td {
        min-width: 80px;
    }
    .vb-slot .vb-slot-name {
        font-size: 0.7rem;
    }
}
.vb-slot-available {
    background: rgba(var(--bs-success-rgb), 0.05);
    border: 1px dashed rgba(var(--bs-success-rgb), 0.4);
    transition: background 0.15s;
}
.vb-slot-available:hover {
    background: rgba(var(--bs-success-rgb), 0.15);
    border-style: solid;
}
.cursor-pointer { cursor: pointer; }
.smaller { font-size: 0.7rem; }
.vb-slot-blocked { background-color: rgba(108, 117, 125, 0.25) !important; border: 1px solid rgba(108, 117, 125, 0.5); }
.border-purple { border-color: #7c3aed !important; }
.bg-purple-subtle { background-color: rgba(124, 58, 237, 0.1) !important; }
.bg-purple { background-color: #7c3aed !important; }
.bg-orange-subtle { background-color: rgba(253, 126, 20, 0.15) !important; }
.text-purple { color: #7c3aed !important; }

/* Patient profile links in calendar grid */
.vb-patient-link:hover { text-decoration: underline !important; opacity: 0.85; }


/* Search bar layout (public/search-results) */
.vb-search-bar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.vb-search-bar .form-control,
.vb-search-bar .btn,
.vb-search-bar .ts-wrapper .ts-control { border-radius: 0.375rem; }
.vb-search-bar .form-control { flex: 1 1 250px; min-width: 0; }
#citySelect + .ts-wrapper { width: 180px; flex-shrink: 0; }
#citySelect + .ts-wrapper .ts-control { height: 100%; font-size: 1rem; }
#citySelect + .ts-wrapper .ts-dropdown { max-height: 200px; }
#nearbyBtn { white-space: nowrap; }
@media (max-width: 575.98px) {
    .vb-search-bar { justify-content: center; }
    .vb-search-bar .form-control { flex: 1 1 100%; }
    #citySelect + .ts-wrapper { width: 100%; max-width: 100%; }
    .vb-search-bar .btn { flex: 1 1 auto; }
}
