/* =====================================================================
   BIA Bot - Styles
   Professional administrative UI for public procurement jury panels
   ===================================================================== */

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary */
    --primary:        #1a365d;
    --primary-light:  #2a4a7f;
    --primary-dark:   #0f2440;
    --primary-bg:     #edf2f7;

    /* Accent */
    --accent:         #3182ce;
    --accent-light:   #63b3ed;

    /* Status */
    --success:        #38a169;
    --success-bg:     #f0fff4;
    --warning:        #d69e2e;
    --warning-bg:     #fffff0;
    --danger:         #e53e3e;
    --danger-bg:      #fff5f5;

    /* Neutrals */
    --white:          #ffffff;
    --gray-50:        #f7fafc;
    --gray-100:       #edf2f7;
    --gray-200:       #e2e8f0;
    --gray-300:       #cbd5e0;
    --gray-400:       #a0aec0;
    --gray-500:       #718096;
    --gray-600:       #4a5568;
    --gray-700:       #2d3748;
    --gray-800:       #1a202c;

    /* Sidebar */
    --sidebar-bg:             rgba(244, 244, 244, 0.82);
    --sidebar-border:         rgba(0, 0, 0, 0.06);
    --sidebar-active-bg:      rgba(0, 0, 0, 0.06);
    --sidebar-active-color:   var(--gray-800);
    --sidebar-hover-bg:       rgba(0, 0, 0, 0.03);
    --sidebar-section-color:  var(--gray-400);
    --sidebar-collapsed-width: 60px;
    --sidebar-icon-size:      20px;

    /* Typography */
    --font-family:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono:      'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* Sizing */
    --sidebar-width:  260px;
    --header-height:  64px;
    --radius:         6px;
    --radius-lg:      10px;

    /* Shadows */
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
    --shadow:         0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:      0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    /* Transitions */
    --transition:     all 0.2s ease;
}

html {
    font-size: 14px;
    min-width: 1024px;
}

body {
    font-family: var(--font-family);
    color: var(--gray-700);
    background: var(--gray-50);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    color: var(--gray-700);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    border-right: 1px solid var(--sidebar-border);
    transition: width 300ms cubic-bezier(0.32, 0.72, 0, 1);
    will-change: width;
}

/* ── Sidebar Header ───────────────────────────────────────────────── */
.sidebar-header {
    padding: 14px 14px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    flex-shrink: 0;
    position: relative;
}

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

.logo-icon {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gray-600);
    width: 32px;
    height: 32px;
}

.logo-icon .icon {
    width: 24px;
    height: 24px;
}

.logo-text {
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 150ms ease;
}

.logo-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--gray-800);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.65rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s, opacity 0.15s;
    flex-shrink: 0;
    opacity: 0;
}

.sidebar-header:hover .sidebar-toggle,
.sidebar-toggle:focus-visible {
    opacity: 1;
}

.sidebar-toggle:hover {
    color: var(--gray-600);
    background: var(--sidebar-hover-bg);
}

/* ── Sidebar Nav ──────────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 4px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sidebar-section-color);
    padding: 16px 20px 4px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    height: auto;
    opacity: 1;
    transition: opacity 150ms ease, height 300ms cubic-bezier(0.32, 0.72, 0, 1),
                padding 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    margin: 1px 8px;
    color: var(--gray-500);
    text-decoration: none;
    transition: color 150ms ease, background 150ms ease;
    font-size: 0.85rem;
    border-radius: 7px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

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

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

.nav-icon {
    width: var(--sidebar-icon-size);
    height: var(--sidebar-icon-size);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon .icon {
    width: var(--sidebar-icon-size);
    height: var(--sidebar-icon-size);
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity 150ms ease;
}

/* ── Sidebar Footer ───────────────────────────────────────────────── */
.sidebar-footer {
    padding: 8px 8px 12px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.version-info {
    font-size: 0.65rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    padding: 0 6px;
    transition: opacity 150ms ease;
}

/* ── Sidebar Notifications ────────────────────────────────────────── */
.sidebar-notifications {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    margin: 0 0 4px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 150ms ease;
    position: relative;
    overflow: hidden;
}

.sidebar-notifications:hover {
    background: var(--sidebar-hover-bg);
}

.notification-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--sidebar-icon-size);
    height: var(--sidebar-icon-size);
    flex-shrink: 0;
}

.notification-icon .icon {
    width: var(--sidebar-icon-size);
    height: var(--sidebar-icon-size);
    color: var(--gray-400);
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ff3b30;
    color: var(--white);
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.notification-text {
    font-size: 0.85rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity 150ms ease;
}

/* ── Sidebar Collapsed State ──────────────────────────────────────── */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Hide text elements — must not take any space */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-details,
.sidebar.collapsed .version-info,
.sidebar.collapsed .notification-text {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    padding: 0;
    margin: 0;
}

/* Collapse section headers fully (no residual space) */
.sidebar.collapsed .nav-section {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Header: center logo icon, hide toggle (show on hover) */
.sidebar.collapsed .sidebar-header {
    padding: 14px 0 10px;
    justify-content: center;
}

.sidebar.collapsed .logo {
    justify-content: center;
    gap: 0;
    width: 32px;
}

.sidebar.collapsed .logo-icon {
    border-radius: 8px;
    transition: background 150ms ease;
}

.sidebar.collapsed .logo-icon:hover {
    background: var(--sidebar-hover-bg);
}

/* In collapsed mode, hide toggle entirely — clicking logo expands */
.sidebar.collapsed .sidebar-toggle {
    display: none;
}

/* Allow tooltips to escape nav container */
.sidebar.collapsed .sidebar-nav {
    overflow: visible;
}

/* Nav items: square icon pills, centered */
.sidebar.collapsed .nav-item {
    justify-content: center;
    margin: 2px auto;
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    gap: 0;
    overflow: visible;
}

/* Notifications: centered icon */
.sidebar.collapsed .sidebar-notifications {
    justify-content: center;
    margin: 0 auto 4px;
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    gap: 0;
    overflow: visible;
}

/* Footer: stack and center everything */
.sidebar.collapsed .sidebar-footer {
    padding: 8px 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sidebar.collapsed .user-menu {
    justify-content: center;
    padding: 4px 0;
    margin: 0 auto 4px;
    width: 40px;
}

.sidebar.collapsed .user-info {
    gap: 0;
}

.sidebar.collapsed .btn-logout {
    display: none;
}

/* No hover background on user-menu when collapsed — avatar is enough */
.sidebar.collapsed .user-menu:hover {
    background: none;
}

/* ── Collapsed Tooltips ───────────────────────────────────────────── */
.sidebar.collapsed .nav-item::after,
.sidebar.collapsed .sidebar-notifications::after,
.sidebar.collapsed .user-menu[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-800);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    letter-spacing: -0.01em;
}

.sidebar.collapsed .nav-item:hover::after,
.sidebar.collapsed .sidebar-notifications:hover::after,
.sidebar.collapsed .user-menu[data-tooltip]:hover::after {
    opacity: 1;
}

/* ── Main Content ──────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* Collapsed layout driven by class on .app-layout (set by JS) */
.app-layout.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.app-container {
    padding: 24px 32px;
    max-width: 1440px;
    margin: 0 auto;
}

/* ── Page Header ───────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.page-header .breadcrumb {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.page-header .breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.page-header .breadcrumb a:hover {
    text-decoration: underline;
}

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* ── Tables ────────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    vertical-align: middle;
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--gray-50);
}

table tbody tr.clickable {
    cursor: pointer;
}

table tbody tr.clickable:hover {
    background: #eef3fb;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-family);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.btn-accent:hover:not(:disabled) {
    background: #2b6cb0;
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #2f855a;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
    border-color: var(--warning);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-300);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-icon {
    padding: 6px;
    border-radius: var(--radius);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #c6f6d5;
}

.badge-warning {
    background: var(--warning-bg);
    color: #975a16;
    border: 1px solid #fefcbf;
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fed7d7;
}

.badge-info {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #bee3f8;
}

.badge-neutral {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 2px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: var(--font-family);
    color: var(--gray-700);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49,130,206,0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
    gap: 0;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-family);
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ── Upload Area ───────────────────────────────────────────────────── */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--gray-50);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: #ebf8ff;
}

.upload-area .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    color: var(--gray-400);
}

