/* MarcouBem brand: palette, type and Bootstrap overrides */
:root {
    --mb-blue: #1673E6;
    --mb-blue-strong: #1264CC;
    --mb-blue-hover: #0F57B3;
    --mb-navy: #183451;
    --mb-sky: #B9DEFF;
    --mb-ice: #F3F8FF;
    --mb-soft: #E6F1FF;
    --mb-line: #E3ECF7;
    --mb-muted: #5B6B7F;
    --mb-surface: #FFFFFF;
    --mb-subtle: #F6F9FD;
    --mb-stripe: #EEF2F7;
    --mb-heading: #183451;
    --mb-nav-text: #3D5269;
    --bs-primary: #1673E6;
    --bs-primary-rgb: 22, 115, 230;
    --bs-link-color: #1264CC;
    --bs-link-color-rgb: 18, 100, 204;
    --bs-link-hover-color: #0F57B3;
    --bs-body-color: #183451;
    --bs-body-color-rgb: 24, 52, 81;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-border-radius: .6rem;
    --bs-border-radius-sm: .45rem;
    --bs-border-radius-lg: .9rem;
}

html, body {
    font-family: var(--bs-body-font-family);
    background: var(--mb-ice);
    color: var(--bs-body-color);
}

.btn { font-weight: 600; }

.btn-primary {
    --bs-btn-bg: var(--mb-blue-strong);
    --bs-btn-border-color: var(--mb-blue-strong);
    --bs-btn-hover-bg: var(--mb-blue-hover);
    --bs-btn-hover-border-color: var(--mb-blue-hover);
    --bs-btn-active-bg: var(--mb-blue-hover);
    --bs-btn-active-border-color: var(--mb-blue-hover);
    --bs-btn-disabled-bg: var(--mb-blue-strong);
    --bs-btn-disabled-border-color: var(--mb-blue-strong);
    --bs-btn-focus-shadow-rgb: 22, 115, 230;
}

.btn-outline-primary {
    --bs-btn-color: var(--mb-blue-strong);
    --bs-btn-border-color: var(--mb-blue-strong);
    --bs-btn-hover-bg: var(--mb-blue-strong);
    --bs-btn-hover-border-color: var(--mb-blue-strong);
    --bs-btn-active-bg: var(--mb-blue-hover);
    --bs-btn-active-border-color: var(--mb-blue-hover);
    --bs-btn-focus-shadow-rgb: 22, 115, 230;
}

.text-primary { color: var(--mb-blue) !important; }
.bg-primary { background-color: var(--mb-blue) !important; }
.form-check-input:checked { background-color: var(--mb-blue); border-color: var(--mb-blue); }
.nav-pills .nav-link.active { background-color: var(--mb-blue); }
.table { --bs-table-color: var(--bs-body-color); --bs-table-bg: transparent; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--mb-heading); font-weight: 700; letter-spacing: -.01em; }

/* App shell: sidebar on desktop, bottom bar + "Mais" drawer on phones */
.app-shell {
    --sidebar-width: 232px;
    --bottomnav-height: 60px;
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-shell main {
    max-width: 1400px;
    width: 100%;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--mb-surface);
    border-right: 1px solid var(--mb-line);
    color: var(--mb-navy);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .15s ease;
}

.side-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem .75rem .5rem 1.25rem;
}

.app-shell .brand, .app-more .brand {
    color: var(--mb-navy);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap;
}

.sidebar-toggle {
    background: none;
    border: 0;
    color: #8A9AAE;
    padding: .35rem .5rem;
    border-radius: .375rem;
}

.sidebar-toggle:hover {
    color: var(--mb-blue);
    background: var(--mb-ice);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 1rem;
}

.side-nav .nav-section {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    color: #8A9AAE;
    padding: .9rem 1.25rem .3rem;
    white-space: nowrap;
}

.side-nav .nav-link, .side-account .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 .5rem;
    padding: .55rem .75rem;
    min-height: 40px;
    border-radius: .65rem;
    color: var(--mb-nav-text);
    font-weight: 500;
    white-space: nowrap;
    background: none;
    border: 0;
    width: calc(100% - 1rem);
    text-align: left;
}

.side-nav .nav-link:hover, .side-account .nav-link:hover {
    background: var(--mb-ice);
    color: var(--mb-navy);
}

.side-nav .nav-link.active {
    background: var(--mb-soft);
    color: var(--mb-blue-strong);
    font-weight: 700;
}

.side-nav .nav-link i, .side-account .nav-link i, .side-user i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.side-account {
    margin-top: auto;
    border-top: 1px solid var(--mb-line);
    padding: .5rem 0 .75rem;
}

.side-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1.25rem;
    color: var(--mb-navy);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-user span {
    overflow: hidden;
    text-overflow: ellipsis;
}

html.sidebar-collapsed .app-sidebar {
    width: 64px;
}

html.sidebar-collapsed .app-sidebar .side-brand {
    flex-direction: column;
    gap: .5rem;
    padding: .9rem .5rem .5rem;
}

html.sidebar-collapsed .app-sidebar .brand-logo-full { display: none !important; }
html.sidebar-collapsed .app-sidebar .brand-logo-full ~ .brand-logo-mark { display: block; }
html.sidebar-collapsed .app-sidebar .nav-link span,
html.sidebar-collapsed .app-sidebar .side-user span {
    display: none;
}

html.sidebar-collapsed .app-sidebar .nav-section {
    padding: .5rem 0 0;
    margin: .4rem .9rem;
    border-top: 1px solid var(--mb-line);
    font-size: 0;
}

html.sidebar-collapsed .app-sidebar .nav-link {
    justify-content: center;
    padding: .55rem 0;
}

html.sidebar-collapsed .app-sidebar .side-user {
    justify-content: center;
    padding: .5rem 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: 52px;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 1rem;
    background: var(--mb-surface);
    border-bottom: 1px solid var(--mb-line);
}

.brand-mobile {
    display: none;
    font-weight: 600;
    color: var(--mb-navy);
    text-decoration: none;
}

.app-bottomnav {
    display: none;
}

.app-more {
    --bs-offcanvas-width: 300px;
    background: var(--mb-surface);
    color: var(--mb-navy);
}

.app-more .offcanvas-body {
    display: flex;
    flex-direction: column;
    padding: 0;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        display: none;
    }

    .brand-mobile {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
    }

    .app-shell main {
        padding-bottom: calc(var(--bottomnav-height) + 1.5rem + env(safe-area-inset-bottom)) !important;
    }

    .app-bottomnav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        height: calc(var(--bottomnav-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--mb-surface);
        border-top: 1px solid var(--mb-line);
        box-shadow: 0 -4px 14px rgba(24, 52, 81, .06);
    }

    .app-bottomnav a, .app-bottomnav button {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: .72rem;
        color: #8A9AAE;
        text-decoration: none;
        background: none;
        border: 0;
    }

    .app-bottomnav i {
        font-size: 1.3rem;
    }

    .app-bottomnav a.active {
        color: var(--bs-primary);
        font-weight: 600;
    }

    /* Comfortable touch targets */
    .app-shell .btn, .app-shell .form-control, .app-shell .form-select {
        min-height: 44px;
    }

    .app-shell .btn-sm, .app-shell .form-control-sm, .app-shell .form-select-sm {
        min-height: 38px;
    }

    .app-shell .form-check-input {
        width: 1.25em;
        height: 1.25em;
    }
}

/* Floating main action on phones (e.g. "+ Agendar") */
.fab {
    display: none;
}

@media (max-width: 991.98px) {
    .fab {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        position: fixed;
        right: 16px;
        bottom: calc(var(--bottomnav-height, 60px) + 16px + env(safe-area-inset-bottom));
        z-index: 1025;
        border-radius: 999px;
        padding: .75rem 1.15rem;
        box-shadow: 0 8px 20px rgba(18, 100, 204, .35);
    }
}

/* Dialogs take the whole screen on phones; actions stay reachable */
@media (max-width: 575.98px) {
    .modal-fullscreen-sm-down .modal-body > .d-flex.justify-content-end:last-child {
        position: sticky;
        bottom: -1rem;
        margin: 0 -1rem -1rem;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
        background: var(--mb-surface);
        border-top: 1px solid var(--mb-line);
    }
}

.form-control:focus, .form-select:focus {
    border-color: var(--mb-blue);
    box-shadow: 0 0 0 .2rem rgba(22, 115, 230, .15);
}

.validation-message {
    color: #dc3545;
    font-size: .875em;
}

/* Agenda grid */
.agenda {
    display: flex;
    align-items: flex-start;
    border: 1px solid var(--mb-line);
    border-radius: .5rem;
    background: var(--mb-surface);
    overflow: auto;
    user-select: none;
}

.agenda-timecol {
    flex: none;
    width: 56px;
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--mb-subtle);
}

.agenda-col {
    flex: 1 1 160px;
    min-width: 160px;
}

.agenda-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--mb-subtle);
    border-bottom: 1px solid var(--mb-line);
    padding: .5rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-time {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--mb-subtle);
    border-right: 1px solid var(--mb-line);
    border-top: 1px solid var(--mb-line);
    font-size: .75rem;
    color: var(--bs-secondary-color);
    padding: 0 .4rem;
    text-align: right;
    white-space: nowrap;
}

