/* ============================================
   EditalAudit AI — Design System v3.0
   HIGH-TECH ENTERPRISE · Dark Mode Futurista
   Glassmorphism · Neon HUD · Zero Regressão
   ============================================ */

/* ---------- DESIGN TOKENS (DARK HUD) ---------- */
:root {
    color-scheme: dark;

    /* Fonts */
    --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    /* ── Deep Graphite / Slate Noturno ── */
    --bg-base: #0B0F17;
    --bg-surface: #121824;
    --bg-panel: #0E1420;
    --bg-card: rgba(255, 255, 255, 0.025);
    --bg-card-solid: #151D2B;
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-focus: rgba(255, 255, 255, 0.07);
    --bg-sidebar: #0D1219;
    --bg-hover: rgba(0, 212, 255, 0.06);

    /* ── Glass Layer ── */
    --glass-bg: rgba(18, 24, 36, 0.72);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: blur(16px);

    /* ── HUD Borders ── */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(0, 212, 255, 0.5);
    --border-subtle: rgba(255, 255, 255, 0.04);

    /* ── Typography ── */
    --text-primary: #E8ECF4;
    --text-secondary: #8B95A8;
    --text-muted: #94A3B8;
    --text-inverted: #0B0F17;

    /* ── Neon Accents ── */
    --color-primary: #00D4FF;
    --color-primary-hover: #33DEFF;
    --color-primary-light: rgba(0, 212, 255, 0.1);
    --color-primary-ghost: rgba(0, 212, 255, 0.08);
    --color-primary-border: rgba(0, 212, 255, 0.25);
    --color-secondary: #6366F1;
    --color-secondary-light: rgba(99, 102, 241, 0.1);

    /* ── Semantic: Emerald / Amber / Crimson ── */
    --color-success: #00FF88;
    --color-success-bg: rgba(0, 255, 136, 0.08);
    --color-success-border: rgba(0, 255, 136, 0.2);
    --color-warning: #FFB800;
    --color-warning-bg: rgba(255, 184, 0, 0.08);
    --color-warning-border: rgba(255, 184, 0, 0.2);
    --color-error: #FF3366;
    --color-error-bg: rgba(255, 51, 102, 0.08);
    --color-error-border: rgba(255, 51, 102, 0.2);

    /* ── Shadows & Radii ── */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-focus: 0 0 0 3px rgba(0, 212, 255, 0.2);
    --shadow-neon-cyan: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-neon-emerald: 0 0 20px rgba(0, 255, 136, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* ── Transitions ── */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-hud: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Compatibility Tokens ── */
    --color-bg-subtle: #151D2B;
    --color-text: #E8ECF4;
    --color-border: rgba(255, 255, 255, 0.08);
}

/* ── Explicit Dark Mode Tokens ── */
body.dark-mode {
    color-scheme: dark;
    --bg-base: #0B0F17;
    --bg-surface: #121824;
    --bg-panel: #0E1420;
    --bg-card: rgba(255, 255, 255, 0.025);
    --bg-card-solid: #151D2B;
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-focus: rgba(255, 255, 255, 0.07);
    --bg-sidebar: #0D1219;
    --bg-hover: rgba(0, 212, 255, 0.06);

    --glass-bg: rgba(18, 24, 36, 0.72);
    --glass-border: rgba(255, 255, 255, 0.06);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(0, 212, 255, 0.5);
    --border-subtle: rgba(255, 255, 255, 0.04);

    --text-primary: #E8ECF4;
    --text-secondary: #8B95A8;
    --text-muted: #94A3B8;
    --text-inverted: #0B0F17;

    --color-primary: #00D4FF;
    --color-primary-hover: #33DEFF;
    --color-primary-light: rgba(0, 212, 255, 0.1);
    --color-primary-ghost: rgba(0, 212, 255, 0.08);
    --color-primary-border: rgba(0, 212, 255, 0.25);
    --color-secondary: #6366F1;
    --color-secondary-light: rgba(99, 102, 241, 0.1);

    --color-bg-subtle: #151D2B;
    --color-text: #E8ECF4;
    --color-border: rgba(255, 255, 255, 0.08);
}

/* ── Light Mode Override ── */
body.light-mode {
    color-scheme: light;
    --bg-base: hsl(210, 16%, 97%);
    --bg-surface: hsl(0, 0%, 100%);
    --bg-panel: hsl(210, 14%, 95%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-card-solid: hsl(0, 0%, 100%);
    --bg-input: hsl(210, 12%, 94%);
    --bg-input-focus: hsl(0, 0%, 100%);
    --bg-sidebar: hsl(210, 15%, 98%);
    --bg-hover: hsla(217, 90%, 56%, 0.04);

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);

    --border-color: hsl(210, 14%, 89%);
    --border-hover: hsl(210, 14%, 80%);
    --border-focus: hsl(217, 90%, 56%);
    --border-subtle: hsl(210, 12%, 93%);

    --text-primary: hsl(222, 47%, 12%);
    --text-secondary: hsl(215, 20%, 40%);
    --text-muted: hsl(215, 16%, 42%);
    --text-inverted: hsl(0, 0%, 100%);

    --color-primary: hsl(195, 100%, 42%);
    --color-primary-hover: hsl(195, 100%, 36%);
    --color-primary-light: hsl(195, 100%, 95%);
    --color-primary-ghost: hsla(195, 100%, 42%, 0.08);
    --color-primary-border: hsla(195, 100%, 42%, 0.25);
    --color-secondary: hsl(239, 84%, 67%);
    --color-secondary-light: hsl(239, 40%, 95%);

    --color-success: hsl(152, 100%, 35%);
    --color-success-bg: hsl(152, 70%, 96%);
    --color-success-border: hsl(152, 60%, 88%);
    --color-warning: hsl(40, 100%, 45%);
    --color-warning-bg: hsl(40, 100%, 97%);
    --color-warning-border: hsl(40, 90%, 90%);
    --color-error: hsl(343, 100%, 48%);
    --color-error-bg: hsl(343, 100%, 97%);
    --color-error-border: hsl(343, 90%, 90%);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-focus: 0 0 0 3px rgba(0, 150, 200, 0.15);
    --shadow-neon-cyan: none;
    --shadow-neon-emerald: none;

    /* ── Compatibility Tokens ── */
    --color-bg-subtle: hsl(210, 14%, 96%);
    --color-text: hsl(222, 47%, 12%);
    --color-border: hsl(210, 14%, 89%);
}

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ---------- SCROLLBAR (HUD Style) ---------- */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.3);
}

/* ---------- HEADER (Command Bar) ---------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* HUD scan-line effect on header */
header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 212, 255, 0.3) 25%,
            rgba(0, 212, 255, 0.6) 50%,
            rgba(0, 212, 255, 0.3) 75%,
            transparent 100%);
    animation: headerScanLine 4s ease-in-out infinite;
}

@keyframes headerScanLine {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

body.light-mode header {
    background: rgba(255, 255, 255, 0.92);
}

body.light-mode header::after {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 150, 200, 0.2) 50%,
            transparent 100%);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.35rem;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.4));
}

body.light-mode .logo-icon {
    filter: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

/* Axis Selector */
.axis-selector-wrapper select,
#axis-select {
    background-color: var(--bg-card-solid);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-hud);
}

.axis-selector-wrapper select:focus,
#axis-select:focus,
.axis-selector-wrapper select:hover,
#axis-select:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

/* API Config */
.api-config {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    transition: var(--transition-hud);
}

.api-config:focus-within {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus), var(--shadow-neon-cyan);
    background: var(--bg-input-focus);
}

