/* CompliantCare CRM - Shopify-Inspired Light Theme */

:root {
    /* Colors */
    --bg-main: #f6f6f7;
    --bg-white: #ffffff;
    --bg-sidebar: #1a1a1a;
    --bg-sidebar-hover: #2a2a2a;
    --text-dark: #1a1a1a;
    --text-secondary: #616161;
    --text-muted: #8c8c8c;
    --text-sidebar: #b5b5b5;
    --text-sidebar-active: #ffffff;
    --border: #e3e3e3;
    --border-light: #ebebeb;
    --green: #22c55e;
    --green-bg: #dcfce7;
    --blue: #2563eb;
    --blue-bg: #dbeafe;
    --orange: #f59e0b;
    --orange-bg: #fef3c7;
    --red: #ef4444;
    --red-bg: #fee2e2;
    --purple: #8b5cf6;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

.loader {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--text-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* App Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 14px;
    transition: all 0.15s;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-sidebar-active);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-section {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    color: var(--text-sidebar);
    margin-bottom: 4px;
}

.filter-group select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-sidebar-hover);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.filter-group select option {
    background: var(--bg-sidebar);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sidebar);
}

.filter-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--green);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-settings {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-sidebar);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-settings:hover {
    background: var(--bg-sidebar-hover);
    color: white;
}

/* Main Content */
.main {
    flex: 1;
    margin-left: 220px;
    padding: 24px 32px;
    min-height: 100vh;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.view-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    min-width: 240px;
}

.search-box svg {
    color: var(--text-muted);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--text-dark);
}

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

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-dark);
}

.btn:hover {
    background: var(--bg-main);
}

.btn-primary {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
}

.btn-primary:hover {
    background: #333;
}

.btn-icon {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Stats Row - New Layout */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card-fixed {
    width: 200px;
    flex-shrink: 0;
}

.stats-ratings {
    flex: 1;
    display: flex;
    gap: 12px;
}

.stat-card-rating {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* Legacy stats-grid for backwards compatibility */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}

.stat-value.green {
    color: var(--green);
}

.stat-value.blue {
    color: var(--blue);
}

.stat-chart {
    height: 24px;
    margin-top: 12px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
}

/* Cards */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.link {
    color: var(--blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.card-body {
    padding: 20px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.charts-grid .card {
    margin-bottom: 0;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 60px;
    align-items: center;
    gap: 16px;
}

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

.bar-track {
    height: 8px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out;
    width: 0;
}

.bar-fill.green {
    background: var(--green);
}

.bar-fill.blue {
    background: var(--blue);
}

.bar-fill.orange {
    background: var(--orange);
}

.bar-fill.red {
    background: var(--red);
}

.bar-value {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

/* Regions List */
.regions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.region-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.region-name {
    font-size: 14px;
}

.region-bar {
    flex: 1;
    margin: 0 16px;
    height: 6px;
    background: var(--bg-main);
    border-radius: 3px;
    overflow: hidden;
}

.region-fill {
    height: 100%;
    background: var(--purple);
    border-radius: 3px;
}

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

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-main);
}

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

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

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

/* Status column width - ensure badges don't wrap */
.data-table.full th:nth-child(3),
.data-table.full td:nth-child(3) {
    min-width: 160px;
}

.data-table.full th:first-child,
.data-table.full td:first-child {
    width: 40px;
}

.facility-name {
    font-weight: 500;
}

.facility-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge.outstanding {
    background: var(--green-bg);
    color: #15803d;
}

.badge.good {
    background: var(--blue-bg);
    color: #1d4ed8;
}

.badge.requires {
    background: var(--orange-bg);
    color: #b45309;
}

.badge.inadequate {
    background: var(--red-bg);
    color: #dc2626;
}

.badge.draft {
    background: var(--bg-main);
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-main);
    padding: 4px;
    border-radius: var(--radius);
}

.tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover {
    color: var(--text-dark);
}

.tab.active {
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: var(--shadow);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-main);
    border-color: var(--text-dark);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination span {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 12px;
}

/* Map */
.map-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: calc(100vh - 160px);
}

#map {
    width: 100%;
    height: 100%;
}

.view-header.compact {
    margin-bottom: 16px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    margin-left: 12px;
}

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

.dot.blue {
    background: var(--blue);
}

.dot.orange {
    background: var(--orange);
}

.dot.red {
    background: var(--red);
}

/* Analytics - Enhanced Dashboard */
.analytics-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-select {
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    min-width: 160px;
}

.toggle-group {
    display: flex;
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 4px;
}

.toggle-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-btn:hover {
    color: var(--text-dark);
}

.toggle-btn.active {
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: var(--shadow);
}