.upload-area .upload-text {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.upload-area .upload-hint {
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* ── File List ─────────────────────────────────────────────────────── */
.file-list {
    list-style: none;
    margin-top: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 6px;
    background: var(--white);
    font-size: 0.85rem;
}

.file-item .file-icon {
    color: var(--gray-400);
}

.file-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-size {
    color: var(--gray-400);
    font-size: 0.8rem;
}

.file-item .file-remove {
    color: var(--gray-400);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.1rem;
    padding: 2px;
    line-height: 1;
}

.file-item .file-remove:hover {
    color: var(--danger);
}

/* ── Status Indicators ─────────────────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.green  { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red    { background: var(--danger); }
.status-dot.gray   { background: var(--gray-400); }

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-bar.green  { background: var(--success); }
.progress-bar.yellow { background: var(--warning); }
.progress-bar.red    { background: var(--danger); }

/* ── Scoring / Bar Charts ──────────────────────────────────────────── */
.score-bar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.score-bar-label {
    width: 100px;
    font-size: 0.8rem;
    color: var(--gray-600);
    text-align: right;
    flex-shrink: 0;
}

.score-bar-track {
    flex: 1;
    height: 22px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    min-width: fit-content;
}

.score-bar-fill.blue   { background: var(--accent); }
.score-bar-fill.green  { background: var(--success); }
.score-bar-fill.orange { background: #dd6b20; }
.score-bar-fill.navy   { background: var(--primary); }

.score-bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    width: 50px;
    text-align: left;
    flex-shrink: 0;
}

/* ── Sliders ───────────────────────────────────────────────────────── */
.slider-group {
    margin-bottom: 16px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.slider-header label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.slider-header .slider-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: var(--shadow);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: var(--shadow);
}

/* ── Report Viewer ─────────────────────────────────────────────────── */
.report-viewer {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
}

.report-nav {
    position: sticky;
    top: 20px;
    align-self: start;
}

.report-nav ul {
    list-style: none;
}

.report-nav li {
    margin-bottom: 2px;
}

.report-nav a {
    display: block;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: var(--transition);
}

.report-nav a:hover,
.report-nav a.active {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: var(--primary);
}

.report-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.report-body h1 { font-size: 1.5rem; margin: 24px 0 12px; color: var(--gray-800); }
.report-body h2 { font-size: 1.25rem; margin: 20px 0 10px; color: var(--gray-800); border-bottom: 1px solid var(--gray-200); padding-bottom: 6px; }
.report-body h3 { font-size: 1.1rem; margin: 16px 0 8px; color: var(--gray-700); }
.report-body p  { margin-bottom: 12px; }
.report-body ul, .report-body ol { margin: 8px 0 12px 20px; }
.report-body li { margin-bottom: 4px; }
.report-body strong { color: var(--gray-800); }

.report-body table {
    border: 1px solid var(--gray-200);
    margin: 12px 0;
}

.report-body table th,
.report-body table td {
    border: 1px solid var(--gray-200);
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* ── Proposal Card (Accordion) ─────────────────────────────────────── */
.proposal-card {
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.proposal-card:hover {
    box-shadow: var(--shadow-md);
}

.proposal-card:not(.collapsed) {
    border-left-color: var(--accent);
}

/* ── Header (always visible, clickable) ── */
.proposal-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.proposal-card-header:hover {
    background: var(--gray-50);
}

.pc-chevron .icon {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.proposal-card.collapsed .pc-chevron .icon {
    transform: rotate(-90deg);
}

.pc-identity {
    flex: 1;
    min-width: 0;
}

.pc-company {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-nif {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 1px;
}

.pc-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pc-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 2px 8px;
    border-radius: var(--radius);
    white-space: nowrap;
}

.pc-stat .icon {
    width: 12px;
    height: 12px;
}

/* ── Body (collapsible via grid rows) ── */
.proposal-card-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.proposal-card:not(.collapsed) .proposal-card-body {
    grid-template-rows: 1fr;
}

.proposal-card-body-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 18px 16px;
}

.proposal-card.collapsed .proposal-card-body-inner {
    padding-top: 0;
    padding-bottom: 0;
}

/* ── Sections inside body ── */
.pc-section {
    margin-top: 12px;
}

.pc-section:empty {
    display: none;
}

.pc-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    margin-bottom: 6px;
}

.pc-docs-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pc-empty-hint {
    font-size: 0.8rem;
    color: var(--gray-400);
    font-style: italic;
}

.pc-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

/* ── Empty State ───────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state .empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.empty-state .empty-text {
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ── Loading / Spinners ────────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.loading-text {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--gray-500);
}

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

/* ── Toast Notifications ───────────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideIn 0.3s ease;
    font-size: 0.875rem;
    line-height: 1.4;
    min-width: 280px;
}

.toast.toast-success {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #276749;
}

.toast.toast-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #9b2c2c;
}

.toast.toast-warning {
    background: #fffff0;
    border: 1px solid #fefcbf;
    color: #975a16;
}

.toast.toast-info {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2b6cb0;
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    padding: 0;
    line-height: 1;
    color: inherit;
}

.toast-close:hover {
    opacity: 1;
}

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

.modal.modal-wide {
    max-width: 640px;
}

.upload-area.upload-area-compact {
    padding: 20px;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ── Metrics Page ──────────────────────────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.metric-card .metric-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.metric-card .metric-detail {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.external-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.external-link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--gray-700);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.external-link-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.external-link-card .link-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.external-link-card .link-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.external-link-card .link-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ── Requirements List ─────────────────────────────────────────────── */
.requirements-list {
    list-style: none;
}

.requirement-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 6px;
    background: var(--white);
}

.requirement-category {
    flex-shrink: 0;
}

.requirement-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.requirement-id {
    font-size: 0.75rem;
    color: var(--gray-400);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

/* ── Category Badges ───────────────────────────────────────────────── */
.cat-technical   { background: #ebf8ff; color: #2b6cb0; border: 1px solid #bee3f8; }
.cat-financial   { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.cat-legal       { background: #faf5ff; color: #6b46c1; border: 1px solid #e9d8fd; }
.cat-documentary { background: #fffff0; color: #975a16; border: 1px solid #fefcbf; }

/* ── SVG Icons ─────────────────────────────────────────────────────── */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Icons inside buttons */
.btn .icon {
    width: 16px;
    height: 16px;
}

/* Icons inside card headers */
.card-header h3 .icon {
    width: 18px;
    height: 18px;
    margin-right: 4px;
}

/* Icons inside tabs */
.tab .icon {
    width: 16px;
    height: 16px;
    margin-right: 2px;
}

/* Empty state icons */
.empty-state .empty-icon .icon {
    width: 48px;
    height: 48px;
}

/* Link card icons */
.external-link-card .link-icon .icon {
    width: 32px;
    height: 32px;
}

/* Upload area icons */
.upload-area .upload-icon .icon {
    width: 40px;
    height: 40px;
}

/* File list icons */
.file-item .file-icon .icon {
    width: 16px;
    height: 16px;
}

/* Toast icons */
.toast-icon .icon {
    width: 18px;
    height: 18px;
}

/* Weight sum indicator icons */
.weight-sum-indicator .icon {
    width: 16px;
    height: 16px;
}

/* Section title icons */
.section-title .icon {
    width: 18px;
    height: 18px;
    margin-right: 4px;
}

/* ── Utilities ─────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-400); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mr-1 { margin-right: 8px; }
.ml-1 { margin-left: 8px; }
.p-2 { padding: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

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

/* ── Ranking Position ──────────────────────────────────────────────── */
.rank-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.rank-position.rank-1 {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #f59e0b;
}

.rank-position.rank-2 {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 2px solid var(--gray-400);
}

.rank-position.rank-3 {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #d97706;
}

.rank-position.rank-other {
    background: var(--gray-50);
    color: var(--gray-500);
    border: 1px solid var(--gray-300);
}

/* ── Tooltip ───────────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--gray-800);
    color: var(--white);
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Suppress global tooltips inside sidebar — dedicated collapsed rules handle them */
.sidebar [data-tooltip]:hover::after {
    content: none;
}

/* ── Weight Sum Indicator ──────────────────────────────────────────── */
.weight-sum-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
}

.weight-sum-indicator.valid {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #c6f6d5;
}

.weight-sum-indicator.invalid {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fed7d7;
}

/* ── Evidence Popup ──────────────────────────────────────────────── */
.evidence-popup {
    position: absolute;
    z-index: 100;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-width: 400px;
    min-width: 280px;
}

.evidence-popup.hidden {
    display: none;
}

.evidence-popup-content {
    padding: 16px;
}

.evidence-section {
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.evidence-section strong {
    color: var(--gray-800);
    display: block;
    margin-bottom: 2px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.evidence-section p {
    margin: 4px 0 0;
    line-height: 1.4;
}

.evidence-excerpt {
    background: var(--gray-50);
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--accent);
    font-size: 0.8rem;
    max-height: 120px;
    overflow-y: auto;
}

.evidence-close {
    margin-top: 8px;
    width: 100%;
}

.evidence-cell {
    cursor: pointer;
    transition: transform 0.1s;
}

.evidence-cell:hover {
    transform: scale(1.2);
}

/* ── Report Evidence Markers (Traceability Audit) ────────────────── */
.report-evidence-marker {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(49, 130, 206, 0.12);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(49, 130, 206, 0.25);
    vertical-align: middle;
    margin-left: 4px;
    white-space: nowrap;
    user-select: none;
}

.report-evidence-marker:hover {
    background: rgba(49, 130, 206, 0.22);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(49, 130, 206, 0.3);
    transform: translateY(-1px);
}

.report-evidence-marker .evidence-marker-icon {
    font-size: 0.8rem;
    line-height: 1;
}

/* Report evidence popup (positioned inside report-body) */
.report-evidence-popup {
    position: absolute;
    z-index: 200;
    max-width: 420px;
    min-width: 300px;
    animation: evidencePopupIn 0.15s ease-out;
}

@keyframes evidencePopupIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.evidence-popup-close {
    line-height: 1;
}

/* Audit panel entry hover */
.audit-evidence-header:hover {
    background: var(--gray-100) !important;
}

/* ── Signature Details ───────────────────────────────────────────── */
.sig-details {
    transition: all 0.2s;
}

.sig-detail-card .meta-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Comparative SWOT Grid ───────────────────────────────────────── */
.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── PDF Preview Modal ────────────────────────────────────────────── */
.pdf-preview-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.pdf-preview-modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

.pdf-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.pdf-preview-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.pdf-preview-title .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pdf-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pdf-preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
    font-size: 0.85rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.pdf-preview-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    background: var(--gray-100);
}

.pdf-preview-body canvas {
    box-shadow: var(--shadow-md);
    background: var(--white);
}

.pdf-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--gray-500);
    padding: 40px;
}

/* ── Document List (shared by tender & proposal) ──────────────────── */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.82rem;
    transition: var(--transition);
}

.doc-list-item:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.doc-list-icon {
    color: var(--gray-400);
    flex-shrink: 0;
}

.doc-list-icon .icon {
    width: 14px;
    height: 14px;
}

.doc-list-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-700);
}

.doc-list-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.doc-list-actions .btn-icon {
    padding: 3px;
    color: var(--gray-400);
}

.doc-list-actions .btn-icon .icon {
    width: 14px;
    height: 14px;
}

.doc-list-actions .btn-icon:hover {
    color: var(--accent);
}

/* ── Enriched Tender Doc Cards ────────────────────────────────────── */
.tender-doc-list { display: flex; flex-direction: column; gap: 8px; }
.tender-doc-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 10px 12px; background: white; transition: var(--transition); }
.tender-doc-card:hover { border-color: var(--gray-300); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.tender-doc-header { display: flex; align-items: center; gap: 10px; }
.tender-doc-info { flex: 1; min-width: 0; }
.tender-doc-name { font-size: 0.88rem; font-weight: 500; color: var(--gray-800); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tender-doc-name:hover { color: var(--accent); text-decoration: underline; }
.tender-doc-meta { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.tender-doc-reqs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gray-100); }
.tender-doc-reqs .cf-req-label { cursor: pointer; transition: var(--transition); }
.tender-doc-reqs .cf-req-label:hover { background: rgba(49,130,206,0.18); transform: translateY(-1px); }
.tender-doc-reqs .cf-req-label.loading { opacity: 0.5; pointer-events: none; }

/* (Proposal card document section — now inline in accordion body) */

/* ── Proposals Filter Bar ─────────────────────────────────────────── */
.proposals-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.proposals-filter-bar .filter-group {
    flex: 0 0 auto;
}

.proposals-filter-bar .filter-group:first-child {
    flex: 1 1 120px;
    min-width: 120px;
    max-width: 280px;
}

.proposals-filter-bar .filter-group-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.proposals-filter-bar .filter-range-sep {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.proposals-filter-bar .form-control {
    padding: 6px 10px;
    font-size: 0.82rem;
    height: 34px;
}

.proposals-filter-bar input[type="number"] {
    width: 110px;
}

.proposals-filter-bar select {
    min-width: 160px;
    padding-right: 32px;
}

/* ── Procedures Sections ─────────────────────────────────────────── */
.procedures-section {
    margin-bottom: 24px;
}

.procedures-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.procedures-section-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.procedures-section-header h3 .badge {
    font-size: 0.7rem;
    padding: 1px 8px;
}

/* ── Status Select (inline dropdown styled as badge) ──────────────── */
.status-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 20px 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    vertical-align: middle;
    font-family: var(--font-family);
    line-height: 1.4;
}
.status-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(49,130,206,0.3);
}
.status-select.status-draft      { background-color: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.status-select.status-active     { background-color: #ebf8ff; color: #2b6cb0; border: 1px solid #bee3f8; }
.status-select.status-evaluation { background-color: var(--warning-bg); color: #975a16; border: 1px solid #fefcbf; }
.status-select.status-completed  { background-color: var(--success-bg); color: var(--success); border: 1px solid #c6f6d5; }
.status-select.status-cancelled  { background-color: var(--danger-bg); color: var(--danger); border: 1px solid #fed7d7; }

/* =====================================================================
   Pipeline & Proposal Detail Page
   ===================================================================== */

/* ── Breadcrumb ────────────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .breadcrumb-sep {
    color: var(--gray-400);
}

/* ── Proposal Header ──────────────────────────────────────────────── */
.proposal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.proposal-header-info h2 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.proposal-header-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.proposal-header-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Pipeline Trigger Button ──────────────────────────────────────── */
.btn-pipeline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-pipeline:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-pipeline .icon {
    width: 18px;
    height: 18px;
}

/* ── Horizontal Stepper ───────────────────────────────────────────── */
.pipeline-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin: 32px 0;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
    min-width: 140px;
    transition: var(--transition);
}

.stepper-step:hover .stepper-circle {
    transform: scale(1.1);
}

.stepper-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    border: 3px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-400);
}

.stepper-circle .icon {
    width: 18px;
    height: 18px;
}

.stepper-label {
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
    max-width: 120px;
}

.stepper-sublabel {
    font-size: 0.72rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 2px;
}

/* Stepper states */
.stepper-step.pending .stepper-circle {
    border-color: var(--gray-300);
    color: var(--gray-400);
}

.stepper-step.active .stepper-circle {
    border-color: var(--accent);
    color: var(--accent);
    animation: stepper-pulse 1.5s ease-in-out infinite;
}

.stepper-step.active .stepper-label {
    color: var(--accent);
}

.stepper-step.completed .stepper-circle {
    border-color: var(--success);
    background: var(--success);
    color: var(--white);
}

.stepper-step.completed .stepper-label {
    color: var(--success);
}

.stepper-step.error .stepper-circle {
    border-color: var(--danger);
    background: var(--danger);
    color: var(--white);
}

.stepper-step.error .stepper-label {
    color: var(--danger);
}

/* Stepper connectors */
.stepper-connector {
    flex: 1;
    height: 3px;
    background: var(--gray-200);
    margin-top: 22px;
    min-width: 40px;
    max-width: 120px;
    transition: background 0.3s ease;
}

.stepper-connector.completed {
    background: var(--success);
}

.stepper-connector.active {
    background: linear-gradient(90deg, var(--success), var(--accent));
}

@keyframes stepper-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(49, 130, 206, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(49, 130, 206, 0); }
}

/* ── Scenario Sections ────────────────────────────────────────────── */
.scenario-section {
    margin-bottom: 32px;
    scroll-margin-top: 20px;
}

.scenario-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
}

