/* RESET & PALETA MODERNA */
:root {
    /* Cores principais */
    --primary-color: #1a1a2e;
    --primary-light: #16213e;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #0f3460;
    --accent-color: #e94560;
    
    /* Cores de texto */
    --white: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Cores de fundo */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    
    /* Bordas e sombras */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Estados */
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Raios de borda */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transições */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* HEADER MODERNO */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    height: 70px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 32px;
}

.brand-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.logo:hover {
    transform: translateY(-1px);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: var(--shadow-md);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: -2px;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.nav-tab i {
    font-size: 16px;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
}

.nav-tab.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--accent-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.user-avatar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.user-avatar:hover {
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

/* LAYOUT PRINCIPAL */
main {
    margin-top: 70px;
    padding: 32px 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 70px);
}

.page-header {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h1 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

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

/* DASHBOARD */
.dashboard-main {
    padding-top: 24px;
}

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

.date-range {
    background: var(--bg-tertiary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.refresh-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: var(--transition-fast);
}

.refresh-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.dashboard-grid {
    display: grid;
    gap: 24px;
}

/* KPIs MODERNOS */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card.revenue::before { background: linear-gradient(135deg, #22c55e, #16a34a); }
.kpi-card.appointments::before { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.kpi-card.clients::before { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.kpi-card.ticket::before { background: linear-gradient(135deg, #f59e0b, #d97706); }

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.kpi-card.revenue .kpi-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.kpi-card.appointments .kpi-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.kpi-card.clients .kpi-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.kpi-card.ticket .kpi-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.kpi-trend.positive { color: var(--success); }
.kpi-trend.negative { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-secondary); }

/* WIDGETS DO DASHBOARD */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.widget {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.widget-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.widget-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.widget-content {
    padding: 24px;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-fast);
}

.view-all:hover {
    text-decoration: underline;
}

/* CARDS MODERNOS */
.modern-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-normal);
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
}

.modern-card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.header-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* SUMMARY CARDS */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.summary-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.summary-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.summary-content {
    flex: 1;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.summary-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* CONTROLES MODERNOS */
.agenda-controls {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.controls-section {
    display: flex;
    align-items: end;
    gap: 20px;
    flex-wrap: wrap;
    flex: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.modern-select, .modern-input {
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
    outline: none;
}

.modern-select:focus, .modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modern-select:hover, .modern-input:hover {
    border-color: var(--border-medium);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* BOTÕES MODERNOS */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-success:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* AGENDA MODERNA */
.agenda-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.modern-agenda-grid {
    padding: 24px;
    display: grid;
    gap: 16px;
}

/* RELATÓRIOS */
.reports-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.report-filters .card-body {
    padding: 24px;
}

.reports-toolbar {
    display: flex;
    align-items: end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.reports-toolbar .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
}

.reports-toolbar label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.reports-toolbar select,
.reports-toolbar input {
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.reports-toolbar select:focus,
.reports-toolbar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chart-card {
    grid-column: span 2;
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 350px;
}

.modern-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.period-select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 12px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
}

/* TABELAS MODERNAS */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

.table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
}

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

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* FORMULÁRIOS MODERNOS */
.form-grid {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

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

.field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.field input,
.field select,
.field textarea {
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field input::placeholder {
    color: var(--text-muted);
}

/* NOTIFICAÇÕES */
#notification-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    font-weight: 600;
    animation: slideIn 0.3s ease-out;
}

.notification.success { border-left: 4px solid var(--success); }
.notification.error { border-left: 4px solid var(--danger); }
.notification.warning { border-left: 4px solid var(--warning); }

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

/* RESPONSIVIDADE */
@media (max-width: 1200px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
        gap: 16px;
    }
    
    .brand-name {
        font-size: 18px;
    }
    
    .nav-tabs {
        order: 3;
        width: 100%;
    }
    
    main {
        padding: 24px 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-title h1 {
        font-size: 24px;
    }
    
    .kpi-section {
        grid-template-columns: 1fr;
    }
    
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .control-group {
        min-width: auto;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
}

/* COMPONENTES DO DASHBOARD */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
}

.appointment-item:hover {
    background: var(--border-light);
}

.appointment-time {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.appointment-details {
    flex: 1;
}

.appointment-client {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.appointment-service {
    font-size: 13px;
    color: var(--text-secondary);
}

.appointment-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: capitalize;
}

.appointment-status.confirmado {
    background: var(--success-light);
    color: var(--success);
}

.appointment-status.pendente {
    background: var(--warning-light);
    color: var(--warning);
}

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

.service-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.service-info {
    flex: 1;
}

.service-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.service-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.service-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
}

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

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: right;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.activity-icon.agendamento { background: var(--info); }
.activity-icon.pagamento { background: var(--success); }
.activity-icon.cliente { background: var(--primary-color); }
.activity-icon.cancelamento { background: var(--danger); }

.activity-content {
    flex: 1;
}

.activity-description {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-size: 14px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* OCULTAR ABAS INATIVAS */
main {
    display: none;
}

main.active {
    display: block;
}

/* MODO ESCURO (OPCIONAL) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-light: #334155;
        --border-medium: #475569;
    }
}

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

/* BOTÕES GERAIS */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: 0;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .2s;
}

.btn-sm {
    padding: 8px 12px;
    font-size: .9rem;
}

.btn i {
    font-size: 1.2rem;
}

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

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(55, 65, 81, 0.3);
}

.btn-edit {
    background: #3b82f6;
    color: #fff;
}

.btn-del,
.btn-danger {
    background: var(--danger);
    color: #fff;
}

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

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

.btn-light {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

input:disabled,
input:read-only {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background-color: #e5e7eb;
}

/* CONTEÚDO PRINCIPAL */
main {
    display: none;
    padding: 110px 24px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

main.active {
    display: block;
}

/* LAYOUTS */
.grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1.5fr 1fr;
}

/* TOOLBARS E FORMULÁRIOS */
.toolbar,
.reports-toolbar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--white);
    border-radius: 14px;
    border: 1px solid var(--border);
}

.form-row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field,
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: .9rem;
}

select,
input {
    color: var(--text-dark);
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 1rem;
    width: 100%;
    transition: all .2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.2);
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.form-grid {
    display: grid;
    gap: 20px;
}

/* CARDS E TABELAS */
.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.card-body {
    padding: 20px;
}

.card-body-table {
    padding: 0;
    overflow-x: auto;
    max-height: 550px;
    overflow-y: auto;
}

table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    min-width: 700px;
}

table.table th {
    text-align: left;
    background: var(--bg-light);
    color: var(--text-light);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
}

table.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
    white-space: nowrap;
}

table.table td:first-child {
    white-space: normal;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--primary-light);
}

/* FILTROS DE CLIENTES */
.client-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.search-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}

.search-wrapper .bx-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.2rem;
}

#clientSearch {
    padding-left: 44px;
}

.client-filter-tabs {
    display: flex;
    gap: 4px;
    background-color: var(--background);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.filter-tab-btn {
    background: transparent;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s ease-in-out;
}

.filter-tab-btn.active {
    background: var(--white);
    color: var(--text-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

/* COMPONENTES */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 20px;
}

.kpi-label {
    color: var(--text-light);
    font-weight: 500;
    font-size: .9rem;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}


.modal-content {
    background: #fff;
    width: 95%;
    max-width: 520px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    transform: scale(0.95);
    transition: transform 0.2s ease-in-out;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

/* Modal-specific styles for blocking hours - V2 */
.block-hours-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    background-color: var(--bg-light);
    padding: 10px;
    border-radius: 8px;
}

.block-hours-controls .btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
}

.block-hours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.hour-toggle-btn {
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 8px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.hour-toggle-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hour-toggle-btn.selected {
    background-color: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.hour-toggle-btn:disabled {
    background-color: var(--bg-light);
    color: var(--text-light);
    text-decoration: line-through;
    cursor: not-allowed;
    border-style: dashed;
}


.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

.payments-total {
    padding: 16px 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    text-align: right;
    font-weight: 600;
}

.loading-row td,
.loading-row {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge.ativo {
    background: #ecfdf5;
    color: #047857;
}

.badge.inativo {
    background: #fef2f2;
    color: #b91c1c;
}

.badge.pausado {
    background: #fffbeb;
    color: #b45309;
}

#notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s forwards, fadeOut 0.3s 2.7s forwards;
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--danger);
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.hidden-block {
    display: none !important;
}

/* NOVA AGENDA VISUAL */
#agenda-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.timeslot {
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: stretch;
    min-height: 80px;
    transition: box-shadow 0.2s;
}

.timeslot:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.timeslot-time {
    background-color: var(--bg-light);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 12px 0 0 12px;
    flex: 0 0 100px;
}

.timeslot-content {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointment-card {
    background-color: var(--primary-light);
    border: 1px solid #e5d1d5;
    border-radius: 8px;
    padding: 10px 14px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.appointment-info strong {
    color: var(--secondary-color);
    font-size: 1rem;
}

.appointment-info span {
    font-size: .9rem;
    color: var(--text-light);
}

.timeslot-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    padding: 12px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeslot-empty:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.blocked-slot {
    background-color: #f8f9fa;
    color: var(--text-light);
}

.blocked-slot .timeslot-time {
    color: var(--text-light);
}

/* Custom Chart Legend */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
    /* row-gap column-gap */
    margin-top: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.legend-color-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}


/* ======================================= */
/* ESTILOS RESPONSIVOS                   */
/* ======================================= */

@media (max-width: 992px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    main {
        padding: 100px 16px 40px;
    }

    .toolbar,
    .reports-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .field,
    .reports-toolbar .field {
        width: 100%;
    }

    .client-list-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .card-body-table {
        overflow-x: hidden;
    }

    table.table {
        min-width: 100%;
        border: 0;
    }

    table.table thead {
        display: none;
    }

    table.table tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 16px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    tbody tr:hover {
        background: var(--white);
    }

    table.table td {
        display: block;
        text-align: right;
        font-size: .9rem;
        border-bottom: 1px dashed var(--border);
        position: relative;
        padding-left: 50%;
        white-space: normal;
    }

    table.table td:last-child {
        border-bottom: 0;
    }

    table.table td::before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: var(--text-dark);
    }

    table.table td[data-label="Ações"] .actions {
        justify-content: flex-end;
    }
}

@media (max-width: 600px) {
    nav {
        flex-direction: column;
        align-items: center;
    }

    main {
        padding-top: 150px;
    }

    .tabs-in-header {
        margin-top: 12px;
        width: 100%;
        justify-content: center;
    }

    .tab-btn {
        flex-grow: 1;
        justify-content: center;
    }

    .timeslot {
        flex-direction: column;
    }

    .timeslot-time {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        border-radius: 12px 12px 0 0;
        padding: 10px;
        flex-basis: auto;
    }

    .appointment-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .appointment-card .actions {
        margin-top: 8px;
    }

    .modal-content {
        width: 100%;
        margin: 16px;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

}



/* ================================
   Botão: Ir para Agendamentos
   ================================ */
#openBookingModal {
    --btn-bg-start: var(--gray-900, #111827);
    --btn-bg-end: var(--gray-700, #374151);
    --btn-border: var(--gray-900, #111827);
    --btn-focus: #60a5fa;
    /* azul do focus ring */

    display: inline-flex;
    align-items: center;
    gap: .55rem;

    padding: .78rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--btn-border);

    background: linear-gradient(135deg, var(--btn-bg-start), var(--btn-bg-end));
    color: #fff;
    font-weight: 700;
    letter-spacing: .2px;

    box-shadow: 0 6px 18px rgba(17, 24, 39, .18);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    cursor: pointer;
}

#openBookingModal i {
    font-size: 1.1em;
    line-height: 1;
    transition: transform .18s ease, opacity .18s ease;
    opacity: .95;
}

#openBookingModal:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(17, 24, 39, .22);
    filter: brightness(1.03);
}

#openBookingModal:hover i {
    transform: translateX(2px);
}

#openBookingModal:active {
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(17, 24, 39, .18);
    filter: brightness(.98);
}

#openBookingModal:focus-visible {
    outline: 3px solid var(--btn-focus);
    outline-offset: 2px;
}

