/* --- GERAL E VARIÁVEIS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #F7F8FA;
    --bg-card: #FFFFFF;
    --text-primary: #0A0A18;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --accent-primary: #4F46E5;
    --accent-secondary: #F3F4F6;
    --font-family: 'Inter', sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --sidebar-width: 250px;
    --header-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: var(--bg-main); color: var(--text-primary); line-height: 1.5; display: flex; }

/* --- LAYOUT PRINCIPAL (SIDEBAR + CONTEÚDO) --- */
.sidebar { width: var(--sidebar-width); height: 100vh; background-color: var(--bg-card); border-right: 1px solid var(--border-color); position: fixed; top: 0; left: 0; display: flex; flex-direction: column; z-index: 102; transition: transform 0.3s ease; }
.main-container { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); transition: margin-left 0.3s ease; }

.sidebar-header { height: var(--header-height); display: flex; align-items: center; padding: 0 24px; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--border-color); }
.sidebar-nav { flex-grow: 1; padding: 16px 0; }
.sidebar-nav-group-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; padding: 8px 24px; margin-top: 16px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-primary); padding: 8px 24px; font-size: 14px; font-weight: 500; }
.sidebar-nav a .icon { width: 20px; height: 20px; stroke: var(--text-secondary); stroke-width: 1.8; }
.sidebar-nav a.active, .sidebar-nav a:hover { background-color: var(--bg-main); font-weight: 600; }
.sidebar-nav a.active .icon { stroke: var(--accent-primary); }

.main-header { height: var(--header-height); background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.search-bar { display: flex; align-items: center; gap: 8px; }
.search-bar .icon { color: var(--text-secondary); }
.search-bar input { background: none; border: none; outline: none; font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions .icon { color: var(--text-primary); cursor: pointer; }
.btn { background-color: var(--accent-primary); color: white; border: none; border-radius: var(--radius-md); padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.btn .icon { width: 16px; height: 16px; }

.page-content { padding: 32px; }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.card { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }

/* --- COMPONENTES DO DASHBOARD --- */
.dashboard-section { margin-bottom: 32px; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.kpi-card h4 { font-size: 14px; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.kpi-card .value { font-size: 24px; font-weight: 600; }
.kpi-card .sub-value { font-size: 14px; color: var(--text-secondary); }
.kpi-card .details-link { font-size: 14px; color: var(--accent-primary); text-decoration: none; font-weight: 500; }
.chart-container-large { height: 100px; }
.notification-card { background-color: var(--accent-secondary); border: none; box-shadow: none; }

.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.overview-card h4 { font-size: 14px; font-weight: 500; }
.overview-card .value { font-size: 20px; font-weight: 600; }
.chart-container-small { height: 40px; margin-top: 16px; }
.empty-state { border: 1px dashed var(--border-color); background-color: var(--bg-main); text-align: center; color: var(--text-secondary); font-size: 14px; padding: 40px 24px; border-radius: var(--radius-md); }
.top-clients-list { list-style: none; }
.top-clients-list li { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }

/* --- COMPONENTES DA PÁGINA DE CLIENTES --- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.tabs button { background: none; border: none; padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--text-primary); border-bottom-color: var(--accent-primary); }
.filters-and-actions { display: flex; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 16px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pills button { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 99px; padding: 6px 12px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.table-actions button { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 6px 12px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.clients-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.clients-table th, .clients-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.clients-table th { color: var(--text-secondary); font-weight: 500; background-color: var(--bg-main); }
.clients-table td .tag { background-color: var(--accent-secondary); color: var(--text-secondary); font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; }

/* --- RESPONSIVIDADE --- */
.mobile-header { display: none; }
.mobile-overlay { display: none; }
@media (max-width: 768px) {
    body { display: block; padding-top: var(--header-height); }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-container { margin-left: 0; width: 100%; }
    .main-header { display: none; }
    .page-content { padding: 16px; }
    .page-title { font-size: 24px; }
    .mobile-header { display: flex; position: fixed; top: 0; left: 0; width: 100%; background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); align-items: center; justify-content: space-between; padding: 0 16px; z-index: 101; }
    .mobile-header button, .mobile-header .icon { cursor: pointer; color: var(--text-primary); background: none; border: none; }
    .mobile-overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 100; opacity: 0; visibility: hidden; transition: opacity 0.3s; }
    .mobile-overlay.visible { opacity: 1; visibility: visible; }
    .kpi-grid, .overview-grid { grid-template-columns: 1fr; }
    .filters-and-actions { flex-direction: column; gap: 16px; }
    .clients-table thead { display: none; }
    .clients-table tr, .clients-table td { display: block; width: 100%; }
    .clients-table tr { border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 16px; padding: 8px; }
    .clients-table td { border: none; padding: 8px; display: flex; justify-content: space-between; align-items: center; }
    .clients-table td:before { content: attr(data-label); font-weight: 500; color: var(--text-secondary); }
}

/* ... Cole aqui o conteúdo completo do CSS da resposta anterior ... */
/* A única adição é o estilo para o toggle-switch e action-icon */

.header-actions .toggle-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}
.header-actions .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.header-actions .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.header-actions .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.header-actions input:checked + .slider {
    background-color: var(--accent-primary);
}
.header-actions input:checked + .slider:before {
    transform: translateX(14px);
}
.header-actions .action-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px;
}
.header-actions .action-icon:hover {
    color: var(--accent-primary);
}