.scenario-section-header .icon {
    width: 22px;
    height: 22px;
}

.scenario-section-header h3 {
    font-size: 1.1rem;
    color: var(--gray-800);
}

.scenario-section-header .badge {
    margin-left: auto;
}

/* ── Sub-steps List ───────────────────────────────────────────────── */
.sub-steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.sub-step {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.sub-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
}

.sub-step-header:hover {
    background: var(--gray-50);
}

.sub-step-header .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sub-step-name {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--gray-700);
    flex: 1;
}

.sub-step-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* Sub-step states */
.sub-step.pending {
    border-color: var(--gray-200);
    opacity: 0.7;
}

.sub-step.pending .sub-step-status {
    color: var(--gray-400);
}

.sub-step.running {
    border-color: var(--accent);
    border-left-width: 3px;
}

.sub-step.running .sub-step-status {
    color: var(--accent);
}

.sub-step.running .sub-step-status .icon {
    animation: spin 1s linear infinite;
}

.sub-step.completed {
    border-color: var(--gray-200);
}

.sub-step.completed .sub-step-status {
    color: var(--success);
}

.sub-step.error {
    border-color: var(--danger);
    border-left-width: 3px;
    background: var(--danger-bg);
}

.sub-step.error .sub-step-status {
    color: var(--danger);
}

/* Sub-step summary (always visible compact line) */
.sub-step-summary {
    padding: 0 14px 8px;
    font-size: 0.78rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.sub-step-summary .badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    vertical-align: middle;
}

/* Sub-step detail panel */
.sub-step-detail {
    display: none;
    padding: 12px 14px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 0.82rem;
    color: var(--gray-600);
}

.sub-step.expanded .sub-step-detail {
    display: block;
}

.sub-step-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin-top: 4px;
}

.sub-step-detail-table th,
.sub-step-detail-table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.sub-step-detail-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--white);
}

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

/* ── Results Section ──────────────────────────────────────────────── */
.pipeline-results {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.pipeline-results h4 {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin-bottom: 12px;
}

/* Signature details table */
.sig-table-wrapper {
    overflow-x: auto;
    margin-top: 8px;
}

.sig-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 700px;
}

.sig-table th,
.sig-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.sig-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Document grouping cell */
.sig-table td.sig-doc-cell {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-700);
    vertical-align: top;
    border-right: 2px solid var(--gray-200);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Truncated cells with tooltip */
.sig-table .sig-cell-truncate {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sig-table .sig-cell-signer {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sig-table .sig-cell-issuer {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SCAP muted text */
.sig-scap-empty {
    color: var(--gray-400);
    font-size: 0.78rem;
    font-style: italic;
}

/* Conformity matrix in pipeline */
.conformity-grid {
    display: grid;
    gap: 8px;
}

.conformity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--gray-300);
}

.conformity-item.compliant {
    border-left-color: var(--success);
}

.conformity-item.partially_compliant {
    border-left-color: var(--warning);
}

.conformity-item.non_compliant {
    border-left-color: var(--danger);
}

.conformity-item-status {
    font-size: 0.78rem;
    font-weight: 600;
    min-width: 80px;
}

.conformity-item-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--gray-700);
}

.conformity-item-evidence {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
    font-style: italic;
}

/* Score bars in pipeline */
.score-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-bar-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-600);
    min-width: 110px;
}

.score-bar-track {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    background: var(--accent);
}

.score-bar-fill.high { background: var(--success); }
.score-bar-fill.medium { background: var(--warning); }
.score-bar-fill.low { background: var(--danger); }

.score-bar-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    min-width: 50px;
    text-align: right;
}

/* Evidence link */
.evidence-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.78rem;
    cursor: pointer;
    border-bottom: 1px dashed var(--accent-light);
}

.evidence-link:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

/* Report preview in pipeline */
.report-preview-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}

.report-preview-box h1,
.report-preview-box h2,
.report-preview-box h3 {
    color: var(--gray-800);
    margin: 12px 0 6px;
}

.report-preview-box h1 { font-size: 1.2rem; }
.report-preview-box h2 { font-size: 1.05rem; border-bottom: 1px solid var(--gray-200); padding-bottom: 4px; }
.report-preview-box h3 { font-size: 0.95rem; }
.report-preview-box p  { margin-bottom: 10px; }
.report-preview-box ul, .report-preview-box ol { margin: 8px 0 12px 20px; }
.report-preview-box li { margin-bottom: 4px; }
.report-preview-box strong { color: var(--gray-800); }

.report-preview-box table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--gray-200);
    margin: 12px 0;
}

.report-preview-box table th,
.report-preview-box table td {
    border: 1px solid var(--gray-200);
    padding: 8px 12px;
    font-size: 0.85rem;
}

.report-preview-box table th {
    background: var(--gray-50);
    font-weight: 600;
}

/* SWOT cards */
.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.swot-card {
    padding: 14px;
    border-radius: var(--radius);
    font-size: 0.82rem;
}

.swot-card h5 {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.swot-card.strengths {
    background: var(--success-bg);
    border: 1px solid #c6f6d5;
}

.swot-card.weaknesses {
    background: var(--danger-bg);
    border: 1px solid #fed7d7;
}

.swot-card.opportunities {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
}

.swot-card.threats {
    background: var(--warning-bg);
    border: 1px solid #fefcbf;
}

.swot-card ul {
    list-style: disc;
    padding-left: 18px;
}

.swot-card li {
    margin-bottom: 4px;
}

/* Ranking table in pipeline */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 12px;
}

.ranking-table th,
.ranking-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.ranking-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-600);
}

.ranking-table tr.current-proposal {
    background: #ebf8ff;
    font-weight: 600;
}

/* Empty scenario state */
.scenario-empty {
    text-align: center;
    padding: 24px;
    color: var(--gray-400);
    font-size: 0.88rem;
}

.scenario-empty .icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ── Proposal Detail - Ver Analise button ─────────────────────────── */
.btn-ver-analise {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-ver-analise:hover {
    background: var(--accent);
    color: var(--white);
}

.btn-ver-analise .icon {
    width: 14px;
    height: 14px;
}

/* ── Document Detail Page ─────────────────────────────────────────── */

.doc-detail-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.doc-detail-metadata .meta-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-detail-metadata .meta-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.doc-detail-metadata .meta-value {
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* Entity groups */
.entity-group {
    margin-bottom: 16px;
}

.entity-group h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.entity-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.entity-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 8px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.entity-value {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.entity-context {
    color: var(--gray-500);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Section cards */
.section-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}

.section-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gray-50);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.88rem;
    user-select: none;
}

.section-card-header:hover {
    background: var(--gray-100);
}

.section-arrow {
    font-size: 0.7rem;
    color: var(--gray-400);
    width: 14px;
    text-align: center;
}

.section-name {
    flex: 1;
    color: var(--gray-700);
}

.section-card-body {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--gray-600);
    border-top: 1px solid var(--gray-200);
}

/* Requirements list */
.requirement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirement-item {
    padding: 6px 8px;
    border-left: 3px solid var(--gray-300);
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.4;
}

.requirement-item.mandatory {
    border-left-color: var(--danger);
}

.requirement-item.optional {
    border-left-color: var(--accent-light);
}

.req-indicator {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
}

.requirement-item.mandatory .req-indicator {
    background: var(--danger-bg);
    color: var(--danger);
}

.requirement-item.optional .req-indicator {
    background: #ebf8ff;
    color: var(--accent);
}

/* Chunk debug table */
.chunk-table-wrapper {
    max-height: 500px;
    overflow: auto;
}