.api-config label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.api-config input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-code);
    font-size: 0.8rem;
    width: 180px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.status-indicator.active {
    background-color: var(--color-success);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
    }

    50% {
        box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme Switch Slider */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.theme-icon {
    font-size: 0.85rem;
    user-select: none;
}

.theme-switch {
    display: inline-block;
    height: 20px;
    position: relative;
    width: 38px;
    cursor: pointer;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: rgba(255, 255, 255, 0.12);
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: var(--transition-fast);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

body.light-mode .slider {
    background-color: var(--border-color);
}

.slider:before {
    background-color: var(--color-primary);
    bottom: 2px;
    content: "";
    height: 14px;
    left: 2px;
    position: absolute;
    transition: var(--transition-fast);
    width: 14px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
}

body.light-mode .slider:before {
    background-color: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.theme-switch input:checked+.slider {
    background-color: rgba(0, 212, 255, 0.2);
}

.theme-switch input:checked+.slider:before {
    transform: translateX(18px);
}

/* ---------- TOASTS ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-left-color: var(--color-success);
}

.toast.error {
    border-left-color: var(--color-error);
}

.toast.warning {
    border-left-color: var(--color-warning);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: bold;
    padding: 0;
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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


/* ---------- LAYOUT ---------- */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    max-width: 1920px;
    width: 100%;
    margin: 0 auto;
}

.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    overflow-y: auto;
}

.content-area {
    padding: 2rem 3%;
    overflow-y: auto;
    position: relative;
}

@media (min-width: 1025px) {
    body {
        height: 100vh;
        overflow: hidden;
    }

    main {
        height: calc(100vh - 56px);
        overflow: hidden;
    }

    .sidebar {
        height: 100%;
        position: static;
        overflow-y: auto;
    }

    .content-area {
        height: 100%;
        overflow-y: auto;
    }
}

/* Glow orbs — hidden */
.glow-orb-1,
.glow-orb-2 {
    display: none;
}

/* ---------- TAB CONTROLS ---------- */
.tab-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: var(--bg-input);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    width: 100%;
}

.tab-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: var(--transition-hud);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

body.light-mode .tab-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.tab-btn.active {
    background-color: var(--color-primary-ghost);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
    border: 1px solid var(--color-primary-border);
}

/* ---------- SECTION TITLE ---------- */
.section-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: -0.2px;
}

/* ---------- DROP ZONE (HUD Scanner) ---------- */
.upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.drop-zone {
    border: 1px dashed rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-input);
    transition: var(--transition-hud);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}

/* HUD corner accents */
.drop-zone::before,
.drop-zone::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: rgba(0, 212, 255, 0.25);
    border-style: solid;
    transition: var(--transition-hud);
}

.drop-zone::before {
    top: 6px;
    left: 6px;
    border-width: 2px 0 0 2px;
}

.drop-zone::after {
    bottom: 6px;
    right: 6px;
    border-width: 0 2px 2px 0;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(0, 212, 255, 0.04);
    box-shadow: inset 0 0 30px rgba(0, 212, 255, 0.03);
}

.drop-zone:hover::before,
.drop-zone:hover::after,
.drop-zone.dragover::before,
.drop-zone.dragover::after {
    border-color: var(--color-primary);
}

.drop-zone-icon {
    font-size: 1.5rem;
    transition: var(--transition-smooth);
}

.drop-zone:hover .drop-zone-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
}

.drop-zone h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drop-zone p {
    font-size: 0.68rem;
    color: var(--text-muted);
}

#file-input,
#file-input-proposal,
#file-input-edital-ref,
#file-input-annex,
#file-input-proposal-draft {
    display: none;
}

/* ---------- FILE BADGE ---------- */
.file-info-badge {
    background-color: var(--color-primary-light);
    border: 1px solid var(--color-primary-border);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.file-info-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--color-primary);
}

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--color-error);
    cursor: pointer;
    font-weight: bold;
    padding: 0 0.25rem;
    font-size: 1rem;
    line-height: 1;
    transition: var(--transition-fast);
}

.btn-remove-file:hover {
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.5);
}

/* ---------- BUTTONS (HIGH-TECH CYBER HUD DESIGN SYSTEM) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-hud) cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    gap: 0.5rem;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
    user-select: none;
    text-decoration: none;
    line-height: 1.3;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Subtle laser highlight on top edge */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

/* Light sweep shimmer effect on hover */
.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.22),
        transparent
    );
    transform: rotate(25deg);
    pointer-events: none;
    opacity: 0;
    transition: none;
}

.btn:hover:not(:disabled)::after {
    left: 140%;
    opacity: 1;
    transition: left 0.75s ease-in-out;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1.5px);
}

.btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    filter: brightness(0.95);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.42 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
    filter: grayscale(0.4);
}

