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

:root {
    --purple: #5E00FF;
    --blue: #0086FF;
    --bg-primary: #F2F2F2;
    --bg-secondary: #FFFFFF;
    --bg-card: #FAFAFA;
    --text-primary: #0A0A0A;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #E5E5E5;
    --border-light: #F0F0F0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --sidebar-width: 260px;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
}

/* Ensure all elements are visible by default */
.metric-card,
.card,
.activity-item,
.quick-action {
    opacity: 1;
    visibility: visible;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    position: relative;
}

.nav-item svg {
    flex-shrink: 0;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.1), rgba(0, 134, 255, 0.1));
    color: var(--purple);
}

.badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    background: var(--purple);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
}

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

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
}

/* Top Bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.topbar-left h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}

.btn-icon.notification {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(94, 0, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(94, 0, 255, 0.3);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

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

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-header svg {
    color: var(--text-tertiary);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--danger);
}

.metric-change.neutral {
    color: var(--text-tertiary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

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

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.view-all {
    color: var(--purple);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--blue);
}

.time-filter {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
}

/* Chart */
.chart-container {
    height: 300px;
    position: relative;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.activity-item:hover {
    background: var(--bg-primary);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.1), rgba(0, 134, 255, 0.1));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple);
    flex-shrink: 0;
}

.activity-icon.urgent {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: 2.8em;
}

.activity-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.urgent-tag {
    color: var(--danger);
    font-weight: 500;
}

.activity-time {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

/* Usage Card - NEW DESIGN */
.usage-minutes-section {
    margin-bottom: 1.5rem;
}

.minutes-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.minutes-icon {
    color: var(--purple);
    flex-shrink: 0;
}

.minutes-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.minutes-main {
    margin-bottom: 0.75rem;
}

.minutes-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.minutes-total {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Large progress bar */
.usage-bar.large {
    height: 12px;
    background: var(--border-light);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.usage-bar.large .usage-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--blue));
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(94, 0, 255, 0.3);
}

/* When usage is high (>80%), change color to warning */
.usage-bar.large .usage-progress.high-usage {
    background: linear-gradient(90deg, #FF9900, #FF5500);
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.3);
}

/* Mini stats row */
.usage-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.mini-stat {
    text-align: center;
}

.mini-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
    display: block;
}

.mini-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Plan footer section */
.usage-plan-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.plan-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.1), rgba(0, 134, 255, 0.1));
    border: 1px solid rgba(94, 0, 255, 0.2);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--purple);
}

.plan-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Warning message */
.plan-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 153, 0, 0.05);
    border: 1px solid rgba(255, 153, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #FF9900;
}

.plan-warning svg {
    flex-shrink: 0;
    color: #FF9900;
}

/* Action buttons */
.plan-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-upgrade,
.btn-manage {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-upgrade {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(94, 0, 255, 0.2);
}

.btn-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 0, 255, 0.3);
}

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

.btn-manage:hover {
    background: var(--bg-primary);
    border-color: var(--purple);
    color: var(--purple);
}

/* Hide upgrade button for Pro users */
.usage-card.pro-plan .btn-upgrade {
    display: none;
}

.usage-card.pro-plan .btn-manage {
    flex: 1;
}

/* OLD STYLES - Keep for backward compatibility if needed */
.usage-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.usage-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.usage-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.usage-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.usage-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: 100px;
    overflow: hidden;
}

.usage-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--blue));
    border-radius: 100px;
    transition: width 1s ease;
}

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

.usage-remaining {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.usage-percentage {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.usage-plan {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-renewal {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* Outcomes Card */
.outcomes-chart {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.outcomes-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.booked {
    background: var(--purple);
}

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

.legend-dot.info {
    background: var(--text-tertiary);
}

.legend-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action:hover {
    background: var(--bg-secondary);
    border-color: var(--purple);
    transform: translateY(-2px);
}

.quick-action svg {
    color: var(--purple);
}

/* Responsive */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    /* New usage card responsive */
    .usage-mini-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .mini-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .mini-stat-label {
        margin-bottom: 0;
    }

    .plan-actions {
        flex-direction: column;
    }

    .btn-upgrade,
    .btn-manage {
        width: 100%;
    }
}