.chunk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.chunk-table th,
.chunk-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}

.chunk-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    position: sticky;
    top: 0;
    z-index: 1;
}

.chunk-text-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-500);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* Debug toggle */
.debug-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    user-select: none;
}

.debug-toggle input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Clickable document names */
.doc-list-item a.doc-list-name {
    color: inherit;
    text-decoration: none;
}

.doc-list-item a.doc-list-name:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ── Drag-and-Drop (Procedure List) ───────────────────────────────── */
tr.draggable          { cursor: grab; }
tr.draggable:active   { cursor: grabbing; }
tr.dragging           { opacity: 0.4; background: var(--gray-100); }
.drop-zone            { transition: box-shadow 0.2s, border-color 0.2s; border: 2px solid transparent; border-radius: var(--radius-lg); }
.drop-zone-active     { border-color: var(--gray-200); }
.drop-zone-hover      { border-color: var(--accent); background: rgba(49,130,206,0.03); box-shadow: 0 0 0 3px rgba(49,130,206,0.1); }
tr.clickable .status-select { cursor: pointer; position: relative; z-index: 1; }

/* ── Completed Section: Year Filter & Pagination ─────────────────── */
.completed-year-select {
    width: auto;
    min-width: 130px;
    padding: 4px 10px;
    font-size: 0.82rem;
    height: 30px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.pagination-info { white-space: nowrap; }

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-current {
    padding: 0 10px;
    font-weight: 600;
    color: var(--gray-700);
    min-width: 60px;
    text-align: center;
}

.pagination-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Chat Widget (Apple-grade) ──────────────────────────────────── */

/* — FAB Bubble — */
.chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.88) 0%, rgba(20, 40, 72, 0.92) 100%);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    color: white;
    border: 1px solid rgba(255,255,255,0.18);
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(30,58,95,0.25),
        0 8px 24px rgba(30,58,95,0.18),
        inset 0 1px 0 rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.22s cubic-bezier(0.32,0.72,0,1), box-shadow 0.22s ease, opacity 0.28s ease;
    animation: fab-enter 450ms cubic-bezier(0.34,1.56,0.64,1) both, fab-breathe 3.5s ease-in-out 1s infinite;
}
.chat-toggle-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 24px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.22) 0%, transparent 70%);
    pointer-events: none;
}
.chat-toggle-btn::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid rgba(30,58,95,0.9);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.chat-toggle-btn.has-unread::after { transform: scale(1); }
.chat-toggle-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 4px 12px rgba(30,58,95,0.3),
        0 12px 32px rgba(30,58,95,0.22),
        inset 0 1px 0 rgba(255,255,255,0.15);
    animation: none;
}
.chat-toggle-btn:active {
    transform: scale(0.97);
    transition-duration: 100ms;
}
.chat-toggle-btn.hidden {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
    animation: none;
}
.chat-toggle-btn svg {
    animation: fab-spin-in 400ms cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes fab-enter {
    0% { opacity: 0; transform: scale(0.6) translateY(12px); }
    70% { transform: scale(1.06) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fab-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.025); }
}
@keyframes fab-spin-in {
    0% { opacity: 0; transform: rotate(-30deg); }
    100% { opacity: 1; transform: rotate(0deg); }
}

/* — Drawer Container — */
.chat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: rgba(250,250,252,0.96);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: -4px 0 24px rgba(0,0,0,0.10), -1px 0 0 rgba(0,0,0,0.04);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 380ms cubic-bezier(0.32, 0.72, 0, 1);
}
.chat-drawer.open { transform: translateX(0); }

/* — Header (Translucent) — */
.chat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-avatar-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #1e3a5f 0%, #142848 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.chat-header-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.chat-header-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--gray-800);
    line-height: 1.2;
}
.chat-header-subtitle {
    font-size: 0.72rem;
    color: var(--gray-500);
    line-height: 1.2;
}
.chat-header-right {
    display: flex;
    gap: 2px;
}
.chat-header-right button {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.chat-header-right button:hover { background: rgba(0,0,0,0.05); color: var(--gray-700); }

/* — Session Chips — */
.chat-sessions-bar {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
    scrollbar-width: none;
}
.chat-sessions-bar::-webkit-scrollbar { display: none; }
.chat-sessions-bar:empty { display: none; }

.chat-session-chip {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--gray-300);
    background: white;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    color: var(--gray-600);
    transition: all 0.18s ease;
}
.chat-session-chip:hover {
    border-color: rgba(30,58,95,0.3);
    background: rgba(30,58,95,0.04);
    color: var(--gray-700);
}
.chat-session-chip.active {
    background: linear-gradient(135deg, #1e3a5f 0%, #142848 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 1px 4px rgba(30,58,95,0.25);
}

/* — Messages — */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.12) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }

.chat-msg {
    max-width: 88%;
    word-wrap: break-word;
    animation: chat-msg-enter 220ms cubic-bezier(0.32,0.72,0,1) both;
}
.chat-msg-user {
    align-self: flex-end;
    animation-name: chat-msg-enter-right;
}
.chat-msg-user .chat-msg-content {
    background: linear-gradient(135deg, #1e3a5f 0%, #162d4d 100%);
    color: white;
    padding: 10px 14px;
    border-radius: 18px 18px 5px 18px;
    font-size: 0.9rem;
    line-height: 1.45;
    box-shadow: 0 1px 3px rgba(30,58,95,0.15);
}
.chat-msg-assistant {
    align-self: flex-start;
    animation-name: chat-msg-enter-left;
}
.chat-msg-assistant .chat-msg-content {
    background: white;
    border: 1px solid rgba(0,0,0,0.06);
    padding: 10px 14px;
    border-radius: 5px 18px 18px 18px;
    font-size: 0.9rem;
    line-height: 1.55;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.chat-msg-assistant .chat-msg-content h1,
.chat-msg-assistant .chat-msg-content h2,
.chat-msg-assistant .chat-msg-content h3 {
    font-size: 0.95rem;
    margin: 8px 0 4px;
}
.chat-msg-assistant .chat-msg-content p { margin: 4px 0; }
.chat-msg-assistant .chat-msg-content ul,
.chat-msg-assistant .chat-msg-content ol { margin: 4px 0; padding-left: 20px; }
.chat-msg-assistant .chat-msg-content table { font-size: 0.82rem; margin: 6px 0; }
.chat-msg-assistant .chat-msg-content code {
    background: rgba(0,0,0,0.04);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.82rem;
}

@keyframes chat-msg-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes chat-msg-enter-right {
    from { opacity: 0; transform: translateX(12px) translateY(4px); }
    to { opacity: 1; transform: translateX(0) translateY(0); }
}
@keyframes chat-msg-enter-left {
    from { opacity: 0; transform: translateX(-12px) translateY(4px); }
    to { opacity: 1; transform: translateX(0) translateY(0); }
}

/* — Tool Chips & Sources — */
.chat-tool-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.chat-tool-chips:empty { display: none; }

.chat-tool-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}
.chat-tool-chip.tool-running {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    animation: tool-pulse 1.5s ease-in-out infinite;
}
.chat-tool-chip.tool-done {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
@keyframes tool-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.chat-sources-container {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.78rem;
    color: var(--gray-500);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.chat-sources-label {
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}
.chat-source-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.06);
    font-size: 0.72rem;
    color: var(--gray-600);
    transition: background 0.15s;
}
.chat-source-chip:hover { background: rgba(0,0,0,0.06); }

/* — Input Area (iMessage style) — */
.chat-input-area {
    padding: 10px 12px 12px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.chat-input-pill {
    display: flex;
    align-items: flex-end;
    background: white;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 22px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-pill:focus-within {
    border-color: rgba(30,58,95,0.35);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
}
.chat-input {
    flex: 1;
    border: none;
    padding: 7px 0;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 120px;
    line-height: 1.4;
    background: transparent;
}
.chat-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f 0%, #142848 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
}
.chat-send-btn:hover { transform: scale(1.06); }
.chat-send-btn:active { transform: scale(0.94); }
.chat-send-btn:disabled { opacity: 0.3; cursor: default; transform: none; }

/* — Welcome Screen — */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px 32px;
    flex: 1;
}
.chat-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1e3a5f 0%, #142848 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px rgba(30,58,95,0.25);
    animation: welcome-icon-enter 500ms cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes welcome-icon-enter {
    0% { opacity: 0; transform: scale(0.5) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.chat-welcome h3 {
    margin: 14px 0 4px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}
.chat-welcome p {
    font-size: 0.84rem;
    color: var(--gray-500);
    max-width: 280px;
    line-height: 1.5;
}
.chat-context-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 16px;
    background: rgba(30,58,95,0.06);
    border: 1px solid rgba(30,58,95,0.10);
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 10px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-context-badge svg { flex-shrink: 0; color: var(--gray-500); }
.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
    width: 100%;
    max-width: 300px;
}
.chat-suggestion {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.07);
    background: white;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--gray-700);
    text-align: left;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.chat-suggestion:hover {
    border-color: rgba(30,58,95,0.18);
    background: rgba(30,58,95,0.02);
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* — Utility — */
.chat-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: chat-spin 0.6s linear infinite;
}
@keyframes chat-spin {
    to { transform: rotate(360deg); }
}

.chat-error-text {
    color: var(--danger, #dc2626);
    font-size: 0.85rem;
}

.chat-error {
    text-align: center;
    padding: 16px;
    color: var(--danger, #dc2626);
    font-size: 0.85rem;
}

/* ── Login Page ────────────────────────────────────────────────────── */

.login-page {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    z-index: 100;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header svg {
    color: var(--gray-600);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 10px;
    letter-spacing: -0.03em;
}

.login-header p {
    color: var(--gray-400);
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: 2px;
}

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

.login-form .form-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-500);
}

.login-form .form-control {
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-form .form-control::placeholder {
    color: var(--gray-300);
}

.login-form .form-control:focus {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 11px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
    background: var(--gray-800);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 150ms ease, opacity 150ms ease;
}

.login-btn:hover {
    background: var(--gray-700);
}

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

.login-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid rgba(229, 62, 62, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.login-error.hidden {
    display: none;
}

.login-footer {
    margin-top: 20px;
    font-size: 0.7rem;
    color: var(--gray-400);
    text-align: center;
}

/* ── User Menu (sidebar footer) ────────────────────────────────────── */

.user-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    min-height: 0;
    margin-bottom: 4px;
    position: relative;
    border-radius: 7px;
    transition: background 150ms ease;
}

.user-menu:hover {
    background: var(--sidebar-hover-bg);
}

.user-menu:empty {
    display: none;
}

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

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s, opacity 0.15s;
    opacity: 0;
}

.user-menu:hover .btn-logout {
    opacity: 1;
}

.btn-logout:hover {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.08);
}

/* ── Revocation detail lines ─────────────────────────────────────── */
.sig-rev-detail {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sig-rev-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 2px;
}

/* =====================================================================
   Traceability Audit Panel (ta-* prefix)
   ===================================================================== */

/* ── Summary Bar ──────────────────────────────────────────────────── */
.ta-summary-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-wrap: wrap;
}

