/**
 * ESG Report form styles.
 * Extracted from the HTML prototype (pages/esg-report.html).
 *
 * @package esg-report
 */

/* ── Page header ─────────────────────────────────────────── */
.report-page-header {
    margin-top: 78px; /* compensate for fixed nav */
    background: linear-gradient(135deg, #1a2e1f 0%, #2d5a3d 100%);
    color: #fff;
    padding: 2rem 0 1.5rem;
}
.report-page-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.report-page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}
.report-year-badge {
    background: var(--orange, #E16839);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-left: 0.5rem;
}
.report-page-header p {
    margin: 0.25rem 0 0;
    opacity: 0.8;
    font-size: 0.95rem;
}
.report-status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}
.report-progress-label {
    color: rgba(255,255,255,0.7);
}
.report-progress-count {
    font-weight: 700;
    color: #7dd3a8;
}

/* ── Layout ─────────────────────────────────────────────── */
.report-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem 0 4rem;
    position: relative; /* needed for JS sticky boundary */
}
.report-main {
    flex: 1 1 0;
    min-width: 0;
}

/* ── Sidebar ─────────────────────────────────────────────── */
/* NOTE: CSS position:sticky is intentionally NOT used here.
   body{overflow-x:hidden} in the shared stylesheet breaks CSS sticky
   in Chrome. Instead we use a JS translateY-based sticky (see <script>). */