/* Analytics Stats Row */
.analytics-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    transition: all 0.2s;
}

.analytics-stat-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.green {
    background: var(--green-bg);
    color: var(--green);
}

.stat-icon.blue {
    background: var(--blue-bg);
    color: var(--blue);
}

.stat-icon.orange {
    background: var(--orange-bg);
    color: var(--orange);
}

.stat-icon.red {
    background: var(--red-bg);
    color: var(--red);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.stat-pct {
    font-size: 14px;
    font-weight: 600;
}

.stat-pct.green {
    color: var(--green);
}

.stat-pct.blue {
    color: var(--blue);
}

.stat-pct.orange {
    color: var(--orange);
}

.stat-pct.red {
    color: var(--red);
}

/* Analytics Grid */
.analytics-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.analytics-card {
    margin-bottom: 0;
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chart Containers */
.chart-container {
    position: relative;
}

.donut-container {
    max-width: 240px;
    margin: 0 auto 20px;
}

.bar-container {
    height: 300px;
}

.wide-bar-container {
    height: 250px;
}

/* Chart View Toggle */
.chart-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-main);
    padding: 3px;
    border-radius: 6px;
}

.view-btn {
    padding: 5px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.view-btn.active {
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Chart Legend */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding-top: 8px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: opacity 0.2s;
}

.chart-legend-item:hover {
    opacity: 0.8;
}

.chart-legend-item.inactive {
    opacity: 0.4;
}

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

/* Donut Legend Row Style (matching image 2) */
.donut-legend-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
    padding: 12px 8px 4px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.donut-legend-item .legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.donut-legend-item .legend-label {
    color: var(--text-dark);
    font-weight: 500;
}

.donut-legend-item .legend-value {
    color: var(--text-secondary);
}

/* Regional Breakdown Bars (matching image 1) */
.regional-breakdown-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
    max-height: 360px;
    overflow-y: auto;
}

.regional-bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: background 0.15s;
    padding: 4px 8px;
    margin: 0 -8px;
    border-radius: 6px;
}

.regional-bar-row:hover {
    background: var(--bg-main);
}

.region-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-bar-track {
    display: flex;
    height: 20px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.region-bar-segment {
    height: 100%;
    min-width: 0;
    transition: width 0.3s ease;
}

.region-bar-segment.outstanding {
    background: #22c55e;
}

.region-bar-segment.good {
    background: #3b82f6;
}

.region-bar-segment.requires {
    background: #f59e0b;
}

.region-bar-segment.inadequate {
    background: #ef4444;
}

.region-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
}

/* Heat Map */
.heatmap-container {
    position: relative;
    min-height: 320px;
}

.heatmap-legend {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.legend-gradient {
    width: 100px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #f3f4f6, #22c55e);
}

/* Heatmap Grid */
.heatmap-grid {
    position: relative;
    width: 100%;
    height: 280px;
}

.heatmap-region {
    position: absolute;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.heatmap-region:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.heatmap-label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    text-align: center;
    pointer-events: none;
}

/* Regional Bars */
.regional-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
}

.regional-bars::-webkit-scrollbar {
    width: 4px;
}

.regional-bars::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 2px;
}

.regional-bars::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.regional-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.regional-bar-item:hover {
    background: var(--bg-main);
}

.region-bar-name {
    width: 140px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.region-bar-segment {
    height: 100%;
    transition: width 0.6s ease-out;
}

.region-bar-segment.outstanding {
    background: var(--green);
}

.region-bar-segment.good {
    background: var(--blue);
}

.region-bar-segment.requires {
    background: var(--orange);
}

.region-bar-segment.inadequate {
    background: var(--red);
}

.region-bar-count {
    width: 60px;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
}

/* Rating Toggles */
.rating-toggles {
    display: flex;
    gap: 8px;
}

.rating-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.rating-toggle:hover {
    border-color: var(--toggle-color, var(--text-muted));
}

.rating-toggle.active {
    background: var(--bg-white);
    border-color: var(--toggle-color, var(--text-dark));
    color: var(--text-dark);
}

.toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--toggle-color);
    opacity: 0.4;
    transition: opacity 0.2s;
}

.rating-toggle.active .toggle-dot {
    opacity: 1;
}

/* Providers Table */
.providers-table {
    max-height: 280px;
    overflow-y: auto;
}

.provider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.provider-row:hover {
    background: var(--bg-main);
    margin: 0 -20px;
    padding: 10px 20px;
}

.provider-row:last-child {
    border-bottom: none;
}