.ta-stat-chip {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ta-stat-chip__number {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.ta-stat-chip__number--formal { color: #22c55e; }
.ta-stat-chip__number--conformity { color: #3b82f6; }
.ta-stat-chip__number--scoring { color: #f97316; }

.ta-stat-chip__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--gray-500);
    line-height: 1;
}

.ta-compliance-bar-wrap {
    margin-left: auto;
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ta-status-dist-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--gray-200);
}

.ta-dist-segment {
    transition: width 0.3s ease;
    min-width: 0;
}

.ta-dist-segment.compliant { background: var(--success); }
.ta-dist-segment.partial { background: var(--warning); }
.ta-dist-segment.non-compliant { background: var(--danger); }
.ta-dist-segment.not-addressed { background: var(--gray-400); }

.ta-status-dist-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ta-legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    color: var(--gray-600);
}

.ta-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ta-legend-dot.compliant { background: var(--success); }
.ta-legend-dot.partial { background: var(--warning); }
.ta-legend-dot.non-compliant { background: var(--danger); }
.ta-legend-dot.not-addressed { background: var(--gray-400); }

/* ── Toolbar ──────────────────────────────────────────────────────── */
.ta-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.ta-toolbar__search {
    position: relative;
    flex: 0 1 220px;
    min-width: 140px;
}

.ta-toolbar__search .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--gray-400);
    pointer-events: none;
}

.ta-search-input {
    width: 100%;
    padding: 5px 10px 5px 30px;
    font-size: 0.8rem;
    font-family: var(--font-family);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-700);
    transition: var(--transition);
}

.ta-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(49,130,206,0.12);
}

.ta-search-input::placeholder {
    color: var(--gray-400);
}

.ta-toolbar__select {
    padding: 5px 26px 5px 8px;
    font-size: 0.78rem;
    font-family: var(--font-family);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-700);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
    transition: var(--transition);
}

.ta-toolbar__select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(49,130,206,0.12);
}

.ta-toolbar__select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ta-toolbar__meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ta-filter-count {
    font-size: 0.78rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.ta-clear-btn {
    font-size: 0.75rem;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-family);
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
}

.ta-clear-btn:hover {
    background: rgba(49,130,206,0.08);
}

.ta-toolbar__expand-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--gray-500);
    font-size: 0.85rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.ta-toolbar__expand-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* ── Company Groups ────────────────────────────────────────────────── */
.ta-entries-container {
    padding: 12px 20px 20px;
}

.ta-company-group {
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.ta-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--gray-50);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.ta-group-header:hover {
    background: var(--gray-100);
}

.ta-group-chevron {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--gray-400);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ta-group--open > .ta-group-header .ta-group-chevron,
.ta-group-header.ta-group--open .ta-group-chevron {
    transform: rotate(90deg);
}

.ta-group-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.ta-group-count {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 400;
    min-width: 24px;
    text-align: center;
}

.ta-group-minibar {
    flex: 0 0 80px;
    height: 6px;
    border-radius: 3px;
    display: flex;
    overflow: hidden;
    margin-left: auto;
    background: var(--gray-200);
}

.ta-minibar-seg {
    height: 100%;
}

.ta-minibar-seg--formal { background: #22c55e; }
.ta-minibar-seg--conformity { background: #3b82f6; }
.ta-minibar-seg--scoring { background: #f97316; }

.ta-group-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
    overflow: hidden;
}

.ta-group-body > div {
    overflow: hidden;
}

.ta-group-body--open {
    grid-template-rows: 1fr;
}

/* ── Entry Cards ───────────────────────────────────────────────────── */
.ta-entry {
    border-top: 1px solid var(--gray-100);
}

.ta-entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}

.ta-entry-header:hover {
    background: var(--gray-50);
}

.ta-entry-header:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.ta-entry-chevron {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ta-entry-chevron::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 4px solid var(--gray-400);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    transition: transform 0.2s;
}

.ta-entry--open .ta-entry-chevron::after {
    transform: rotate(90deg);
}

.ta-entry-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    line-height: 1;
}

.ta-entry-status--compliant { background: var(--success); }
.ta-entry-status--non_compliant { background: var(--danger); }
.ta-entry-status--partially_compliant { background: var(--warning); color: #975a16; }
.ta-entry-status--not_addressed { background: var(--gray-400); }
.ta-entry-status--formal { background: #22c55e; }
.ta-entry-status--scoring { background: #f97316; }

.ta-entry-claim {
    flex: 1;
    font-size: 0.82rem;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.ta-entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ta-page-ref {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-family: var(--font-mono);
}

.ta-similarity {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--gray-500);
}

.ta-similarity-bar {
    width: 40px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.ta-similarity-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}

/* ── Accordion Body (CSS Grid) ────────────────────────────────────── */
.ta-entry-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
    overflow: hidden;
}

.ta-entry-body > div {
    overflow: hidden;
}

.ta-entry-body--open {
    grid-template-rows: 1fr;
}

.ta-entry-body-inner {
    padding: 10px 16px 14px 42px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.82rem;
}

/* ── Detail Badges (moved from header) ────────────────────────────── */
.ta-detail-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

/* ── Detail Grid ───────────────────────────────────────────────────── */
.ta-detail-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
}

.ta-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding-top: 2px;
}

.ta-detail-value {
    font-size: 0.82rem;
    color: var(--gray-700);
    line-height: 1.5;
    word-break: break-word;
}

/* ── Score Cells ───────────────────────────────────────────────────── */
.ta-scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}

.ta-score-cell {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 6px 10px;
    text-align: center;
}

.ta-score-cell-label {
    font-size: 0.68rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ta-score-cell-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.ta-score-cell--highlight {
    background: rgba(49,130,206,0.06);
    border-color: var(--accent);
}

.ta-score-cell--highlight .ta-score-cell-value {
    color: var(--accent);
}

/* ── Search Highlighting ──────────────────────────────────────────── */
.ta-search-match {
    background: rgba(249,204,46,0.35);
    border-radius: 2px;
    padding: 0 1px;
}

.ta-search-active .ta-entry-claim {
    white-space: normal;
}

/* ── Scroll-to-Entry Highlight ────────────────────────────────────── */
.ta-entry--highlight {
    animation: taEntryPulse 2s ease;
}

@keyframes taEntryPulse {
    0% {
        box-shadow: inset 3px 0 0 var(--accent), 0 0 0 2px rgba(49,130,206,0.2);
        background: rgba(49,130,206,0.08);
    }
    100% {
        box-shadow: inset 0 0 0 transparent, 0 0 0 0 transparent;
        background: transparent;
    }
}

/* ── Empty State ───────────────────────────────────────────────────── */
.ta-empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--gray-400);
}

.ta-empty-state-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.ta-empty-state-text {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ta-toolbar {
        gap: 6px;
    }
    .ta-toolbar__search {
        flex: 1 1 100%;
    }
    .ta-summary-bar {
        gap: 10px;
    }
    .ta-compliance-bar-wrap {
        flex: 1 1 100%;
        margin-left: 0;
    }
}

/* =====================================================================
   Conformidade Técnica — cf- prefixed styles
   ===================================================================== */

/* ── Dashboard Stats Grid ─────────────────────────────────────────── */
.cf-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.cf-stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.cf-stat-card:hover {
    box-shadow: var(--shadow-md);
}

.cf-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
}

.cf-stat-value.success { color: var(--success); }
.cf-stat-value.warning { color: var(--warning); }
.cf-stat-value.danger  { color: var(--danger); }
.cf-stat-value.neutral { color: var(--gray-700); }

.cf-stat-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

/* ── Category Breakdown Bars ──────────────────────────────────────── */
.cf-cat-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.cf-cat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-cat-label {
    width: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    text-align: right;
    flex-shrink: 0;
}

.cf-cat-bar {
    flex: 1;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    background: var(--gray-100);
}

.cf-cat-seg {
    height: 100%;
    transition: width 0.5s ease;
}

.cf-cat-seg.compliant     { background: var(--success); }
.cf-cat-seg.partial       { background: var(--warning); }
.cf-cat-seg.non-compliant { background: var(--danger); }
.cf-cat-seg.not-addressed { background: var(--gray-300); }

.cf-cat-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    width: 40px;
    flex-shrink: 0;
}

/* ── Search Bar ───────────────────────────────────────────────────── */
.cf-search {
    position: relative;
    margin-bottom: 12px;
}

.cf-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--white);
    transition: var(--transition);
}

.cf-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49,130,206,0.1);
}

.cf-search .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

/* ── Requirement Groups (Collapsible) ─────────────────────────────── */
.cf-req-group {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
    background: var(--white);
}

.cf-req-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    background: var(--gray-50);
    transition: var(--transition);
    user-select: none;
}

.cf-req-group-header:hover {
    background: var(--gray-100);
}

.cf-req-group-header .icon {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.cf-req-group.collapsed .cf-req-group-header .icon {
    transform: rotate(-90deg);
}

.cf-req-group-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 1px 8px;
    border-radius: 10px;
}

.cf-req-group-body {
    padding: 6px 10px 10px;
    max-height: 1000px;
    transition: max-height 0.25s ease, padding 0.25s ease;
    overflow: hidden;
}

.cf-req-group.collapsed .cf-req-group-body {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
}

.cf-req-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 6px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.84rem;
}

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

.cf-req-doc-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 2px;
    border-radius: var(--radius);
    flex-shrink: 0;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    margin-left: auto;
}

.cf-req-doc-link:hover {
    color: var(--accent);
    background: rgba(49,130,206,0.08);
}

.cf-req-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(49,130,206,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
}

.cf-req-mandatory {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.cf-req-mandatory.required { background: var(--danger); }
.cf-req-mandatory.optional { background: var(--gray-300); }

.cf-req-text {
    flex: 1;
    color: var(--gray-700);
    line-height: 1.4;
}

.cf-hidden { display: none; }

/* ── View Toggle ──────────────────────────────────────────────────── */
.cf-view-toggle {
    display: inline-flex;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.cf-view-btn {
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--white);
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
}

.cf-view-btn:not(:last-child) {
    border-right: 1px solid var(--gray-200);
}

.cf-view-btn.active {
    background: var(--accent);
    color: var(--white);
}

/* ── Proposal Cards ───────────────────────────────────────────────── */
.cf-proposal-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-proposal-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.cf-proposal-card:hover {
    box-shadow: var(--shadow-md);
}

.cf-proposal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.cf-proposal-header:hover {
    background: var(--gray-50);
}

.cf-proposal-header .icon {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.cf-proposal-card.collapsed .cf-proposal-header .icon {
    transform: rotate(-90deg);
}

.cf-proposal-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--gray-800);
    flex: 1;
}

