/* ============================================================
   Dog Tired Pet Care — Brand & App Styles
   Primary: #6B21A8 (logo purple)
   ============================================================ */
:root {
    --dt-primary:       #6B21A8;
    --dt-primary-dark:  #4C1D95;
    --dt-primary-hover: #7C3AED;
    --dt-primary-light: #EDE9FE;
    --dt-sidebar-bg:    #2D1B69;
    --dt-sidebar-text:  rgba(255,255,255,0.85);
    --dt-sidebar-muted: rgba(255,255,255,0.45);
    --dt-sidebar-hover: rgba(255,255,255,0.10);
    --dt-sidebar-active:rgba(255,255,255,0.18);
    --dt-header-bg:     #6B21A8;
    --dt-text:          #1F2937;
    --dt-muted:         #6B7280;
    --dt-border:        #E5E7EB;
    --dt-bg:            #F9FAFB;
}

/* ============================================================
   Base
   ============================================================ */
html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    background: var(--dt-bg);
    color: var(--dt-text);
}

/* ============================================================
   App shell — sidebar + main
   ============================================================ */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--dt-sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease, transform 0.2s ease;
    z-index: 200;
}

.sidebar-brand {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 64px;
}

.sidebar-brand-id {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.sidebar-logo {
    width: 120px;
    height: auto;
    /* Logo is purple on white — invert to white on dark sidebar */
    filter: brightness(0) invert(1);
}

/* Per-tenant org name shown under the logo (only when customized away from the default) */
.sidebar-brand-name {
    color: var(--dt-sidebar-text);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapsed .sidebar-brand-name {
    display: none;
}

/* Per-tenant uploaded logo in the sidebar (not inverted — keep its real colors) */
.sidebar-logo-custom {
    max-width: 180px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-collapsed .sidebar-logo-custom {
    display: none;
}

/* Text wordmark fallback for a customized org with no uploaded logo */
.sidebar-wordmark {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapsed .sidebar-wordmark {
    display: none;
}

/* ── Logo uploader (Configuration → Branding) ───────────────────────── */
.dt-logo-uploader {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dt-logo-preview {
    /* Preview on the real sidebar color so light/white logos are visible as they'll appear */
    background: var(--dt-sidebar-bg, #2D1B69);
    border: 1px solid var(--dt-border);
    border-radius: 8px;
    min-height: 92px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dt-logo-preview img {
    max-width: 240px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.dt-logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

.dt-logo-placeholder i {
    font-size: 1.5rem;
}

.dt-logo-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ── Messaging (/messages) ──────────────────────────────────────────── */
.msg-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1rem;
    height: calc(100vh - 230px);
    min-height: 420px;
}

.msg-list {
    border: 1px solid var(--dt-border);
    border-radius: 10px;
    padding: 0.6rem;
    overflow-y: auto;
    background: #fff;
}

.msg-list-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
}

.msg-list-item:hover { background: var(--dt-bg); }
.msg-list-item.active { background: var(--dt-primary-light); }

.msg-list-meta { display: flex; flex-direction: column; min-width: 0; }
.msg-list-name { font-weight: 600; font-size: 0.9rem; }
.msg-list-preview {
    font-size: 0.8rem; color: var(--dt-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px;
}

/* Unread conversation: bolder name + darker preview, with a dot on the right. */
.msg-list-item.unread .msg-list-name { font-weight: 700; color: var(--dt-text); }
.msg-list-item.unread .msg-list-preview { color: var(--dt-text); font-weight: 600; }
.msg-unread-dot {
    margin-left: auto;
    flex: none;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--dt-primary);
}

.msg-main {
    border: 1px solid var(--dt-border);
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.msg-empty {
    margin: auto;
    text-align: center;
    color: var(--dt-muted);
}
.msg-empty i { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; opacity: 0.5; }

.msg-thread-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--dt-border);
    display: flex;
    align-items: center;
}

.msg-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.msg-bubble-row { display: flex; }
.msg-bubble-row.mine { justify-content: flex-end; }

.msg-bubble {
    max-width: 70%;
    background: var(--dt-bg);
    border: 1px solid var(--dt-border);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
}
.msg-bubble-row.mine .msg-bubble {
    background: var(--dt-primary-light);
    border-color: var(--dt-primary-light);
}

.msg-sender { font-size: 0.75rem; font-weight: 600; color: var(--dt-primary); margin-bottom: 0.15rem; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: 0.7rem; color: var(--dt-muted); margin-top: 0.2rem; text-align: right; }

.msg-attachments { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.msg-attachment {
    max-width: 180px; max-height: 180px; border-radius: 8px; object-fit: cover;
}

.msg-composer {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem;
    border-top: 1px solid var(--dt-border);
    align-items: flex-end;
}
.msg-composer textarea { resize: none; }

.msg-new { padding: 1rem; overflow-y: auto; }
.msg-picker-list {
    border: 1px solid var(--dt-border);
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
}
.msg-picker-item {
    display: flex; align-items: center; gap: 0.6rem;
    width: 100%; text-align: left; border: none; background: transparent;
    padding: 0.5rem 0.6rem; cursor: pointer; border-bottom: 1px solid var(--dt-border);
}
.msg-picker-item:last-child { border-bottom: none; }
.msg-picker-item:hover { background: var(--dt-bg); }

.msg-attach-picker { border-top: 1px solid var(--dt-border); padding: 0.6rem; background: var(--dt-bg); }
.msg-attach-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; max-height: 180px; overflow-y: auto; }
.msg-attach-thumb {
    position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
    border: 2px solid transparent; padding: 0; cursor: pointer; background: #000;
}
.msg-attach-thumb.sel { border-color: var(--dt-primary); }
.msg-attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.msg-attach-video { color: #fff; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.msg-attach-check {
    position: absolute; top: 2px; right: 2px; background: var(--dt-primary); color: #fff;
    border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem;
}

/* Clickable message attachment thumbnails */
.msg-attachment-btn {
    position: relative; display: inline-block; padding: 0; border: none; background: none;
    cursor: pointer; line-height: 0; border-radius: 10px; overflow: hidden;
}
.msg-attachment-btn .msg-attachment { transition: transform 0.12s; }
.msg-attachment-btn:hover .msg-attachment { transform: scale(1.02); }
.msg-attachment-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2rem; text-shadow: 0 1px 6px rgba(0,0,0,0.6); pointer-events: none;
}

/* Full-size media lightbox */
.msg-lightbox {
    position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,0.82);
    display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.msg-lightbox-inner {
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem; max-width: 100%; max-height: 100%;
}
.msg-lightbox-media {
    max-width: 90vw; max-height: 80vh; border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); background: #000;
}
.msg-lightbox-actions { display: flex; gap: 0.5rem; }

/* Pending device-upload previews (above the composer) */
.msg-pending-uploads { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.4rem 0.2rem 0; }
.msg-pending-thumb {
    position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
    background: #000; border: 1px solid var(--bs-border-color, #dee2e6);
}
.msg-pending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.msg-pending-remove {
    position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0;
    border: none; border-radius: 50%; background: rgba(0,0,0,0.65); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 0.75rem; cursor: pointer;
}
.msg-pending-remove:hover { background: #dc3545; }

@media (max-width: 768px) {
    .msg-shell { grid-template-columns: 1fr; height: auto; }
    .msg-list { max-height: 240px; }
    .msg-main { min-height: 420px; }
}

/* Unread count badge on a sidebar nav item (iPhone-style red pill) */
.sidebar-nav .nav-link .nav-badge {
    margin-left: auto;
    background: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* When the sidebar is collapsed to a rail, float the badge over the icon. */
.sidebar-collapsed .sidebar-nav .nav-link .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    margin-left: 0;
}

/* Collapse / expand toggle (desktop) */
.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.22);
}

.sidebar-toggle i {
    transition: transform 0.2s ease;
    font-size: 1.05rem;
    line-height: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

/* Section headers */
.nav-section-label {
    padding: 1rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dt-sidebar-muted);
}

/* Nav links */
.sidebar-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.45rem 1rem;
    margin: 1px 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--dt-sidebar-text);
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar-nav .nav-link:hover {
    background: var(--dt-sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--dt-sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 1.1rem;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}

/* ── Main area ── */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Sidebar footer: account + sign out, pinned to bottom ── */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.sidebar-account {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--dt-sidebar-text);
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar-account:hover {
    background: var(--dt-sidebar-hover);
}

.account-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dt-primary-hover);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.account-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.account-name {
    font-size: 0.8rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-link-label {
    font-size: 0.7rem;
    color: var(--dt-sidebar-muted);
}

.sidebar-signout {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--dt-sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.sidebar-signout:hover {
    background: var(--dt-sidebar-hover);
    color: #fff;
}

.sidebar-signout i {
    width: 34px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Floating menu button (mobile only) ── */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 160;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: var(--dt-primary);
    color: #fff;
    font-size: 1.4rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ── Collapsed rail (desktop) ── */
.app-shell.sidebar-collapsed .app-sidebar {
    width: 76px;
}

.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0.85rem 0;
}

.sidebar-collapsed .sidebar-logo {
    display: none;
}

.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .account-meta {
    display: none;
}

.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    gap: 0;
    padding: 0.5rem 0;
    margin: 1px 0.5rem;
}

.sidebar-collapsed .sidebar-account,
.sidebar-collapsed .sidebar-signout {
    justify-content: center;
    padding: 0.5rem 0;
}

.sidebar-collapsed .sidebar-signout i {
    width: auto;
}

/* ── Content ── */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ── Mobile sidebar overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 150;
}

@media (max-width: 767px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.35);
    }

    .app-shell.sidebar-open .sidebar-overlay {
        display: block;
    }

    /* On mobile the sidebar is a full off-canvas drawer — never the icon rail. */
    .app-shell.sidebar-collapsed .app-sidebar {
        width: 240px;
    }

    .sidebar-collapsed .nav-label {
        display: inline;
    }

    .sidebar-collapsed .nav-section-label {
        display: block;
    }

    .sidebar-collapsed .account-meta {
        display: flex;
    }

    .sidebar-collapsed .sidebar-nav .nav-link,
    .sidebar-collapsed .sidebar-account,
    .sidebar-collapsed .sidebar-signout {
        justify-content: flex-start;
        gap: 0.625rem;
    }

    .sidebar-collapsed .sidebar-logo {
        display: block;
    }

    /* Hide the desktop collapse chevron; show the floating open button. */
    .sidebar-toggle {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .app-content {
        padding-top: 4rem;
    }

    .btn-mobile-full {
        width: 100%;
        padding: 14px;
        font-size: 1.1rem;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .app-sidebar {
        width: 200px;
    }
}

/* ============================================================
   Page content helpers
   ============================================================ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dt-primary);
    margin: 0;
}

.page-header .page-subtitle {
    font-size: 0.875rem;
    color: var(--dt-muted);
    margin-top: 0.25rem;
}

/* ============================================================
   Status chips
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-scheduled  { background: #EDE9FE; color: #6B21A8; }
.status-inprogress { background: #FFF7ED; color: #C2410C; }
.status-completed  { background: #F0FDF4; color: #15803D; }
.status-cancelled  { background: #F3F4F6; color: #4B5563; }
.status-missed     { background: #FEF2F2; color: #B91C1C; }

/* ============================================================
   Bootstrap override — primary color → brand purple
   ============================================================ */
.btn-primary {
    --bs-btn-bg:            #6B21A8;
    --bs-btn-border-color:  #6B21A8;
    --bs-btn-hover-bg:      #7C3AED;
    --bs-btn-hover-border:  #7C3AED;
    --bs-btn-active-bg:     #4C1D95;
    --bs-btn-active-border: #4C1D95;
}

.btn-outline-primary {
    --bs-btn-color:         #6B21A8;
    --bs-btn-border-color:  #6B21A8;
    --bs-btn-hover-bg:      #6B21A8;
    --bs-btn-hover-border:  #6B21A8;
}

/* ============================================================
   Cards
   ============================================================ */
.dt-card {
    background: #fff;
    border: 1px solid var(--dt-border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.dt-stat-card {
    background: #fff;
    border: 1px solid var(--dt-border);
    border-radius: 8px;
    padding: 1.25rem;
    border-left: 4px solid var(--dt-primary);
}

.dt-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dt-primary);
    line-height: 1;
}

.dt-stat-label {
    font-size: 0.8rem;
    color: var(--dt-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.dt-stat-sub {
    font-size: 0.8rem;
    color: var(--dt-muted);
    margin-top: 0.5rem;
}

/* ============================================================
   Placeholder / coming soon pages
   ============================================================ */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    color: var(--dt-muted);
}

.placeholder-page i {
    font-size: 3rem;
    color: var(--dt-primary-light);
    margin-bottom: 1rem;
}

.placeholder-page h2 {
    color: var(--dt-primary);
    margin-bottom: 0.5rem;
}

/* ============================================================
   Identity / auth pages
   ============================================================ */
.content { padding-top: 1.1rem; }
h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #15803D; }
.invalid { outline: 1px solid #B91C1C; }
.validation-message { color: #B91C1C; }

.blazor-error-boundary {
    background: #B32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Calendar appointment colors ────────────────────────────────────────── */
.e-schedule .e-appointment.appt-dogwalk   { background: #6B21A8; border-color: #4C1D95; }
.e-schedule .e-appointment.appt-dropin    { background: #059669; border-color: #047857; }
.e-schedule .e-appointment.appt-overnight { background: #1D4ED8; border-color: #1e40af; }
.e-schedule .e-appointment.appt-meetgreet { background: #D97706; border-color: #b45309; }
.e-schedule .e-appointment.appt-other     { background: #6B7280; border-color: #4b5563; }
.e-schedule .e-appointment .e-appointment-details { color: #fff; }


/* ── Blazor reconnect modal ──────────────────────────────────────────────
   blazor.web.js toggles one class at a time on #components-reconnect-modal:
     .components-reconnect-show     — trying to reconnect
     .components-reconnect-failed   — gave up
     .components-reconnect-rejected — session ended by server
   ─────────────────────────────────────────────────────────────────────── */

#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
}

/* Semi-transparent backdrop */
.reconnect-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
}

/* Centered card */
.reconnect-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem 2.5rem;
    width: min(380px, 90vw);
    text-align: center;
}

/* All state sections hidden by default */
.reconnect-state {
    display: none;
}

/* Show only the active state's section */
#components-reconnect-modal.components-reconnect-show     .reconnect-state-show     { display: block; }
#components-reconnect-modal.components-reconnect-failed   .reconnect-state-failed   { display: block; }
#components-reconnect-modal.components-reconnect-rejected .reconnect-state-rejected { display: block; }

/* ── Animal toggle cards (booking form) ─────────────────────────────────
   Replaces checkbox inputs with fully-clickable cards.
   ─────────────────────────────────────────────────────────────────────── */
/* ── Active Visit — orange button for "Vet Contact Recommended" health flag ──
   Bootstrap 5 has no built-in orange; this fills the gap between warning and danger.
   ─────────────────────────────────────────────────────────────────────────── */
.btn-vet {
    --bs-btn-color:         #fff;
    --bs-btn-bg:            #EA580C;
    --bs-btn-border-color:  #C2410C;
    --bs-btn-hover-bg:      #C2410C;
    --bs-btn-hover-border:  #9A3412;
    --bs-btn-active-bg:     #9A3412;
    --bs-btn-active-border: #7C2D12;
}
.btn-outline-vet {
    --bs-btn-color:         #EA580C;
    --bs-btn-border-color:  #EA580C;
    --bs-btn-hover-color:   #fff;
    --bs-btn-hover-bg:      #EA580C;
    --bs-btn-hover-border:  #C2410C;
}

/* ── Active Visit status card borders ─────────────────────────────────────── */
.visit-event-card-inprogress { border-left: 4px solid #C2410C; }
.visit-event-card-scheduled  { border-left: 4px solid #6B21A8; }
.visit-event-card-completed  { border-left: 4px solid #15803D; }

.animal-toggle-card {
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    user-select: none;
}

.animal-toggle-card:hover {
    border-color: #adb5bd;
    background-color: #f8f9fa;
}

.animal-toggle-card.selected {
    border-color: var(--dt-primary, #6B21A8);
    background-color: #f3e8ff;
}

.animal-toggle-icon {
    font-size: 1.25rem;
    color: #adb5bd;
    flex-shrink: 0;
}

/* ── Blazor error UI (global — scoped CSS cannot target this element reliably) ── */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.animal-toggle-card.selected .animal-toggle-icon {
    color: var(--dt-primary, #6B21A8);
}

/* ── Pack Walk Builder — drag-and-drop panels ─────────────────────────────── */
.pw-dropzone {
    min-height: 220px;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 0.5rem;
    transition: border-color 0.15s, background-color 0.15s;
}

.pw-dropzone-active {
    border-color: var(--dt-primary, #6B21A8);
    background-color: #f3e8ff;
}

.pw-dropzone-walk {
    border-color: #c3b1e1;
    background-color: #faf5ff;
}

.pw-dog-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.12s, border-color 0.12s;
}

.pw-dog-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
    border-color: #adb5bd;
}

.pw-dog-card:active {
    cursor: grabbing;
}

.pw-dog-card-on-walk {
    border-left: 3px solid var(--dt-primary, #6B21A8);
}

.pw-dog-conflict {
    border-left: 3px solid #f59e0b;
    background-color: #fffbeb;
}

.pw-dog-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pw-dog-info {
    flex: 1;
    min-width: 0;
}

.pw-dog-info .fw-semibold {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Profile photos / avatars ─────────────────────────────────────────────── */
.dt-avatar {
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dt-primary-hover, #5a4b8a);
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 1;
    text-transform: uppercase;
}

.dt-avatar-fallback {
    /* initials sit centered on the soft brand background */
}

.dt-avatar-sm { width: 32px;  height: 32px;  font-size: 0.8rem; }
.dt-avatar-md { width: 48px;  height: 48px;  font-size: 1rem; }
.dt-avatar-lg { width: 72px;  height: 72px;  font-size: 1.4rem; }
.dt-avatar-xl { width: 112px; height: 112px; font-size: 2.2rem; }

/* ── Single-photo uploader ────────────────────────────────────────────────── */
.dt-uploader {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.dt-uploader-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Multi-photo gallery ──────────────────────────────────────────────────── */
.dt-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.dt-gallery-item {
    margin: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.dt-gallery-item img,
.dt-gallery-item video {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #000;
}

.dt-gallery-item figcaption {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
