:root {
    --bg: #F8F9FA;
    --surface: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --border: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --accent: #E53E3E;
    --accent-hover: #C53030;
    --accent-light: #FEF2F2;
    --status-green: #10b981;
    --status-yellow: #f59e0b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.logo-mark {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.logo h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.12s;
}

.nav-item:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.agent-status-panel {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.agent-status-panel h4 {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.6rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot.green {
    background: var(--status-green);
}

.dot.yellow {
    background: var(--status-yellow);
}

/* ===== MAIN ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem;
    gap: 0;
}

/* ===== TOP HEADER ===== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.top-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-widget {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.12s, color 0.12s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.btn-small {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

/* ===== AVATAR ===== */
.profile-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ===== VIEWS ===== */
.views-wrapper {
    flex: 1;
}

.view-section {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.view-section.active {
    display: flex;
}

/* ===== CARD ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header .sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    font-weight: 400;
}

/* ===== METRICS GRID ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.metric-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.metric-body h3 {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.25rem;
}

.metric-body .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.trend {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.trend.positive {
    color: var(--status-green);
    font-weight: 500;
}

.trend.negative {
    color: var(--accent);
}

.card-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ===== CHARTS ROW ===== */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.chart-card canvas {
    width: 100% !important;
}

/* Tabs */
.tab-group {
    display: flex;
    gap: 0.25rem;
}

.tab {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 400;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
}

.tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}


.service-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.service-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.service-pct {
    font-weight: 500;
    color: var(--text-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* ===== PERFORMANCE GRID ===== */
.perf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.perf-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.perf-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.perf-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.3;
}

/* ===== DASHBOARD SPLIT ===== */
.dashboard-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

/* ===== LOG FEED ===== */
.log-feed {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    height: 240px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-entry {
    display: flex;
    gap: 0.5rem;
    border-left: 2px solid transparent;
    padding-left: 0.4rem;
}

.log-entry.atendente {
    border-color: #1D4ED8;
    color: #1D4ED8;
}

.log-entry.analista {
    border-color: #9CA3AF;
    color: #6B7280;
}

.log-entry.organizador {
    border-color: #059669;
    color: #059669;
}

.log-entry.recuperacao {
    border-color: #D97706;
    color: #D97706;
}

.log-time {
    color: var(--text-secondary);
    width: 56px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ===== RECOMMENDATIONS ===== */
.recommendation-list {
    list-style: none;
}

.recommendation-list li {
    border-left: 3px solid var(--accent);
    padding-left: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.recommendation-list p {
    margin: 0.4rem 0;
    font-size: 0.83rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* ===== BADGES ===== */
.badge {
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    margin-bottom: 0.4rem;
}

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

.badge.vip {
    background: #EEF2FF;
    color: #4338CA;
    border: 1px solid #C7D2FE;
}

.badge.cuidador {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.badge.preco {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge.alert {
    background: #FFF7ED;
    color: #92400E;
    border: 1px solid #FED7AA;
}

/* ===== CRM TABLE ===== */
.panel-header,
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.search-input {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    color: var(--text-primary);
    width: 240px;
    font-size: 0.83rem;
}

.search-input:focus {
    border-color: var(--accent);
    outline: none;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg);
}

.data-table td {
    font-size: 0.85rem;
}

.data-table tr:hover td {
    background: var(--bg);
}

.cell-nome {
    font-weight: 500;
}

.cell-telefone {
    color: var(--text-secondary);
}

.cell-placa {
    font-size: 0.73rem;
    background: var(--bg);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
    display: inline-block;
}

.cell-servico-data {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* ===== SCHEDULER ===== */
.scheduler-panel {
    padding: 0;
    overflow: hidden;
}

.scheduler-panel .card-header {
    padding: 1.2rem 1.2rem 0;
}

.scheduler-grid {
    display: flex;
    overflow-x: auto;
    border-top: 1px solid var(--border);
    margin-top: 0.8rem;
}

.time-col {
    width: 70px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--bg);
}

.boxes-container {
    display: flex;
    flex: 1;
}

.box-col {
    flex: 1;
    min-width: 190px;
    border-right: 1px solid var(--border);
}

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

.grid-header {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg);
}

.time-slot {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.box-slot {
    height: 60px;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding: 2px;
}

.appointment {
    position: absolute;
    top: 2px;
    left: 4px;
    right: 4px;
    border-radius: 5px;
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
    overflow: hidden;
    border-left: 3px solid;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.app-sub {
    font-size: 0.68rem;
    opacity: 0.75;
}

.bg-confirmed {
    background: #EFF6FF;
    border-left-color: #3B82F6;
    color: #1E40AF;
}

.bg-execution {
    background: #FFFBEB;
    border-left-color: #F59E0B;
    color: #92400E;
}

.bg-completed {
    background: #F0FDF4;
    border-left-color: #10B981;
    color: #065F46;
}

.bg-blocked {
    background: #FEF2F2;
    border-left-color: #EF4444;
    color: #991B1B;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== CHAT ===== */
.simulator-panel {
    padding: 0;
    overflow: hidden;
}

.chat-header {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bot-avatar {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.75rem;
}

.chat-contact h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.status-online {
    color: var(--status-green);
    font-size: 0.75rem;
}

.chat-history {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg);
    min-height: 300px;
    max-height: 460px;
}

.chat-message {
    max-width: 72%;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.45;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bot {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
    color: var(--text-primary);
}

.message-user {
    align-self: flex-end;
    background: var(--accent);
    border-bottom-right-radius: 2px;
    color: #fff;
}

.chat-input-area {
    padding: 0.9rem 1.2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    background: var(--surface);
}

#chat-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.65rem 0.9rem;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
}

#chat-input:focus {
    border-color: var(--accent);
    outline: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.3rem;
    align-items: center;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ===== PERFORMANCE IA VIEW ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.page-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.period-tabs {
    display: flex;
    gap: 0.25rem;
}

.period-btn {
    padding: 0.3rem 0.75rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
}

.period-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.perf-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .perf-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.perf-card-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.perf-card-stat.highlight {
    border-top: 3px solid var(--accent);
    padding-top: calc(1.1rem - 2px);
}

.perf-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}

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

.perf-stat-value.green {
    color: #059669;
}

.perf-stat-value.red {
    color: var(--accent);
}

.perf-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.perf-charts-row .card {
    padding: 16px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
}

#chart-objections,
#chart-lost {
    max-height: 200px;
    flex-shrink: 0;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    overflow-y: auto;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-legend-pct {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 480px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}
.modal-header h3 { margin: 0; font-size: 1.1rem; color: #111827; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6B7280;
}
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: #374151; }
.form-group input, .form-group select {
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #111827;
    outline: none;
}
.form-group input:focus, .form-group select:focus {
    border-color: #E53E3E;
}
.btn-primary {
    background: #E53E3E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.btn-secondary {
    background: #F3F4F6;
    color: #374151;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

/* ===== CRM TABS & MODAL ===== */
.crm-tabs { display: flex; gap: 4px; background: #F3F4F6; padding: 4px; border-radius: 10px; }
.crm-tab { background: transparent; border: none; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; color: #6B7280; font-weight: 500; transition: all 0.15s; }
.crm-tab.active { background: #ffffff; color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.crm-tab:hover:not(.active) { color: #374151; }
.template-btns { display: flex; gap: 8px; margin-bottom: 12px; }
.template-btn { background: #F3F4F6; border: 1px solid #E5E7EB; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.82rem; color: #374151; }
.template-btn:hover { background: #E5E7EB; }
.badge-success { background: #ECFDF5; color: #059669; padding: 3px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-pending { background: #FFFBEB; color: #D97706; padding: 3px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.btn-whatsapp-icon {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s;
    opacity: 0.8;
}
.btn-whatsapp-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ===== REATIVAR METRICS ===== */
.reativar-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.metric-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.metric-card.highlight {
    border-top: 3px solid #E53E3E;
}
.metric-label {
    font-size: 0.78rem;
    color: #6B7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
}
.reativar-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.reativar-table-header h3 { margin: 0; font-size: 1rem; }

/* ===== CALENDAR (GOOGLE CALENDAR STYLE) ===== */
.calendar-container { padding: 0; overflow: hidden; }
.cal-week-header { display: grid; border-bottom: 1px solid #E5E7EB; }
.cal-week-header-cell {
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid #F3F4F6;
    background: #FAFAFA;
}
.cal-week-header-cell.today {
    background: #FFF5F5;
}
.cal-week-body { display: flex; max-height: 600px; overflow-y: auto; }
.cal-time-col {
    width: 56px;
    flex-shrink: 0;
    border-right: 1px solid #E5E7EB;
    background: #FAFAFA;
}
.cal-time-slot {
    height: 60px;
    padding: 6px 10px 0 0;
    font-size: 0.72rem;
    color: #9CA3AF;
    border-bottom: 1px solid #F3F4F6;
    text-align: right;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.cal-week-grid { display: grid; flex: 1; }
.cal-day-col { border-right: 1px solid #F3F4F6; position: relative; }
.cal-day-col:last-child { border-right: none; }
.cal-cell {
    height: 60px;
    border-bottom: 1px solid #F3F4F6;
    border-right: 1px solid #F3F4F6;
    position: relative;
}
.cal-cell:hover { background: #FAFAFA; }
.cal-event { position: absolute; left: 4px; right: 4px; border-radius: 6px; padding: 4px 8px; font-size: 0.75rem; font-weight: 500; cursor: pointer; z-index: 1; overflow: hidden; }
.service-lavagem { background: #DCFCE7; color: #166534; border-left: 3px solid #16A34A; }
.service-polimento { background: #DBEAFE; color: #1E40AF; border-left: 3px solid #2563EB; }
.service-vitri { background: #EDE9FE; color: #5B21B6; border-left: 3px solid #7C3AED; }
.service-higieni { background: #FEF3C7; color: #92400E; border-left: 3px solid #D97706; }
.service-cera { background: #FCE7F3; color: #9D174D; border-left: 3px solid #DB2777; }
.service-outros { background: #F3F4F6; color: #374151; border-left: 3px solid #6B7280; }

.cal-legend {
    display: flex;
    gap: 20px;
    padding: 14px 20px;
    border-top: 1px solid #F3F4F6;
    background: #FAFAFA;
    flex-wrap: wrap;
    border-radius: 0 0 12px 12px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #6B7280;
    font-weight: 500;
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cal-occupancy-bar { height: 3px; background: #E5E7EB; border-radius: 99px; margin-top: 4px; overflow: hidden; }
.cal-occupancy-fill { height: 100%; border-radius: 99px; transition: width 0.3s; }
.cal-occupancy-fill.low { background: #E53E3E; }
.cal-occupancy-fill.mid { background: #F59E0B; }
.cal-occupancy-fill.high { background: #10B981; }
.cal-occupancy-label { font-size: 0.68rem; color: #9CA3AF; }

.cal-day-col.low-occupancy { background: #FFF5F5; }
.cal-nav-btn { background: #F3F4F6; border: 1px solid #E5E7EB; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.cal-nav-btn:hover { background: #E5E7EB; }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-month-header { padding: 10px; text-align: center; font-size: 0.8rem; color: #6B7280; font-weight: 600; border-bottom: 1px solid #E5E7EB; background: #F9FAFB; }
.cal-month-day {
    min-height: 110px;
    padding: 10px 8px;
    border-right: 1px solid #F3F4F6;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: top;
    position: relative;
    overflow: hidden;
}
.cal-month-day.other-month { background: #FAFAFA; }
.cal-month-day.today {
    background: #FFF5F5;
}
.cal-month-day-num {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.cal-month-day-num.today-num { background: #E53E3E; color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal-month-event { position: relative !important; font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; left: auto !important; right: auto !important; }
.cal-day-grid { flex: 1; position: relative; }
.cal-day-header { padding: 12px 16px; border-bottom: 1px solid #E5E7EB; font-weight: 600; color: #111827; }

.cal-title-btn { background: none; border: none; font-size: 1.3rem; font-weight: 700; color: #111827; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.cal-title-btn:hover { background: #F3F4F6; }
.cal-date-picker { position: absolute; top: 40px; left: 0; background: white; border: 1px solid #E5E7EB; border-radius: 12px; padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 100; width: 260px; }
.cal-picker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; }
.cal-picker-header button { background: #F3F4F6; border: none; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.cal-picker-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-picker-month { padding: 8px; text-align: center; border-radius: 8px; cursor: pointer; font-size: 0.85rem; color: #374151; border: 1px solid transparent; }
.cal-picker-month:hover { background: #FEF2F2; color: #E53E3E; }
.cal-picker-month.selected { background: #E53E3E; color: white; }