.cf-pills {
    display: flex;
    gap: 6px;
}

.cf-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

.cf-pill.compliant     { background: var(--success-bg); color: var(--success); }
.cf-pill.partial       { background: var(--warning-bg); color: var(--warning); }
.cf-pill.non-compliant { background: var(--danger-bg);  color: var(--danger); }

/* ── Score Ring (conic-gradient) ──────────────────────────────────── */
.cf-score-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.cf-score-ring-inner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-700);
}

/* ── Proposal Detail ──────────────────────────────────────────────── */
.cf-proposal-detail {
    padding: 0 16px 14px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.cf-proposal-card:not(.collapsed) .cf-proposal-detail {
    max-height: 400px;
    overflow-y: auto;
}

.cf-proposal-card.collapsed .cf-proposal-detail {
    padding-top: 0;
    padding-bottom: 0;
}

.cf-detail-cat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-500);
    padding: 6px 0 4px;
    border-bottom: 1px solid var(--gray-100);
    margin-top: 8px;
}

.cf-detail-cat-label:first-child {
    margin-top: 0;
}

.cf-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    border-bottom: 1px solid var(--gray-50);
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
}

.cf-detail-row:hover {
    background: var(--gray-50);
}

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

.cf-detail-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-status-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.cf-status-pill.compliant     { background: var(--success-bg); color: var(--success); }
.cf-status-pill.partial       { background: var(--warning-bg); color: var(--warning); }
.cf-status-pill.non-compliant { background: var(--danger-bg);  color: var(--danger); }
.cf-status-pill.not-addressed { background: var(--gray-100);   color: var(--gray-500); }

.cf-confidence {
    font-size: 0.7rem;
    color: var(--gray-400);
    flex-shrink: 0;
    width: 36px;
    text-align: right;
}

/* ── Matrix Table (compact toggle) ────────────────────────────────── */
.cf-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.cf-matrix-table th {
    padding: 6px 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    height: 80px;
    max-width: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-matrix-table th:first-child {
    writing-mode: horizontal-tb;
    transform: none;
    text-align: left;
    height: auto;
    max-width: none;
    padding: 6px 8px;
}

.cf-matrix-table td {
    padding: 4px;
    text-align: center;
}

.cf-matrix-table td:first-child {
    text-align: left;
    padding: 4px 8px;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

.cf-matrix-table tbody tr:hover {
    background: var(--gray-50);
}

.cf-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.cf-dot:hover {
    transform: scale(1.3);
}

.cf-dot.compliant     { background: var(--success); }
.cf-dot.partial       { background: var(--warning); }
.cf-dot.non-compliant { background: var(--danger); }
.cf-dot.not-addressed { background: var(--gray-300); }

/* ── Evidence Drawer ──────────────────────────────────────────────── */
.cf-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.cf-drawer-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.cf-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 460px;
    max-width: 90vw;
    height: 100vh;
    background: var(--white);
    z-index: 910;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cf-drawer.open {
    right: 0;
}

.cf-drawer-status {
    padding: 12px 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cf-drawer-status.compliant     { background: var(--success-bg); color: var(--success); }
.cf-drawer-status.partial       { background: var(--warning-bg); color: var(--warning); }
.cf-drawer-status.non-compliant { background: var(--danger-bg);  color: var(--danger); }
.cf-drawer-status.not-addressed { background: var(--gray-100);   color: var(--gray-500); }

.cf-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.cf-drawer-header h4 {
    font-size: 0.92rem;
    color: var(--gray-800);
    margin: 0;
}

.cf-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.cf-drawer-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.cf-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cf-drawer-section {
    margin-bottom: 18px;
}

.cf-drawer-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.cf-drawer-text {
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.cf-drawer-excerpt {
    background: var(--gray-50);
    padding: 12px;
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
    font-size: 0.82rem;
    color: var(--gray-600);
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

.cf-drawer-page-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(49,130,206,0.1);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 6px;
}

.cf-drawer-confidence {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cf-drawer-conf-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.cf-drawer-conf-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.cf-drawer-conf-fill.high   { background: var(--success); }
.cf-drawer-conf-fill.medium { background: var(--warning); }
.cf-drawer-conf-fill.low    { background: var(--danger); }

.cf-drawer-conf-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-700);
    min-width: 36px;
    text-align: right;
}

/* ── Progress Steps ───────────────────────────────────────────────── */
.cf-progress {
    padding: 20px 0;
}

.cf-progress-bar {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 14px;
}

.cf-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.cf-progress-counter {
    font-size: 0.82rem;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 10px;
}

.cf-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cf-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius);
    font-size: 0.84rem;
}

.cf-progress-step .step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.65rem;
}

.cf-progress-step.pending .step-icon {
    background: var(--gray-200);
    color: var(--gray-400);
}

.cf-progress-step.active {
    background: rgba(49,130,206,0.05);
}

.cf-progress-step.active .step-icon {
    background: var(--accent);
    color: var(--white);
}

.cf-progress-step.completed .step-icon {
    background: var(--success);
    color: var(--white);
}

.cf-progress-step .step-label {
    color: var(--gray-600);
}

.cf-progress-step.active .step-label {
    color: var(--accent);
    font-weight: 600;
}

.cf-progress-step.completed .step-label {
    color: var(--success);
}

/* ── Source Context Panel ─────────────────────────────────── */
.cf-source-panel {
    margin: 0 0 0 28px;
    padding: 0;
    background: var(--gray-50);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
}
.cf-source-panel.open {
    max-height: 800px;
    opacity: 1;
    padding: 12px 16px;
    overflow-y: auto;
}
.cf-source-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.75rem; }
.cf-source-heading { color: var(--gray-600); font-weight: 500; }
.cf-source-page-badge { background: rgba(49,130,206,0.08); color: var(--accent); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }
.cf-source-sim { color: var(--gray-400); font-size: 0.7rem; margin-left: auto; }
.cf-source-excerpt {
    margin: 0 0 10px; padding: 10px 14px;
    background: white; border-radius: 6px; border: 1px solid var(--gray-200);
    font-size: 0.85rem; line-height: 1.65; color: var(--gray-700);
    max-height: 200px; overflow-y: auto;
}
.cf-source-excerpt mark { background: #fef08a; color: inherit; padding: 1px 2px; border-radius: 2px; }
.cf-source-actions { display: flex; gap: 8px; }
.cf-source-secondary { font-size: 0.8rem; color: var(--gray-500); margin-top: 8px; }
.cf-source-secondary summary { cursor: pointer; font-weight: 500; }
.cf-source-secondary blockquote { margin: 6px 0; padding: 8px 12px; background: white; border-radius: 4px; border: 1px solid var(--gray-200); font-size: 0.8rem; }
.cf-req-doc-link.loading { opacity: 0.5; pointer-events: none; }

/* ── Status-colored R# pills (proposal conformity) ──────── */
.cf-req-label.compliant     { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.cf-req-label.partial       { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.cf-req-label.non-compliant { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.cf-req-label.not-addressed { background: var(--gray-100);   color: var(--gray-500); }

/* ── Clickable evidence rows ────────────────────────────── */
.cf-req-row-evidence { cursor: pointer; transition: var(--transition); }
.cf-req-row-evidence:hover { background: var(--gray-50); }

/* ── KPI bar ────────────────────────────────────────────── */
.cf-kpi-bar { display: flex; gap: 16px; padding: 12px 0; margin-bottom: 12px; border-bottom: 1px solid var(--gray-100); }
.cf-kpi { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 500; color: var(--gray-600); }
.cf-kpi-count { font-size: 1.1rem; font-weight: 700; }
.cf-kpi.compliant .cf-kpi-count { color: var(--success); }
.cf-kpi.partial .cf-kpi-count { color: var(--warning); }
.cf-kpi.non-compliant .cf-kpi-count { color: var(--danger); }

/* ── Evidence panel variant (left border color by status) ─ */
.cf-source-panel.evidence-compliant     { border-left: 3px solid var(--success); }
.cf-source-panel.evidence-partial       { border-left: 3px solid var(--warning); }
.cf-source-panel.evidence-non-compliant { border-left: 3px solid var(--danger); }
.cf-source-panel.evidence-not-addressed { border-left: 3px solid var(--gray-300); }

/* ── LLM explanation ────────────────────────────────────── */
.cf-evidence-explanation { font-size: 0.84rem; line-height: 1.5; color: var(--gray-600); margin-bottom: 10px; }

/* ── Proposal card conformity pills ─────────────────────── */
.proposal-card-conformity-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.proposal-card-conformity-pills .cf-req-label { cursor: pointer; transition: var(--transition); }
.proposal-card-conformity-pills .cf-req-label:hover { transform: translateY(-1px); }
.proposal-card-conformity-pills .cf-req-label.loading { opacity: 0.5; pointer-events: none; }

/* ── Confidence badge in evidence rows ──────────────────── */
.cf-confidence { font-size: 0.7rem; color: var(--gray-400); margin-left: auto; flex-shrink: 0; font-family: var(--font-mono); }

/* ── Evidence Panel (3-column expected/proposed/source) ── */
.cf-evidence-panel {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.cf-evidence-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cf-evidence-col-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}

.cf-evidence-col-title.expected { color: var(--accent); border-bottom-color: var(--accent); }
.cf-evidence-col-title.proposed { color: var(--success); border-bottom-color: var(--success); }
.cf-evidence-col-title.source   { color: var(--gray-500); }

.cf-evidence-col-value {
    font-size: 0.84rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.cf-evidence-col-meta {
    font-size: 0.72rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cf-evidence-check {
    color: var(--success);
    font-weight: 700;
}

.cf-evidence-cross {
    color: var(--danger);
    font-weight: 700;
}

/* ── Timeline visualization ──────────────────────────── */
.cf-timeline {
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.cf-timeline-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cf-timeline-bar {
    position: relative;
    height: 20px;
    background: var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.cf-timeline-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.cf-timeline-fill.meets     { background: var(--success); }
.cf-timeline-fill.close     { background: var(--warning); }
.cf-timeline-fill.insufficient { background: var(--danger); }

.cf-timeline-markers {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--gray-400);
}

.cf-timeline-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--gray-600);
}

.cf-timeline-summary strong {
    color: var(--gray-800);
}

/* ── Delta indicator (numeric comparison) ────────────── */
.cf-delta-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.cf-delta-indicator.over  { background: var(--success-bg); color: var(--success); }
.cf-delta-indicator.under { background: var(--danger-bg);  color: var(--danger); }
.cf-delta-indicator.exact { background: var(--gray-100);   color: var(--gray-600); }

/* ── Filter pills ────────────────────────────────────── */
.cf-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.cf-filter-pill {
    padding: 4px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    background: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
}

.cf-filter-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cf-filter-pill.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

/* ── KPI strip (compact horizontal) ──────────────────── */
.cf-kpi-strip {
    display: flex;
    gap: 20px;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.cf-kpi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cf-kpi-item-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.cf-kpi-item-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cf-kpi-item-value.success { color: var(--success); }
.cf-kpi-item-value.warning { color: var(--warning); }
.cf-kpi-item-value.danger  { color: var(--danger); }
.cf-kpi-item-value.neutral { color: var(--gray-700); }

/* ── Category bar (interactive stacked bar) ──────────── */
.cf-category-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 12px;
}

.cf-category-bar-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    width: 80px;
    flex-shrink: 0;
}

.cf-category-bar-track {
    flex: 1;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    background: var(--gray-100);
    cursor: pointer;
}

.cf-category-bar-track .cf-cat-seg {
    cursor: pointer;
    transition: opacity 0.2s;
}

.cf-category-bar-track .cf-cat-seg:hover {
    opacity: 0.8;
}

/* ── Document type edit dropdown ─────────────────────── */
.doc-type-edit-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.doc-type-select {
    padding: 3px 8px;
    font-size: 0.78rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}

.doc-type-select:hover {
    border-color: var(--accent);
}

.doc-type-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49,130,206,0.1);
}

.doc-type-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 2px;
    transition: var(--transition);
}

.doc-type-edit-btn:hover {
    color: var(--accent);
}

/* ── Classification badge (upload panel) ─────────────── */
.upload-classification-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(49,130,206,0.08);
    color: var(--accent);
}