.agenda-col {
    position: relative;
    border-right: 1px solid var(--mb-line);
}

.agenda-cell {
    border-top: 1px solid var(--mb-line);
    cursor: pointer;
}

.agenda-cell.off {
    background: repeating-linear-gradient(135deg, var(--mb-subtle), var(--mb-subtle) 6px, var(--mb-stripe) 6px, var(--mb-stripe) 12px);
    cursor: default;
}

.agenda-cell.busy {
    background: #fff3cd;
    cursor: default;
}

.agenda-cell:not(.off):not(.busy):hover {
    background: #e7f1ff;
}

.agenda-appt {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: .35rem;
    padding: .2rem .4rem;
    font-size: .78rem;
    line-height: 1.2;
    overflow: hidden;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}


.status-badge-Scheduled { background: #5B8DEF; }
.status-badge-ReminderSent { background: #F08C2E; }
.status-badge-Confirmed { background: #22A06B; }
.status-badge-Cancelled { background: #adb5bd; }
.status-badge-Rescheduled { background: #adb5bd; }
.status-badge-CustomerRequestedOtherTime { background: #dc3545; }
.status-badge-Completed { background: #8B5CF6; }
.status-badge-NoShow { background: #6C757D; }

#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;
}

/* WhatsApp settings: template list, editor and phone-like preview */
.template-item { cursor: pointer; }
.template-item.active, .template-item.active:hover, .template-item.active:focus { background: var(--bs-primary-bg-subtle); color: var(--bs-body-color); border-color: var(--bs-border-color); border-left: 3px solid var(--bs-primary); }
.variable-chip { font-family: var(--bs-font-monospace); font-size: .8rem; }
.wa-preview { background: #efeae2; border-radius: .75rem; padding: 1rem; min-height: 260px; }
.wa-preview-header { background: #075e54; color: #fff; border-radius: .5rem; padding: .5rem .75rem; font-size: .85rem; margin-bottom: .75rem; }
.wa-bubble { background: #d9fdd3; border-radius: .5rem .5rem 0 .5rem; padding: .5rem .65rem 1.1rem; max-width: 92%; margin-left: auto;
             box-shadow: 0 1px .5px rgba(0,0,0,.13); word-wrap: break-word; position: relative; font-size: .9rem; }
.wa-bubble .wa-time { position: absolute; right: .5rem; bottom: .2rem; font-size: .7rem; color: #667781; }
.wa-system { color: #54656f; border-top: 1px dashed #b7c7b1; margin-top: .4rem; padding-top: .35rem; }

/* Clients: filter chips and side sheet */
.filter-chip { border-radius: 999px; }
.filter-chip .count { opacity: .75; margin-left: .35rem; }
.customer-row { cursor: pointer; }
.side-sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1040; }
.side-sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--bs-body-bg);
              z-index: 1045; box-shadow: -4px 0 16px rgba(0,0,0,.15); overflow-y: auto; }
.stat-tile { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .5rem .75rem; }
.stat-tile .value { font-size: 1.1rem; font-weight: 600; }

/* Compact WhatsApp connection warning: one line, never pushes the page down much */
.wa-status-strip {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    padding: .45rem .75rem;
    border-radius: .5rem;
    background: #fdecee;
    border: 1px solid #f5c2c7;
    color: #842029;
    font-size: .875rem;
    line-height: 1.3;
}

.wa-status-strip a {
    color: #842029;
}

/* iOS zooms into any field under 16px; keep phone fields at 16px */
@media (max-width: 991.98px) {
    .form-control, .form-select, .form-control-sm, .form-select-sm, .input-group-text {
        font-size: 16px;
    }
}

/* Agenda toolbar: one compact line on phones */
.agenda-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.agenda-date {
    position: relative;
    margin: 0;
}

.agenda-date input {
    width: 160px;
}

@media (max-width: 991.98px) {
    .agenda-date {
        padding: .4rem .25rem;
        cursor: pointer;
    }

    /* The native picker sits invisibly on top of the short date label. */
    .agenda-date input {
        position: absolute;
        inset: 0;
        width: 100%;
        min-height: 0 !important;
        opacity: 0;
    }

    .agenda {
        height: auto !important;
    }
}

/* Horizontal, swipeable chip row (professionals, filters) */
.chip-scroll {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: -12px;
    margin-right: -12px;
    padding: 0 12px 2px;
}

.chip-scroll::-webkit-scrollbar {
    display: none;
}

.chip-scroll .filter-chip, .chip-scroll .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.chip-scroll > .filter-chip {
    border: 1px solid var(--bs-border-color);
    background: var(--mb-surface);
    color: var(--bs-body-color);
    padding: .4rem .9rem;
    font-size: .875rem;
    min-height: 38px;
}

.chip-scroll > .filter-chip.active {
    background: #1f2329;
    border-color: #1f2329;
    color: #fff;
}

/* Agenda day list (phones) */
.agenda-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.agenda-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .8rem;
    background: var(--mb-surface);
    border: 1px solid var(--mb-line);
    border-left: 4px solid #6c757d;
    border-radius: .6rem;
    cursor: pointer;
    min-height: 60px;
}

.agenda-list-item:active {
    background: var(--mb-subtle);
}

.agenda-list-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    line-height: 1.2;
}

.agenda-list-time span {
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

.agenda-list-status {
    font-weight: 500;
    white-space: normal;
    max-width: 96px;
    text-align: center;
}

.agenda-list-block {
    cursor: default;
    background: repeating-linear-gradient(45deg, var(--mb-subtle), var(--mb-subtle) 8px, var(--mb-stripe) 8px, var(--mb-stripe) 16px);
    border-left-color: #adb5bd;
}

.status-line-Scheduled { border-left-color: #6c757d; }
.status-line-ReminderSent { border-left-color: #fd7e14; }
.status-line-Confirmed { border-left-color: #198754; }
.status-line-CustomerRequestedOtherTime { border-left-color: #dc3545; }
.status-line-Completed { border-left-color: #0d6efd; opacity: .75; }
.status-line-NoShow { border-left-color: #343a40; opacity: .65; }

.agenda-list-empty {
    text-align: center;
    color: var(--bs-secondary-color);
    padding: 2.5rem 1rem;
    background: var(--mb-surface);
    border: 1px dashed #d0d5da;
    border-radius: .6rem;
}

.agenda-list-empty > i {
    font-size: 2rem;
    display: block;
    margin-bottom: .5rem;
}

.min-w-0 {
    min-width: 0;
}

/* Tables become one card per row on phones. Cells carry data-label; the first
   cell (card-main) spans the card, actions sit at the bottom right. */
@media (max-width: 767.98px) {
    .table-cards-wrap {
        background: transparent !important;
        border: 0 !important;
        overflow: visible;
    }

    .table-cards thead {
        display: none;
    }

    .table-cards, .table-cards tbody {
        display: block;
        width: 100%;
    }

    .table-cards tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .35rem .75rem;
        margin-bottom: .5rem;
        padding: .7rem .85rem;
        background: var(--mb-surface);
        border: 1px solid var(--mb-line);
        border-radius: .6rem;
    }

    .table-cards td {
        display: block;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-align: left !important;
        min-width: 0;
    }

    .table-cards td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: .7rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--bs-secondary-color);
    }

    .table-cards td.card-main {
        grid-column: 1 / -1;
        order: -1;
        font-size: 1rem;
    }

    .table-cards td.card-actions {
        grid-column: 2;
        display: flex;
        gap: .5rem;
        justify-content: flex-end;
        align-items: flex-end;
    }

    .table-cards td:empty {
        display: none;
    }

    .chips-mobile-scroll {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scrollbar-width: none;
        width: calc(100% + 24px);
        margin: 0 -12px;
        padding: 0 12px 2px;
    }

    .chips-mobile-scroll::-webkit-scrollbar {
        display: none;
    }

    .chips-mobile-scroll > * {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* Toasts: slide in at the top right (above the bottom bar on phones), stay a moment and slide out */
.toast-stack {
    position: fixed; top: 16px; right: 16px; z-index: 1090;
    display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; pointer-events: none;
}
.app-toast {
    pointer-events: auto; display: flex; align-items: center; gap: .6rem;
    min-width: 260px; max-width: min(440px, calc(100vw - 32px));
    padding: .65rem .7rem .65rem .9rem; border-radius: .7rem; border: 1px solid;
    font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25);
    backdrop-filter: blur(6px);
    animation: toast-in .35s cubic-bezier(.2,.9,.3,1.2) both;
}
.app-toast.leaving { animation: toast-out .32s ease-in forwards; }
.app-toast-success { background: #0F3D2B; border-color: #1E7A52; color: #8BE3B5; }
.app-toast-error { background: #4A1717; border-color: #A33A3A; color: #FFB3B3; }
.app-toast-info { background: #12304F; border-color: #2F6DB5; color: #A9D0FF; }
.app-toast-icon { font-size: 1.15rem; }
.app-toast-text { flex: 1; }
.app-toast-close { border: 0; background: none; color: inherit; opacity: .75; padding: .1rem .3rem; border-radius: .35rem; }
.app-toast-close:hover { opacity: 1; background: rgba(255,255,255,.08); }
@keyframes toast-in { from { transform: translateX(calc(100% + 24px)); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { from { transform: none; opacity: 1; } to { transform: translateX(calc(100% + 24px)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .app-toast, .app-toast.leaving { animation-duration: .01s; } }
@media (max-width: 991.98px) {
    .toast-stack { left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); align-items: stretch; }
    .app-toast { max-width: none; }
    @keyframes toast-in { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
    @keyframes toast-out { from { transform: none; opacity: 1; } to { transform: translateY(-120%); opacity: 0; } }
}

/* ===== Login (MarcouBem) ===== */
.auth-shell {
    --mb-blue: #1673E6;
    --mb-blue-strong: #1264CC;
    --mb-navy: #183451;
    --mb-sky: #B9DEFF;
    --mb-ice: #F3F8FF;
    --mb-muted: #5B6B7F;
    --mb-border: #D6E2F0;
    font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 100vh;
    background: #fff;
    color: var(--mb-navy);
}

.brand-logo { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo img { display: block; width: auto; }
.brand-logo-full ~ .brand-logo-mark { display: none; }
.brand-logo .logo-on-dark { display: none; }
[data-bs-theme="dark"] .brand-logo-themed .logo-on-light { display: none; }
[data-bs-theme="dark"] .brand-logo-themed .logo-on-dark { display: block; }

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 2.5rem clamp(2rem, 5vw, 4.5rem);
    background:
        radial-gradient(circle at 85% 15%, rgba(185, 222, 255, .55), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(185, 222, 255, .45), transparent 40%),
        var(--mb-ice);
}
.auth-brand-logo { position: relative; z-index: 1; align-self: flex-start; text-decoration: none; }
.auth-brand-body { position: relative; z-index: 1; margin: auto 0; max-width: 520px; }
.auth-headline { font-size: clamp(2.4rem, 4.2vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; margin: 0 0 1rem; color: var(--mb-navy); }
.auth-headline span { display: block; }
.auth-headline-accent { color: var(--mb-blue); }
.auth-tagline { font-size: 1.15rem; color: var(--mb-muted); margin-bottom: 2.25rem; }

.auth-agenda { background: #fff; border-radius: 18px; box-shadow: 0 18px 40px rgba(24, 52, 81, .10); padding: 1rem 1.1rem; max-width: 400px; }
.auth-agenda-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: .4rem; color: var(--mb-navy); }
.auth-agenda-head i { color: var(--mb-blue); }
.auth-agenda-row { display: grid; grid-template-columns: 3rem .6rem 1fr auto; align-items: center; gap: .6rem; padding: .6rem 0; border-top: 1px solid #EEF3FA; font-size: .85rem; }
.auth-agenda-row b { font-weight: 700; color: var(--mb-navy); }
.auth-agenda-row .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--dot); }
.auth-agenda-row strong { display: block; font-weight: 600; }
.auth-agenda-row small { color: var(--mb-muted); }
.auth-agenda-row .ok { font-size: .72rem; font-weight: 600; color: #11865A; background: #E3F6EE; border-radius: 999px; padding: .2rem .55rem; white-space: nowrap; }
.auth-agenda-row .wait { font-size: .72rem; font-weight: 600; color: var(--mb-blue-strong); background: #E6F1FF; border-radius: 999px; padding: .2rem .55rem; white-space: nowrap; }

.auth-watermark { position: absolute; right: -70px; bottom: -50px; width: 360px; height: 360px; opacity: .07; pointer-events: none; }
.auth-copy { position: relative; z-index: 1; font-size: .8rem; color: var(--mb-muted); }

.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2.5rem 1.5rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-title { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; color: var(--mb-navy); margin-bottom: .35rem; }
.auth-subtitle { color: var(--mb-muted); margin-bottom: 1.75rem; }

.auth-alert { display: flex; gap: .5rem; align-items: flex-start; background: #FFF1F1; color: #B42318; border: 1px solid #F7C9C9; border-radius: 12px; padding: .7rem .9rem; font-size: .9rem; margin-bottom: 1rem; }

.auth-field { margin-bottom: 1.15rem; }
.auth-field label { display: block; font-weight: 700; font-size: .875rem; margin-bottom: .4rem; color: var(--mb-navy); }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-link { font-size: .85rem; font-weight: 600; color: var(--mb-blue); text-decoration: none; }
.auth-link:hover { color: var(--mb-blue-strong); text-decoration: underline; }

.auth-input { position: relative; display: flex; align-items: center; border: 1.5px solid var(--mb-border); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.auth-input:focus-within { border-color: var(--mb-blue); box-shadow: 0 0 0 4px rgba(22, 115, 230, .15); }
.auth-input > i { position: absolute; left: .9rem; color: #8A9AAE; pointer-events: none; }
.auth-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: .8rem .9rem .8rem 2.6rem; font: inherit; color: var(--mb-navy); border-radius: 12px; }
.auth-input input::placeholder { color: #9AA8B9; }
.auth-input input.invalid { color: #B42318; }
.auth-eye { border: 0; background: transparent; color: #8A9AAE; padding: 0 .9rem; height: 100%; cursor: pointer; }
.auth-eye:hover { color: var(--mb-blue); }
.auth-validation { color: #B42318; font-size: .82rem; margin-top: .3rem; }

.auth-success { display: flex; gap: .5rem; align-items: flex-start; background: #ECF8F2; color: #11683F; border: 1px solid #BFE6D2; border-radius: 12px; padding: .75rem .9rem; font-size: .9rem; margin-bottom: 1rem; }
.auth-back { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .9rem; color: var(--mb-muted); text-decoration: none; margin-bottom: 1.5rem; }
.auth-back:hover { color: var(--mb-blue); }

.auth-submit { width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: .5rem; border: 0; border-radius: 12px; padding: .9rem 1rem; background: var(--mb-blue-strong); color: #fff; font: inherit; font-weight: 700; font-size: 1.02rem; box-shadow: 0 10px 22px rgba(18, 100, 204, .25); transition: background .15s, transform .05s; cursor: pointer; }
.auth-submit:hover { background: #0F57B3; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: 3px solid var(--mb-sky); outline-offset: 2px; }

.auth-hint { text-align: center; font-size: .82rem; color: var(--mb-muted); margin: 1.1rem 0 0; }
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.6rem 0 1rem; font-size: .82rem; color: var(--mb-muted); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--mb-border); }
.auth-secondary { display: block; text-align: center; border: 1.5px solid var(--mb-border); border-radius: 12px; padding: .75rem 1rem; font-weight: 700; color: var(--mb-navy); text-decoration: none; transition: border-color .15s, background .15s; }
.auth-secondary:hover { border-color: var(--mb-blue); background: var(--mb-ice); color: var(--mb-navy); }

/* On phones only the "Entrar" part shows: no brand panel, logo or footer. */
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-main { justify-content: center; align-items: stretch; padding: 2rem 1.25rem; }
    .auth-card { max-width: 440px; margin: 0 auto; }
}

/* Icon-only row actions (admin lists): same size, aligned, brand colors */
.icon-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; padding: 0;
    border: 1px solid var(--mb-line); border-radius: .6rem;
    background: var(--mb-ice); color: var(--mb-blue-strong);
    font-size: 1rem; line-height: 1; text-decoration: none; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-icon:hover, .btn-icon:focus-visible { background: var(--mb-blue-strong); border-color: var(--mb-blue-strong); color: #fff; }
.btn-icon:focus-visible { outline: 3px solid var(--mb-sky); outline-offset: 1px; }
.btn-icon-danger { color: #B42318; }
.btn-icon-danger:hover, .btn-icon-danger:focus-visible { background: #B42318; border-color: #B42318; color: #fff; }

.email-preview { width: 100%; height: 640px; border: 1px solid var(--mb-line); border-radius: .9rem; background: var(--mb-ice); }

/* Dark theme (after login): same brand blues on deep navy surfaces. Toggled in the user menu. */
[data-bs-theme="dark"] {
    --mb-ice: #0D1623;
    --mb-surface: #142131;
    --mb-subtle: #182839;
    --mb-stripe: #1D2F44;
    --mb-soft: #17375C;
    --mb-line: #24364C;
    --mb-muted: #93A4B8;
    --mb-heading: #EAF1FA;
    --mb-nav-text: #B8C6D6;
    --mb-blue-strong: #2F86F0;
    --mb-blue-hover: #1673E6;
    --bs-body-bg: #0D1623;
    --bs-body-bg-rgb: 13, 22, 35;
    --bs-body-color: #D8E2EE;
    --bs-body-color-rgb: 216, 226, 238;
    --bs-secondary-color: #93A4B8;
    --bs-secondary-bg: #142131;
    --bs-tertiary-bg: #182839;
    --bs-border-color: #24364C;
    --bs-link-color: #6AA9F5;
    --bs-link-color-rgb: 106, 169, 245;
    --bs-link-hover-color: #9CC6F8;
    --bs-primary: #2F86F0;
    --bs-primary-rgb: 47, 134, 240;
    color-scheme: dark;
}
[data-bs-theme="dark"] .side-nav .nav-link.active { color: #FFFFFF; background: var(--mb-soft); }
[data-bs-theme="dark"] .side-nav .nav-link:hover, [data-bs-theme="dark"] .side-account .nav-link:hover { background: var(--mb-subtle); color: #FFFFFF; }
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .bg-light { background-color: var(--mb-surface) !important; }
[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--mb-subtle); --bs-table-color: var(--bs-body-color); --bs-table-border-color: var(--mb-line); }
[data-bs-theme="dark"] .card, [data-bs-theme="dark"] .modal-content, [data-bs-theme="dark"] .list-group-item, [data-bs-theme="dark"] .dropdown-menu { background-color: var(--mb-surface); }
[data-bs-theme="dark"] .text-dark { color: var(--bs-body-color) !important; }
[data-bs-theme="dark"] .btn-icon { background: var(--mb-subtle); color: #9CC6F8; }
[data-bs-theme="dark"] .btn-icon-danger { color: #F08A80; }
[data-bs-theme="dark"] .email-preview { background: #F3F8FF; }

/* Account menu behind the user's name (sidebar footer and phone drawer) */
.user-menu { position: relative; }
.side-account .side-user {
    display: flex; align-items: center; gap: .65rem; width: calc(100% - 1rem); margin: 0 .5rem;
    padding: .5rem .6rem; border: 0; border-radius: .65rem; background: none; color: var(--mb-heading); text-align: left;
}
.side-account .side-user:hover, .side-account .side-user[aria-expanded="true"] { background: var(--mb-ice); }
.user-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.1rem; height: 2.1rem; border-radius: 50%;
    background: var(--mb-soft); color: var(--mb-blue-strong); font-weight: 700;
}
.user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: .78rem; color: var(--bs-secondary-color); }
.user-more { color: var(--bs-secondary-color); }
/* Positioned "fixed" by Popper (see NavMenu) so the sidebar's overflow never clips it; same width as the user button. */
.user-menu-panel { width: calc(var(--sidebar-width) - 1rem); min-width: 0; padding: .4rem; border-radius: .9rem; border-color: var(--mb-line); }
.app-more .user-menu-panel { width: min(320px, calc(100vw - 2rem)); }
html.sidebar-collapsed .app-sidebar .user-menu-panel { width: 230px; }
.user-menu-panel .dropdown-item, .user-menu-panel .dropdown-item-text { display: flex; align-items: center; gap: .6rem; border-radius: .55rem; padding: .55rem .7rem; font-weight: 500; }
.user-menu-panel .dropdown-item-text label { cursor: pointer; }
.user-menu-panel .dropdown-item i, .user-menu-panel .dropdown-item-text i { width: 1.2rem; text-align: center; color: var(--bs-secondary-color); }
.user-menu-panel .dropdown-item:hover { background: var(--mb-ice); }
.user-menu-panel .user-menu-signout, .user-menu-panel .user-menu-signout i { color: #D64545; }
html.sidebar-collapsed .app-sidebar .user-text, html.sidebar-collapsed .app-sidebar .user-more { display: none; }
html.sidebar-collapsed .app-sidebar .side-account .side-user { justify-content: center; }
html.sidebar-collapsed .app-sidebar .side-user .user-avatar { display: inline-flex; }

/* ===== Início (home) ===== */
.home-top { display: flex; justify-content: flex-start; margin-bottom: 1.25rem; }
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.home-date { font-weight: 600; font-size: .9rem; color: var(--mb-heading); }
.home-greeting { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; margin: .1rem 0 0; }
.home-cta { padding: .6rem 1.1rem; border-radius: .75rem; display: inline-flex; align-items: center; gap: .45rem; }

.home-card { background: var(--mb-surface); border: 1px solid var(--mb-line); border-radius: 1rem; padding: 1.15rem 1.25rem; }
.home-stats { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.home-stats-2 { grid-template-columns: 1fr 1fr; }
.home-stats-4 { grid-template-columns: repeat(4, 1fr); }
.home-stat-label { display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .88rem; color: var(--bs-secondary-color); }
.home-stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--mb-heading); margin: .35rem 0 .2rem; line-height: 1.15; }
.home-stat-text { font-size: 1.8rem; }
.home-stat-of { font-size: 1.05rem; font-weight: 600; color: var(--bs-secondary-color); letter-spacing: 0; }
.home-stat-sub { font-size: .85rem; color: var(--bs-secondary-color); }
.home-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--mb-blue-strong); text-decoration: none; }
.home-link:hover { text-decoration: underline; }

.home-lists { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 1rem; }
.home-lists-2 { grid-template-columns: 1fr 1fr; }
.home-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.home-card-head h2 { font-size: 1.05rem; margin: 0; }
.home-empty { margin: 0; font-size: .9rem; color: var(--bs-secondary-color); }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list li { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-top: 1px solid var(--mb-line); }
.home-list li:first-child { border-top: 0; padding-top: 0; }
.home-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.9rem; color: var(--mb-heading); }
.home-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--mb-blue); flex-shrink: 0; }
.status-dot-Confirmed { background: #1E9E6A; }
.status-dot-CustomerRequestedOtherTime { background: #E0A100; }
.home-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.home-item-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-item-text small { color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-resolve { display: flex; align-items: center; gap: .6rem; width: 100%; color: inherit; text-decoration: none; padding: .1rem 0; }
.home-resolve > i:first-child { color: var(--mb-blue-strong); font-size: 1.05rem; }
.home-resolve:hover span { text-decoration: underline; }
.home-banner { display: flex; align-items: center; gap: .75rem; padding: .85rem 1.1rem; margin-bottom: 1rem; border-radius: 1rem;
    background: #FFF6E5; border: 1px solid #F3D9A4; color: #7A4B00; text-decoration: none; }
[data-bs-theme="dark"] .home-banner { background: #2E2412; border-color: #5C4517; color: #F3D9A4; }

@media (max-width: 1199.98px) {
    .home-stats, .home-stats-4 { grid-template-columns: 1fr 1fr; }
    .home-lists { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767.98px) {
    .home-stats, .home-stats-2, .home-stats-4, .home-lists, .home-lists-2 { grid-template-columns: 1fr; }
    .home-head { align-items: stretch; }
    .home-cta { justify-content: center; }
}

/* Quick search on Início */
.quick-search { position: relative; width: 100%; max-width: 480px; }
.quick-search-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.quick-search-input { padding-left: 2.5rem; padding-right: 2.5rem; border-radius: .8rem; background: var(--mb-surface); border-color: var(--mb-line); min-height: 44px; }
.quick-search-key { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); font-size: .75rem; padding: .1rem .4rem;
    background: var(--mb-subtle); color: var(--bs-secondary-color); border: 1px solid var(--mb-line); border-radius: .35rem; }
.quick-search-results { position: absolute; z-index: 1040; top: calc(100% + .35rem); left: 0; right: 0; padding: .4rem;
    background: var(--mb-surface); border: 1px solid var(--mb-line); border-radius: .9rem; max-height: 380px; overflow-y: auto; }
.quick-search-group { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); padding: .45rem .6rem .2rem; }
.quick-search-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: .55rem; color: inherit; text-decoration: none; }
.quick-search-item i { color: var(--mb-blue-strong); width: 1.1rem; text-align: center; }
.quick-search-item small { margin-left: auto; color: var(--bs-secondary-color); font-size: .78rem; }
.quick-search-item:hover, .quick-search-item:focus { background: var(--mb-ice); }
.quick-search-empty { padding: .6rem; font-size: .9rem; color: var(--bs-secondary-color); }

/* ===== Client site ("seu portal"): {slug}.marcoubem.com.br ===== */
.portal-root { min-height: 100vh; background: #E9EEF4; }
.pt-page {
    --pt-max: 480px;
    min-height: 100vh; max-width: var(--pt-max); margin: 0 auto; background: var(--pt-page); color: var(--pt-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; box-shadow: 0 0 40px rgba(0,0,0,.06);
}
.pt-hero {
    position: relative; color: var(--pt-top-text); background-color: var(--pt-top); background-size: cover; background-position: center;
    padding: 2rem 1.25rem 3.4rem; text-align: center;
}
.pt-cover-pattern {
    background-image:
        radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--pt-accent) 35%, transparent) 0, transparent 45%),
        radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--pt-top-text) 12%, transparent) 0, transparent 40%),
        repeating-linear-gradient(135deg, color-mix(in srgb, var(--pt-top-text) 5%, transparent) 0 2px, transparent 2px 14px);
}
.pt-hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.pt-logo {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--pt-top); font-weight: 800; font-size: 2rem; margin-bottom: .45rem; font-family: var(--pt-title-font);
}
.pt-logo img { width: 100%; height: 100%; object-fit: cover; }
.pt-logo-ring { box-shadow: 0 0 0 4px var(--pt-top), 0 0 0 6px color-mix(in srgb, var(--pt-top-text) 55%, transparent); }
.pt-name { font-family: var(--pt-title-font); font-weight: 700; font-size: 1.85rem; line-height: 1.15; margin: 0; color: inherit; letter-spacing: -.01em; }
.pt-tagline { font-size: 1rem; opacity: .85; }
.pt-address { font-size: .88rem; opacity: .85; }
.pt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-top: .65rem; }
.pt-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; font-size: .85rem; font-weight: 600;
    color: inherit; text-decoration: none; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--pt-top-text) 40%, transparent);
    background: color-mix(in srgb, var(--pt-top-text) 8%, transparent);
}
.pt-chip:hover { background: color-mix(in srgb, var(--pt-top-text) 18%, transparent); color: inherit; }

.pt-body { padding: 0 1rem 1.5rem; position: relative; }
.pt-cta {
    position: relative; z-index: 2; display: flex; width: 100%; align-items: center; justify-content: center; gap: .55rem;
    margin-top: -1.6rem; padding: 1rem 1.25rem; border: 0; border-radius: var(--pt-radius);
    background: var(--pt-accent); color: var(--pt-accent-text); font-weight: 700; font-size: 1.1rem; font-family: var(--pt-title-font);
    box-shadow: var(--pt-shadow); cursor: pointer;
}
.pt-cta:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.pt-cta.pt-waiting { opacity: .8; }
.pt-off { margin-top: -1.6rem; position: relative; z-index: 2; background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 14px; padding: 1rem; text-align: center; }
.pt-section { font-family: var(--pt-title-font); font-size: 1.2rem; font-weight: 700; margin: 1.6rem 0 .75rem; color: var(--pt-text); }
.pt-services, .pt-pick-list { list-style: none; margin: 0; padding: 0; background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 16px; overflow: hidden; }
.pt-services li + li, .pt-pick-list li + li { border-top: 1px solid var(--pt-line); }
.pt-service, .pt-pick {
    display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem .9rem; border: 0; background: none;
    color: var(--pt-text); text-align: left; cursor: pointer; margin: 0;
}
.pt-service:disabled { cursor: default; }
.pt-service-photo {
    width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--pt-accent) 12%, var(--pt-card)); color: var(--pt-accent);
}
.pt-service-photo img { width: 100%; height: 100%; object-fit: cover; }
.pt-service-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pt-service-text strong { font-weight: 600; }
.pt-service-text small { color: var(--pt-muted); }
.pt-service-price { font-weight: 700; white-space: nowrap; }
.pt-service-go { color: var(--pt-muted); }
.pt-footer { text-align: center; font-size: .8rem; color: var(--pt-muted); margin-top: 1.75rem; }
.pt-footer a { color: inherit; }
.pt-missing { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #5B6B7F; gap: .5rem; font-size: 1.05rem; }
.pt-missing i { font-size: 2.5rem; }
.pt-text-page { padding-top: 1.5rem; line-height: 1.6; }
.pt-back { display: inline-flex; gap: .35rem; align-items: center; color: var(--pt-muted); text-decoration: none; font-weight: 600; }

/* Booking sheet */
.pt-sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 25, .55); z-index: 1050; }
.pt-sheet {
    position: fixed; z-index: 1051; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, var(--pt-max, 480px));
    max-height: 92vh; display: flex; flex-direction: column; background: var(--pt-page); color: var(--pt-text);
    border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
@media (min-width: 600px) { .pt-sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 20px; max-height: 86vh; } }
.pt-sheet-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem .4rem; }
.pt-round { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 0; background: var(--pt-line); color: var(--pt-text); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pt-round:disabled { opacity: .35; }
.pt-progress { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.pt-progress span { height: 4px; border-radius: 4px; background: var(--pt-line); }
.pt-progress span.on { background: var(--pt-accent); }
.pt-sheet-body { overflow-y: auto; padding: .5rem 1rem 1rem; }
.pt-sheet-foot { padding: .75rem 1rem calc(.9rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--pt-line); }
.pt-sheet-foot .pt-cta { margin-top: 0; font-size: 1rem; }
.pt-step-title { font-family: var(--pt-title-font); font-weight: 700; font-size: 1.35rem; margin: .4rem 0 .15rem; }
.pt-muted { color: var(--pt-muted); }
.pt-small { font-size: .82rem; }
.pt-pick input { position: absolute; opacity: 0; pointer-events: none; }
.pt-pick { position: relative; }
.pt-pick.on { background: color-mix(in srgb, var(--pt-accent) 10%, var(--pt-card)); }
.pt-check { width: 1.35rem; height: 1.35rem; border-radius: 6px; border: 2px solid var(--pt-line); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; }
.pt-pick.on .pt-check { background: var(--pt-accent); border-color: var(--pt-accent); color: var(--pt-accent-text); }
.pt-pros, .pt-days { display: flex; gap: .45rem; overflow-x: auto; padding: .35rem 0 .6rem; scrollbar-width: thin; }
.pt-pro { white-space: nowrap; border: 1px solid var(--pt-line); background: var(--pt-card); color: var(--pt-text); border-radius: 999px; padding: .4rem .9rem; font-weight: 600; font-size: .88rem; }
.pt-pro.on { background: var(--pt-accent); border-color: var(--pt-accent); color: var(--pt-accent-text); }
.pt-day { display: flex; flex-direction: column; align-items: center; min-width: 3.6rem; padding: .45rem .3rem; border: 1px solid var(--pt-line); border-radius: 14px; background: var(--pt-card); color: var(--pt-text); line-height: 1.15; }
.pt-day small { font-size: .7rem; color: var(--pt-muted); }
.pt-day strong { font-size: 1.15rem; }
.pt-day.on { background: var(--pt-accent); border-color: var(--pt-accent); color: var(--pt-accent-text); }
.pt-day.on small { color: inherit; opacity: .85; }
.pt-period { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pt-muted); margin: .8rem 0 .4rem; }
.pt-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.pt-slot { border: 1px solid var(--pt-line); background: var(--pt-card); color: var(--pt-text); border-radius: 999px; padding: .5rem 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-slot.on { background: var(--pt-accent); border-color: var(--pt-accent); color: var(--pt-accent-text); }
.pt-summary { display: flex; flex-direction: column; gap: .15rem; background: color-mix(in srgb, var(--pt-text) 6%, var(--pt-card)); border-radius: 14px; padding: .85rem 1rem; margin: .75rem 0 1rem; }
.pt-summary span { font-size: .88rem; color: var(--pt-muted); }
.pt-label { display: block; font-weight: 700; font-size: .85rem; margin: .8rem 0 .35rem; }
.pt-input { width: 100%; border: 1.5px solid var(--pt-line); border-radius: 12px; padding: .7rem .85rem; background: var(--pt-card); color: var(--pt-text); font: inherit; }
.pt-input:focus { outline: none; border-color: var(--pt-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pt-accent) 20%, transparent); }
.pt-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: .5rem; }
.pt-alert { background: #FDECEC; color: #9B1C1C; border-radius: 12px; padding: .7rem .9rem; margin: .5rem 0; font-size: .9rem; }
.pt-loading, .pt-empty { color: var(--pt-muted); padding: 1rem 0; text-align: center; }
.pt-done { text-align: center; padding: 1.5rem 0 .5rem; }
.pt-done-icon { width: 4rem; height: 4rem; border-radius: 50%; margin: 0 auto .9rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--pt-accent); color: var(--pt-accent-text); }
.pt-done h2 { font-family: var(--pt-title-font); font-weight: 700; }
.pt-note { background: color-mix(in srgb, var(--pt-accent) 10%, var(--pt-card)); border-radius: 12px; padding: .75rem; font-size: .9rem; }

/* Panel preview of the page (phone frame) */
.pt-preview { min-height: 0; box-shadow: none; pointer-events: none; }
.portal-phone { width: 100%; max-width: 340px; margin: 0 auto; border-radius: 28px; border: 8px solid #10161F; overflow: hidden auto; background: #E9EEF4; max-height: 680px; }
.portal-phone .pt-page { --pt-max: 100%; }

/* "Seu portal" editor */
.portal-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.portal-swatch { border: 1.5px solid var(--mb-line); border-radius: .9rem; background: var(--mb-surface); padding: .45rem; text-align: center; font-weight: 600; font-size: .85rem; color: var(--bs-body-color); }
.portal-swatch.on { border-color: var(--mb-blue-strong); box-shadow: 0 0 0 2px var(--mb-blue-strong); }
.portal-swatch-art { display: block; border-radius: .55rem; overflow: hidden; height: 58px; margin-bottom: .35rem; border: 1px solid var(--mb-line); }
.portal-swatch-art .top { display: flex; align-items: center; justify-content: center; height: 55%; }
.portal-swatch-art .top i { display: block; width: 70%; height: 9px; border-radius: 6px; }
.portal-swatch-art .bottom { display: flex; align-items: center; justify-content: center; height: 45%; }
.portal-swatch-art .bottom i { display: block; width: 70%; height: 7px; border-radius: 6px; opacity: .5; }
.portal-options { display: flex; flex-wrap: wrap; gap: .45rem; }
.portal-option { border: 1.5px solid var(--mb-line); background: var(--mb-surface); color: var(--bs-body-color); border-radius: .7rem; padding: .45rem .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.portal-option.on { background: var(--mb-blue-strong); border-color: var(--mb-blue-strong); color: #fff; }
.portal-logo-edit { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.portal-logo-edit .pt-logo { width: 84px; height: 84px; margin: 0; border: 1px solid var(--mb-line); color: #183451; }
.portal-sticky { position: sticky; top: 4.5rem; }

.pt-subtitle { font-family: var(--pt-title-font); font-size: 1rem; font-weight: 700; margin: 1.25rem 0 .35rem; }

/* Agenda cards: time on top, customer in bold, service beside (short card) or below (tall card); draggable */
/* Agenda card: tinted by status with a solid stripe; time + status on top, then name and service */
.agenda-appt[class*="status-"] {
    --appt-c: #5B8DEF;
    background: color-mix(in srgb, var(--appt-c) 20%, var(--mb-surface));
    color: var(--bs-body-color);
    border: 1px solid color-mix(in srgb, var(--appt-c) 45%, transparent); border-left: 4px solid var(--appt-c);
    border-radius: .6rem; padding: .3rem .5rem .3rem .45rem; line-height: 1.25;
    box-shadow: 0 2px 6px rgba(15,23,42,.12);
    display: flex; flex-direction: column; gap: .1rem;
}
.agenda-appt[class*="status-"]:hover { background: color-mix(in srgb, var(--appt-c) 30%, var(--mb-surface)); }
.agenda-appt.status-Scheduled { --appt-c: #5B8DEF; }
.agenda-appt.status-ReminderSent { --appt-c: #F08C2E; }
.agenda-appt.status-Confirmed { --appt-c: #22A06B; }
.agenda-appt.status-CustomerRequestedOtherTime { --appt-c: #DC3545; }
.agenda-appt.status-Completed { --appt-c: #8B5CF6; }
.agenda-appt.status-NoShow { --appt-c: #6C757D; opacity: .7; }
.agenda-appt[draggable="true"] { cursor: grab; }
.agenda-appt-top { display: flex; align-items: center; gap: .35rem; min-width: 0; white-space: nowrap; }
.agenda-appt-time { font-size: .8rem; font-weight: 800; color: var(--mb-heading); font-variant-numeric: tabular-nums; }
.agenda-appt-flags { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; min-width: 0; color: var(--appt-c); }
.agenda-appt-status { display: inline-flex; align-items: center; gap: .2rem; min-width: 0; padding: 0 .4rem; border-radius: 99px; font-size: .68rem; font-weight: 700;
    background: color-mix(in srgb, var(--appt-c) 22%, transparent); }
.agenda-appt-status-text { overflow: hidden; text-overflow: ellipsis; }
.agenda-appt-body { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .35rem; min-width: 0; }
.agenda-appt-name { font-weight: 800; font-size: .9rem; color: var(--mb-heading); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-appt-services { font-size: .8rem; color: var(--bs-secondary-color); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-appt.compact { flex-direction: row; padding-top: .1rem; padding-bottom: .1rem; }
.agenda-appt.compact .agenda-appt-top { flex: 1; }
.agenda-appt.compact .agenda-appt-name { font-size: .8rem; }
.agenda-col > div { container-type: inline-size; }
@container (max-width: 160px) { .agenda-appt-status-text { display: none; } }
/* Blocked time: striped, click to unblock */
.agenda-block {
    position: absolute; left: 2px; right: 2px; border-radius: .6rem; padding: .3rem .5rem; overflow: hidden; cursor: pointer;
    background: repeating-linear-gradient(135deg, var(--mb-subtle), var(--mb-subtle) 6px, var(--mb-stripe) 6px, var(--mb-stripe) 12px);
    border: 1px dashed var(--mb-line); color: var(--bs-secondary-color); font-size: .78rem; line-height: 1.25;
}
.agenda-block:hover { border-color: #DC3545; }
.agenda-block-title { font-weight: 700; color: var(--mb-heading); }
.agenda-block-reason { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-block.compact .agenda-block-reason { display: none; }
.agenda-appt.is-dragged { opacity: .45; }
.agenda-dragging .agenda-appt:not(.is-dragged) { pointer-events: none; }
.agenda-cell.drop-target { background: color-mix(in srgb, var(--mb-blue) 22%, transparent) !important; outline: 2px dashed var(--mb-blue); outline-offset: -2px; }

/* "Produtos e serviços" list: arrows to reorder, photo, chips, duration and price */
.catalog-list { list-style: none; margin: 0; padding: 0; background: var(--mb-surface); border: 1px solid var(--mb-line); border-radius: 1rem; overflow: hidden; }
.catalog-list li { display: flex; align-items: center; gap: .25rem; padding: .3rem .6rem .3rem .4rem; border-top: 1px solid var(--mb-line); }
.catalog-list li:first-child { border-top: 0; }
.catalog-list li.inactive { opacity: .6; }
.catalog-move { display: flex; flex-direction: column; }
.btn-arrow { border: 0; background: none; color: var(--bs-secondary-color); padding: 0 .3rem; line-height: 1.1; }
.btn-arrow:hover:not(:disabled) { color: var(--mb-blue-strong); }
.btn-arrow:disabled { opacity: .25; }
.catalog-item { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; border: 0; background: none; color: inherit; text-align: left; padding: .45rem .25rem; border-radius: .6rem; }
.catalog-item:hover { background: var(--mb-ice); }
.catalog-photo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--mb-soft); color: var(--mb-blue-strong); }
.catalog-photo img { width: 100%; height: 100%; object-fit: cover; }
.catalog-photo-lg { width: 64px; height: 64px; border-radius: 50%; font-size: 1.4rem; }
.catalog-text { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
.catalog-text strong { font-weight: 700; }
.catalog-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.catalog-chip { font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: .4rem; border: 1px solid var(--mb-line); background: var(--mb-subtle); color: var(--bs-secondary-color); display: inline-flex; gap: .3rem; align-items: center; }
.catalog-meta { font-size: .85rem; color: var(--bs-secondary-color); white-space: nowrap; display: inline-flex; gap: .3rem; align-items: center; }
.catalog-price { font-weight: 800; white-space: nowrap; min-width: 5.5rem; text-align: right; }
@media (max-width: 575.98px) { .catalog-meta { display: none; } .catalog-price { min-width: 0; } }

.pt-upsell-title { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .9rem; margin: 1rem 0 .5rem; color: var(--pt-accent); }

/* Produtos: profit over the cost under the sale price */
.catalog-price { display: inline-flex; flex-direction: column; align-items: flex-end; }
.catalog-profit { font-size: .75rem; font-weight: 600; color: #22A06B; white-space: nowrap; }
.catalog-profit.loss { color: #DC3545; }
.agenda-block.closure { cursor: default; }
.agenda-block.closure:hover { border-color: var(--mb-line); }

/* Modal title with an icon tile */
.modal-title-icon { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: .55rem; background: var(--mb-blue, #2F6FED); color: #fff; font-size: 1rem; flex-shrink: 0; }

/* "O que deseja criar?" (empty slot of the agenda) */
.slot-when { color: var(--bs-secondary-color); font-weight: 600; margin-bottom: .9rem; }
.slot-option { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; padding: .9rem 1rem; margin-bottom: .6rem;
    border: 1px solid var(--mb-line); border-radius: .8rem; background: var(--mb-surface); color: var(--bs-body-color); transition: border-color .15s, background .15s; }
.slot-option:hover, .slot-option:focus-visible { border-color: var(--mb-blue, #2F6FED); background: color-mix(in srgb, var(--mb-blue, #2F6FED) 8%, var(--mb-surface)); }
.slot-option strong { display: block; color: var(--mb-heading); }
.slot-option small { color: var(--bs-secondary-color); }
.slot-option-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: .6rem; font-size: 1.2rem; flex-shrink: 0; }
.slot-option-icon.blue { background: color-mix(in srgb, #2F6FED 18%, transparent); color: #5B8DEF; }
.slot-option-icon.amber { background: color-mix(in srgb, #E0A21B 20%, transparent); color: #E0A21B; }
.quick-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.quick-chip { border: 1px solid var(--mb-line); background: none; color: var(--bs-body-color); border-radius: 99px; padding: .15rem .65rem; font-size: .8rem; }
.quick-chip.active, .quick-chip:hover { border-color: var(--mb-blue, #2F6FED); color: var(--mb-blue, #2F6FED); }
.form-section-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bs-secondary-color); margin-bottom: .35rem; }

/* New appointment: client search (nothing listed until typing, "Cliente avulso" first) and service picks */
.customer-combo { position: relative; }
.customer-combo-icon { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.customer-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 260px; overflow: auto;
    background: var(--mb-surface); border: 1px solid var(--mb-line); border-radius: .7rem; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: .3rem; }
.customer-result { display: flex; align-items: baseline; gap: .45rem; width: 100%; border: 0; background: none; text-align: left; padding: .5rem .6rem; border-radius: .5rem; color: var(--bs-body-color); }
.customer-result:hover { background: var(--mb-ice); }
.customer-result small { color: var(--bs-secondary-color); margin-left: auto; white-space: nowrap; }
.customer-result.walk-in { border-bottom: 1px solid var(--mb-line); border-radius: .5rem .5rem 0 0; margin-bottom: .2rem; }
.customer-empty { text-align: center; color: var(--bs-secondary-color); padding: .7rem; font-size: .9rem; }
.customer-chosen { display: flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border: 1px solid var(--mb-blue); border-radius: var(--bs-border-radius); background: color-mix(in srgb, var(--mb-blue) 8%, var(--mb-surface)); font-weight: 600; }
.customer-chosen i { color: var(--mb-blue); }
.service-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem; }
.service-pick { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--mb-line); border-radius: .55rem; cursor: pointer; margin: 0; }
.service-pick .form-check-input { margin: 0; }
.service-pick.on { border-color: var(--mb-blue); background: color-mix(in srgb, var(--mb-blue) 8%, transparent); }

/* Appointment details (click on a card) */
.appt-when { color: var(--bs-secondary-color); margin: -.4rem 0 .9rem; }
.appt-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.appt-avatar { width: 3rem; height: 3rem; font-size: 1.05rem; margin-right: .25rem; }
.appt-chip { --appt-c: var(--bs-secondary-color); display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: .45rem;
    border: 1px solid var(--mb-line); font-size: .8rem; font-weight: 600; color: var(--bs-body-color); }
.appt-chip .bi-circle-fill { font-size: .45rem; color: var(--appt-c); }
.appt-chip.status-Scheduled { --appt-c: #5B8DEF; } .appt-chip.status-ReminderSent { --appt-c: #F08C2E; } .appt-chip.status-Confirmed { --appt-c: #22A06B; }
.appt-chip.status-CustomerRequestedOtherTime { --appt-c: #DC3545; } .appt-chip.status-Completed { --appt-c: #8B5CF6; } .appt-chip.status-NoShow, .appt-chip.status-Cancelled, .appt-chip.status-Rescheduled { --appt-c: #6C757D; }
.appt-info { border: 1px solid var(--mb-line); border-radius: .8rem; overflow: hidden; margin-bottom: .9rem; }
.appt-row { display: flex; gap: 1rem; padding: .75rem 1rem; }
.appt-row + .appt-row { border-top: 1px solid var(--mb-line); }
.appt-label { width: 6.5rem; flex-shrink: 0; color: var(--bs-secondary-color); font-size: .9rem; }
.appt-value { flex: 1; min-width: 0; color: var(--mb-heading); }
.appt-dot { font-size: .5rem; color: var(--mb-blue); vertical-align: middle; margin-right: .2rem; }
.appt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.appt-action { display: flex; align-items: center; gap: .55rem; padding: .8rem .9rem; border: 1px solid var(--mb-line); border-radius: .7rem; background: var(--mb-surface);
    color: var(--mb-heading); font-weight: 600; text-align: left; transition: border-color .15s, background .15s; }
.appt-action i { font-size: 1.1rem; }
.appt-action:hover, .appt-action.on { border-color: var(--mb-blue); background: color-mix(in srgb, var(--mb-blue) 7%, var(--mb-surface)); }
.appt-reschedule { border: 1px solid var(--mb-line); border-radius: .7rem; padding: .75rem; margin-top: .6rem; background: var(--mb-subtle); }
.appt-cancel { border: 0; background: none; color: #E05252; font-weight: 600; padding: .25rem 0; margin-top: .9rem; }
.appt-cancel:hover { text-decoration: underline; }
.appt-charge { font-weight: 700; }

/* Agenda header: big day title, Dia/Semana switch, day cards strip, empty-day invite, professional header */
.agenda-toolbar-end { margin-left: auto; align-items: center; gap: .5rem; }
.agenda-date-big > span { font-size: 1.45rem; font-weight: 800; color: var(--mb-heading); display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.agenda-date-big > span i { font-size: 1rem; color: var(--bs-secondary-color); }
.view-switch { display: inline-flex; padding: .2rem; border-radius: .6rem; background: var(--mb-subtle); border: 1px solid var(--mb-line); }
.view-switch > * { padding: .25rem .8rem; border-radius: .45rem; font-size: .875rem; font-weight: 600; color: var(--bs-secondary-color); text-decoration: none; }
.view-switch > .active { background: var(--mb-surface); color: var(--mb-heading); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.view-switch > a:hover { color: var(--mb-heading); }
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: .5rem; margin-bottom: .75rem; overflow-x: auto; padding-bottom: .15rem; }
.day-card { display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .55rem .4rem; border-radius: .8rem;
    border: 1px solid var(--mb-line); background: var(--mb-surface); color: var(--bs-body-color); transition: border-color .15s, transform .15s; }
.day-card:hover { border-color: var(--mb-blue); }
.day-card-week { font-size: .78rem; color: var(--bs-secondary-color); }
.day-card-number { font-size: 1.35rem; font-weight: 800; color: var(--mb-heading); line-height: 1.15; }
.day-card-count { font-size: .72rem; color: var(--bs-secondary-color); }
.day-card.today .day-card-number { color: var(--mb-blue); }
.day-card.closed { opacity: .6; }
.day-card.selected { background: var(--mb-blue); border-color: var(--mb-blue); box-shadow: 0 6px 18px color-mix(in srgb, var(--mb-blue) 35%, transparent); }
.day-card.selected .day-card-week, .day-card.selected .day-card-number, .day-card.selected .day-card-count { color: #fff; }
.agenda-empty { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.1rem; margin-bottom: .75rem; border-radius: .8rem;
    border: 1px solid color-mix(in srgb, var(--mb-blue) 35%, var(--mb-line)); background: color-mix(in srgb, var(--mb-blue) 9%, var(--mb-surface)); }
.agenda-empty strong { color: var(--mb-heading); }
.agenda-empty-icon { font-size: 1.5rem; color: var(--mb-blue); }
.agenda-empty-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.agenda-pro { display: inline-flex; align-items: center; gap: .55rem; padding: .2rem 0; }
.agenda-pro-photo { width: 2.2rem; height: 2.2rem; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
    background: var(--mb-soft); color: var(--mb-blue-strong); font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.agenda-pro-photo img { width: 100%; height: 100%; object-fit: cover; }
.agenda-pro-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.agenda-pro-text small { font-weight: 500; color: var(--bs-secondary-color); font-size: .75rem; }
@media (max-width: 991.98px) {
    .agenda-date-big > span { font-size: 1.15rem; }
    .day-strip { grid-template-columns: repeat(7, 64px); }
    .day-card-number { font-size: 1.1rem; }
}
.agenda-date-big { position: relative; }
.agenda-date-big input { position: absolute; inset: 0; width: 100%; min-height: 0 !important; opacity: 0; pointer-events: none; }
.service-picks { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.service-pick-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.service-pick-name { font-weight: 600; color: var(--mb-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-pick-text small { color: var(--bs-secondary-color); }
.customer-result { flex-wrap: wrap; }
.customer-result > .text-truncate { max-width: 60%; }
.customer-result.walk-in small { flex-basis: 100%; margin-left: 1.45rem; }

/* Clientes: phone with the WhatsApp icon in its own column */
.phone-wa { display: inline-flex; align-items: center; gap: .4rem; color: #1FA855; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.phone-wa:hover { text-decoration: underline; }
.phone-wa i { font-size: 1.05rem; }
.phone-wa.muted { color: var(--bs-secondary-color); font-weight: 500; }
[data-bs-theme="dark"] .phone-wa:not(.muted) { color: #3DDC84; }

/* Settings pages: a single "Salvar alterações" at the end, centered */
.form-save-bar { display: flex; justify-content: center; padding: 1.75rem 0 1rem; }
.form-save-bar .btn { min-width: 260px; font-weight: 700; }
@media (max-width: 575.98px) { .form-save-bar .btn { width: 100%; } }

/* Profissionais: photo with the name, new professional dialog */
.pro-cell { display: inline-flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; }
.pro-cell:hover .fw-semibold { color: var(--mb-blue); }
.pro-avatar { --pro-c: #1F7A85; width: 2.5rem; height: 2.5rem; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: var(--pro-c); color: #fff; font-weight: 700; font-size: .9rem; box-shadow: 0 0 0 2px var(--mb-surface), 0 0 0 4px var(--pro-c); }
.pro-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pro-subtitle { color: var(--bs-secondary-color); margin: -.6rem 0 1.1rem; font-size: .9rem; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; }
.pro-photo { width: 4.5rem; height: 4.5rem; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1.3rem; flex-shrink: 0; transition: background .2s; }
.pro-photo img { width: 100%; height: 100%; object-fit: cover; }
.color-swatches { display: flex; flex-wrap: wrap; gap: .55rem; }
.color-swatch { width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: transform .12s; }
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.on { box-shadow: 0 0 0 2px var(--mb-surface), 0 0 0 4px var(--mb-heading); }
.day-toggles { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.day-toggle { border: 1px solid var(--mb-line); background: var(--mb-surface); color: var(--bs-body-color); border-radius: .6rem; padding: .6rem .5rem; font-weight: 600; transition: background .15s, border-color .15s; }
.day-toggle:hover { border-color: var(--mb-blue); }
.day-toggle.on { background: var(--mb-blue); border-color: var(--mb-blue); color: #fff; }
.pro-switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--mb-line); border-radius: .8rem; background: var(--mb-subtle); cursor: pointer; margin: 0; }
.pro-switch strong { display: block; color: var(--mb-heading); }
.pro-switch small { color: var(--bs-secondary-color); }
.pro-switch .form-check-input { width: 2.6rem; height: 1.4rem; }
.pro-day-row { display: grid; grid-template-columns: 6.5rem 1fr auto 1fr; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.pro-day-name { font-weight: 600; color: var(--mb-heading); }
@media (max-width: 575.98px) { .day-toggles { grid-template-columns: repeat(4, 1fr); } .pro-day-row { grid-template-columns: 5rem 1fr auto 1fr; } }

/* Every button that mentions WhatsApp uses the WhatsApp green */
:root { --wa-green: #25D366; --wa-green-dark: #1DA851; }
.btn-whatsapp { --bs-btn-color: #fff; --bs-btn-bg: var(--wa-green-dark); --bs-btn-border-color: var(--wa-green-dark);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #179246; --bs-btn-hover-border-color: #179246;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #147E3C; --bs-btn-active-border-color: #147E3C;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--wa-green-dark); --bs-btn-disabled-border-color: var(--wa-green-dark);
    --bs-btn-focus-shadow-rgb: 37, 211, 102; font-weight: 600; }
.pt-chip.pt-chip-wa { background: var(--wa-green-dark); border-color: var(--wa-green-dark); color: #fff; }
.pt-chip.pt-chip-wa:hover { background: #179246; color: #fff; }

/* Clientes: circle with the initial, same as the user menu */
.customer-initial { width: 2.2rem; height: 2.2rem; font-size: .9rem; }
.min-w-0 { min-width: 0; }

/* Agenda: every header (time column included) has the same height, so the hour labels line up with the rows. */
.agenda-header { height: 58px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; overflow: hidden; }

/* Início: "Próximos clientes" with initials, status and a "Cobrar" shortcut; the next one highlighted */
.next-list { list-style: none; margin: 0 -1.25rem -1.15rem; padding: 0; }
.home-card:has(.next-list) { overflow: hidden; }
.next-list li { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.25rem; border-top: 1px solid var(--mb-line); border-left: 3px solid transparent; }
.next-list li.is-next { border-left-color: var(--mb-blue); background: color-mix(in srgb, var(--mb-blue) 9%, transparent); }
.next-time { font-weight: 800; color: var(--mb-heading); font-variant-numeric: tabular-nums; width: 3rem; flex-shrink: 0; }
.next-avatar { width: 2.4rem; height: 2.4rem; font-size: .85rem; }
.next-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.next-text strong { color: var(--mb-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-text small { color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-status { flex-shrink: 0; }
.next-charge { flex-shrink: 0; font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
@media (max-width: 575.98px) {
    .next-list li { flex-wrap: wrap; gap: .5rem .75rem; }
    .next-status { display: none; }
    .next-text { flex-basis: calc(100% - 7rem); }
    .next-charge { margin-left: auto; }
}
.home-lists:has(> .home-card-next) { grid-template-columns: 1fr 1fr; }
.home-lists > .home-card-next { grid-column: 1 / -1; }
@media (max-width: 767.98px) { .home-lists:has(> .home-card-next) { grid-template-columns: 1fr; } }

/* Client site: floating "Instalar app" banner */
.pt-install {
    position: fixed; z-index: 1040; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
    width: min(calc(100% - 24px), calc(var(--pt-max, 480px) - 24px)); transform: translate(-50%, 140%);
    display: flex; align-items: center; gap: .7rem; padding: .7rem .6rem .7rem .75rem;
    background: var(--pt-card, #fff); color: var(--pt-text, #1A2433); border: 1px solid var(--pt-line, #E5E9F0);
    border-radius: 16px; box-shadow: 0 12px 34px rgba(10, 16, 25, .28); transition: transform .35s cubic-bezier(.2, .9, .3, 1.15);
}
.pt-install[hidden] { display: none; }
.pt-install.show { transform: translate(-50%, 0); }
.pt-install-icon { width: 2.6rem; height: 2.6rem; border-radius: 12px; overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: var(--pt-top, #0B3D91); color: var(--pt-top-text, #fff); font-size: 1.2rem; }
.pt-install-icon img { width: 100%; height: 100%; object-fit: cover; }
.pt-install-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.pt-install-text strong { font-size: .92rem; }
.pt-install-text small { font-size: .78rem; opacity: .75; }
.pt-install-text small[hidden] { display: none; }
.pt-install-go { border: 0; border-radius: 999px; padding: .5rem 1rem; font-weight: 700; flex-shrink: 0;
    background: var(--pt-accent, #1673E6); color: var(--pt-accent-text, #fff); }
.pt-install-go[hidden] { display: none; }
.pt-install-close { border: 0; background: none; color: inherit; opacity: .6; padding: .35rem; border-radius: 50%; flex-shrink: 0; }
.pt-install-close:hover { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pt-install { transition: none; } }

/* Client site, phone first: the WhatsApp / Instagram / Como chegar buttons always stay on one line,
   shrinking (and cutting a long Instagram name) instead of wrapping. */
.pt-chips { flex-wrap: nowrap; width: 100%; max-width: 100%; gap: clamp(.25rem, 1.5vw, .45rem); }
.pt-chip { flex: 0 1 auto; min-width: 0; white-space: nowrap; font-size: clamp(.68rem, 3.3vw, .85rem);
    padding: clamp(.3rem, 1.4vw, .4rem) clamp(.45rem, 2.6vw, .8rem); gap: clamp(.2rem, 1vw, .35rem); }
.pt-chip > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pt-chip > i { flex-shrink: 0; }
.pt-hero { padding: clamp(1.5rem, 6vw, 2rem) clamp(.75rem, 4vw, 1.25rem) 3.4rem; }
.pt-name { font-size: clamp(1.4rem, 6.5vw, 1.85rem); overflow-wrap: anywhere; }
.pt-logo { width: clamp(76px, 22vw, 96px); height: clamp(76px, 22vw, 96px); }
.pt-tagline, .pt-address { overflow-wrap: anywhere; }
.pt-body { padding: 0 clamp(.6rem, 3vw, 1rem) 1.5rem; }
.pt-service, .pt-pick { padding: .7rem clamp(.6rem, 2.5vw, .9rem); gap: clamp(.5rem, 2.5vw, .75rem); }
.pt-cta { font-size: clamp(1rem, 4.4vw, 1.1rem); }
.portal-root { overflow-x: hidden; }
.pt-chip { flex-shrink: 0; font-size: clamp(.66rem, 3.2vw, .85rem); }
.pt-chip.pt-chip-ig { flex-shrink: 1; }

/* "Instalar app" banner, compact: translucent, no icon, one-line hint, close in the top-right corner */
.pt-install { padding: .75rem 2.2rem .75rem 1rem; gap: .75rem;
    background: color-mix(in srgb, var(--pt-card, #fff) 82%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
.pt-install-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-install-text small[data-install-ios] { white-space: normal; }
.pt-install-close { position: absolute; top: .3rem; right: .3rem; padding: .25rem .4rem; font-size: .8rem; }

/* Portal: returning client greeting under the WhatsApp field */
.pt-welcome { margin: .4rem 0 0; font-size: .85rem; font-weight: 600; color: var(--pt-accent); display: flex; align-items: center; gap: .35rem; }
.pt-link { border: 0; background: none; padding: 0 0 0 .25rem; color: var(--pt-muted); font-size: .8rem; font-weight: 600; text-decoration: underline; }

/* Status badges on light backgrounds (warning, info, light): soft background + strong text, readable in both themes.
   The dark theme turns .text-dark light, which made yellow badges unreadable. */
.badge.bg-warning, .badge.text-bg-warning { background-color: #FFE7A0 !important; color: #5A4100 !important; }
.badge.bg-info, .badge.text-bg-info { background-color: #CDEBFA !important; color: #0B4A6F !important; }
.badge.bg-light, .badge.text-bg-light { background-color: #EEF2F7 !important; color: #344054 !important; }
[data-bs-theme="dark"] .badge.bg-warning, [data-bs-theme="dark"] .badge.text-bg-warning {
    background-color: rgba(245, 183, 49, .18) !important; color: #FFD36B !important; box-shadow: inset 0 0 0 1px rgba(245, 183, 49, .45); }
[data-bs-theme="dark"] .badge.bg-info, [data-bs-theme="dark"] .badge.text-bg-info {
    background-color: rgba(56, 182, 255, .16) !important; color: #8FD3FF !important; box-shadow: inset 0 0 0 1px rgba(56, 182, 255, .4); }
[data-bs-theme="dark"] .badge.bg-light, [data-bs-theme="dark"] .badge.text-bg-light {
    background-color: var(--mb-subtle) !important; color: var(--bs-body-color) !important; box-shadow: inset 0 0 0 1px var(--mb-line); }