/* ── VARIANT 1: NEON CYBER CYAN (Primary Master Action) ── */
.btn-primary,
.btn-cyber-cyan {
    background: linear-gradient(135deg, #00D4FF 0%, #0088FF 100%);
    color: #050B14;
    font-weight: 700;
    border: 1px solid rgba(0, 212, 255, 0.75);
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover:not(:disabled),
.btn-cyber-cyan:hover:not(:disabled) {
    background: linear-gradient(135deg, #33DEFF 0%, #0099FF 100%);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.55), 0 4px 16px rgba(0, 136, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: #66EAFF;
    color: #02070D;
}

body.light-mode .btn-primary,
body.light-mode .btn-cyber-cyan {
    background: linear-gradient(135deg, hsl(195, 100%, 42%) 0%, hsl(210, 100%, 48%) 100%);
    color: #ffffff;
    border-color: hsl(195, 100%, 38%);
    box-shadow: 0 2px 8px rgba(0, 150, 200, 0.25);
    text-shadow: none;
}

body.light-mode .btn-primary:hover:not(:disabled),
body.light-mode .btn-cyber-cyan:hover:not(:disabled) {
    background: linear-gradient(135deg, hsl(195, 100%, 38%) 0%, hsl(210, 100%, 44%) 100%);
    box-shadow: 0 4px 14px rgba(0, 150, 200, 0.35);
    color: #ffffff;
}

/* ── VARIANT 2: COSMIC VIOLET / AI MAGIC ── */
.btn-cyber-purple,
.btn-ai-magic {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    color: #FFFFFF;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.65);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-cyber-purple:hover:not(:disabled),
.btn-ai-magic:hover:not(:disabled) {
    background: linear-gradient(135deg, #9D74FF 0%, #7578FF 100%);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.55), 0 4px 16px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: #B494FF;
    color: #FFFFFF;
}

body.light-mode .btn-cyber-purple,
body.light-mode .btn-ai-magic {
    background: linear-gradient(135deg, hsl(258, 90%, 62%) 0%, hsl(239, 84%, 62%) 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* ── VARIANT 3: NEON EMERALD (Success & Deliverables) ── */
.btn-cyber-emerald,
.btn-success {
    background: linear-gradient(135deg, #00FF88 0%, #10B981 100%);
    color: #041B10;
    font-weight: 700;
    border: 1px solid rgba(0, 255, 136, 0.75);
    box-shadow: 0 2px 12px rgba(0, 255, 136, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-cyber-emerald:hover:not(:disabled),
.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #33FFA0 0%, #14D495 100%);
    box-shadow: 0 0 24px rgba(0, 255, 136, 0.55), 0 4px 16px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: #66FFB8;
    color: #02120A;
}

body.light-mode .btn-cyber-emerald,
body.light-mode .btn-success {
    background: linear-gradient(135deg, hsl(152, 90%, 38%) 0%, hsl(160, 84%, 39%) 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* ── VARIANT 4: NEON CRIMSON (Danger & Cleanup) ── */
.btn-cyber-danger,
.btn-danger {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.12) 0%, rgba(225, 29, 72, 0.22) 100%);
    color: #FF3366;
    font-weight: 600;
    border: 1px solid rgba(255, 51, 102, 0.45);
    box-shadow: 0 2px 8px rgba(255, 51, 102, 0.15);
}

.btn-cyber-danger:hover:not(:disabled),
.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #FF3366 0%, #E11D48 100%);
    color: #FFFFFF;
    border-color: #FF6688;
    box-shadow: 0 0 24px rgba(255, 51, 102, 0.5), 0 4px 16px rgba(225, 29, 72, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.light-mode .btn-cyber-danger,
body.light-mode .btn-danger {
    background: hsla(343, 90%, 55%, 0.1);
    color: hsl(343, 90%, 48%);
    border-color: hsla(343, 90%, 48%, 0.35);
}

body.light-mode .btn-cyber-danger:hover:not(:disabled),
body.light-mode .btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, hsl(343, 90%, 48%) 0%, hsl(350, 85%, 45%) 100%);
    color: #ffffff;
}

/* ── VARIANT 5: NEON AMBER (Warning & Revisions) ── */
.btn-cyber-amber,
.btn-warning {
    background: linear-gradient(135deg, #FFB800 0%, #D97706 100%);
    color: #1A1000;
    font-weight: 700;
    border: 1px solid rgba(255, 184, 0, 0.7);
    box-shadow: 0 2px 12px rgba(255, 184, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-cyber-amber:hover:not(:disabled),
.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFC833 0%, #E58E1A 100%);
    box-shadow: 0 0 24px rgba(255, 184, 0, 0.55);
    border-color: #FFE066;
    color: #100A00;
}

/* ── VARIANT 6: TITANIUM SLATE / SECONDARY (Dark Glass Bevel) ── */
.btn-secondary,
.btn-cyber-dark {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%), var(--bg-card-solid);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled),
.btn-cyber-dark:hover:not(:disabled) {
    border-color: rgba(0, 212, 255, 0.45);
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), var(--bg-card-solid);
    color: #FFFFFF;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.2), 0 4px 12px rgba(0, 0, 0, 0.35);
}

body.light-mode .btn-secondary,
body.light-mode .btn-cyber-dark {
    background: hsl(0, 0%, 100%);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

body.light-mode .btn-secondary:hover:not(:disabled),
body.light-mode .btn-cyber-dark:hover:not(:disabled) {
    background: hsl(210, 20%, 96%);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 150, 200, 0.15);
}

/* ── VARIANT 7: CYBER GHOST (Translucent HUD) ── */
.btn-cyber-ghost,
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.btn-cyber-ghost:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
    color: var(--color-primary);
    border-color: var(--color-primary-border);
    background: var(--color-primary-ghost);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.2);
}

/* ── SPECIAL: GLOW PULSE (Multi-agent Master Pipeline CTAs) ── */
@keyframes cyberPulseGlow {
    0%, 100% {
        box-shadow: 0 0 14px rgba(0, 212, 255, 0.35), 0 0 0 0 rgba(0, 212, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 28px rgba(0, 212, 255, 0.65), 0 0 0 5px rgba(0, 212, 255, 0.15);
    }
}

.btn-glow-pulse {
    animation: cyberPulseGlow 2.4s ease-in-out infinite;
}

.btn-glow-pulse:hover {
    animation: none;
}

/* ── SPECIAL: GLOW PULSE PURPLE ── */
@keyframes cyberPulsePurple {
    0%, 100% {
        box-shadow: 0 0 14px rgba(139, 92, 246, 0.35), 0 0 0 0 rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 28px rgba(139, 92, 246, 0.65), 0 0 0 5px rgba(139, 92, 246, 0.15);
    }
}

.btn-glow-pulse-purple {
    animation: cyberPulsePurple 2.4s ease-in-out infinite;
}

.btn-glow-pulse-purple:hover {
    animation: none;
}

/* ── SPECIAL: GLOW PULSE EMERALD ── */
@keyframes cyberPulseEmerald {
    0%, 100% {
        box-shadow: 0 0 14px rgba(0, 255, 136, 0.35), 0 0 0 0 rgba(0, 255, 136, 0.4);
    }
    50% {
        box-shadow: 0 0 28px rgba(0, 255, 136, 0.65), 0 0 0 5px rgba(0, 255, 136, 0.15);
    }
}

.btn-glow-pulse-emerald {
    animation: cyberPulseEmerald 2.4s ease-in-out infinite;
}

.btn-glow-pulse-emerald:hover {
    animation: none;
}

/* ── BUTTON SIZES & UTILITIES ── */
.btn-sm {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.75rem !important;
    border-radius: var(--radius-sm) !important;
}

.btn-md {
    padding: 0.6rem 1.15rem !important;
    font-size: 0.82rem !important;
}

.btn-lg {
    padding: 0.8rem 1.6rem !important;
    font-size: 0.95rem !important;
    border-radius: var(--radius-lg) !important;
}

.btn-auto {
    width: auto !important;
}

.btn-full {
    width: 100% !important;
}

.btn-pill {
    border-radius: var(--radius-full) !important;
}

/* ---------- TEXT INPUT ---------- */
.text-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.text-input-container textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: var(--transition-hud);
    line-height: 1.5;
}

.text-input-container textarea:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
    background: var(--bg-input-focus);
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem;
    gap: 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    animation: pulse 2s infinite ease-in-out;
}

.empty-state h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 440px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---------- LOADER ---------- */
.loader-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 8rem 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.loader-overlay h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.loader-progress {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-family: var(--font-code);
}

/* ---------- CARD (Glassmorphism HUD) ---------- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    position: relative;
    transition: var(--transition-hud);
}

/* HUD corner micro-indicators */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    border-left: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: var(--radius-lg) 0 0 0;
    pointer-events: none;
    transition: var(--transition-hud);
}

.card:hover::before {
    border-color: rgba(0, 212, 255, 0.35);
    width: 28px;
    height: 28px;
}

body.light-mode .card {
    background: var(--bg-card);
    backdrop-filter: none;
}

body.light-mode .card::before {
    display: none;
}

.card h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
}

.card h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* ---------- DASHBOARD GRID ---------- */
.dashboard-grid {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.35s ease-out;
}

/* Metadata Grid */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.metadata-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: var(--shadow-xs);
}

.metadata-card label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.metadata-card p {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Score Section */
.score-section-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
}

.score-main-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

/* Score glow ring */
.score-main-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent 30%, rgba(0, 212, 255, 0.1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.score-badge {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
}

.classification-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.score-main-card.excelente {
    border-color: var(--color-success-border);
}

.score-main-card.excelente .score-badge {
    color: var(--color-success);
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
}

.excelente .classification-label {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.score-main-card.regular {
    border-color: var(--color-warning-border);
}

.score-main-card.regular .score-badge {
    color: var(--color-warning);
    text-shadow: 0 0 30px rgba(255, 184, 0, 0.2);
}

.regular .classification-label {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.score-main-card.critico {
    border-color: var(--color-error-border);
}

.score-main-card.critico .score-badge {
    color: var(--color-error);
    text-shadow: 0 0 30px rgba(255, 51, 102, 0.2);
}

.critico .classification-label {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error-border);
}

/* Dimensions (Analytic Meters) */
.dimensions-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.dimension-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dimension-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dimension-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

.dimension-score {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meter-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 2px;
    width: 0;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* ---------- ALERTS ---------- */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: var(--transition-hud);
}

.alert-item:hover {
    border-color: var(--border-hover);
}

.alert-item.alta {
    border-left-color: var(--color-error);
}

.alert-item.media {
    border-left-color: var(--color-warning);
}

.alert-item.baixa {
    border-left-color: var(--color-primary);
}

.alert-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.alert-title {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.urgency-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alta .urgency-badge {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error-border);
}

.media .urgency-badge {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.baixa .urgency-badge {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-border);
}

.alert-toggle-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.alert-item.open .alert-toggle-icon {
    transform: rotate(180deg);
}

.alert-body {
    padding: 0 1rem 1rem 1rem;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
}

.alert-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.alert-field label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-field p {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.alert-field code {
    font-family: var(--font-code);
    background: var(--bg-input);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    color: var(--color-primary);
}

/* ---------- QUALITATIVE GRID ---------- */
.qualitative-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.qualitative-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
}

.qualitative-card.pontos-fortes {
    border-top: 2px solid var(--color-success);
}

.qualitative-card.omissoes {
    border-top: 2px solid var(--color-warning);
}

.qualitative-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.qualitative-list li {
    font-size: 0.82rem;
    line-height: 1.5;
    padding-left: 1.25rem;
    position: relative;
    color: var(--text-secondary);
}

.pontos-fortes .qualitative-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: bold;
    font-size: 0.85rem;
}

.omissoes .qualitative-list li::before {
    content: "⚠";
    position: absolute;
    left: 0;
    color: var(--color-warning);
    font-size: 0.8rem;
}

/* Reviewer Opinion */
.reviewer-opinion-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
    line-height: 1.65;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Action Plan */
.action-plan-container {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.action-item {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.action-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.action-text {
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.action-item.checked .action-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Report Actions */
.report-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* ---------- BANCA DASHBOARD COMPONENTS ---------- */
.banca-head {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--color-primary);
}

.banca-head h2 {
    font-size: 1.2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    border: none;
    padding: 0;
}

.banca-head .sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.banca-head .score-box-big {
    display: inline-block;
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary-border);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-code);
    color: var(--color-primary);
}

.banca-disc {
    background-color: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Banca Table (HUD Data Grid) */
.banca-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin: 0.75rem 0;
}

.banca-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.banca-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    line-height: 1.45;
    color: var(--text-secondary);
}

.banca-table tr:hover td {
    background-color: var(--bg-hover);
}

.banca-table tr.tot-row td {
    background-color: var(--color-primary-light);
    font-weight: 700;
    color: var(--color-primary);
    border-top: 1px solid var(--color-primary-border);
}

/* Color classes for score cells */
.banca-table td.g {
    color: var(--color-success);
}

.banca-table td.y {
    color: var(--color-warning);
}

.banca-table td.r {
    color: var(--color-error);
}

/* Frag & Forte blocks */
.frag-block {
    border-left: 3px solid var(--color-error);
    background-color: var(--color-error-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.frag-block.warning {
    border-left-color: var(--color-warning);
    background-color: var(--color-warning-bg);
}

.frag-block b {
    font-weight: 700;
}

.frag-block .sug-text {
    display: block;
    margin-top: 0.3rem;
    color: var(--color-success);
    font-weight: 600;
    font-size: 0.78rem;
}

.forte-block {
    border-left: 3px solid var(--color-success);
    background-color: var(--color-success-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.banca-crit {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.banca-crit p {
    margin-bottom: 0.5rem;
}

.banca-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: var(--radius-full);
    margin-left: 0.4rem;
    text-transform: uppercase;
}

.banca-badge.elim {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error-border);
}

.banca-badge.hab {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-border);
}

/* ---------- SPLIT LAYOUT ---------- */
.banca-dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
    width: 100%;
}

.banca-report-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.banca-chat-col {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1025px) {
    .banca-chat-col {
        position: sticky;
        top: 72px;
        height: calc(100vh - 90px);
    }
}

/* ---------- CHATBOT ---------- */
.agent-chip,
.agent-chip-criacao {
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-body);
    background: var(--bg-card-solid);
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    transition: var(--transition-hud);
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-chip:hover,
.agent-chip-criacao:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary-border);
}

.agent-chip.active,
.agent-chip-criacao.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.9), rgba(99, 102, 241, 0.9));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.chat-message {
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
    word-break: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(99, 102, 241, 0.15));
    color: var(--text-primary);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-bottom-right-radius: 2px;
}