.upload-classification-badge .conf-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.upload-classification-badge .conf-indicator.high   { background: var(--success); }
.upload-classification-badge .conf-indicator.medium { background: var(--warning); }
.upload-classification-badge .conf-indicator.low    { background: var(--gray-400); }

/* ── Evidence panel responsive ───────────────────────── */
@media (max-width: 768px) {
    .cf-evidence-panel { grid-template-columns: 1fr; }
    .cf-kpi-strip { flex-wrap: wrap; gap: 12px; }
    .cf-filter-pills { gap: 4px; }
}

/* ── Document Detail: Hero strip ───────────────────────── */
.doc-hero { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); margin-top: 12px; }
.doc-hero-info { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--gray-600); flex-wrap: wrap; }
.doc-hero-sep { color: var(--gray-300); }
.doc-hero-status { flex-shrink: 0; }

/* ── Document Detail: Collapsible secondary cards ──────── */
.doc-collapsible-header { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.doc-collapsible-header:hover { background: var(--gray-50); }
.collapse-icon { font-size: 0.7rem; color: var(--gray-400); transition: transform 0.2s ease; }
.doc-collapsible-card.expanded .collapse-icon { transform: rotate(90deg); }

/* ── Document Detail: Section requirement pills ────────── */
.section-req-pills { display: flex; gap: 3px; margin-left: auto; }
.section-req-pills .cf-req-label { font-size: 0.65rem; padding: 1px 5px; }

/* =====================================================================
   Validação Formal — vf- prefixed styles
   ===================================================================== */

/* ── Dashboard Stats Grid ─────────────────────────────────────────── */
.vf-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.vf-stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.vf-stat-card:hover { box-shadow: var(--shadow-md); }

.vf-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
}

.vf-stat-value.success { color: var(--success); }
.vf-stat-value.warning { color: var(--warning); }
.vf-stat-value.danger  { color: var(--danger); }
.vf-stat-value.neutral { color: var(--gray-700); }

.vf-stat-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

/* ── Pillar Aggregate Bars ──────────────────────────────────────────── */
.vf-pillar-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.vf-pillar-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vf-pillar-bar-label {
    width: 180px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    text-align: right;
    flex-shrink: 0;
}

.vf-pillar-bar-track {
    flex: 1;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--gray-100);
}

.vf-pillar-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.vf-pillar-bar-fill.high    { background: var(--success); }
.vf-pillar-bar-fill.medium  { background: var(--warning); }
.vf-pillar-bar-fill.low     { background: var(--danger); }

.vf-pillar-bar-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-600);
    width: 60px;
    flex-shrink: 0;
}

.vf-pillar-bar-weight {
    font-size: 0.7rem;
    color: var(--gray-400);
    width: 40px;
    flex-shrink: 0;
    text-align: right;
}

/* ── Proposal Cards ─────────────────────────────────────────────────── */
.vf-proposal-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vf-proposal-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.vf-proposal-card:hover { box-shadow: var(--shadow-md); }

.vf-proposal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.vf-proposal-header:hover { background: var(--gray-50); }

.vf-proposal-header .icon {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.vf-proposal-card.collapsed .vf-proposal-header .icon {
    transform: rotate(-90deg);
}

.vf-proposal-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--gray-800);
}

.vf-proposal-nif {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
}

.vf-proposal-name-block {
    flex: 1;
    min-width: 0;
}

.vf-proposal-detail {
    padding: 0 16px 14px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.vf-proposal-card:not(.collapsed) .vf-proposal-detail {
    max-height: 2000px;
    overflow-y: auto;
}

.vf-proposal-card.collapsed .vf-proposal-detail {
    padding-top: 0;
    padding-bottom: 0;
}

/* ── Pills ──────────────────────────────────────────────────────────── */
.vf-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.vf-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
    white-space: nowrap;
}

.vf-pill.complete    { background: var(--success-bg); color: var(--success); }
.vf-pill.partial     { background: var(--warning-bg); color: var(--warning); }
.vf-pill.missing     { background: var(--danger-bg);  color: var(--danger); }
.vf-pill.qualified   { background: var(--success-bg); color: var(--success); }
.vf-pill.unqualified { background: var(--warning-bg); color: var(--warning); }
.vf-pill.neutral     { background: var(--gray-100);   color: var(--gray-500); }

/* ── Pillar Sections (inside expanded cards) ───────────────────────── */
.vf-pillar {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
}

.vf-pillar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gray-50);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--gray-700);
}

.vf-pillar-header .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.vf-pillar-header .vf-pill {
    margin-left: auto;
}

.vf-pillar-body {
    padding: 10px 14px;
}

/* ── Checklist Items ────────────────────────────────────────────────── */
.vf-check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.84rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-50);
}

.vf-check-item:last-child { border-bottom: none; }

.vf-check-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.vf-check-icon.pass   { color: var(--success); }
.vf-check-icon.fail   { color: var(--danger); }
.vf-check-icon.unknown { color: var(--gray-400); }

.vf-check-text { flex: 1; line-height: 1.4; }

/* ── Score Breakdown ────────────────────────────────────────────────── */
.vf-score-breakdown {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
}

.vf-score-breakdown-header {
    padding: 10px 14px;
    background: var(--gray-50);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--gray-700);
}

.vf-score-breakdown-body {
    padding: 10px 14px;
}

.vf-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--gray-50);
}

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

.vf-score-row-label {
    width: 180px;
    font-weight: 500;
    color: var(--gray-600);
    flex-shrink: 0;
}

.vf-score-bar-track {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-100);
    overflow: hidden;
}

.vf-score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.vf-score-bar-fill.high    { background: var(--success); }
.vf-score-bar-fill.medium  { background: var(--warning); }
.vf-score-bar-fill.low     { background: var(--danger); }

.vf-score-row-value {
    font-weight: 700;
    color: var(--gray-700);
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}

.vf-score-row-weight {
    font-size: 0.72rem;
    color: var(--gray-400);
    width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.vf-score-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--gray-50);
    font-weight: 700;
    font-size: 0.88rem;
    border-top: 1px solid var(--gray-200);
}

/* ── Signature Detail Rows ──────────────────────────────────────────── */
.vf-sig-summary {
    font-size: 0.84rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.vf-sig-row {
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    margin-bottom: 6px;
    overflow: hidden;
}

.vf-sig-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--gray-700);
    transition: var(--transition);
}

.vf-sig-row-header:hover { background: var(--gray-50); }

.vf-sig-row-header .icon {
    width: 12px;
    height: 12px;
    color: var(--gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.vf-sig-row.collapsed .vf-sig-row-header .icon {
    transform: rotate(-90deg);
}

.vf-sig-row-header .badge { margin-left: auto; }

.vf-sig-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    padding: 8px 12px;
    font-size: 0.82rem;
    border-top: 1px solid var(--gray-100);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
}

.vf-sig-row:not(.collapsed) .vf-sig-grid {
    max-height: 400px;
    padding: 8px 12px;
}

.vf-sig-row.collapsed .vf-sig-grid {
    padding-top: 0;
    padding-bottom: 0;
}

.vf-sig-row.collapsed .vf-sig-badges {
    display: none;
}

.vf-sig-grid .meta-label {
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.78rem;
}

.vf-sig-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 12px 8px;
    border-top: 1px solid var(--gray-100);
}

/* ── Alert box ──────────────────────────────────────────────────────── */
.vf-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    margin-top: 8px;
}

.vf-alert.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(237,137,54,0.2);
}

.vf-alert.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(229,62,62,0.2);
}

.vf-alert.info {
    background: rgba(49,130,206,0.06);
    color: var(--accent);
    border: 1px solid rgba(49,130,206,0.15);
}

.vf-alert .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Observations text ──────────────────────────────────────────────── */
.vf-observations {
    font-size: 0.82rem;
    color: var(--gray-500);
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-top: 6px;
    line-height: 1.5;
}

/* ── Revalidate button in header ──────────────────────────────────── */
.vf-btn-revalidate {
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.vf-btn-revalidate:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(49,130,206,0.04);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .vf-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .vf-pillar-bar-label { width: 120px; font-size: 0.75rem; }
    .vf-score-row-label { width: 120px; }
    .vf-sig-grid { grid-template-columns: 1fr; }
    .vf-proposal-header { flex-wrap: wrap; }
    .vf-pills { order: 10; width: 100%; }
}

/* =====================================================================
   Report Page (rp-*) — Premium Jury Decision Dashboard
   ===================================================================== */

/* ── rp: Page wrapper ─────────────────────────────────────────────── */
.rp-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── rp: Pipeline Stepper ─────────────────────────────────────────── */
.rp-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    gap: 0;
}

.rp-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rp-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-400);
    transition: all 0.3s ease;
    position: relative;
}

.rp-step--complete .rp-step-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.rp-step--complete .rp-step-dot::after {
    content: '\2713';
    font-size: 0.8rem;
    font-weight: 700;
}

.rp-step--active .rp-step-dot {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px rgba(49,130,206,0.12);
}

.rp-step-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    white-space: nowrap;
    font-weight: 500;
}

.rp-step--complete .rp-step-label,
.rp-step--active .rp-step-label {
    color: var(--gray-600);
}

