/* Vitronia ESG Portal — Shared CSS
   Prefix: esg- for portal-specific styles
*/

:root {
    --primary: #5B4B8A;
    --primary-light: #7B6BA8;
    --primary-dark: #4A3B7A;
    --accent: #6B46C1;
    --accent-light: #f0ecff;
    --danger: #CC0000;
    --danger-light: #fce4e4;
    --warning: #856404;
    --warning-light: #fff3cd;
    --bg: #f8f7fc;
    --card-bg: #ffffff;
    --text: #333;
    --text-muted: #808080;
    --border: #ddd;
    --radius: 8px;
}

/* ---- Dark mode ---- */
:root[data-theme="dark"] {
    --primary: #b8a8e0;
    --primary-light: #8a7ab8;
    --primary-dark: #6B5BA0;
    --accent: #9B7AE8;
    --accent-light: #2a2040;
    --danger: #ff6b6b;
    --danger-light: #3d1a1a;
    --warning: #ffc107;
    --warning-light: #3d3000;
    --bg: #1a1d23;
    --card-bg: #23272e;
    --text: #e0e0e0;
    --text-muted: #999;
    --border: #3a3e47;
    --radius: 8px;
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--text); }
:root[data-theme="dark"] a { color: var(--accent); }
:root[data-theme="dark"] .esg-nav { background: #16191f; }
:root[data-theme="dark"] .esg-table th { background: #2a2f38; }
:root[data-theme="dark"] .esg-table tr:hover { background: #2a2f38; }
:root[data-theme="dark"] .esg-table tbody tr:hover { background: #2a2f38; }
:root[data-theme="dark"] select, :root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] input[type="text"], :root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] textarea { background: #2a2f38; color: var(--text); border-color: var(--border); }
:root[data-theme="dark"] .login-card { background: var(--card-bg); }
:root[data-theme="dark"] .pin-input { background: #2a2f38; color: var(--text); border-color: var(--border); }
:root[data-theme="dark"] .methodology { background: #2a2f38; }
:root[data-theme="dark"] .healthcare-note { background: #1a3a24; color: #81c784; }
:root[data-theme="dark"] .esg-completeness { background: #2a2f38; }
:root[data-theme="dark"] .esg-upload-zone { background: #2a2f38; border-color: var(--border); }
:root[data-theme="dark"] .ai-callout { background: linear-gradient(135deg, #2a1f36 0%, #1e2233 100%); }
:root[data-theme="dark"] .edit-modal { background: var(--card-bg); }
:root[data-theme="dark"] .edit-overlay { background: rgba(0,0,0,0.6); }
:root[data-theme="dark"] .section-nav { background: var(--card-bg); border-color: var(--border); }
:root[data-theme="dark"] .action-bar { background: var(--card-bg); }
:root[data-theme="dark"] .esg-progress { background: #3a3e47; }
:root[data-theme="dark"] .s3-bar-track { background: #3a3e47; }
:root[data-theme="dark"] .coverage-bar-container { background: #3a3e47; }
:root[data-theme="dark"] .esg-alert-info { background: #1a2438; border-left-color: #4a90d9; }
:root[data-theme="dark"] .esg-alert-warning { background: var(--warning-light); border-left-color: var(--warning); }
:root[data-theme="dark"] .esg-alert-error { background: var(--danger-light); border-left-color: var(--danger); }
:root[data-theme="dark"] .esg-alert-success { background: var(--accent-light); border-left-color: var(--accent); }
:root[data-theme="dark"] .cat-environment { background: rgba(46,125,50,0.08); }
:root[data-theme="dark"] .cat-social { background: rgba(100,150,220,0.08); }
:root[data-theme="dark"] .cat-governance { background: rgba(150,80,200,0.08); }
:root[data-theme="dark"] .cat-climate { background: rgba(230,130,60,0.08); }
:root[data-theme="dark"] .cat-other { background: rgba(255,255,255,0.03); }
:root[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #2a2f38 25%, #3a3e47 50%, #2a2f38 75%); background-size: 200% 100%; }
:root[data-theme="dark"] .donut-total { color: var(--text); }
:root[data-theme="dark"] .fund-deadline { background: var(--warning-light); border-color: #665200; }

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Navigation ---- */
.esg-nav {
    background: var(--primary);
    color: white;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.esg-nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    margin-right: 2rem;
}
.esg-nav-brand:hover { text-decoration: none; }
.esg-nav-links {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}
.esg-nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}
.esg-nav-link:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
.esg-nav-link.active { color: white; background: rgba(255,255,255,0.15); }
.esg-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.esg-nav-company {
    font-size: 0.8rem;
    opacity: 0.8;
}
.esg-nav-company select {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
}
.esg-nav-logout {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
}
.esg-nav-logout:hover { color: white; border-color: rgba(255,255,255,0.6); text-decoration: none; }

/* ---- Container ---- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ---- Cards ---- */
.esg-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.esg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.esg-card-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
}

/* ---- KPI Grid ---- */
.esg-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.esg-kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
}
.esg-kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.esg-kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}
.esg-kpi-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ---- Tables ---- */
.esg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.esg-table th {
    background: var(--primary);
    color: white;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}
.esg-table th:first-child { border-radius: var(--radius) 0 0 0; }
.esg-table th:last-child { border-radius: 0 var(--radius) 0 0; }
.esg-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.esg-table tr:hover { background: #f8f9fc; }
.esg-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.esg-table .num-bold { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Forms ---- */
.form-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; font-size: 0.9rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

select, input[type="password"], input[type="text"], input[type="number"], input[type="email"], input[type="date"], textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: white;
    font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-accent { background: var(--accent); color: white; border-color: var(--accent); }
.btn-accent:hover { filter: brightness(1.1); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-lg { padding: 0.7rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; gap: 0.5rem; align-items: center; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-ok { background: var(--accent-light); color: #1b5e20; }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-critical { background: var(--danger-light); color: var(--danger); }
.badge-info { background: #e3f2fd; color: #0d47a1; }
.badge-draft { background: #f5f5f5; color: #666; }

/* ---- Progress bar ---- */
.esg-progress {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}
.esg-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.esg-progress-bar.ok { background: var(--accent); }
.esg-progress-bar.warning { background: #ffc107; }
.esg-progress-bar.critical { background: var(--danger); }

/* ---- Upload area ---- */
.esg-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfd;
}
.esg-upload-zone:hover, .esg-upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.esg-upload-zone h3 { margin: 0 0 0.5rem; color: var(--primary); }
.esg-upload-zone p { margin: 0; color: var(--text-muted); font-size: 0.85rem; }

/* ---- Tabs ---- */
.esg-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}
.esg-tab {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}
.esg-tab:hover { color: var(--primary); }
.esg-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.esg-tab-content { display: none; }
.esg-tab-content.active { display: block; }

/* ---- Delta indicators ---- */
.delta-pos { color: var(--accent); }
.delta-neg { color: var(--danger); }
.delta-flat { color: var(--text-muted); }
.delta-pos::before { content: "+"; }

/* ---- Completeness panel ---- */
.esg-completeness {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fc;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.esg-completeness-pct {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
}
.esg-completeness-details { flex: 1; }
.esg-completeness-label { font-size: 0.8rem; color: var(--text-muted); }
.esg-completeness-bar { flex: 1; max-width: 300px; }

/* ---- Alerts ---- */
.esg-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.esg-alert-info { background: #e3f2fd; border-left: 4px solid #1976d2; }
.esg-alert-warning { background: var(--warning-light); border-left: 4px solid #ffc107; }
.esg-alert-error { background: var(--danger-light); border-left: 4px solid var(--danger); }
.esg-alert-success { background: var(--accent-light); border-left: 4px solid var(--accent); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .esg-kpi-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .ghg-visual { flex-wrap: wrap; justify-content: center; }
    .s3-bar-name { width: 140px; font-size: 0.75rem; }
}
@media (max-width: 768px) {
    .esg-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .form-row { flex-direction: column; }
    .esg-nav-links { display: none; }
    .container { padding: 1rem; }
    .ghg-visual { flex-direction: column; align-items: center; gap: 1rem; }
    .scope-legend { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
    .edit-modal { min-width: unset; width: calc(100vw - 2rem); max-width: 500px; }
    .s3-bar-name { width: 100px; font-size: 0.7rem; }
    .action-bar { gap: 0.35rem; padding: 0.5rem; }
    .action-bar .btn { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
    .section-nav { padding: 0 0.25rem; }
    .section-nav-link { padding: 0.5rem 0.5rem; font-size: 0.7rem; }
    .esg-table { font-size: 0.78rem; }
    .esg-table th, .esg-table td { padding: 0.4rem 0.5rem; }
    .baseline-table td, .baseline-table th { padding: 0.35rem 0.5rem; }
}
@media (max-width: 480px) {
    .esg-kpi-grid { grid-template-columns: 1fr !important; }
    .esg-kpi-value { font-size: 1.4rem; }
    h1 { font-size: 1.3rem; }
}

/* ---- Page-specific: Login ---- */
.login-container {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.login-card h2 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1.25rem; }
.login-card p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.pin-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s;
}
.pin-input:focus { border-color: var(--primary); }
.pin-input.error { border-color: var(--danger); animation: shake 0.3s; }
.login-btn {
    width: 100%;
    padding: 12px;
    margin-top: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}
.login-btn:hover { filter: brightness(1.1); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 0.75rem; display: none; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ---- Scope colors ---- */
.scope1-color { color: #e65100; }
.scope2-color { color: #1565c0; }
.scope3-color { color: #2e7d32; }
.scope1-bg { background: #fff3e0; }
.scope2-bg { background: #e3f2fd; }
.scope3-bg { background: #e8f5e9; }

/* ============================================================
   DASHBOARD V2 — Feature parity styles
   ============================================================ */

/* ---- Section structure ---- */
.section { margin-bottom: 2rem; }
.section-title {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-auto { background: var(--accent-light); color: var(--primary-dark); }
.badge-semi { background: #fff3cd; color: #856404; }
.badge-manual { background: #fce4e4; color: #CC0000; }

/* ---- Action bar ---- */
.action-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.action-bar .spacer { flex: 1; }

/* ---- Section nav (sticky) ---- */
.section-nav {
    position: sticky;
    top: 56px;
    z-index: 50;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.section-nav-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    text-decoration: none;
}
.section-nav-link:hover { color: var(--primary); text-decoration: none; }
.section-nav-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---- GHG Donut chart ---- */
.ghg-visual {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}
.donut-container { position: relative; flex-shrink: 0; }
.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.donut-total { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.donut-label { font-size: 0.7rem; color: var(--text-muted); }
.scope-legend { display: flex; flex-direction: column; gap: 0.75rem; }
.scope-item { display: flex; align-items: center; gap: 0.75rem; }
.scope-dot { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.scope-name { font-weight: 600; font-size: 0.85rem; }
.scope-source { font-size: 0.75rem; color: var(--text-muted); }

/* ---- Status indicators ---- */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.dot-auto { background: #2faa51; }
.dot-semi { background: #f59e0b; }
.dot-manual { background: #ef4444; }
.dot-na { background: #ccc; }
.status-auto { color: #1b5e20; }
.status-semi { color: #92400e; }
.status-manual { color: #CC0000; }
.status-na { color: #999; }
.user-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    background: #e3f2fd;
    color: #0d47a1;
}
.ai-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    background: #f3e5f5;
    color: #6a1b9a;
}

/* ---- Coverage bars ---- */
.coverage-meter { margin-bottom: 1rem; }
.coverage-meter label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; display: block; }
.coverage-bar-container {
    height: 20px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
.coverage-bar { height: 100%; transition: width 0.5s ease; }
.coverage-auto { background: #2faa51; }
.coverage-semi { background: #f59e0b; }

/* ---- Scope 3 horizontal bars ---- */
.s3-h-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.s3-bar-name { font-size: 0.8rem; width: 200px; text-align: right; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s3-bar-track { flex: 1; height: 16px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.s3-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.s3-bar-val { font-size: 0.75rem; width: 80px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Edit modal ---- */
.edit-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    animation: fadeIn 0.15s ease;
}
.edit-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    min-width: 380px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 201;
    animation: fadeIn 0.2s ease;
}
.edit-modal h3 { margin: 0 0 1rem; color: var(--primary); font-size: 1rem; }
.edit-field { margin-bottom: 0.75rem; }
.edit-field label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--text-muted); }
.edit-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: var(--text-muted);
    transition: all 0.15s;
}
.edit-btn:hover { background: #f0f0f0; color: var(--primary); }

/* ---- AI panel ---- */
.ai-callout {
    background: linear-gradient(135deg, #f3e5f5 0%, #e8eaf6 100%);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.ai-callout .dismiss {
    margin-left: auto;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    background: none;
    border: none;
}
.ai-panel {
    background: var(--card-bg);
    border: 2px dashed #ce93d8;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: none;
}
.ai-panel.visible { display: block; animation: fadeIn 0.3s ease; }
.ai-panel h3 { margin: 0 0 1rem; color: #6a1b9a; font-size: 1rem; }
.ai-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; font-size: 0.85rem; }
.ai-confidence {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    background: #f3e5f5;
    color: #6a1b9a;
}
.ai-evidence { font-size: 0.75rem; color: var(--text-muted); margin-left: 1.5rem; }
.ai-accept-btn {
    background: #6a1b9a;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    margin-top: 1rem;
}
.ai-accept-btn:hover { filter: brightness(1.15); }

/* ---- Methodology ---- */
.methodology {
    background: #f8f9fc;
    border-radius: var(--radius);
    padding: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.methodology h4 { margin: 0 0 0.5rem; color: var(--primary); font-size: 0.85rem; }
.methodology ul { margin: 0.5rem 0; padding-left: 1.25rem; }

/* ---- Healthcare note ---- */
.healthcare-note {
    background: #e8f5e9;
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: #1b5e20;
    margin: 1rem 0;
}

/* ---- eNPS sparkline ---- */
.enps-chart-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ---- Category row grouping (EDCI/SFDR) ---- */
.cat-environment { background: rgba(46,125,50,0.04); }
.cat-social { background: rgba(21,101,192,0.04); }
.cat-governance { background: rgba(106,27,154,0.04); }
.cat-climate { background: rgba(230,81,0,0.04); }
.cat-other { background: rgba(0,0,0,0.02); }

/* ---- Table hover polish ---- */
.esg-table tbody tr { transition: background 0.15s ease; }
.esg-table tbody tr:hover { background: #f3f0fa; }

/* ---- Tooltip on source description ---- */
td[title]:not([title=""]) {
    cursor: help;
    border-bottom: 1px dotted var(--text-muted);
}

/* ---- Coverage bar animation ---- */
.coverage-bar {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Section entrance animation ---- */
.section { animation: sectionFadeIn 0.4s ease both; }

/* ---- KPI card hover ---- */
.esg-kpi-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.esg-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* ---- Scope 3 bar animation ---- */
.s3-bar-fill { transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---- AI upload spinner ---- */
.ai-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ce93d8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}
.empty-state h3 { color: var(--primary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; margin-bottom: 1rem; }

/* ---- Loading skeleton ---- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-value { height: 28px; width: 60%; margin: 0 auto; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Data freshness indicator ---- */
.data-freshness {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.data-freshness .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.data-freshness .dot-fresh { background: var(--accent); }
.data-freshness .dot-stale { background: #f59e0b; }

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---- Print ---- */
@media print {
    /* Hide interactive/nav elements */
    .esg-nav, .section-nav, .edit-btn, .ai-panel, .ai-callout,
    .action-bar, footer, .period-selector, .data-freshness,
    .esg-nav-logout, #audit-log-body { display: none !important; }

    /* Layout */
    html { scroll-behavior: auto; }
    body { font-size: 9pt; color: #000; background: white; }
    .container { max-width: 100%; padding: 0; margin: 0; }
    .dashboard-page > h1 { font-size: 16pt; border-bottom: 2px solid #5B4B8A; padding-bottom: 4pt; }

    /* Cards & sections */
    .section { break-inside: avoid; margin-bottom: 12pt; animation: none !important; }
    .esg-card { box-shadow: none; border: 1px solid #ddd; padding: 8pt; }
    .esg-kpi-grid { grid-template-columns: repeat(5, 1fr) !important; gap: 6pt; }
    .esg-kpi-card { box-shadow: none; border: 1px solid #ddd; padding: 8pt; transform: none !important; }
    .esg-kpi-value { font-size: 14pt; }

    /* GHG donut — ensure it prints */
    .ghg-visual { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
    .donut-container svg { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* Tables */
    .esg-table { font-size: 8pt; }
    .esg-table th { background: #5B4B8A !important; color: white !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; padding: 3pt 6pt; }
    .esg-table td { padding: 3pt 6pt; }
    .esg-table tbody tr:hover { background: transparent; }

    /* Status dots + badges */
    .status-dot, .scope-dot, .coverage-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .section-badge, .user-badge, .ai-badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* Scope 3 bars */
    .s3-bar-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* Coverage bars */
    .coverage-bar-container { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .coverage-auto, .coverage-semi { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* eNPS sparkline */
    .enps-chart-container { break-inside: avoid; }
    .enps-chart-container svg { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* Methodology */
    .methodology { border: 1px solid #ddd; background: #f8f8f8 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* Healthcare note */
    .healthcare-note { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* Page breaks */
    #section-edci { break-before: page; }
    .esg-completeness { break-inside: avoid; }

    /* Links */
    a { color: #000; text-decoration: none; }
}