.provider-rank {
    width: 24px;
    height: 24px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.provider-info {
    flex: 1;
    min-width: 0;
}

.provider-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.provider-bar {
    width: 120px;
    height: 6px;
    background: var(--bg-main);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}

.provider-bar-segment {
    height: 100%;
}

/* Type Comparison */
.type-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.type-column {
    flex: 1;
    text-align: center;
}

.type-chart-container {
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
}

.type-column h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.type-total {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
}

.type-divider {
    width: 1px;
    height: 160px;
    background: var(--border);
}

/* Sort Button */
.sort-btn {
    padding: 6px;
    transition: transform 0.2s;
}

.sort-btn.desc {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 1200px) {
    .analytics-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-grid-2 {
        grid-template-columns: 1fr;
    }

    .rating-toggles {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .analytics-stats-row {
        grid-template-columns: 1fr;
    }
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.detail-panel.active {
    right: 0;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-white);
}

.detail-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    background: var(--bg-main);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.btn-close:hover {
    background: var(--border);
    color: var(--text-dark);
}

.detail-body {
    padding: 24px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.detail-section p {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--text-dark);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
}

.detail-link:hover {
    background: #333;
}

/* Detail Chips - Pill Style Tags */
.detail-chip {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-chip.provider-chip {
    background: var(--purple);
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: transparent;
}

/* Detail Mini Map */
.detail-mini-map {
    width: 100%;
    height: 140px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-main);
}

.mini-map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
}

.mini-map-placeholder span {
    font-size: 24px;
    opacity: 0.5;
}

.mini-map-placeholder p {
    font-size: 12px;
    margin: 0;
}

/* Leaflet Custom Styles */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.popup-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

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

/* Settings Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 440px;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

/* Settings Items */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.setting-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.setting-info-panel {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--blue-bg);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--blue);
    line-height: 1.4;
}

.setting-info-panel svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--green);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Responsive */
@media (max-width: 1200px) {

    .charts-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main {
        margin-left: 0;
        padding: 16px;
    }

    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* ===== PROVIDERS PAGE ===== */

/* Provider Filter Select */
.provider-filter-select {
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    min-width: 160px;
}

.provider-filter-select:focus {
    outline: none;
    border-color: var(--text-dark);
}

/* Multi-Select Dropdown */
.multi-select-dropdown {
    position: relative;
    display: inline-block;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    min-width: 160px;
    transition: all 0.15s;
}

.multi-select-trigger:hover {
    border-color: var(--text-muted);
}

.multi-select-trigger svg {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.multi-select-dropdown.open .multi-select-trigger svg {
    transform: rotate(180deg);
}

.multi-select-label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.multi-select-dropdown.open .multi-select-menu {
    display: block;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.1s;
}

.multi-select-item:hover {
    background: var(--bg-main);
}

.multi-select-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--purple);
    cursor: pointer;
}

/* Providers Grid */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

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

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

/* Provider Card */
.provider-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.provider-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

.provider-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    max-width: 200px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.provider-card-badge {
    background: var(--purple);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.provider-card-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.provider-stat-item {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    background: var(--bg-main);
    border-radius: 8px;
}

.provider-stat-value {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.provider-stat-value.green {
    color: var(--green);
}

.provider-stat-value.blue {
    color: var(--blue);
}

.provider-stat-value.orange {
    color: var(--orange);
}

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

.provider-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.provider-card-rating-bar {
    height: 6px;
    background: var(--bg-main);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    margin-bottom: 16px;
}

.provider-rating-segment {
    height: 100%;
    transition: width 0.4s ease-out;
}

.provider-rating-segment.outstanding {
    background: var(--green);
}

.provider-rating-segment.good {
    background: var(--blue);
}

.provider-rating-segment.requires {
    background: var(--orange);
}

.provider-rating-segment.inadequate {
    background: var(--red);
}

.provider-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.provider-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.provider-view-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--blue);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.provider-view-btn:hover {
    text-decoration: underline;
}

.provider-view-btn svg {
    width: 14px;
    height: 14px;
}

/* Empty State */
.providers-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.providers-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.providers-empty p {
    font-size: 15px;
}

/* ===== PROVIDER DETAIL MODAL ===== */

.provider-modal-overlay {
    z-index: 9100;
}

.provider-detail-modal {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.provider-modal-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.provider-modal-title h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

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

.provider-modal-body {
    padding: 0;
    overflow: hidden;
    flex: 1;
}

.provider-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    max-height: calc(90vh - 80px);
}

@media (max-width: 768px) {
    .provider-modal-content {
        grid-template-columns: 1fr;
    }
}

.provider-modal-left {
    padding: 20px 24px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    max-height: calc(90vh - 80px);
}

.provider-modal-right {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.provider-modal-left h4,
.provider-modal-right h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
}

/* Provider Stats Summary */
.provider-stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.provider-summary-stat {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-main);
    border-radius: 8px;
}