.rp-step-connector {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 4px;
    margin-bottom: 18px;
    transition: background 0.3s ease;
}

.rp-step-connector--complete {
    background: var(--accent);
}

/* ── rp: Hero Section ─────────────────────────────────────────────── */
.rp-hero {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
}

.rp-hero--empty {
    border: 2px dashed var(--gray-200);
    background: var(--gray-50);
    box-shadow: none;
    padding: 40px 32px;
}

.rp-hero-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    font-weight: 600;
    margin-bottom: 4px;
}

.rp-hero-company {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.rp-donut {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    display: block;
}

.rp-donut-bg {
    stroke: var(--gray-100);
    stroke-width: 8;
    fill: none;
}

.rp-donut-fill {
    stroke: var(--accent);
    stroke-width: 8;
    fill: none;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dasharray 1s ease;
}

.rp-donut-text {
    fill: var(--gray-800);
    font-size: 1.4rem;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
}

.rp-donut-sublabel {
    fill: var(--gray-400);
    font-size: 0.55rem;
    text-anchor: middle;
}

.rp-hero-runners {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.rp-runner {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-600);
}

.rp-runner-pos {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--white);
}

.rp-runner-pos--2 { background: #94a3b8; }
.rp-runner-pos--3 { background: #d97706; }

.rp-hero-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.rp-hero-badge--conforme {
    background: rgba(34,197,94,0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.rp-hero-badge--nao-conforme {
    background: rgba(229,62,62,0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* ── rp: Ranking Cards ────────────────────────────────────────────── */
.rp-ranking-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.rp-rank-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--gray-200);
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.rp-rank-card:hover {
    box-shadow: var(--shadow-md);
}

.rp-rank-card--1st { border-top-color: #f59e0b; }
.rp-rank-card--2nd { border-top-color: #94a3b8; }
.rp-rank-card--3rd { border-top-color: #d97706; }

.rp-rank-medal {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.rp-rank-medal--1st { background: rgba(245,158,11,0.15); color: #b45309; }
.rp-rank-medal--2nd { background: rgba(148,163,184,0.2); color: #475569; }
.rp-rank-medal--3rd { background: rgba(217,119,6,0.15); color: #92400e; }
.rp-rank-medal--other { background: var(--gray-100); color: var(--gray-500); }

.rp-rank-company {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rp-rank-final {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 12px;
}

.rp-mini-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rp-mini-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rp-mini-bar-label {
    font-size: 0.68rem;
    color: var(--gray-400);
    width: 14px;
    text-align: right;
    font-weight: 600;
}

.rp-mini-track {
    flex: 1;
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
}

.rp-mini-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.rp-mini-fill.blue   { background: var(--accent); }
.rp-mini-fill.green  { background: var(--success); }
.rp-mini-fill.orange { background: #dd6b20; }

.rp-mini-bar-value {
    font-size: 0.68rem;
    color: var(--gray-500);
    width: 32px;
    text-align: left;
    font-weight: 500;
}

/* ── rp: Compact Weights Panel ────────────────────────────────────── */
.rp-weights-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.rp-weights-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rp-weights-sliders {
    display: flex;
    gap: 24px;
}

.rp-weight-slider {
    flex: 1;
}

.rp-weight-color {
    height: 4px;
    border-radius: 2px;
    margin-bottom: 8px;
}

.rp-weight-color--conf  { background: var(--accent); }
.rp-weight-color--tech  { background: var(--success); }
.rp-weight-color--fin   { background: #dd6b20; }

.rp-weights-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-100);
    margin-top: 16px;
    padding-top: 12px;
}

/* ── rp: Section Base & Action Bar ────────────────────────────────── */
.rp-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.rp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.rp-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rp-action-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rp-action-bar .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ── rp: Validation Gate ──────────────────────────────────────────── */
.rp-validation-gate {
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    background: var(--white);
    transition: all 0.3s ease;
}

.rp-validation-gate--decided {
    border-style: solid;
}

.rp-validation-gate--conforme {
    border-color: var(--success);
    background: rgba(34,197,94,0.03);
}

.rp-validation-gate--nao-conforme {
    border-color: var(--danger);
    background: rgba(229,62,62,0.03);
}

.rp-validation-gate-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.rp-validation-gate-subtitle {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-bottom: 24px;
}

.rp-validation-decisions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}

.rp-validation-decision {
    width: 240px;
    padding: 24px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
}

.rp-validation-decision:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.rp-validation-decision--conforme:hover,
.rp-validation-decision--conforme.selected {
    border-color: var(--success);
    background: rgba(34,197,94,0.04);
}

.rp-validation-decision--nao-conforme:hover,
.rp-validation-decision--nao-conforme.selected {
    border-color: var(--danger);
    background: rgba(229,62,62,0.04);
}

.rp-validation-decision .rp-vd-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.rp-validation-decision .rp-vd-label {
    font-size: 1rem;
    font-weight: 700;
}

.rp-validation-decision--conforme .rp-vd-label { color: var(--success); }
.rp-validation-decision--nao-conforme .rp-vd-label { color: var(--danger); }

.rp-validation-stamp {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rp-validation-stamp-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.rp-validation-stamp-icon--conforme {
    background: rgba(34,197,94,0.12);
    color: var(--success);
}

.rp-validation-stamp-icon--nao-conforme {
    background: rgba(229,62,62,0.12);
    color: var(--danger);
}

.rp-validation-stamp-label {
    font-size: 1.1rem;
    font-weight: 700;
}

.rp-validation-stamp-meta {
    font-size: 0.82rem;
    color: var(--gray-400);
}

.rp-validation-details {
    text-align: left;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
}

.rp-validation-form-group {
    margin-bottom: 12px;
}

.rp-validation-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gray-700);
}

.rp-validation-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    resize: vertical;
    font-family: var(--font-family);
}

.rp-validation-form-group--warning label {
    color: var(--warning);
}

.rp-validation-form-group--warning textarea {
    border-color: var(--warning);
}

/* ── rp: SWOT Grid ────────────────────────────────────────────────── */
.rp-swot-company {
    margin-bottom: 16px;
}

.rp-swot-company-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.rp-swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.rp-swot-cell {
    padding: 16px;
    font-size: 0.85rem;
    background: var(--white);
}

.rp-swot-cell h5 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 8px;
}

.rp-swot-cell ul {
    margin: 0;
    padding-left: 16px;
    font-size: 0.82rem;
    line-height: 1.6;
}

.rp-swot-cell--strengths {
    background: rgba(34,197,94,0.04);
    border-left: 3px solid var(--success);
}
.rp-swot-cell--strengths h5 { color: var(--success); }

.rp-swot-cell--weaknesses {
    background: rgba(229,62,62,0.04);
    border-left: 3px solid var(--danger);
}
.rp-swot-cell--weaknesses h5 { color: var(--danger); }

.rp-swot-cell--opportunities {
    background: rgba(49,130,206,0.04);
    border-left: 3px solid var(--accent);
}
.rp-swot-cell--opportunities h5 { color: var(--accent); }

.rp-swot-cell--threats {
    background: rgba(217,119,6,0.04);
    border-left: 3px solid #dd6b20;
}
.rp-swot-cell--threats h5 { color: #dd6b20; }

.rp-swot-meta {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--gray-500);
}

.rp-swot-differentiators {
    margin-top: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.rp-swot-differentiators strong {
    font-size: 0.85rem;
}

.rp-swot-differentiators ul {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: 0.82rem;
}

/* ── rp: SWOT Custom Prompt ──────────────────────────────────────── */
.rp-swot-prompt-bar {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden;
    transition: border-color 0.2s;
}
.rp-swot-prompt-bar:hover {
    border-color: var(--gray-300);
}
.rp-swot-prompt-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--gray-400);
    user-select: none;
}
.rp-swot-prompt-toggle:hover {
    color: var(--gray-600);
}
.rp-swot-prompt-toggle .icon {
    flex-shrink: 0;
}
.rp-swot-prompt-toggle span:first-of-type {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rp-swot-prompt-chevron {
    transition: transform 0.2s;
}
.rp-swot-prompt-chevron.open {
    transform: rotate(180deg);
}
.rp-swot-prompt-panel {
    padding: 0 14px 12px;
}
.rp-swot-prompt-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.82rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rp-swot-prompt-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(49,130,206,0.15);
}
.rp-swot-prompt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.72rem;
}
.rp-swot-prompt-counter {
    color: var(--gray-400);
}
.rp-swot-prompt-saved {
    color: var(--success);
    font-weight: 500;
    animation: rp-swot-fade-in 0.2s ease;
}
@keyframes rp-swot-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── rp: Disabled state helper ────────────────────────────────────── */
.rp-disabled-overlay {
    opacity: 0.5;
    pointer-events: none;
}

/* ── rp: Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .rp-weights-sliders { flex-direction: column; gap: 12px; }
    .rp-ranking-cards { grid-template-columns: 1fr; }
    .rp-pipeline { flex-wrap: wrap; gap: 4px; }
    .rp-step-label { font-size: 0.6rem; }
    .rp-step-connector { width: 20px; }
    .rp-validation-decisions { flex-direction: column; align-items: center; }
    .rp-swot-grid { grid-template-columns: 1fr; }
    .rp-hero-runners { flex-direction: column; gap: 8px; }
}


/* ══════════════════════════════════════════════════════════════════════
   Processing Animations & Background Processing UX
   ══════════════════════════════════════════════════════════════════════ */

/* Pulsing dot indicator */
.processing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: processing-pulse 1.5s ease infinite;
    margin-right: 4px;
    vertical-align: middle;
}

@keyframes processing-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Badge for processing state */
.badge-processing {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* Processing banner for document detail */
.processing-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.processing-banner.processing-failed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.04));
    border-color: rgba(239, 68, 68, 0.2);
}

.processing-banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.processing-banner-text strong {
    color: var(--accent);
}

.processing-failed .processing-banner-text strong {
    color: var(--danger);
}

/* Segmented stages progress bar */
.processing-stages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stage-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--gray-100);
    transition: all 0.3s ease;
}

.stage-indicator .stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.stage-indicator .stage-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stage-indicator.done {
    background: rgba(34, 197, 94, 0.1);
}

.stage-indicator.done .stage-dot {
    background: var(--success);
}

.stage-indicator.done .stage-label {
    color: var(--success);
}

.stage-indicator.active {
    background: rgba(99, 102, 241, 0.1);
}

.stage-indicator.active .stage-dot {
    background: var(--accent);
    animation: processing-pulse 1.5s ease infinite;
}

.stage-indicator.active .stage-label {
    color: var(--accent);
    font-weight: 600;
}

/* Global processing badge in sidebar */
.processing-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: processing-pulse 2s ease infinite;
}

.nav-item {
    position: relative;
}

/* Fade-in animation for content appearing after processing */
.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