.chat-message.agent {
    align-self: flex-start;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-primary);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

.chat-message.system {
    align-self: stretch;
    background-color: var(--color-primary-ghost);
    border: 1px dashed var(--color-primary-border);
    color: var(--text-secondary);
    font-style: italic;
    max-width: 100%;
}

.suggestion-chip {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition-hud);
    text-align: left;
    outline: none;
}

.suggestion-chip:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

/* ---------- ANNEXES & SEARCH ---------- */
.annex-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-hud);
}

.annex-item:hover {
    border-color: var(--color-primary-border);
    background: var(--color-primary-light);
}

.annex-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.annex-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.annex-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-code);
}

.search-result-item {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition-hud);
    box-shadow: var(--shadow-xs);
}

.search-result-item:hover {
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-md), var(--shadow-neon-cyan);
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.search-result-url {
    font-size: 0.68rem;
    color: var(--color-primary);
    text-decoration: none;
    word-break: break-all;
    font-family: var(--font-code);
}

.search-result-url:hover {
    text-decoration: underline;
}

.search-result-snippet {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.search-result-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.search-result-actions .btn {
    width: auto;
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
}

.portal-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-primary-light);
    border: 1px solid var(--color-primary-border);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    transition: var(--transition-hud);
}

.portal-link-item:hover {
    border-color: var(--color-primary);
}

.portal-link-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.portal-link-actions {
    display: flex;
    gap: 0.4rem;
}

.portal-link-actions .btn {
    width: auto;
    padding: 0.3rem 0.6rem;
    font-size: 0.68rem;
    border-radius: var(--radius-sm);
}

/* ---------- ABNT EDITOR (Digital A4 Sheet) ---------- */
.abnt-document-card {
    height: 100% !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
    overflow: hidden !important;
}

.abnt-editor-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card-solid) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.75rem 1rem;
    margin-bottom: 0;
}

/* Toolbar glow line */
.abnt-editor-toolbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 212, 255, 0.2),
            transparent);
}

#abnt-document-preview {
    font-size: 12pt;
}

.abnt-section h3 {
    font-size: 12pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #000 !important;
    border: none;
    padding: 0;
}

.abnt-text-block {
    font-size: 12pt;
    color: #333 !important;
    text-align: justify;
    margin-bottom: 1.5rem;
    outline: none;
    white-space: pre-wrap;
    border: 1px dashed transparent;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.abnt-text-block:hover {
    border-color: rgba(0, 212, 255, 0.25);
    background-color: rgba(0, 212, 255, 0.02);
    cursor: text;
}

.abnt-text-block:focus {
    border-color: rgba(0, 212, 255, 0.5);
    background-color: rgba(0, 212, 255, 0.04);
    color: #000 !important;
}

.abnt-text-block.is-placeholder {
    color: var(--text-muted) !important;
    font-style: italic;
}

/* Copy & Insert Buttons */
.btn-copy-to {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-primary-ghost);
    border: 1px solid var(--color-primary-border);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
    font-family: var(--font-body);
    box-shadow: 0 1px 4px rgba(0, 212, 255, 0.1);
}

.btn-copy-to:hover {
    background: var(--color-primary);
    color: #050B14;
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.45);
    transform: translateY(-1px);
}

.btn-insert-at-cursor {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    border-radius: var(--radius-sm);
    color: var(--color-success);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
    font-family: var(--font-body);
    box-shadow: 0 1px 4px rgba(0, 255, 136, 0.1);
}

.btn-insert-at-cursor:hover {
    background: var(--color-success);
    color: #041B10;
    box-shadow: 0 0 14px rgba(0, 255, 136, 0.45);
    transform: translateY(-1px);
}

/* Toolbar Buttons */
.toolbar-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.55rem;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-hud);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: var(--shadow-xs);
}

.toolbar-btn:hover {
    background-color: var(--color-primary-ghost);
    color: var(--color-primary);
    border-color: var(--color-primary-border);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
}

.toolbar-btn:active {
    background-color: rgba(0, 212, 255, 0.2);
    transform: translateY(1px);
}

