/* Google Ad Manager / Cloud Style - Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #1a73e8;
    /* Google Blue */
    --kpi-text: #202124;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #e0e0e0;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-text: #5f6368;
    --sidebar-active-bg: #e8f0fe;
    --sidebar-active-text: #1967d2;
    --hover-bg: #f1f3f4;
    --shadow-card: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    /* Sidebar Layout */
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 256px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header svg {
    margin-right: 10px;
    color: var(--primary-color);
}

.nav-links {
    padding: 1rem 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 48px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background-color 0.2s;
}

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

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

.nav-item svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

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

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header/Toolbar */
.top-bar {
    height: 64px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
}

.breadcrumb {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 400;
}

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

.badge {
    padding: 4px 12px;
    border-radius: 4px;
    background-color: #e8eaed;
    color: #3c4043;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Material Button */
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    /* Standard Material */
    padding: 0 24px;
    height: 36px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
    transition: box-shadow 0.2s, background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1765cc;
    box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn-primary:disabled {
    background-color: #dadce0;
    color: #fff;
    box-shadow: none;
    cursor: default;
}

/* Scrollable Content Area */
/* Scrollable Content Area */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    /* No border in material usually, just shadow */
}

.card h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* KPI Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    padding: 12px;
    margin-bottom: 0;
}

.metric-card h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.metric-card .value {
    font-size: 1.4rem;
    font-weight: 400;
    /* Thin look like Ad Manager */
    color: var(--kpi-text);
}

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

.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

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

/* Views Logic */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

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

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

/* Progress */
#progress-section {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 12px 24px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-bar-container {
    flex: 1;
    height: 4px;
    background: #d2e3fc;
    margin: 0 16px;
    border-radius: 2px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

.hidden {
    display: none !important;
}

/* Logs */
.logs-container {
    background: #f1f3f4;
    border: 1px solid #e0e0e0;
    padding: 16px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #3c4043;
    border-radius: 4px;
}

/* Heatmap Table */
.heatmap-table {
    font-size: 0.75rem;
    border-collapse: collapse;
}

.heatmap-table th,
.heatmap-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    min-width: 70px;
}

.heatmap-table thead th {
    background: var(--bg-color);
    font-weight: 500;
    font-size: 0.7rem;
}

.heatmap-table tbody th {
    text-align: left;
    background: var(--bg-color);
    font-weight: 500;
}

.heatmap-cell {
    color: #fff;
    font-weight: 500;
    border-radius: 2px;
}

/* Funnel Chart colors */
.funnel-label {
    font-weight: 500;
    color: var(--text-primary);
}

/* ========== INSIGHTS PANEL ========== */
.insights-panel {
    background: var(--card-bg);
}

.insight-box {
    background: rgba(var(--text-primary-rgb, 0, 0, 0), 0.02);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s ease;
}

.insight-box:hover {
    background: rgba(var(--text-primary-rgb, 0, 0, 0), 0.04);
}

.insight-box.critical {
    border-left-color: #e53935;
    background: rgba(229, 57, 53, 0.04);
}

.insight-box.high {
    border-left-color: #fb8c00;
    background: rgba(251, 140, 0, 0.04);
}

.insight-box.medium {
    border-left-color: #1e88e5;
    background: rgba(30, 136, 229, 0.04);
}

.insight-box.info {
    border-left-color: #43a047;
    background: rgba(67, 160, 71, 0.04);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.insight-severity {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 8px;
    border-radius: 4px;
}

.insight-severity.critical {
    color: #e53935;
    background: rgba(229, 57, 53, 0.12);
}

.insight-severity.high {
    color: #fb8c00;
    background: rgba(251, 140, 0, 0.12);
}

.insight-severity.medium {
    color: #1e88e5;
    background: rgba(30, 136, 229, 0.12);
}

.insight-severity.info {
    color: #43a047;
    background: rgba(67, 160, 71, 0.12);
}

.insight-category {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.insight-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.insight-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.insight-summary-badge.critical {
    background: rgba(229, 57, 53, 0.12);
    color: #e53935;
}

.insight-summary-badge.high {
    background: rgba(251, 140, 0, 0.12);
    color: #fb8c00;
}

.insight-summary-badge.medium {
    background: rgba(30, 136, 229, 0.12);
    color: #1e88e5;
}

.insight-summary-badge.info {
    background: rgba(67, 160, 71, 0.12);
    color: #43a047;
}

.no-insights {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

.no-insights svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}