/* ==========================================================================
   ALABAMA BARBEARIA - PREMIUM DARK THEMING

   Paleta derivada da identidade real da barbearia:
   - Preto esverdeado: paredes e piso do salão
   - Dourado: luminárias de latão do teto e os destaques do Instagram
   - Off-white: letreiro da fachada e o traço da logo
   ========================================================================== */

/* Design Tokens & Variables */
:root {
    --bg-primary: #0C110F;
    --bg-secondary: #141B18;
    --bg-tertiary: #1D2620;
    --bg-glass: rgba(20, 27, 24, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-active: rgba(201, 162, 75, 0.4);

    /* Brand Colors */
    --primary: #C9A24B; /* Dourado latão */
    --primary-hover: #DFBE72;
    --primary-dark: #8F6F2E;
    --primary-light: rgba(201, 162, 75, 0.15);

    /* Action & Status Colors */
    --success: #10b981; /* Emerald */
    --success-light: rgba(16, 185, 129, 0.12);
    --warning: #E67E22; /* Laranja - distinto do dourado da marca */
    --warning-light: rgba(230, 126, 34, 0.12);
    --danger: #f43f5e; /* Rose */
    --danger-light: rgba(244, 63, 94, 0.12);
    --info: #3b82f6; /* Sky Blue */
    --info-light: rgba(59, 130, 246, 0.12);
    --gray: #64748b;
    --gray-light: rgba(100, 116, 139, 0.12);
    
    /* Typography Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0C110F;
    
    /* Spacing & Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(201, 162, 75, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* As fontes de emoji no fim da pilha são o que garante o desenho de 💈, 🎉 etc.
       Sem elas, aparelhos cuja fonte de texto não tem o glifo mostram quadradinhos
       — foi o que acontecia na mensagem de agendamento do WhatsApp. */
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif,
                 "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: var(--bg-primary);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* SPA Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Altura real da área visível. Em navegador mobile, 100vh mede a janela
       SEM as barras do navegador, então o rodapé da sidebar — onde fica o
       botão Sair — era empurrado para fora da tela e ficava inalcançável.
       Mesmo motivo pelo qual o auth.css já usa 100dvh. */
    height: 100dvh;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Logomarca da barbearia, tratada como avatar redondo — o mesmo formato que a
   página pública usa em .pub-logo. Em quadrado a marca destoava do restante da
   interface, que é toda arredondada.
   O arquivo padrão é uma tela quadrada e transparente, então o recorte circular
   coincide com o desenho; uma foto enviada pelo salão é preenchida com "cover",
   comportamento normal de avatar. O anel dourado sustenta a forma mesmo quando a
   imagem tem fundo transparente. */
.logo-mark {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid rgba(201, 162, 75, 0.35);
    background-color: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    box-shadow: var(--shadow-glow);
}

.logo-dot {
    color: var(--primary);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.sidebar-menu {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.menu-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.menu-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    color: var(--text-main);
    background: var(--primary-light);
    border-color: rgba(201, 162, 75, 0.2);
    font-weight: 600;
}

.menu-item.active i {
    color: var(--primary);
}

.menu-item-special {
    background: linear-gradient(135deg, rgba(201, 162, 75, 0.1), rgba(59, 130, 246, 0.05));
    border: 1px dashed rgba(201, 162, 75, 0.3);
}

.menu-item-special:hover {
    background: linear-gradient(135deg, rgba(201, 162, 75, 0.15), rgba(59, 130, 246, 0.1));
    border-color: var(--primary);
}

.menu-item-special.active {
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: white;
}

.menu-item-special.active i {
    color: white;
}

.feature-paused {
    display: none !important;
}

.menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 16px;
}

.badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.badge-alert {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background-color: var(--warning-light);
    color: var(--warning);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

/* Top Header */
.top-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
}

.header-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    background-color: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Pages Container */
.pages-container {
    padding: 30px;
    flex: 1;
}

.page-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.page-section.active {
    display: block;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

/* Botão travado precisa parecer travado: sem isso o "Confirmar Fechamento"
   ficava idêntico ao normal e dava a impressão de que o clique não funcionou. */
.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(0.5);
}

.btn:disabled:hover,
.btn[disabled]:hover {
    transform: none;
}

.btn-primary {
    background-gradient: linear-gradient(135deg, var(--primary), var(--primary-dark));
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(201, 162, 75, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201, 162, 75, 0.4);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary.btn-active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: rgba(201, 162, 75, 0.3);
}

.btn-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

/* Já era usada no painel "Confirmar Pagamentos" e no aviso do fechamento de
   caixa, mas nunca tinha sido definida — o botão saía sem cor nenhuma. */
.btn-warning {
    background-color: var(--warning-light);
    color: var(--warning);
    border-color: rgba(230, 126, 34, 0.25);
}

.btn-warning:hover {
    background-color: var(--warning);
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-icon:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary);
}

.btn-full {
    width: 100%;
}

/* Glass Panels */
.glass-effect {
    background-color: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
}

/* Metrics Grid & Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-active);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-purple-soft { background-color: var(--primary-light); }
.text-purple { color: var(--primary); }

.bg-blue-soft { background-color: var(--info-light); }
.text-blue { color: var(--info); }

.bg-green-soft { background-color: var(--success-light); }
.text-green { color: var(--success); }

.bg-red-soft { background-color: var(--danger-light); }
.text-red { color: var(--danger); }

.bg-amber-soft { background-color: var(--warning-light); }
.text-amber { color: var(--warning); }

.bg-indigo-soft { background-color: rgba(79, 70, 229, 0.15); }
.text-indigo { color: #6366f1; }

.metric-details {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-top: 2px;
}

/* Dashboard Panel & Layout */
.dashboard-layout {
    display: flex;
    gap: 24px;
}

.flex-2 { flex: 2; }
.flex-1-5 { flex: 1.5; }
.flex-1 { flex: 1; }

.dashboard-panel {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title i {
    font-size: 16px;
}

.panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    background-color: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.panel-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.dashboard-side-panels {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Today's Appointments List */
.atendimentos-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.atendimento-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--gray);
    transition: var(--transition);
}

.atendimento-card:hover {
    background-color: var(--bg-tertiary);
    transform: translateX(4px);
}

.atendimento-card.status-scheduled { border-left-color: var(--info); }
.atendimento-card.status-confirmed { border-left-color: var(--primary); }
.atendimento-card.status-done { border-left-color: var(--success); }
.atendimento-card.status-no_show { border-left-color: var(--danger); }
.atendimento-card.status-cancelled { border-left-color: var(--gray); }

.atendimento-card.is-hoje {
    background-color: var(--primary-light);
    border-right: 2px solid var(--primary);
}

.atendimento-card.is-futuro {
    background-color: var(--bg-secondary);
}

.dash-agenda-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.appt-time-box {
    display: flex;
    flex-direction: column;
    min-width: 60px;
}

.appt-time {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
}

.appt-duration {
    font-size: 11px;
    color: var(--text-muted);
}

.appt-client-info {
    flex: 1;
    margin-left: 20px;
}

.appt-client-name {
    font-weight: 600;
    font-size: 14px;
    display: block;
}

.appt-service-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.appt-meta-tags {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.status-badge.scheduled { background-color: var(--info-light); color: var(--info); }
.status-badge.confirmed { background-color: var(--primary-light); color: var(--primary); }
.status-badge.done { background-color: var(--success-light); color: var(--success); }
.status-badge.no_show { background-color: var(--danger-light); color: var(--danger); }
.status-badge.cancelled { background-color: var(--gray-light); color: var(--gray); }

.appt-price {
    font-weight: 700;
    font-size: 14px;
    margin-left: 15px;
}

.appt-actions {
    margin-left: 15px;
    opacity: 0;
    transition: var(--transition);
}

.atendimento-card:hover .appt-actions {
    opacity: 1;
}

/* CRM Alerts styling */
.crm-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crm-alert-card {
    padding: 12px;
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crm-alert-text {
    font-size: 13px;
}

.crm-alert-text strong {
    color: var(--text-main);
}

.crm-alert-subtext {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Leads Conversions stats & lists */
.leads-quick-stats {
    margin-bottom: 16px;
}

.lead-progress-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lead-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.lead-progress-labels strong {
    color: var(--warning);
}

.progress-bar-bg {
    height: 6px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-gradient: linear-gradient(90deg, var(--warning), var(--primary));
    background-color: var(--warning);
    border-radius: var(--radius-full);
}

.recent-leads {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-lead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.recent-lead-name {
    font-weight: 600;
}

.recent-lead-source {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

/* Data Tables */
.table-container {
    margin-top: 20px;
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Actions Bar on Sections */
.section-actions-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(201, 162, 75, 0.15);
}

/* Agenda / Calendar Styles */
.agenda-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.agenda-navigation {
    display: flex;
    align-items: center;
    gap: 14px;
}

.agenda-current-date-title {
    font-size: 16px;
    font-weight: 700;
}

.calendar-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 240px);
    min-height: 500px;
    overflow: hidden;
}

.calendar-header-cols {
    display: flex;
    padding-left: 60px; /* Aligns with hour axis */
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
    overflow-y: scroll; /* Força o espaço do scrollbar para alinhar com o grid abaixo */
}
.calendar-header-cols::-webkit-scrollbar-thumb { background: transparent; }
.calendar-header-cols::-webkit-scrollbar-track { background: transparent; }

.calendar-header-col {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-weight: 700;
    font-size: 14px;
    border-right: 1px solid var(--border-color);
}

.calendar-header-col:last-child {
    border-right: none;
}

.calendar-body-scroll {
    flex: 1;
    overflow-y: scroll; /* Força scroll permanente para bater com o header em 100% dos casos */
}

.calendar-time-grid {
    display: flex;
    position: relative;
    height: 720px; /* 12 hours * 60px per hour */
}

.calendar-time-axis {
    width: 60px;
    border-right: 1px solid var(--border-color);
    position: relative;
    background-color: rgba(11, 15, 25, 0.2);
}

.time-axis-label {
    height: 60px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    padding-top: 5px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
}

.calendar-columns-container {
    flex: 1;
    display: flex;
    position: relative;
}

.calendar-col {
    flex: 1;
    height: 100%;
    position: relative;
    border-right: 1px solid var(--border-color);
}

.calendar-col:last-child {
    border-right: none;
}

/* Time slots grid lines in background */
.calendar-grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.grid-line {
    height: 60px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
}

.calendar-appt-event {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    overflow: hidden;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid var(--gray);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.calendar-appt-event:hover {
    transform: scale(1.02);
    z-index: 5;
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
}

.calendar-appt-event.scheduled { background-color: var(--info-light); border-left-color: var(--info); color: #93c5fd; }
.calendar-appt-event.confirmed { background-color: var(--primary-light); border-left-color: var(--primary); color: #DFBE72; }
.calendar-appt-event.done { background-color: var(--success-light); border-left-color: var(--success); color: #6ee7b7; }
.calendar-appt-event.no_show { background-color: var(--danger-light); border-left-color: var(--danger); color: #fca5a5; }
.calendar-appt-event.cancelled { background-color: var(--gray-light); border-left-color: var(--gray); color: #cbd5e1; }

/* Destaque para clientes com 2+ agendamentos na mesma semana */
.calendar-appt-event.duplicate-week-appt {
    border-left-color: #E67E22 !important;
    border-left-width: 5px !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25), inset 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.duplicate-week-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.25);
    color: #E67E22;
    font-size: 8px;
    margin-right: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

.calendar-appt-event .comm-badge {
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    font-size: 8px;
}

.event-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-desc {
    font-size: 10px;
    opacity: 0.8;
}

.event-time {
    font-size: 9px;
    font-weight: 600;
    align-self: flex-end;
}

.calendar-alternate-view {
    padding: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
}

/* Kanban Leads Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    height: calc(100vh - 240px);
    min-height: 500px;
    overflow-x: auto;
}

.kanban-column {
    min-width: 200px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.column-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.bg-blue { background-color: var(--info); }
.bg-amber { background-color: var(--warning); }
.bg-purple { background-color: var(--primary); }
.bg-green { background-color: var(--success); }
.bg-indigo { background-color: #6366f1; }
.bg-gray { background-color: var(--gray); }

.column-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.column-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.kanban-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
}

.kanban-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: grab;
    transition: var(--transition);
}

.kanban-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-active);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.lead-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.lead-source-icon {
    font-size: 11px;
    color: var(--text-muted);
}

.lead-source-icon.instagram { color: #e1306c; }
.lead-source-icon.whatsapp { color: #25d366; }

.lead-card-body {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lead-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lead-card-date {
    font-size: 9px;
    color: var(--text-muted);
}

.lead-card-actions {
    display: flex;
    gap: 4px;
}

.btn-card-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 2px;
    transition: var(--transition);
}

.btn-card-action:hover {
    color: var(--primary);
}

.finance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 992px) {
    .finance-grid {
        grid-template-columns: 1fr;
    }
    .finance-grid > .dashboard-panel {
        grid-column: span 1 !important;
    }
}

.table-container-embedded {
    overflow-x: auto;
    max-height: 400px;
}

.small-text {
    font-size: 13px;
}

.small-text th, .small-text td {
    padding: 10px 14px;
}

.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

.finance-list-actions {
    display: flex;
    gap: 10px;
}

.chart-box-mock {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chart-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.chart-bar-labels span { font-weight: 500; }
.chart-bar-labels strong { color: var(--text-main); }

.chart-bar-bg {
    height: 8px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
}

.payment-methods-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.payment-method-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-method-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

/* Config Tab Panels & Form Styles */
.config-subnav {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.config-tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.25s ease-out;
}

.config-tab-content.active {
    display: block;
}

.panel-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 680px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
}

.input-prefix-wrapper {
    display: flex;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.input-prefix-wrapper:focus-within {
    border-color: var(--primary);
}

.input-prefix {
    padding: 10px 14px;
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.input-prefix-wrapper .form-control {
    border: none;
    border-radius: 0;
}

.hours-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.01);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.hour-day-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.hour-day-row span:first-child {
    min-width: 140px;
    font-weight: 600;
}

.inline-time {
    width: auto;
    padding: 6px 10px;
}

/* Config grid cards (services & professionals) */
.services-list-grid, .professionals-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.item-config-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.item-config-card:hover {
    border-color: var(--border-color-active);
    transform: translateY(-2px);
}

.item-config-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.item-config-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
}

.item-config-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.item-config-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.item-price-tag {
    font-weight: 800;
    color: var(--primary);
    font-size: 15px;
}

.item-status-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.item-status-tag.active {
    background-color: var(--success-light);
    color: var(--success);
}

.item-status-tag.inactive {
    background-color: var(--gray-light);
    color: var(--gray);
}

/* Modals Backdrop & Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Altura real da área visível. Mesmo motivo da sidebar: no mobile 100vh
       mede a janela SEM as barras do navegador, e como o modal é ancorado
       embaixo o rodapé (com os botões) ficava atrás da barra do Safari. */
    height: 100dvh;
    padding: 24px;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.privacy-modal {
    z-index: 100000;
}

.modal-dialog {
    width: 100%;
    max-width: 500px;
    /* Nunca passa da área visível: o que sobra vira rolagem no corpo,
       nunca conteúdo escapando por baixo da tela. */
    max-height: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Vários modais envolvem corpo + rodapé num <form>. Sem isto o form é um
   bloco comum: o corpo não sabe qual altura pode ocupar, cresce à vontade e
   empurra o rodapé para fora do diálogo — foi assim que os botões do
   "Abrir Caixa do Dia" ficaram inalcançáveis no celular. */
.modal-dialog > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.modal-backdrop.show .modal-dialog {
    transform: scale(1);
}

.privacy-content {
    display: grid;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.65;
}

.privacy-content p {
    margin: 0;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
}

/* O corpo é quem encolhe e rola; cabeçalho e rodapé mantêm a altura natural
   e ficam sempre visíveis. min-height: 0 é obrigatório — sem ele um item
   flex se recusa a encolher abaixo do próprio conteúdo. */
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 12px;
}

.input-select-plus {
    display: flex;
    gap: 8px;
}

.input-select-plus select {
    flex: 1;
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    font-weight: 600;
    color: var(--text-muted);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.08);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Public Booking Link Simulator Panel */
.simulator-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.simulator-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.simulator-info h3 {
    font-size: 20px;
    font-weight: 800;
}

.link-copier-box {
    padding: 16px;
}

.link-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.link-copier {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background-color: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.link-copier code {
    font-family: monospace;
    font-size: 13px;
    color: var(--primary-hover);
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-outline:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--primary);
}

.simulator-instructions-box {
    padding: 20px;
}

.simulator-instructions-box h5 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.sim-steps-list {
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.alert-box {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.alert-info i {
    font-size: 16px;
    margin-top: 2px;
}

/* Smartphone Mockup */
.iphone-frame {
    width: 320px;
    height: 640px;
    border-radius: 40px;
    border: 12px solid #333F38;
    background-color: #0C110F;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 4px #4a5568;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Speaker / Notch */
.iphone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 18px;
    background-color: #333F38;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 100;
}

.iphone-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.phone-status-bar {
    height: 28px;
    padding: 4px 20px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    z-index: 90;
    background-color: #0C110F;
    flex-shrink: 0;
}

.phone-icons {
    display: flex;
    gap: 4px;
}

.phone-browser-header {
    height: 32px;
    background-color: #1a202c;
    border-bottom: 1px solid var(--border-color);
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    z-index: 90;
    flex-shrink: 0;
}

.browser-url {
    flex: 1;
    background-color: #0C110F;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.phone-content {
    flex: 1;
    overflow-y: auto;
    background-color: #0F1512;
    color: #e2e8f0;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Public booking page styling elements within Phone Viewport */
.pub-header {
    padding: 20px 14px;
    text-align: center;
    background: linear-gradient(180deg, rgba(201, 162, 75, 0.1) 0%, rgba(13, 19, 31, 0) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.pub-logo {
    width: 80px;
    height: 80px;
    /* Resquício da paleta antiga: --info é azul e destoava do dourado da
       Alabama quando o salão ainda não subiu a logo. */
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 800;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 4px 10px rgba(201,162,75,0.3);
}

.pub-title {
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.pub-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.pub-section {
    padding: 16px 14px;
}

.pub-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 12px;
}

.pub-services-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pub-service-card {
    background-color: #1D2620;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pub-service-card:hover {
    border-color: rgba(201,162,75,0.3);
    background-color: #26312B;
}

.pub-service-card.selected {
    border-color: var(--primary);
    background: rgba(201, 162, 75, 0.08);
}

.pub-service-name {
    font-weight: 700;
    font-size: 12px;
    color: white;
}

.pub-service-dur {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.pub-service-price {
    font-weight: 800;
    color: var(--primary-hover);
    font-size: 12px;
}

.pub-select-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.pub-select-card {
    background-color: #1D2620;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pub-select-card:hover {
    border-color: rgba(201,162,75,0.3);
    background-color: #26312B;
}

.pub-select-card.selected {
    border-color: var(--primary);
    background: rgba(201, 162, 75, 0.08);
}

.pub-select-name {
    font-weight: 700;
    font-size: 11px;
}

.pub-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.pub-slot-btn {
    background-color: #1D2620;
    border: 1px solid rgba(255,255,255,0.05);
    color: #e2e8f0;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.pub-slot-btn:hover {
    background-color: #26312B;
    border-color: var(--primary-hover);
}

.pub-slot-btn.selected {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pub-slot-btn.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background-color: #0C110F;
}

.pub-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pub-input {
    background-color: #1D2620;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    color: white;
    padding: 10px 12px;
    outline: none;
    font-size: 12px;
}

.pub-input:focus {
    border-color: var(--primary);
}

.pub-btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(201,162,75,0.3);
    transition: var(--transition);
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.pub-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(201,162,75,0.5);
}

/* Falha ao confirmar o agendamento: fica logo acima do botão, onde o
   cliente já está olhando (o toast do canto passa batido no celular). */
.pub-booking-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 15px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background-color: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fda4af;
    font-size: 13px;
    line-height: 1.45;
}

.pub-booking-error i {
    margin-top: 2px;
    flex-shrink: 0;
}

.pub-success-screen {
    text-align: center;
    padding: 30px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.success-icon-wrapper {
    width: 60px;
    height: 60px;
    background-color: rgba(16,185,129,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    font-size: 28px;
    margin-bottom: 20px;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-title {
    font-size: 16px;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
}

.success-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 20px;
}

.pub-summary-box {
    background-color: #1D2620;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.pub-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
}

.pub-summary-row:last-child {
    margin-bottom: 0;
}

.pub-summary-label {
    color: #94a3b8;
}

.pub-summary-val {
    font-weight: 700;
    color: white;
}

/* WhatsApp Dialog Simulator Theme */
.whatsapp-dialog {
    max-width: 440px;
    background-color: #0b141a !important; /* Authentic WA Dark color */
    border-color: rgba(255,255,255,0.05) !important;
}

.wa-header {
    background-color: #1f2c34;
    border-bottom: none;
    padding: 12px 20px;
}

.wa-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-avatar {
    width: 40px;
    height: 40px;
    background-color: #6a7f8c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.wa-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #e9edef;
}

.wa-status {
    font-size: 12px;
    color: #8696a0;
}

.wa-close {
    color: #8696a0 !important;
}

.wa-chat-body {
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Classic WhatsApp BG */
    background-color: #0b141a;
    padding: 20px !important;
    max-height: 450px !important;
}

.wa-chat-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.wa-message {
    display: flex;
    width: 100%;
}

.wa-msg-bubble {
    max-width: 80%;
    padding: 8px 12px 18px;
    border-radius: 8px;
    position: relative;
    font-size: 13.5px;
    color: #e9edef;
    line-height: 1.4;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.wa-msg-received {
    justify-content: flex-start;
}

.wa-msg-received .wa-msg-bubble {
    background-color: #202c33;
    border-top-left-radius: 0;
}

.wa-msg-sent {
    justify-content: flex-end;
}

.wa-msg-sent .wa-msg-bubble {
    background-color: #005c4b; /* WA green */
    border-top-right-radius: 0;
}

.wa-msg-time {
    position: absolute;
    bottom: 3px;
    right: 8px;
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.4);
}

.wa-chat-draft-box {
    margin-top: 10px;
    padding: 12px;
    background-color: rgba(11, 20, 26, 0.85);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
}

.draft-label {
    font-size: 11px;
    color: #00a884; /* WA Green tone text */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.draft-content-text {
    font-size: 13px;
    color: #e9edef;
    line-height: 1.4;
    user-select: all;
    background-color: rgba(255,255,255,0.02);
    padding: 8px;
    border-radius: 4px;
    white-space: pre-wrap;
    border-left: 2px solid #00a884;
}

.wa-footer {
    background-color: #1f2c34;
    border-top: none;
    padding: 14px 20px;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.3s ease 3.7s forwards;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-info { border-left-color: var(--info); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Responsive Rules */
@media (max-width: 1024px) {
    .dashboard-layout, .finance-grid {
        flex-direction: column;
    }
    .simulator-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .simulator-info {
        width: 100%;
    }
}

/* Hidden elements on desktop */
.mobile-tab-bar, .mobile-prof-switcher, .mobile-kanban-tabs {
    display: none;
}

@media (max-width: 768px) {
    .main-content {
        padding-bottom: 24px;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1100;
        box-shadow: 10px 0 30px rgba(0,0,0,0.8);
    }
    .sidebar.show {
        left: 0;
    }
    .sidebar-close {
        display: block;
    }
    .sidebar-toggle {
        display: block;
    }
    .top-header {
        padding: 16px 20px;
    }
    .pages-container {
        padding: 16px;
    }
    .header-right .header-date {
        display: none;
    }
    .header-right .quick-actions {
        display: none; /* Hide header btn on small mobile to fit title, bottom bar handles it or inside tabs */
    }
    .section-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    /* Metrics Grid Scroll or 2-column layout */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
    .metric-card {
        padding: 14px;
        gap: 10px;
    }
    .metric-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .metric-value {
        font-size: 18px;
    }
    
    /* 1. Mobile Bottom Tab Bar */
    .mobile-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        width: 20%;
        transition: var(--transition);
    }
    
    .tab-item i {
        font-size: 20px;
    }
    
    .tab-item.active {
        color: var(--primary);
    }
    
    /* 2. Mobile Professional Switcher for Agenda */
    .mobile-prof-switcher {
        display: flex;
        gap: 8px;
        margin-bottom: 16px;
        padding: 4px;
        background-color: var(--bg-secondary);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
    }
    .prof-switch-btn {
        flex: 1;
        background: none;
        border: none;
        color: var(--text-muted);
        padding: 10px 8px;
        border-radius: var(--radius-sm);
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition);
        white-space: nowrap;
        text-align: center;
    }
    .prof-switch-btn.active {
        background-color: var(--primary-light);
        color: var(--primary);
    }
    
    /* Columns hide logic in mobile agenda */
    .calendar-col {
        display: none !important;
    }
    .calendar-col.active-mobile-col {
        display: block !important;
    }
    
    .calendar-header-col {
        display: none !important;
    }
    .calendar-header-col.active-mobile-col {
        display: block !important;
        border-right: none;
    }
    
    .calendar-header-cols {
        padding-left: 60px;
    }
    
    /* 3. Mobile Kanban Stages Tabs */
    .mobile-kanban-tabs {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        margin-bottom: 16px;
        padding-bottom: 8px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-kanban-tabs::-webkit-scrollbar {
        display: none;
    }
    .kanban-tab-btn {
        flex-shrink: 0;
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        padding: 8px 14px;
        border-radius: var(--radius-full);
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: var(--transition);
    }
    .kanban-tab-btn.active {
        background-color: var(--primary-light);
        color: var(--primary);
        border-color: rgba(201, 162, 75, 0.4);
    }
    .tab-badge {
        font-size: 10px;
        background-color: var(--bg-tertiary);
        color: var(--text-muted);
        padding: 1px 6px;
        border-radius: var(--radius-sm);
    }
    .kanban-tab-btn.active .tab-badge {
        background-color: var(--primary);
        color: white;
    }
    
    /* Columns hide logic in mobile Kanban */
    .kanban-column {
        display: none !important;
        width: 100%;
        min-width: 0;
    }
    .kanban-column.active-mobile-col {
        display: flex !important;
    }
    .kanban-board {
        display: block;
        height: auto;
        overflow-x: hidden;
    }
    .kanban-cards-container {
        max-height: 500px;
    }

    /* 4. Responsive Tables to Card Layout */
    .data-table thead {
        display: none;
    }
    .data-table, .data-table tbody, .data-table tr, .data-table td {
        display: block;
        width: 100%;
    }
    .data-table tr {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        padding: 12px 14px;
    }
    .data-table td {
        text-align: left !important;
        padding: 8px 0 !important;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }
    .data-table td:last-child {
        border-bottom: none;
        padding-top: 12px !important;
        justify-content: flex-end;
    }
    
    /* Inject label headers on mobile */
    .data-table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-right: 15px;
    }
    
    /* Modal optimizations */
    .modal-dialog {
        width: calc(100% - 24px);
        margin: 12px;
    }
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
}


/* ========================================================================== */
/* MOBILE-FIRST OPERATIONS: MESSAGES, CALENDAR & CLIENT 360                   */
/* ========================================================================== */
.eyebrow { display: block; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 4px; }
.mobile-page-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; margin-bottom: 16px; }
.mobile-page-intro h3 { margin: 0 0 4px; font-size: 21px; }
.mobile-page-intro p { margin: 0; color: var(--text-muted); font-size: 13px; }
.message-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.message-kpi { display: flex; align-items: center; gap: 12px; padding: 16px; }
.message-kpi > i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--bg-tertiary); }
.message-kpi span { display: flex; flex-direction: column; }
.message-kpi strong { font-size: 20px; }
.message-kpi small, .automation-rule small, .message-job-main small, .client-hero small, .history-item small { color: var(--text-muted); }
.automation-rules { padding: 18px; margin-bottom: 16px; }
.automation-rule-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.automation-rule { position: relative; display: grid; grid-template-columns: 38px 1fr 42px; align-items: center; gap: 10px; padding: 13px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; }
.automation-rule > span:nth-child(2) { display: flex; flex-direction: column; }
.rule-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--primary); background: var(--primary-light); border-radius: 11px; }
.automation-rule input { position: absolute; opacity: 0; }
.switch-ui { width: 40px; height: 23px; border-radius: 20px; background: var(--bg-tertiary); position: relative; transition: .2s; }
.switch-ui::after { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s; }
.automation-rule input:checked + .switch-ui { background: var(--primary); }
.automation-rule input:checked + .switch-ui::after { transform: translateX(17px); }
.messages-toolbar { display: flex; justify-content: space-between; margin: 18px 0 12px; }
.segmented-control { display: inline-flex; padding: 4px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; }
.segmented-control button { border: 0; background: transparent; color: var(--text-muted); padding: 9px 14px; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented-control button.active { background: var(--primary); color: white; }
.message-job-list { display: grid; gap: 10px; }
.message-job-card { padding: 16px; border-left: 3px solid var(--border-color); }
.message-job-card.status-failed { border-left-color: var(--danger); }
.message-job-card.status-replied { border-left-color: var(--success); }
.message-job-main { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; }
.message-job-main > div { display: flex; flex-direction: column; }
.client-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; font-weight: 800; background: linear-gradient(135deg, var(--primary), #4f46e5); }
.client-avatar.large { width: 52px; height: 52px; border-radius: 16px; font-size: 20px; }
.message-status { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); background: var(--bg-tertiary); border-radius: 20px; padding: 5px 8px; }
.message-job-card p { color: var(--text-secondary); font-size: 13px; margin: 12px 0; }
.message-job-actions { display: flex; justify-content: flex-end; gap: 8px; }
.empty-state { padding: 40px; text-align: center; color: var(--text-muted); }
.appointment-communication { margin-top: 18px; padding: 14px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.communication-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.communication-heading > div { display: flex; flex-direction: column; }
.message-timeline-empty { color: var(--text-muted); font-size: 12px; margin-top: 12px; }
.message-timeline { display: grid; gap: 8px; margin-top: 12px; }
.message-timeline > div { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; }
.message-timeline span { display: flex; flex-direction: column; }
.comm-badge { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 9px; background: var(--bg-tertiary); }
.comm-badge.delivered, .comm-badge.replied { color: var(--success); background: rgba(16,185,129,.18); }
.comm-badge.failed { color: var(--danger); background: rgba(239,68,68,.18); }
.comm-badge.pending, .comm-badge.sent { color: var(--warning); background: rgba(245,158,11,.18); }
.week-view { display: grid; grid-template-columns: repeat(7, minmax(135px, 1fr)); gap: 8px; padding: 12px; overflow-x: auto; }
.week-day-card, .month-day { color: var(--text-primary); background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); text-align: left; cursor: pointer; }
.week-day-card { min-height: 180px; padding: 14px; display: flex; flex-direction: column; gap: 5px; }
.week-day-card > span { color: var(--text-muted); text-transform: uppercase; font-size: 10px; font-weight: 800; }
.week-day-card > strong { font-size: 24px; }
.week-day-card > small { color: var(--primary); }
.week-day-card.is-today, .month-day.is-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.week-appointments { display: grid; gap: 5px; margin-top: 8px; }
.mini-appt { padding: 5px 6px; background: var(--primary-light); color: #DFBE72; border-radius: 6px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-appointments em { color: var(--text-muted); font-size: 11px; }
.month-weekdays, .month-view { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month-weekdays { padding: 14px 14px 0; color: var(--text-muted); text-align: center; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.month-view { padding: 10px 14px 14px; }
.month-day { position: relative; min-height: 82px; padding: 10px; }
.month-day > span { position: absolute; right: 8px; top: 8px; min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--primary); font-size: 10px; }
.month-day small { display: block; margin-top: 20px; color: var(--success); font-size: 9px; }
.modal-dialog-wide { max-width: 680px; }
.client-hero { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.client-hero > div { display: flex; flex-direction: column; }
.client-stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 18px 0; }
.client-stat-grid > div { padding: 13px; background: var(--bg-secondary); border-radius: 12px; display: flex; flex-direction: column; }
.client-stat-grid small { color: var(--text-muted); font-size: 10px; text-transform: uppercase; }
.client-notes-card { padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; }
.client-notes-card p { margin: 6px 0 0; color: var(--text-secondary); font-size: 13px; }
.client-history { margin-top: 18px; }
.history-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border-color); }
.history-item > div { display: flex; flex-direction: column; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
.history-dot.done { background: var(--success); }
.history-dot.no_show { background: var(--danger); }

@media (max-width: 768px) {
    body { overflow-x: hidden; }
    .top-header { position: sticky; top: 0; z-index: 50; min-height: 58px; background: var(--bg-primary); backdrop-filter: blur(14px); }
    .header-title { font-size: 19px; }
    .pages-container { padding: 12px; }
    .dashboard-layout { gap: 12px; }
    .dashboard-panel { border-radius: 16px; padding: 12px; }
    
    /* Mobile appt card optimization */
    .atendimento-card { flex-wrap: wrap; gap: 8px; padding: 12px; position: relative; }
    .appt-time-box { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; margin-bottom: 4px; }
    .appt-time-box span[style*="font-size: 11px"] { margin-top: 0 !important; }
    .appt-client-info { width: 100%; margin-left: 0; margin-bottom: 8px; }
    .appt-meta-tags { order: 3; margin-top: 4px; }
    .appt-price { order: 4; margin-left: auto; font-size: 16px; margin-top: 4px; }
    .appt-actions { opacity: 1; position: absolute; right: 12px; bottom: 12px; margin-left: 0; }
    
    /* Mobile CRM card optimization */
    .crm-alert-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .crm-alert-card .btn { width: 100%; justify-content: center; }

    .agenda-controls { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .agenda-filters { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
    .agenda-filters .btn { justify-content: center; min-height: 42px; }
    .agenda-navigation { display: grid; grid-template-columns: 42px 1fr 42px; width: 100%; }
    .agenda-current-date-title { text-align: center; font-size: 12px; }
    .agenda-actions .btn { width: 100%; min-height: 46px; justify-content: center; }
    .calendar-wrapper { border-radius: 16px; }
    .calendar-body-scroll { max-height: calc(100vh - 330px); min-height: 410px; }
    .calendar-appt-event { left: 4px; right: 4px; min-height: 38px; padding: 6px 32px 6px 8px; border-radius: 8px; }
    .week-view { grid-template-columns: repeat(7, 78vw); scroll-snap-type: x mandatory; padding: 10px; }
    .week-day-card { scroll-snap-align: center; min-height: 230px; }
    .month-weekdays { gap: 2px; padding-left: 6px; padding-right: 6px; }
    .month-view { gap: 3px; padding: 8px 6px; }
    .month-day { min-height: 58px; padding: 7px; border-radius: 9px; }
    .month-day small { display: none; }
    .month-day > span { right: 4px; top: 4px; min-width: 17px; height: 17px; font-size: 9px; }
    .mobile-page-intro { align-items: stretch; flex-direction: column; padding: 16px; }
    .mobile-page-intro .btn { width: 100%; justify-content: center; min-height: 44px; }
    .message-kpis { gap: 7px; }
    .message-kpi { padding: 11px 8px; gap: 7px; flex-direction: column; align-items: flex-start; }
    .message-kpi > i { width: 32px; height: 32px; }
    .message-kpi strong { font-size: 18px; }
    .message-kpi small { font-size: 9px; }
    .automation-rules { padding: 14px; }
    .automation-rule-list { grid-template-columns: 1fr; }
    .automation-rule { min-height: 62px; }
    .segmented-control { width: 100%; }
    .segmented-control button { flex: 1; padding: 10px 6px; }
    .message-job-card { padding: 14px; }
    .message-job-main { grid-template-columns: 38px 1fr; }
    .message-status { grid-column: 2; justify-self: start; }
    .message-job-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .message-job-actions .btn { justify-content: center; }
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal-dialog { width: 100%; max-height: 100%; margin: 0; border-radius: 22px 22px 0 0; }
    /* O calc antigo (92vh - 132px) chutava a altura de cabeçalho + rodapé.
       Quando errava, o rodapé saía do diálogo e os botões sumiam. Agora o
       corpo simplesmente ocupa o espaço que sobrar. */
    .modal-body { overflow-y: auto; padding: 16px; }
    .modal-header { padding: 16px; }
    .modal-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .sticky-mobile-actions { position: sticky; bottom: 0; background: var(--bg-secondary); }
    .client-hero { grid-template-columns: 52px 1fr; }
    .client-hero .btn { grid-column: 1 / -1; justify-content: center; }
    .client-stat-grid > div { padding: 10px; }
    .client-stat-grid strong { font-size: 13px; }
    .history-item .status-badge { font-size: 9px; }
    .communication-heading { align-items: stretch; flex-direction: column; }
    .communication-heading .btn { justify-content: center; }
    .table-container { border: 0; background: transparent; overflow: visible; }
    .data-table tr { padding: 14px; border-radius: 16px; }
    .data-table td:last-child > div { display: grid !important; grid-template-columns: 1fr 1fr auto; width: 100%; }
    .data-table td:last-child .btn { justify-content: center; min-height: 38px; }
    .mobile-tab-bar { height: 72px; }
    .tab-item { min-height: 48px; justify-content: center; }
}


/* ==========================================================================
   PUBLIC BOOKING PAGE (acesso real via /<slug do salão>)
   ========================================================================== */
#public-booking-page {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    justify-content: center;
    background-color: #0F1512;
}

body.public-booking-mode .mobile-tab-bar {
    display: none !important;
}

#public-booking-page .phone-content {
    width: 100%;
    max-width: 480px;
    height: 100%;
    font-size: 14px;
}

.pub-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px;
    text-align: center;
}

.pub-loading i {
    font-size: 32px;
    color: var(--primary, #C9A24B);
}


/* Nome do salão no topo da sidebar (nomes longos não estouram a largura) */
#sidebar-salon-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
    display: inline-block;
}


/* Controles do topo do Financeiro.
   Cada filtro é um grupo em coluna com o mesmo espaçamento, e o alinhamento da
   linha é pelo topo. Com `align-items: center` os rótulos ficavam em alturas
   diferentes, porque os grupos têm alturas distintas. */
.finance-top-controls {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.finance-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* A lista de profissionais é a que cresce e rola quando há muitos nomes. */
.finance-top-controls .finance-filter-group:nth-child(2) {
    flex: 1;
}

.finance-filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.4;
}

/* Ações do Caixa do Dia. Estava tudo em style inline no HTML, o que impedia
   o mobile de mudar a direção sem !important. */
#cash-register-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

@media (max-width: 768px) {
    .finance-top-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .finance-filter-group {
        width: 100%;
    }
    /* Abrir Caixa e Fechar Caixa nunca aparecem juntos — só um deles está
       visível por vez. Então sobra largura para o Extrato do Dia ficar ao
       lado, e a tela do Financeiro economiza uma linha inteira. */
    #cash-register-actions {
        flex-direction: row;
    }
    #cash-register-actions .btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
        white-space: nowrap;
    }
}