.toolbar-btn.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(99, 102, 241, 0.25));
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
    font-weight: 700;
}

/* ---------- INPUT GROUP ---------- */
.input-group-banca {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ---------- SIDEBAR CLASSES ---------- */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.sidebar-section-divider {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1.5rem;
}

.sidebar-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.sidebar-link-input {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
    background: var(--bg-input);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.sidebar-link-input label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.sidebar-link-row {
    display: flex;
    gap: 0.4rem;
}

.sidebar-link-row input {
    flex: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    outline: none;
    font-family: var(--font-code);
}

.sidebar-link-row input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.sidebar-link-btn {
    width: auto !important;
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
    border-radius: var(--radius-sm) !important;
}

.sidebar-link-status {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sidebar-sm-btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.75rem !important;
    border-radius: var(--radius-sm) !important;
    margin-top: 0.25rem;
}

.sidebar-search-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-text-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
    outline: none;
    font-family: var(--font-body);
    box-sizing: border-box;
    transition: var(--transition-hud);
}

.sidebar-text-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
    background: var(--bg-input-focus);
}

.annexes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Cover Inputs */
.cover-inputs-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cover-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cover-input-row label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
}

.cover-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

/* ---------- CHATBOT CARD ---------- */
.chatbot-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0 !important;
    padding: 1.25rem !important;
    gap: 1rem;
    border-color: var(--color-primary-border) !important;
}

.chatbot-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.chatbot-title {
    font-size: 1.1rem !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: none !important;
    padding: 0 !important;
}

.chatbot-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.chatbot-agents-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.active-agent-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--color-primary-light);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-primary-border);
}

.agent-badge-icon {
    font-size: 1rem;
}

.agent-badge-info {
    display: flex;
    flex-direction: column;
}

.agent-badge-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.agent-badge-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.chat-messages-box {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.6rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    min-height: 250px;
    max-height: calc(100vh - 380px);
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.chat-input-row {
    display: flex;
    gap: 0.4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.6rem;
}

.chat-textarea {
    flex: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    resize: none;
    height: 36px;
    outline: none;
    transition: var(--transition-hud);
    font-family: var(--font-body);
    line-height: 1.3;
}

.chat-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
    background: var(--bg-input-focus);
}

.chat-send-btn {
    padding: 0 0.8rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.8rem !important;
}

/* ---------- UTILITY CLASSES ---------- */
.btn-auto {
    width: auto !important;
}

.col-narrow {
    width: 70px;
    text-align: center;
}

.col-medium {
    width: 200px;
}

.col-tiny {
    width: 40px;
    text-align: center;
}

.col-status {
    width: 90px;
    text-align: center;
}

.card-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

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

.score-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.8px;
}

.banca-dashboard-wrapper {
    width: 100%;
}

/* ---------- BUSCADOR CLASSES ---------- */
.banca-head-teal {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(99, 102, 241, 0.15)) !important;
    border-color: var(--color-primary-border) !important;
    color: var(--text-primary) !important;
}

.banca-head-teal h2,
.banca-head-teal .sub {
    color: var(--text-primary) !important;
}

.portal-links-card-style {
    border-color: var(--color-primary-border) !important;
    background-color: var(--color-primary-light) !important;
}

.portal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.portal-card-title {
    color: var(--color-primary) !important;
    margin: 0 !important;
    font-size: 1.1rem !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none !important;
    padding: 0 !important;
}

.portal-close-btn {
    font-size: 1.5rem !important;
    background: none !important;
    border: none !important;
    color: var(--color-error) !important;
    cursor: pointer !important;
}

.portal-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.empty-search-msg {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

/* ---------- ABNT EDITOR WORKSPACE CLASSES ---------- */
.abnt-editor-card {
    padding: 0 !important;
    overflow-y: auto !important;
}

.toolbar-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.toolbar-row-2 {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.toolbar-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.toolbar-title {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.82rem;
}

.toolbar-sep {
    color: var(--border-color);
    margin: 0 0.15rem;
    user-select: none;
}

.toolbar-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.toolbar-meta b {
    font-weight: 700;
}

.toolbar-font-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.toolbar-select {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.toolbar-select:focus,
.toolbar-select:hover {
    border-color: var(--color-primary-border);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.toolbar-action-btn {
    width: auto !important;
    padding: 0.35rem 0.7rem !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
}

.toolbar-action-danger {
    color: #FF3366 !important;
    background: rgba(255, 51, 102, 0.1) !important;
    border: 1px solid rgba(255, 51, 102, 0.4) !important;
}

.toolbar-action-danger:hover {
    background: linear-gradient(135deg, #FF3366 0%, #E11D48 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(255, 51, 102, 0.4) !important;
}

.toolbar-bold {
    font-weight: bold !important;
}

.toolbar-italic {
    font-style: italic !important;
}

.toolbar-underline {
    text-decoration: underline !important;
}

.toolbar-strike {
    text-decoration: line-through !important;
}

.toolbar-color-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
}

.toolbar-color-input {
    position: absolute;
    opacity: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    left: 0;
}

/* ABNT Cover Page Classes */
.abnt-cover-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 230mm;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 20mm;
    page-break-after: always;
    box-sizing: border-box;
    padding-top: 1cm;
    padding-bottom: 1cm;
}

.cover-institution {
    font-size: 13pt;
    font-weight: bold;
    line-height: 1.3;
    color: #000;
}

.cover-proponent {
    font-size: 13pt;
    font-weight: bold;
    margin-top: 2cm;
    color: #000;
}

.cover-title {
    font-size: 16pt;
    font-weight: bold;
    margin: auto 0;
    line-height: 1.4;
    color: #000;
}

.cover-footer {
    margin-top: auto;
}

.cover-city,
.cover-year {
    font-size: 12pt;
    font-weight: bold;
    color: #000;
}

.cover-year {
    margin-top: 0.2cm;
}

.abnt-content-pages {
    padding-top: 1cm;
}

.abnt-section {
    margin-bottom: 2rem;
}

.abnt-indent {
    text-indent: 1.25cm;
}

/* ---------- ANIMATIONS ---------- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.25;
        transform: scale(0.96);
    }
}

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

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

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .tab-control {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        width: auto;
        flex: 0 0 auto;
        padding: 0.5rem 0.75rem;
    }

    .score-section-grid {
        grid-template-columns: 1fr;
    }

    .banca-dashboard-layout {
        grid-template-columns: 1fr;
    }

    .banca-chat-col {
        height: 580px;
        margin-top: 1rem;
    }

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

@media (max-width: 640px) {
    header {
        padding: 0 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .sidebar {
        padding: 1rem;
    }
}

/* ---------- PRINT ---------- */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    header,
    .sidebar,
    .report-actions,
    .glow-orb-1,
    .glow-orb-2,
    .alert-toggle-icon,
    input[type="checkbox"],
    .abnt-editor-toolbar,
    .banca-chat-col,
    .banca-head,
    #banca-dashboard,
    #minuta-dashboard,
    #buscador-dashboard,
    #criacao-dashboard,
    #consolidacao-dashboard {
        display: none !important;
    }

    main {
        display: block !important;
    }

    .content-area {
        padding: 0 !important;
    }

    /* Conditional display based on body class */
    body.tab-banca #banca-dashboard {
        display: block !important;
    }

    body.tab-minuta #minuta-dashboard {
        display: flex !important;
        flex-direction: column !important;
    }

    body.tab-criacao #criacao-dashboard {
        display: block !important;
    }

    body.tab-consolidacao #consolidacao-dashboard {
        display: block !important;
    }

    /* Hide placeholder elements during print */
    .is-placeholder {
        display: none !important;
    }

    /* Dashboard print */
    .dashboard-grid {
        display: flex !important;
        gap: 1.5rem !important;
    }

    .metadata-card,
    .score-main-card,
    .dimensions-container,
    .alert-item,
    .qualitative-card,
    .reviewer-opinion-card,
    .action-plan-container {
        background: #fff !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        color: #000 !important;
        backdrop-filter: none !important;
    }

    .score-badge {
        color: #000 !important;
        font-size: 3rem !important;
        text-shadow: none !important;
    }

    .alert-body {
        display: flex !important;
        border-top: 1px solid #ddd !important;
    }

    .meter-bg {
        background-color: #eee !important;
        border: 1px solid #ccc !important;
    }

    .meter-fill {
        background: #333 !important;
        box-shadow: none !important;
    }

    .action-text {
        color: #000 !important;
    }

    /* Banca print */
    .banca-table th {
        background: #eee !important;
        color: #000 !important;
    }

    .banca-table td {
        color: #000 !important;
    }

    .banca-table tr.tot-row td {
        background: #eee !important;
        color: #000 !important;
    }

    .frag-block,
    .forte-block {
        background: #fff !important;
        color: #000 !important;
    }

    .frag-block b,
    .forte-block b {
        color: #000 !important;
    }

    .frag-block .sug-text {
        color: #333 !important;
    }

    .banca-crit {
        color: #000 !important;
    }

    .banca-badge {
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }

    .banca-disc {
        background: #fff !important;
        border: 1px solid #ccc !important;
        color: #000 !important;
    }

    /* ABNT Print */
    #criacao-dashboard .banca-dashboard-layout {
        display: block !important;
    }

    #criacao-dashboard .banca-report-col {
        width: 100% !important;
    }

    #consolidacao-dashboard .banca-dashboard-layout {
        display: block !important;
    }

    #consolidacao-dashboard .banca-report-col {
        width: 100% !important;
    }

    .abnt-document-card {
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    #abnt-document-preview,
    #abnt-consolidated-preview {
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 3cm 2cm 2cm 3cm !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
    }

    .abnt-cover-page {
        height: 250mm !important;
        page-break-after: always !important;
    }

    .card::before {
        display: none !important;
    }
}