.report-sidebar {
    flex: 0 0 260px;
    width: 260px;
    align-self: flex-start;
    will-change: transform;
}
.sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray, #888);
    margin-bottom: 0.5rem;
}
.sidebar-nav {
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    overflow: hidden;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    font-size: 0.85rem;
    color: #444;
    border-bottom: 1px solid #f0ece8;
    transition: background 0.15s;
    cursor: pointer;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: #faf8f5; }
.sidebar-item.active { background: #fdf6f2; color: var(--orange, #E16839); font-weight: 600; }
.sidebar-item.done { color: #3a7d57; }
.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    font-size: 0.65rem;
    flex-shrink: 0;
    font-weight: 700;
}
.sidebar-item.done .sidebar-icon {
    background: #3a7d57;
    border-color: #3a7d57;
    color: #fff;
}
.sidebar-item.active .sidebar-icon {
    border-color: var(--orange, #E16839);
}
.pillar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-e { background: #3a7d57; }
.dot-s { background: #2563a8; }
.dot-g { background: #7c3aed; }

/* ── Accordion sections ──────────────────────────────────── */
.report-section {
    scroll-margin-top: 96px; /* smooth scroll offset for fixed nav */
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: opacity 0.2s;
}
.report-section.skipped {
    opacity: 0.5;
}

/* ── Skip reason block ────────────────────────────────────── */
.skip-reason-block {
    display: none;
    background: #fffbf5;
    border: 1px solid #f0dcc8;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.skip-reason-block.visible {
    display: block;
}
.skip-reason-header h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    font-weight: 700;
    color: #8a6d3b;
}
.skip-reason-header p {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #a07940;
}
.skip-reason-skipped-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.skip-reason-label {
    font-size: 0.78rem;
    color: #888;
    font-weight: 600;
}
.skip-reason-tag {
    display: inline-block;
    background: #f0ece8;
    color: #666;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    white-space: nowrap;
}
.skip-reason-block textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}
.skip-reason-block textarea:focus {
    outline: none;
    border-color: #E16839;
    box-shadow: 0 0 0 3px rgba(225,104,57,0.1);
}
.skip-reason-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}
.skip-reason-autosave {
    font-size: 0.8rem;
    color: #888;
}
.btn-save-skip-reason {
    background: #E16839;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.btn-save-skip-reason:hover {
    background: #c9562e;
}
.btn-save-skip-reason:disabled {
    opacity: 0.6;
    cursor: wait;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    cursor: pointer;
    user-select: none;
    gap: 1rem;
}
.section-header:hover { background: #faf8f5; }
.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}
.section-header p {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: #888;
}
.pillar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}
.pillar-e { background: #3a7d57; }
.pillar-s { background: #2563a8; }
.pillar-g { background: #7c3aed; }
.pillar-0 { background: var(--orange, #E16839); }
.section-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.skip-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
}
.skip-toggle input { cursor: pointer; }
.section-chevron {
    font-size: 0.75rem;
    color: #aaa;
    transition: transform 0.2s;
}
.report-section.open .section-chevron { transform: rotate(180deg); }

.section-body {
    display: none;
    padding: 0 1.4rem 1.4rem;
    border-top: 1px solid #f0ece8;
}
.report-section.open .section-body { display: block; }

/* ── Form elements ───────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-1 { grid-template-columns: 1fr; }
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    border: 1px solid #d4cfc9;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #fafaf9;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange, #E16839);
    background: #fff;
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 0.1rem;
}

/* ── Question blocks ─────────────────────────────────────── */
.question-block {
    margin: 1.2rem 0;
    padding: 1rem 1.1rem;
    background: #faf8f5;
    border-radius: 8px;
    border-left: 3px solid #e0d9d2;
}
.question-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.question-code {
    font-size: 0.72rem;
    font-weight: 700;
    background: #1a1a1a;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
}
.question-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #222;
    flex: 1;
}
.question-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    flex-shrink: 0;
    position: relative;
}
.question-help:hover::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    top: 24px;
    background: #222;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    width: 220px;
    line-height: 1.4;
    z-index: 10;
    white-space: normal;
    pointer-events: none;
}
.question-block textarea,
.question-block input[type="text"],
.question-block input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d4cfc9;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    margin-top: 0.4rem;
}
.question-block textarea { resize: vertical; min-height: 80px; }
.question-block input:focus,
.question-block textarea:focus {
    outline: none;
    border-color: var(--orange, #E16839);
}

/* ── ARES lookup ──────────────────────────────────────────── */
.ico-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.ico-input-row input {
    flex: 1;
}
.btn-ares-lookup {
    background: #4A7366;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s, opacity 0.15s;
}
.btn-ares-lookup:hover {
    background: #3a5d52;
}
.btn-ares-lookup:disabled,
.btn-ares-lookup.loading {
    opacity: 0.6;
    cursor: wait;
}
.ares-status {
    display: block;
    font-size: 0.78rem;
    margin-top: 0.3rem;
    min-height: 1.1em;
    color: #888;
}
.ares-status.ares-success {
    color: #3a7d57;
    font-weight: 600;
}
.ares-status.ares-error {
    color: #c0392b;
}
.ares-filled {
    border-color: #3a7d57 !important;
    box-shadow: 0 0 0 3px rgba(58,125,87,0.15);
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* ── Report tables ───────────────────────────────────────── */
.report-table-wrap {
    overflow-x: auto;
    margin-top: 0.6rem;
}
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.report-table th {
    background: #f0ece8;
    padding: 0.5rem 0.7rem;
    text-align: center;
    font-weight: 700;
    color: #444;
    border: 1px solid #ddd;
    white-space: nowrap;
}
.report-table th:first-child { text-align: left; }
.report-table td {
    border: 1px solid #e8e4df;
    padding: 0.3rem 0.4rem;
}
.report-table td:first-child {
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    color: #333;
    background: #faf8f5;
    font-weight: 500;
    white-space: nowrap;
}
.report-table td input[type="number"],
.report-table td input[type="text"] {
    width: 100%;
    min-width: 80px;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.3rem 0.4rem;
    font-size: 0.83rem;
    font-family: inherit;
    background: transparent;
    text-align: right;
    box-sizing: border-box;
}
.report-table td input:focus {
    outline: none;
    border-color: var(--orange, #E16839);
    background: #fff;
}
.report-table tr:hover td { background-color: #fdf6f2; }
.report-table tr:hover td:first-child { background: #f7f0eb; }
.report-table tfoot td {
    background: #f0ece8;
    font-weight: 700;
    font-size: 0.82rem;
}
.table-unit {
    font-size: 0.72rem;
    color: #aaa;
    display: block;
    text-align: center;
    margin-bottom: 0.25rem;
}

/* ── Radio group ─────────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    cursor: pointer;
    font-weight: 500;
}

/* ── Save button ─────────────────────────────────────────── */
.section-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #f0ece8;
}
.btn-save-section {
    background: var(--teal, #4A7366);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.btn-save-section:hover { background: #3a5d52; }
.btn-save-section.saved { background: #3a7d57; }

/* ── Final CTA ───────────────────────────────────────────── */
.report-cta {
    background: linear-gradient(135deg, #1a2e1f 0%, #2d5a3d 100%);
    color: #fff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-top: 1.5rem;
}
.report-cta h3 {
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
    color: #fff;
}
.report-cta p {
    opacity: 0.8;
    margin: 0 0 1.2rem;
    font-size: 0.95rem;
}
.btn-generate {
    background: var(--orange, #E16839);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.85rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s;
}
.btn-generate:hover { background: #c95a2a; transform: translateY(-1px); }

/* ── Profil section (always open, no accordion header) ────── */
.section-profil .section-header { cursor: default; }
.section-profil .section-header:hover { background: transparent; }
.section-profil .section-chevron { display: none; }
.section-profil .section-body { display: block; border-top: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .report-layout {
        flex-direction: column;
    }
    .report-sidebar {
        flex: none;
        width: 100%;
        transform: none !important;
        order: -1;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        background: transparent;
        border: none;
    }
    .sidebar-item {
        border: 1px solid #e8e4df;
        border-radius: 20px;
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
        background: #fff;
    }
    .form-row { grid-template-columns: 1fr; }
    .form-row.cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .report-page-header .container { flex-direction: column; align-items: flex-start; }
    .section-controls { flex-wrap: wrap; gap: 0.5rem; }
}

/* ── Plugin-specific additions ───────────────────────────────── */

/* Export / Versions buttons in header */
.btn-export-json,
.btn-download-zip,
.btn-versions {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.btn-export-json:hover,
.btn-download-zip:hover,
.btn-versions:hover {
    background: rgba(255,255,255,0.25);
}

/* Autosave status */
.autosave-status {
    font-size: 0.78rem;
    color: #888;
    margin-right: auto;
    align-self: center;
}

/* File attachments area */
.section-attachments {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e8e4df;
}
.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f5f3f0;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}
.attachment-item a {
    color: #4A7366;
    text-decoration: none;
}
.attachment-size {
    color: #999;
    font-size: 0.7rem;
}
.attachment-item .delete-attachment {
    color: #999;
    cursor: pointer;
    font-size: 0.7rem;
}
.attachment-item .delete-attachment:hover {
    color: #dc2626;
}
.btn-upload-file {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s;
}
.btn-upload-file:hover {
    border-color: #4A7366;
    color: #4A7366;
}
.btn-upload-file .upload-busy {
    display: none;
}
.btn-upload-file.uploading .upload-label {
    display: none;
}
.btn-upload-file.uploading .upload-busy {
    display: inline;
}
.btn-upload-file.uploading {
    opacity: 0.6;
    pointer-events: none;
}
.upload-hint {
    display: block;
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Versions modal */
.esg-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
}
.esg-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.esg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e8e4df;
}
.esg-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.esg-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}
.esg-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}
.version-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0ece8;
}
.version-row:last-child {
    border-bottom: none;
}
.version-info {
    font-size: 0.88rem;
}
.version-num {
    font-weight: 700;
}
.version-date {
    color: #888;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}
.version-label {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}
.btn-restore-version {
    background: #4A7366;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.btn-restore-version:hover {
    background: #3a5d52;
}

/* Section footer with autosave status */
.section-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #f0ece8;
    gap: 1rem;
}

/* ══════════════════════════════════════════════════════════════
   Report Picker — management view
   ══════════════════════════════════════════════════════════════ */

/* ── Back link in form header ─────────────────────────────── */
.report-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    transition: color 0.15s;
}
.report-back-link:hover {
    color: #fff;
}

/* ── Picker header actions ────────────────────────────────── */
.esg-picker-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.btn-picker-new {
    background: var(--orange, #E16839);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.btn-picker-new:hover {
    background: #c9562e;
}
.btn-picker-new:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ── Import button ────────────────────────────────────────── */
.btn-picker-import {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 0.55rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.btn-picker-import:hover {
    background: rgba(255,255,255,0.25);
}
.btn-picker-import.importing {
    opacity: 0.6;
    cursor: wait;
}
.btn-picker-import--secondary {
    background: #f0ece8;
    color: #555;
    border-color: #ddd;
}
.btn-picker-import--secondary:hover {
    background: #e4ddd6;
}
.esg-picker-empty-or {
    color: #aaa;
    margin: 0.5rem 0;
}

/* ── Picker body ──────────────────────────────────────────── */
.esg-picker-body {
    padding: 2rem 0 4rem;
}

/* ── Empty state ──────────────────────────────────────────── */
.esg-picker-empty {
    text-align: center;
    padding: 4rem 1rem;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 12px;
}
.esg-picker-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.esg-picker-empty h2 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    color: #333;
}
.esg-picker-empty p {
    margin: 0 0 1.5rem;
    color: #888;
}
.btn-picker-new--large {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

/* ── Reports table ────────────────────────────────────────── */
.esg-picker-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    overflow: hidden;
}
.esg-picker-table thead th {
    background: #faf8f5;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    border-bottom: 1px solid #e8e4df;
}
.esg-picker-table tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0ece8;
    vertical-align: middle;
}
.esg-picker-table tbody tr:last-child td {
    border-bottom: none;
}
.esg-picker-table tbody tr:hover {
    background: #fdfbf9;
}

/* ── Table columns ────────────────────────────────────────── */
.picker-firma-link {
    color: #2d5a3d;
    text-decoration: none;
    font-weight: 600;
}
.picker-firma-link:hover {
    text-decoration: underline;
}

.col-rok {
    font-weight: 600;
    color: #555;
}

/* ── Status badge ─────────────────────────────────────────── */
.esg-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.esg-badge--draft {
    background: #fef3cd;
    color: #856404;
}
.esg-badge--complete {
    background: #d4edda;
    color: #155724;
}

/* ── Progress bar ─────────────────────────────────────────── */
.col-progress {
    min-width: 120px;
}
.picker-progress {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}
.picker-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3a7d57, #7dd3a8);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.picker-progress-text {
    font-size: 0.75rem;
    color: #888;
}

.col-attachments {
    text-align: center;
}
.picker-attachment-count {
    font-size: 0.82rem;
    color: #555;
}
.picker-no-attachments {
    color: #ccc;
}

.col-modified {
    color: #888;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* ── Row action buttons ───────────────────────────────────── */
.col-actions {
    white-space: nowrap;
}
.picker-action {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
    font-size: 0.78rem;
    color: #4A7366;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 5px;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
    vertical-align: middle;
}
.picker-action:hover {
    background: #f0ece8;
    border-color: #ddd;
}
.picker-action:disabled {
    opacity: 0.5;
    cursor: wait;
}
.picker-action--danger {
    color: #c0392b;
}
.picker-action--danger:hover {
    background: #fdecea;
    border-color: #e6b8b3;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .esg-picker-table thead { display: none; }
    .esg-picker-table,
    .esg-picker-table tbody,
    .esg-picker-table tr,
    .esg-picker-table td {
        display: block;
    }
    .esg-picker-table tbody tr {
        padding: 1rem;
        border-bottom: 1px solid #e8e4df;
    }
    .esg-picker-table tbody td {
        border-bottom: none;
        padding: 0.3rem 0;
    }
    .col-actions {
        margin-top: 0.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* ══════════════════════════════════════════════════════════
   MEASURES SELECTOR
   ══════════════════════════════════════════════════════════ */

.measures-block {
    background: #fff;
    border: 1px solid #e2e0dc;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.measures-header h3 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    color: #1a1a1a;
}

.measures-header p {
    margin: 0 0 1.25rem;
    color: #6b6b6b;
    font-size: 0.9rem;
}

/* ── Toolbar: search + filter ──────────────────────────── */

.measures-toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.measures-search {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d5d3cf;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #faf9f7;
    transition: border-color 0.2s;
}

.measures-search:focus {
    outline: none;
    border-color: #e8913a;
    background: #fff;
}

.measures-filter {
    min-width: 160px;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d5d3cf;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #faf9f7;
    cursor: pointer;
}

.measures-filter:focus {
    outline: none;
    border-color: #e8913a;
}

/* ── Selected measures ─────────────────────────────────── */

.measures-selected {
    background: #f0f9f0;
    border: 1px solid #c3e6c3;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.measures-selected-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d7a2d;
    margin-bottom: 0.75rem;
}

.measures-selected-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.measures-selected-list .measure-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
}

.measures-selected-list .measure-card-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.measures-selected-list .measure-card-code {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: #2d7a2d;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.measures-selected-list .measure-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
}

.measure-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}

.measure-remove:hover {
    background: #fce4e4;
    color: #c0392b;
}

/* ── Catalog groups ────────────────────────────────────── */

.measures-catalog {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e2e0dc;
    border-radius: 10px;
    background: #faf9f7;
}

.measures-group {
    border-bottom: 1px solid #e2e0dc;
}

.measures-group:last-child {
    border-bottom: none;
}

.measures-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: #f5f4f1;
    user-select: none;
    transition: background 0.15s;
}

.measures-group-header:hover {
    background: #eceae6;
}

.measures-group-chevron {
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.2s;
}

.measures-group.collapsed .measures-group-chevron {
    transform: rotate(-90deg);
}

.measures-group-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.measures-group-count {
    font-size: 0.8rem;
    color: #888;
    margin-left: auto;
}

.measures-group-body {
    padding: 0.5rem;
}

.measures-group.collapsed .measures-group-body {
    display: none;
}

/* ── Measure card (catalog) ────────────────────────────── */

.measures-catalog .measure-card {
    border: 1px solid transparent;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    transition: all 0.15s;
}

.measures-catalog .measure-card:hover {
    background: #fff;
    border-color: #e2e0dc;
}

.measures-catalog .measure-card.selected {
    background: #f0f9f0;
    border-color: #c3e6c3;
}

.measure-card-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    margin: 0;
}

.measure-checkbox {
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: #2d7a2d;
    width: 16px;
    height: 16px;
}

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

.measures-catalog .measure-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
    margin-bottom: 0.2rem;
}

.measure-card-excerpt {
    font-size: 0.82rem;
    color: #6b6b6b;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Meta tags (impact, investment, horizon) ───────────── */

.measure-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.measure-meta-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.measure-meta-tag--impact-high {
    background: #fce4e4;
    color: #c0392b;
}

.measure-meta-tag--impact-medium {
    background: #fff3cd;
    color: #856404;
}

.measure-meta-tag--impact-low {
    background: #d4edda;
    color: #155724;
}

.measure-meta-tag--investment {
    background: #e8f0fe;
    color: #1a56db;
}

.measure-meta-tag--horizon {
    background: #f0ecf9;
    color: #6c3fa0;
}

/* ── Footer (save button) ──────────────────────────────── */

.measures-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.25rem;
}

.measures-save-status {
    font-size: 0.85rem;
    color: #888;
}

.measures-save-status.saved {
    color: #2d7a2d;
}

.measures-save-status.error {
    color: #c0392b;
}

.btn-save-measures {
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, #e8913a 0%, #d4792e 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-measures:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 145, 58, 0.3);
}

.btn-save-measures:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── States ────────────────────────────────────────────── */

.measures-loading,
.measures-error,
.measures-no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: #888;
    font-size: 0.9rem;
}

.measures-error {
    color: #c0392b;
}

/* ── Sidebar measures link ─────────────────────────────── */

.sidebar-item--measures {
    margin-top: 0.75rem;
    border-top: 1px solid #e2e0dc;
    padding-top: 0.75rem;
}

.pillar-dot.dot-measures {
    background: #e8913a;
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 640px) {
    .measures-toolbar {
        flex-direction: column;
    }
    .measures-filter {
        min-width: 100%;
    }
    .measures-block {
        padding: 1.25rem;
    }
    .measures-selected-list .measure-card {
        flex-wrap: wrap;
    }
    .measures-selected-list .measure-card-meta {
        width: 100%;
        margin-top: 0.25rem;
    }
}