/* Estado desabilitado opcional (se usar data-loading ou disabled) */
#openBookingModal[disabled],
#openBookingModal[aria-busy="true"],
#openBookingModal[data-loading="true"] {
    opacity: .7;
    cursor: not-allowed;
    filter: grayscale(.15);
}

/* Mobile: ocupa a largura toda no container */
@media (max-width: 560px) {
    #openBookingModal {
        width: 100%;
        justify-content: center;
    }
}



/* ===== BOTÕES LOGIN/LOGOUT ===== */
.btn-login {
    background: #111827;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.btn-login:hover {
    filter: brightness(1.05);
}

.btn-logout {
    background: #ef4444;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* utilitário opcional */
.w-100 {
    width: 100%;
}

/* ===== MODAL DE LOGIN ===== */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.auth-modal.is-open {
    display: flex;
}

.auth-modal__dialog {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 18px 20px;
    position: relative;
    animation: popIn .18s ease-out;
}

@keyframes popIn {
    from {
        transform: translateY(8px);
        opacity: .85;
    }

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

.auth-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.auth-modal__close:hover {
    background: #eef0f3;
}

.auth-modal__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.auth-modal__title {
    margin: 0;
    font-size: 1.25rem;
    color: #111827;
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-modal__sub {
    margin: 0;
    color: #6b7280;
    font-size: .95rem;
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.auth-form label {
    font-weight: 600;
    color: #1f2937;
    font-size: .95rem;
}

.auth-form input {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

.btn-primary {
    background: #111827;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.06);
}

.auth-error {
    min-height: 1.1em;
    color: #b91c1c;
    font-size: .92rem;
    margin-top: 2px;
}