.provider-summary-stat .value {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

.provider-summary-stat .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

/* Toggleable filter styles for provider stats */
.provider-summary-stat.filter-toggle {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
}

.provider-summary-stat.filter-toggle:hover {
    background: var(--bg-white);
    border-color: var(--border);
    transform: translateY(-1px);
}

.provider-summary-stat.filter-toggle.active {
    border-color: var(--text-dark);
    background: var(--bg-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.provider-summary-stat.filter-toggle[data-rating="Outstanding"].active {
    border-color: var(--green);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.provider-summary-stat.filter-toggle[data-rating="Good"].active {
    border-color: var(--blue);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.provider-summary-stat.filter-toggle[data-rating="Requires improvement"].active {
    border-color: var(--orange);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.provider-summary-stat.filter-toggle[data-rating="Inadequate"].active {
    border-color: var(--red);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

/* Empty state for filtered properties */
.provider-properties-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Provider Enrichment Section */
.provider-enrichment-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.btn-website,
.btn-companies-house {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-website {
    background: var(--green-bg);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-website:hover {
    background: #bbf7d0;
    border-color: var(--green);
}

.btn-companies-house {
    background: var(--blue-bg);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.btn-companies-house:hover {
    background: #bfdbfe;
    border-color: var(--blue);
}

/* Directors Section */
/* Company Info in Provider Modal */
.provider-company-info {
    margin-top: 8px;
}

.company-info-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.company-info-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.company-info-item strong {
    color: var(--text-muted);
    font-weight: 500;
}

.company-info-divider {
    color: var(--border);
    margin: 0 4px;
}

.provider-directors-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.provider-directors-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.provider-directors-section h4 svg {
    color: var(--text-muted);
}

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

.director-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--bg-main);
    border-radius: 8px;
}

.director-rank {
    width: 24px;
    height: 24px;
    background: var(--text-dark);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.director-avatar {
    width: 32px;
    height: 32px;
    background: var(--purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.director-info {
    flex: 1;
    min-width: 0;
}

.director-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-dark);
}

.director-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Director Contact Info */
.director-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.director-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.director-contact-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.contact-value {
    font-family: 'Inter', sans-serif;
}

.contact-blurred {
    filter: blur(4px);
    user-select: none;
    color: var(--text-muted);
}

.contact-found {
    color: var(--text-dark);
    font-weight: 500;
}

.contact-not-found {
    color: var(--text-muted);
    font-style: italic;
}

/* Director Find Button */
.director-find-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--text-dark);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.director-find-btn:hover {
    background: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.director-find-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.director-find-btn svg {
    color: #fbbf24;
}

.director-find-btn .btn-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Find Directors Button */
.btn-find-directors {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--text-dark);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-find-directors:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-find-directors:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-find-directors .btn-icon-svg {
    flex-shrink: 0;
}

.btn-find-directors .btn-spinner {
    display: flex;
    align-items: center;
}

.btn-find-directors .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Properties List */
.provider-properties-section {
    flex: 1;
}

.provider-properties-list {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.provider-property-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.provider-property-item:last-child {
    border-bottom: none;
}

.provider-property-item:hover {
    background: var(--bg-main);
}

.provider-property-info {
    flex: 1;
    min-width: 0;
}

.provider-property-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.provider-property-location {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.provider-property-badge {
    flex-shrink: 0;
}

/* Mini Map */
.provider-mini-map {
    flex: 1;
    min-height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.provider-mini-map .leaflet-container {
    height: 100%;
    width: 100%;
}

/* Scrollbar for properties list */
.provider-properties-list::-webkit-scrollbar {
    width: 6px;
}

.provider-properties-list::-webkit-scrollbar-track {
    background: var(--bg-main);
}

.provider-properties-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.provider-properties-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0 24px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.section-divider::before {
    max-width: 40px;
}

/* ===== HOMEPAGE ANALYTICS ===== */
.home-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

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

/* ===== LOGIN PAGE ===== */
.login-page {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo svg {
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.15s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--text-dark);
    background: var(--bg-white);
}

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

.btn-login {
    width: 100%;
    padding: 14px 20px;
    background: var(--text-dark);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-signup {
    width: 100%;
    padding: 12px 20px;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-signup:hover {
    background: var(--bg-main);
    border-color: var(--text-muted);
}

.btn-signup:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-error {
    display: none;
    background: var(--red-bg);
    color: var(--red);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-error:not(:empty) {
    display: block;
}

/* ===== USER SECTION IN SIDEBAR ===== */
.user-section {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--red);
}