/* ============================================
   WORKSPACE SPLIT-VIEW (Editor + Tabs)
   ============================================ */

.workspace-split-layout {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
    background: var(--bg-base);
}

/* Editor Column (Left) — Digital A4 Prancheta */
.editor-column {
    flex: 1.15;
    min-width: 50%;
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    background: var(--bg-panel);
}

.abnt-document-card {
    height: 100% !important;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
    overflow: hidden !important;
    border-color: var(--border-color);
}

.abnt-editor-toolbar {
    position: sticky;
    top: 0;
    background: var(--bg-card-solid);
    z-index: 10;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.toolbar-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
}

.toolbar-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-primary);
}

.toolbar-sep {
    color: var(--border-color);
}

.toolbar-font-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toolbar-select {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.toolbar-select:focus,
.toolbar-select:hover {
    border-color: var(--color-primary-border);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-action-btn {
    width: auto !important;
    padding: 0.35rem 0.7rem !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
}

.toolbar-action-danger {
    background: rgba(255, 51, 102, 0.1) !important;
    color: #FF3366 !important;
    border: 1px solid rgba(255, 51, 102, 0.4) !important;
}

.toolbar-action-danger:hover {
    background: linear-gradient(135deg, #FF3366 0%, #E11D48 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(255, 51, 102, 0.4) !important;
}

.toolbar-row-2 {
    display: flex;
    gap: 0.25rem;
}

/* A4 Sheet Body */
.abnt-page-body {
    flex: 1 !important;
    overflow-y: auto !important;
    background: var(--bg-panel) !important;
    padding: 1.5rem 0.5rem !important;
    box-sizing: border-box;
}

/* The actual A4 sheet — stays WHITE for readability */
.abnt-page-sheet {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.08),
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: var(--radius-sm);
    margin: 0 auto 2rem auto !important;
    width: 100% !important;
    max-width: 210mm !important;
    min-height: 297mm !important;
    box-sizing: border-box !important;
    padding: 2.5rem 2rem !important;
    text-align: justify !important;
    line-height: 1.5 !important;
}

body.light-mode .abnt-page-sheet {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.abnt-page-sheet * {
    color: #000000 !important;
}

.abnt-cover-page {
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    justify-content: space-between;
    border-bottom: 2px dashed #ddd;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.cover-institution {
    font-weight: bold;
    font-size: 1.25rem;
}

.cover-proponent {
    font-size: 1.1rem;
}

.cover-title {
    font-weight: 800;
    font-size: 1.8rem;
    margin: auto 0;
    line-height: 1.4;
}

.cover-footer {
    margin-top: auto;
}

.cover-city,
.cover-year {
    font-size: 1.05rem;
}

.abnt-content-pages h3 {
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.25rem;
    text-transform: uppercase;
}

.abnt-text-block {
    font-size: 13.5pt;
    min-height: 100px;
    outline: none;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.abnt-text-block:focus {
    background: rgba(0, 212, 255, 0.03);
}

.abnt-indent {
    text-indent: 1.25cm;
}

/* Tabs Column (Right) */
.tabs-column {
    flex: 0.85;
    min-width: 440px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
}

/* Tab Navigation Bar (High-Tech Cyber HUD) */
.workspace-tabs {
    display: flex;
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-surface) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0.85rem 0 0.85rem;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    box-shadow: inset 0 -1px 0 rgba(0, 212, 255, 0.1);
}

.workspace-tabs::-webkit-scrollbar {
    display: none;
}

.w-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-secondary);
    padding: 0.6rem 0.95rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all var(--transition-hud) cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    font-family: var(--font-heading);
    letter-spacing: -0.1px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.w-tab-btn:hover {
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.2);
    border-bottom: none;
    transform: translateY(-1px);
}

.w-tab-btn.active {
    color: var(--color-primary) !important;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.16) 0%, rgba(0, 212, 255, 0.03) 100%), var(--bg-surface) !important;
    border-color: rgba(0, 212, 255, 0.4) rgba(0, 212, 255, 0.4) transparent rgba(0, 212, 255, 0.4) !important;
    border-bottom: 2px solid var(--color-primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 -2px 14px rgba(0, 212, 255, 0.18), inset 0 1px 0 rgba(0, 212, 255, 0.4);
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

body.light-mode .workspace-tabs {
    background: linear-gradient(180deg, hsl(210, 16%, 93%) 0%, hsl(210, 16%, 89%) 100%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

body.light-mode .w-tab-btn {
    color: hsl(215, 20%, 40%);
}

body.light-mode .w-tab-btn:hover {
    color: var(--color-primary);
    background: rgba(0, 150, 200, 0.08);
    border-color: rgba(0, 150, 200, 0.15);
    border-bottom: none;
}

body.light-mode .w-tab-btn.active {
    background: #FFFFFF !important;
    border-color: var(--border-color) var(--border-color) transparent var(--border-color) !important;
    border-bottom: 2px solid var(--color-primary) !important;
    color: var(--color-primary) !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    text-shadow: none;
}

.workspace-tab-contents {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.w-tab-pane {
    display: none;
    animation: fadeIn var(--transition-smooth) forwards;
}

.w-tab-pane.active {
    display: block;
}

.pane-header {
    margin-bottom: 1.5rem;
}

.pane-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.3px;
}

.pane-header p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Revisor Chips */
.agent-chip {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card-solid);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-hud);
}

.agent-chip:hover {
    border-color: var(--color-primary-border);
    color: var(--text-primary);
}

.agent-chip.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.9), rgba(99, 102, 241, 0.9));
    border-color: transparent;
    color: #ffffff;
}

/* Acervo & Biblioteca items */
.saved-edital-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: var(--transition-hud);
    margin-bottom: 0.5rem;
}

.saved-edital-item:hover {
    border-color: var(--color-primary-border);
    transform: translateX(2px);
    box-shadow: var(--shadow-neon-cyan);
}

.saved-edital-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.saved-edital-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.saved-edital-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.saved-edital-actions {
    display: flex;
    gap: 0.5rem;
}

.saved-edital-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-hud);
}

.saved-edital-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.saved-edital-btn.danger {
    color: var(--color-error);
}

.saved-edital-btn.danger:hover {
    background: var(--color-error);
    color: #ffffff;
}

/* ============================================
   HUB DE REVISÃO (High-Tech Agent Pod Cards)
   ============================================ */

.revisor-agents-grid {
    margin-top: 0.75rem;
}

.revisor-agent-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%), var(--bg-card-solid);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-hud) cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-primary);
    font-family: var(--font-body);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

/* Cyber laser accent on top right */
.revisor-agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-top: 2px solid rgba(0, 212, 255, 0.3);
    border-right: 2px solid rgba(0, 212, 255, 0.3);
    transition: all var(--transition-hud);
    pointer-events: none;
}

/* Hologram glow bar on left */
.revisor-agent-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: all var(--transition-hud);
}

.revisor-agent-card:hover {
    border-color: rgba(0, 212, 255, 0.45);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%), var(--bg-card-solid);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 212, 255, 0.2);
}

.revisor-agent-card:hover::before {
    border-color: var(--color-primary);
    width: 22px;
    height: 22px;
}

.revisor-agent-card:hover::after {
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
}

.revisor-agent-card.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%), var(--bg-card-solid);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.revisor-agent-card.active::before {
    border-color: var(--color-primary);
    width: 24px;
    height: 24px;
}

.revisor-agent-card.active::after {
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    box-shadow: 0 0 12px var(--color-primary);
}

.agent-avatar {
    font-size: 1.25rem;
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-hud);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.revisor-agent-card:hover .agent-avatar {
    border-color: var(--color-primary-border);
    transform: scale(1.05);
}

.revisor-agent-card.active .agent-avatar {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(99, 102, 241, 0.25));
    border-color: var(--color-primary);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.35);
    transform: scale(1.05);
}

.agent-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
    flex: 1;
}

.agent-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    letter-spacing: -0.1px;
}

.agent-status-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}

.status-pending {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.status-running {
    background: rgba(255, 184, 0, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(255, 184, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.3);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.status-completed {
    background: rgba(0, 255, 136, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(0, 255, 136, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.25);
}

.status-failed {
    background: rgba(255, 51, 102, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(255, 51, 102, 0.5);
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.25);
}

.diff-container div div {
    min-height: 120px;
    line-height: 1.6;
}

/* ---------- FORM CONTROLS & SELECT STYLES (NO WHITE DROPDOWNS) ---------- */
select,
input,
textarea {
    color-scheme: dark;
}

body.light-mode select,
body.light-mode input,
body.light-mode textarea {
    color-scheme: light;
}

select {
    background-color: var(--bg-card-solid);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 2.2rem 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition-hud);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300D4FF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 12px;
}

select:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
    background-color: var(--bg-input-focus);
}

select option,
select optgroup,
option,
optgroup {
    background-color: #121824 !important;
    color: #E8ECF4 !important;
    padding: 8px 12px;
    font-size: 0.85rem;
}

select option:checked,
select option:hover {
    background-color: #0088FF !important;
    color: #ffffff !important;
}

body.light-mode select {
    background-color: #ffffff;
    color: hsl(222, 47%, 12%);
    border-color: hsl(210, 14%, 89%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230088FF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body.light-mode select option,
body.light-mode select optgroup,
body.light-mode option,
body.light-mode optgroup {
    background-color: #ffffff !important;
    color: hsl(222, 47%, 12%) !important;
}

body.light-mode select option:checked,
body.light-mode select option:hover {
    background-color: hsl(195, 100%, 42%) !important;
    color: #ffffff !important;
}

.form-input {
    width: 100%;
    background-color: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    outline: none;
    transition: var(--transition-hud);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
    background: var(--bg-input-focus);
}

body.light-mode .form-input {
    background-color: #ffffff;
    color: hsl(222, 47%, 12%);
    border-color: hsl(210, 14%, 89%);
}

/* Responsividade Global para Split Layout */
@media (max-width: 1024px) {
    .workspace-split-layout {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    .editor-column {
        flex: none !important;
        width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding: 0.75rem !important;
    }

    .tabs-column {
        flex: none !important;
        width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .abnt-page-body {
        overflow-y: visible !important;
        height: auto !important;
        padding: 0.5rem !important;
    }

    .abnt-document-card {
        height: auto !important;
        overflow: visible !important;
    }

    .abnt-page-sheet {
        min-height: auto !important;
        padding: 1.5rem 1rem !important;
    }

    .diff-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Prevenção de estouro de tabelas e textos */
.abnt-text-block,
.banca-table,
table,
#audit-analytic-report-content,
#revisor-report-content,
#revisor-panel-feedback,
.revisor-tab-content,
.editor-column,
.audit-report {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

.banca-table,
table {
    max-width: 100% !important;
    display: block !important;
    overflow-x: auto !important;
}

.banca-table th,
.banca-table td,
table th,
table td {
    word-break: break-word;
}

#audit-analytic-report-content,
#revisor-report-content,
#revisor-panel-feedback {
    overflow-x: auto !important;
}

/* ==========================================================================
   Chatbot Assistente de Redação & Aba Finalização
   ========================================================================== */
.redator-chat-card {
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.redator-chat-messages {
    scroll-behavior: smooth;
}

.chat-message {
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-md);
    max-width: 92%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    animation: fadeInMsg 0.25s ease-out forwards;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(99, 102, 241, 0.12));
    color: var(--text-primary);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-bottom-right-radius: 2px;
}

.chat-message.agent {
    align-self: flex-start;
    background: var(--bg-card-solid);
    color: var(--text-primary);
    border-left: 3px solid var(--color-primary);
    border-bottom-left-radius: 2px;
    box-shadow: var(--shadow-sm);
}

#pane-finalizacao .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#pane-finalizacao .card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================
   Resiliência Visual & Auto-Fit
   ============================================ */
.editor-container,
.report-card,
.report-content,
.revisor-card,
.revisor-history-item {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.auto-fit-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: normal;
    transition: font-size 0.15s ease-out;
}

/* Workspace Tabs & Panes — Final Overrides */
.w-tab-pane {
    display: none;
}

.w-tab-pane.active {
    display: block !important;
}

/* ==========================================================================
   CITATION PILLS & CONFIDENCE BADGES
   ========================================================================== */

/* Citation Pills (Zero-Alucinação) */
.citation-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin: 2px 2px;
    line-height: 1.4;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    vertical-align: middle;
}

.citation-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.citation-pill-verified {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.citation-pill-inference {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.citation-pill-unverified {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error-border);
}

/* Confidence Badges */
.badge-confidence-alta {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.badge-confidence-media {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.badge-confidence-baixa {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Responsive Table Wrapper */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
}

.table-responsive-wrapper table,
.abnt-text-block table {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-responsive-wrapper th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-weight: 600;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.table-responsive-wrapper td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.abnt-page-sheet .abnt-text-block th,
.abnt-page-sheet table th {
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 600;
    padding: 8px 12px;
    border: 1px solid #e2e8f0 !important;
    text-align: left;
}

.abnt-page-sheet .abnt-text-block td,
.abnt-page-sheet table td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

/* Agent Active Pulse Animation */
@keyframes agentPulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 212, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
    }
}

.agent-pulse {
    animation: agentPulseGlow 1.8s infinite;
}

/* 1-Click Apply Suggestion Button */
.btn-apply-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #00D4FF 0%, #0088FF 100%);
    color: #050B14;
    font-weight: 700;
    border: 1px solid rgba(0, 212, 255, 0.75);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all var(--transition-hud) cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 0.75rem;
}

.btn-apply-suggestion:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.55), 0 4px 14px rgba(0, 136, 255, 0.4);
    border-color: #66EAFF;
    color: #02070D;
}

.btn-apply-suggestion:active {
    transform: translateY(1px) scale(0.98);
}

/* --- Supervisor & Pipeline Stepper Styles --- */
.status-not-required {
    background: var(--bg-input) !important;
    color: var(--text-muted) !important;
    border: 1px dashed var(--border-color) !important;
    opacity: 0.75;
}

.agent-item.not-required-agent {
    opacity: 0.6;
    border-left: 3px solid var(--border-color);
}

.badge-decision-approved {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-decision-adjustment {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-decision-critical {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error-border);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.supervisor-decision-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.supervisor-decision-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-weight: 700;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.supervisor-decision-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    vertical-align: top;
    color: var(--text-secondary);
}

.supervisor-decision-table tr:hover td {
    background: var(--bg-hover);
}

.supervisor-directive-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-xs);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.supervisor-directive-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.supervisor-directive-card.directive-critical {
    border-left: 3px solid var(--color-error);
}

.supervisor-directive-card.directive-adjustment {
    border-left: 3px solid var(--color-warning);
}

.supervisor-directive-card.directive-approved {
    border-left: 3px solid var(--color-success);
}

.directive-capsule-redator {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.06), rgba(99, 102, 241, 0.06));
    border: 1px solid var(--color-primary-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.pipeline-stepper-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ============================================
   AMBIENT GLOW OVERLAY (subtle background effect)
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse at 30% 0%,
            rgba(0, 212, 255, 0.04) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle,
            rgba(99, 102, 241, 0.03) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body.light-mode::before,
body.light-mode::after {
    display: none;
}

/* Make sure main content is above ambient glow */
header,
main,
.toast-container {
    position: relative;
    z-index: 1;
}

/* ============================================
   RESPONSIVIDADE MOBILE (< 768px e 390px Viewports)
   ============================================ */
@media (max-width: 768px) {
    /* 1. Cabeçalho Adaptável */
    header {
        height: auto !important;
        min-height: 56px;
        padding: 0.6rem 0.75rem !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        position: sticky;
        top: 0;
    }

    .logo {
        gap: 0.4rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .axis-selector-wrapper {
        width: 100%;
        order: 3;
    }

    .axis-selector-wrapper select,
    #axis-select {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.8rem;
        padding: 0.4rem 1.5rem 0.4rem 0.6rem;
    }

    .header-actions {
        width: auto;
        flex-wrap: wrap;
        gap: 0.4rem;
        align-items: center;
        justify-content: flex-end;
    }

    .api-config {
        padding: 0.25rem 0.5rem;
        max-width: 160px;
    }

    .api-config input {
        width: 90px;
        font-size: 0.75rem;
    }

    #offline-status-badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    /* 2. Layout Principal Empilhado (100% Largura) */
    main,
    .workspace-split-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .editor-column,
    .tabs-column {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: none !important;
        padding: 0.5rem !important;
        box-sizing: border-box !important;
        border-right: none !important;
    }

    /* 3. Editor ABNT e Barra de Ferramentas */
    .abnt-editor-toolbar {
        padding: 0.5rem !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .toolbar-row-1 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .toolbar-info {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .toolbar-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        width: 100%;
    }

    .toolbar-actions .btn,
    .toolbar-actions .toolbar-action-btn {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.5rem !important;
        flex: 1 1 auto;
        text-align: center;
    }

    .toolbar-row-2 {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .abnt-page-body {
        padding: 0.5rem !important;
        overflow-y: visible !important;
        height: auto !important;
    }

    .abnt-page-sheet {
        min-height: auto !important;
        padding: 1.25rem 0.75rem !important;
        font-size: 11pt !important;
    }

    /* 4. Abas de Trabalho e Navegação Horizontal */
    .workspace-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding: 0.4rem 0.25rem !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 0.3rem !important;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--border-color);
    }

    .w-tab-btn {
        font-size: 0.75rem !important;
        padding: 0.45rem 0.65rem !important;
        white-space: nowrap !important;
        flex-shrink: 0;
    }

    .w-tab-pane {
        padding: 0.75rem 0.25rem !important;
    }

    /* 5. Grids, Cards e Tabelas Responsivas */
    #audit-areas-detail,
    .audit-details-grid,
    .revisores-grid,
    .revisor-agents-grid,
    .qualitative-grid,
    .diff-container {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .audit-summary-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .score-main-card {
        width: 100% !important;
        min-width: 100% !important;
    }

    .banca-table,
    table {
        display: block !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
    }

    .toast-container {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        max-width: calc(100% - 24px) !important;
    }

    .toast {
        min-width: unset !important;
        max-width: 100% !important;
    }
}

/* ============================================================
   Citation Pills & Badges Normativos (Lei 14.133 / TCU / Edital)
   ============================================================ */
.citation-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: var(--radius-sm, 6px);
    margin: 2px 4px;
    line-height: 1.4;
    vertical-align: middle;
}
.citation-pill-verified {
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #38bdf8;
}
.citation-pill-legal {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
}
.citation-pill-tcu {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}
.citation-pill-inference {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}
.citation-pill-unverified {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ============================================================
   BARRA DE MÚLTIPLAS INSTÂNCIAS (GERENCIADOR DE PROJETOS)
   ============================================================ */
.multi-instance-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 1.25rem;
    background: #0d131f;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 56px;
    z-index: 90;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.instance-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 2px;
}

.instance-tabs-wrapper::-webkit-scrollbar {
    height: 4px;
}

.instance-tabs-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.btn-new-instance {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm, 6px);
}

.instance-tabs-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.instance-tab-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-sm, 6px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    max-width: 250px;
}

.instance-tab-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.instance-tab-item.active {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
    font-weight: 600;
}

.instance-tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.instance-tab-badge {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0, 212, 255, 0.18);
    color: var(--color-primary);
    font-weight: 700;
}

.instance-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
}

.instance-tab-close:hover {
    background: rgba(255, 51, 102, 0.25);
    color: #ff3366;
}

.instance-actions-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.card-elaboracao-hero {
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.08);
}

.card-elaboracao-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-primary), #6366f1);
}

/* ==========================================================================
   MODAIS DE NUVEM, AUTENTICAÇÃO E COMPARTILHAMENTO (SaaS MULTIUSUÁRIO)
   ========================================================================== */

.modal-backdrop-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 23, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
}

.modal-backdrop-custom.active {
    display: flex !important;
}

.modal-card-custom {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 212, 255, 0.08);
    overflow: hidden;
    animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    0% { opacity: 0; transform: scale(0.96) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header-custom {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title-custom {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.modal-subtitle-custom {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.btn-close-custom {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-close-custom:hover {
    background: rgba(255, 51, 102, 0.15);
    color: #ff3366;
}

.auth-tabs-custom {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab-btn-custom {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #94a3b8;
    padding: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-tab-btn-custom.active {
    color: #00d4ff;
    border-bottom-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.auth-body-custom {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-google-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    background: #ffffff;
    color: #1e293b;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-google-custom:hover {
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.auth-divider-custom {
    display: flex;
    align-items: center;
    text-align: center;
    color: #64748b;
    font-size: 0.75rem;
    margin: 0.25rem 0;
}

.auth-divider-custom::before,
.auth-divider-custom::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider-custom span {
    padding: 0 0.75rem;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
}

.auth-input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    color: #fff;
    font-size: 0.88rem;
    transition: border-color 0.15s ease;
}

.auth-input-group input:focus {
    border-color: #00d4ff;
    outline: none;
}

.pix-package-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pix-package-card:active {
    transform: scale(0.98);
}