/* =============================================================================
   NAVAN - Portal de Importação
   CSS Design System
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CSS Variables
   ----------------------------------------------------------------------------- */
:root {
    /* Colors - Deep Ocean Theme */
    --color-primary: #0f4c75;
    --color-primary-light: #1b6ca8;
    --color-primary-dark: #0a3454;
    --color-secondary: #3282b8;
    --color-accent: #bbe1fa;
    
    /* Semantic Colors */
    --color-success: #059669;
    --color-success-bg: #d1fae5;
    --color-warning: #d97706;
    --color-warning-bg: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-bg: #fee2e2;
    --color-info: #0284c7;
    --color-info-bg: #e0f2fe;
    
    /* Neutrals */
    --color-bg: #f8fafc;
    --color-bg-alt: #ffffff;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    
    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --header-height: 70px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 6px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

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

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    transition: width 0.2s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.content-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-body {
    flex: 1;
    padding: 1.5rem 2rem 2rem;
}

/* -----------------------------------------------------------------------------
   Sidebar
   ----------------------------------------------------------------------------- */
.sidebar-header {
    flex-shrink: 0;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--sidebar-text-active);
}

.sidebar-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.sidebar.collapsed .sidebar-toggle {
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0.875rem 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.15s ease;
}

.sidebar.collapsed .logo {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.logo img {
    display: block;
    flex-shrink: 0;
    max-height: 52px;
    max-width: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.logo-text {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 0.75rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.nav-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.15s ease;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    color: var(--sidebar-text);
    transition: all var(--transition-fast);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    position: relative;
}

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

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

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-item span:not(.badge) {
    transition: opacity 0.15s ease;
    overflow: hidden;
}

/* Collapsed state */
.sidebar.collapsed .nav-label {
    opacity: 0;
    pointer-events: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.5rem;
    gap: 0;
}

.sidebar.collapsed .nav-item span:not(.badge) {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.5625rem;
}

/* Tooltip on collapsed items */
.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) - 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--color-danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
    padding: 0.875rem 0.5rem;
    gap: 0;
}

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

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

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar span {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.logout-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    color: var(--sidebar-text);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    color: var(--color-danger);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* -----------------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------------- */
.header-left {
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

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

/* -----------------------------------------------------------------------------
   Messages
   ----------------------------------------------------------------------------- */
.messages-container {
    padding: 0 2rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.message-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.message-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.message-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.message-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.message-close {
    background: none;
    border: none;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

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

.message-close svg {
    width: 16px;
    height: 16px;
}

/* Toast - alerta de novas notificações */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: var(--color-primary, #1e3a5f);
    color: #fff;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 360px;
}

.toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification .toast-text {
    flex: 1;
    line-height: 1.4;
}

.toast-notification .toast-link {
    flex-shrink: 0;
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.toast-notification .toast-link:hover {
    opacity: 0.9;
}

/* Django Toasts Modifiers */
.toast.toast-django {
    padding-right: 2rem;
    position: relative;
    color: var(--color-text);
    background: var(--color-surface);
    border-left: 4px solid var(--color-border);
}

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

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

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

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

.toast-close {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

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

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

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

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border-light);
    border-color: var(--color-text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

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

.btn-warning:hover {
    background: #b45309;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-block {
    width: 100%;
}

/* -----------------------------------------------------------------------------
   Cards
   ----------------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.card-action {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-primary);
}

.card-action:hover {
    color: var(--color-primary-light);
}

.card-body {
    padding: 1.25rem;
}

/* -----------------------------------------------------------------------------
   Forms
   ----------------------------------------------------------------------------- */
.form-layout {
    max-width: 900px;
}

/* Padding para formulários diretamente dentro de .card (sem .card-body) */
.card > .form-layout {
    padding: 1.25rem;
}

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

.form-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group.col-span-2 {
    grid-column: span 2;
}

.form-group.col-span-3 {
    grid-column: span 3;
}

.form-group.col-span-4 {
    grid-column: span 4;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 117, 0.1);
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.form-error {
    font-size: 0.75rem;
    color: var(--color-danger);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
    margin-top: 1.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 0.875rem;
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.input-wrapper .form-input {
    padding-left: 2.75rem;
    width: 100%;
}

/* -----------------------------------------------------------------------------
   Tooltips
   ----------------------------------------------------------------------------- */
.nav-tooltip-trigger {
    position: relative;
    display: inline-block;
    cursor: help;
}

.nav-tooltip {
    position: absolute;
    z-index: 2000;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 12rem;
    max-width: 18rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    text-align: left;
    color: #f8fafc;
    background: #0f172a;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.nav-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0f172a;
}

.nav-tooltip-trigger.is-active .nav-tooltip,
.nav-tooltip-trigger:hover .nav-tooltip,
.nav-tooltip-trigger:focus-visible .nav-tooltip {
    opacity: 1;
    visibility: visible;
}

.nav-tooltip.nav-tooltip--fixed {
    position: fixed;
    bottom: auto;
    transform: none;
    z-index: 9999;
}

.nav-tooltip.nav-tooltip--fixed::after {
    display: none;
}

.pendencias-table .nav-tooltip-trigger .nav-tooltip:not(.nav-tooltip--fixed) {
    bottom: auto;
    top: calc(100% + 8px);
    left: 0;
    transform: none;
}

.pendencias-table .nav-tooltip-trigger .nav-tooltip:not(.nav-tooltip--fixed)::after {
    top: auto;
    bottom: 100%;
    left: 1rem;
    transform: none;
    border-top-color: transparent;
    border-bottom-color: #0f172a;
}

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

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

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.data-table td {
    font-size: 0.875rem;
    color: var(--color-text);
}

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

.data-table tfoot td {
    font-weight: 600;
    background: var(--color-bg);
}

.text-right {
    text-align: right;
}

.text-mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

/* -----------------------------------------------------------------------------
   Status Badges
   ----------------------------------------------------------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
}

.status-rascunho { background: #f1f5f9; color: #64748b; }

.status-enviado,
.status-analise_info { background: #dbeafe; color: #1d4ed8; }

.status-info_complementar { background: #fef3c7; color: #b45309; }

.status-simulacao_andamento,
.status-simulacao_enviada { background: #e0e7ff; color: #4338ca; }

.status-aprovado { background: #d1fae5; color: #059669; }

.status-em_processo { 
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%); 
    color: #4338ca; 
    font-weight: 600;
}

.status-concluido,
.status-liberado { background: #d1fae5; color: #059669; }

.status-reprovado,
.status-cancelado { background: #fee2e2; color: #dc2626; }

.status-alteracao { background: #fef3c7; color: #b45309; }

.status-aguardando-avaliacao { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); 
    color: #92400e;
    font-weight: 500;
}

.status-pre_embarque { background: #f3e8ff; color: #7c3aed; }

.status-embarcado,
.status-transito { background: #cffafe; color: #0891b2; }

.status-chegada { background: #ccfbf1; color: #0d9488; }

.status-desembaraco { background: #fef9c3; color: #ca8a04; }

.status-entrega { background: #d1fae5; color: #059669; }

/* Status Ativo/Inativo */
.status-ativo { background: #d1fae5; color: #059669; }
.status-inativo { background: #f1f5f9; color: #64748b; }

/* Urgency Badges */
.urgencia-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
}

.urgencia-baixa { background: #f1f5f9; color: #64748b; }
.urgencia-media { background: #dbeafe; color: #1d4ed8; }
.urgencia-alta { background: #fef3c7; color: #b45309; }
.urgencia-urgente { background: #fee2e2; color: #dc2626; }

/* Canal Badges */
.canal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
}

.canal-verde { background: #d1fae5; color: #059669; }
.canal-amarelo { background: #fef3c7; color: #b45309; }
.canal-vermelho { background: #fee2e2; color: #dc2626; }

/* -----------------------------------------------------------------------------
   Dashboard
   ----------------------------------------------------------------------------- */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

a.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.stat-card-link:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(15, 76, 117, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-blue { background: #dbeafe; color: #1d4ed8; }
.stat-icon-green { background: #d1fae5; color: #059669; }
.stat-icon-yellow { background: #fef3c7; color: #b45309; }
.stat-icon-purple { background: #f3e8ff; color: #7c3aed; }

.stat-content {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.dashboard-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* -----------------------------------------------------------------------------
   List Items
   ----------------------------------------------------------------------------- */
.list-items {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}

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

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

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-icon svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    display: block;
    font-weight: 500;
    color: var(--color-text);
}

.list-item-subtitle {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.list-item-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* -----------------------------------------------------------------------------
   Empty State
   ----------------------------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.empty-state-sm {
    padding: 2rem 1rem;
}

.empty-state-sm svg {
    width: 48px;
    height: 48px;
}

.empty-state-lg {
    padding: 5rem 2rem;
}

.empty-state-lg svg {
    width: 80px;
    height: 80px;
    color: var(--color-primary-light);
    margin-bottom: 1.5rem;
}

.empty-state-lg h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.empty-state-lg p {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.empty-state-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* -----------------------------------------------------------------------------
   Detail Layouts
   ----------------------------------------------------------------------------- */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
}

.info-list-sm .info-item {
    padding: 0.625rem 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

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

.info-item.col-span-2 {
    flex-direction: column;
    gap: 0.375rem;
}

.info-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    text-align: right;
}

.info-item.col-span-2 .info-value {
    text-align: left;
}

.info-value.link {
    color: var(--color-primary);
}

.info-value.link:hover {
    text-decoration: underline;
}

.info-total {
    background: var(--color-bg);
    margin: 0 -1.25rem;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    border-radius: var(--border-radius);
}

.info-total .info-label,
.info-total .info-value {
    font-weight: 600;
    color: var(--color-text);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 2rem;
}

.info-grid .info-item {
    padding: 0.5rem 0;
}

.info-grid .info-item.col-span-2 {
    grid-column: span 2;
}

/* -----------------------------------------------------------------------------
   File List
   ----------------------------------------------------------------------------- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: var(--border-radius);
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 500;
    color: var(--color-text);
}

.file-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.file-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--color-bg);
    border-radius: var(--border-radius);
    text-align: center;
    transition: all var(--transition-fast);
}

.file-card:hover {
    background: var(--color-border-light);
}

.file-card-icon {
    width: 48px;
    height: 48px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.file-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.file-card-name {
    display: block;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.875rem;
}

.file-card-type {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Document Detail (GED) */
.document-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.document-preview-icon {
    width: 64px;
    height: 64px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-preview-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.document-preview-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
    word-break: break-word;
}

.document-preview-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.document-description {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-wrap;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.text-muted {
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Document Vault (GED listing) */
.doc-vault-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    padding: 0.625rem 0 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--color-surface, #fff);
}

.doc-vault-toolbar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.doc-vault-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
}

.doc-vault-sort-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.form-select-sm {
    padding: 0.25rem 1.75rem 0.25rem 0.625rem;
    font-size: 0.8125rem;
    height: auto;
}

.doc-vault-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
}

.doc-vault-check input {
    cursor: pointer;
}

.doc-vault-chip {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.1875rem 0.4375rem;
    border-radius: 9999px;
    background: var(--color-border-light);
    color: var(--color-text-secondary);
}

.doc-vault-toolbar-actions {
    display: flex;
    gap: 0.25rem;
}

.doc-vault-flags,
.doc-vault-section-flags {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.doc-vault-hidden-hint {
    margin: 0.25rem 0 0;
    padding-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.doc-vault {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-vault-client {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.doc-vault-client + .doc-vault-client {
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light);
}

.doc-vault-client-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: transparent;
    transition: opacity var(--transition-fast);
}

.doc-vault-client-head::-webkit-details-marker {
    display: none;
}

.doc-vault-client-head:hover {
    opacity: 0.85;
}

.doc-vault-client[open] > .doc-vault-client-head {
    border-bottom: none;
}

.doc-vault-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.doc-vault-chevron svg {
    width: 1rem;
    height: 1rem;
    transition: transform var(--transition-fast);
}

.doc-vault-client[open] > .doc-vault-client-head .doc-vault-chevron svg {
    transform: rotate(90deg);
}

.doc-vault-client-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-vault-client-avatar svg {
    width: 1.125rem;
    height: 1.125rem;
}

.doc-vault-client-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.doc-vault-client-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-vault-client-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.doc-vault-client-body {
    padding: 0.375rem 0 0.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    background: transparent;
}

.doc-vault-section {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.doc-vault-section-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
}

.doc-vault-section-head::-webkit-details-marker {
    display: none;
}

.doc-vault-section-head:hover {
    background: var(--color-border-light);
}

.doc-vault-section-chevron {
    width: 1rem;
    height: 1rem;
}

.doc-vault-section-chevron svg {
    width: 0.875rem;
    height: 0.875rem;
}

.doc-vault-section[open] > .doc-vault-section-head .doc-vault-section-chevron svg {
    transform: rotate(90deg);
}

.doc-vault-section:not([open]) > .doc-vault-section-head {
    opacity: 0.9;
}

.doc-vault-section-solicitacao .doc-vault-section-icon {
    background: #e0e7ff;
    color: #3730a3;
}

.doc-vault-section-processo .doc-vault-section-icon {
    background: #fef3c7;
    color: #92400e;
}

.doc-vault-section-geral .doc-vault-section-icon {
    background: var(--color-border-light);
    color: var(--color-text-secondary);
}

.doc-vault-section-icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-vault-section-icon svg {
    width: 1rem;
    height: 1rem;
}

.doc-vault-section-text {
    flex: 1;
    min-width: 0;
}

.doc-vault-section-title {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.doc-vault-section-desc {
    font-weight: 400;
    color: var(--color-text-secondary);
}

.doc-vault-section-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.125rem;
}

.doc-vault-section-link {
    flex-shrink: 0;
}

/* Jornada = solicitação + processos aninhados */
.doc-vault-journey {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.doc-vault-journey > .doc-vault-section-head .doc-vault-section-chevron svg {
    transition: transform var(--transition-fast);
}

.doc-vault-journey[open] > .doc-vault-section-head .doc-vault-section-chevron svg {
    transform: rotate(90deg);
}

.doc-vault-journey-count {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.0625rem 0.375rem;
    border-radius: 999px;
    background: var(--color-border-light);
    color: var(--color-text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    vertical-align: middle;
}

.doc-vault-journey-sep {
    color: var(--color-border);
    font-weight: 400;
    margin: 0 0.0625rem;
}

/* Status da jornada/processo em estilo outline para não competir com o código */
.status-badge.doc-vault-status {
    background: transparent;
    border: 1px solid currentColor;
    font-weight: 500;
}

/* Acessibilidade: foco visível por teclado nos cabeçalhos colapsáveis */
.doc-vault-client-head:focus-visible,
.doc-vault-section-head:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--border-radius);
}

a.doc-vault-file:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Modal de detalhe do documento — largura definida após .modal-content (seção Modal) */
body.modal-open {
    overflow: hidden;
}

.doc-detail-modal-head {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.doc-detail-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.doc-detail-modal-loading,
.doc-detail-modal-error {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* No modal: coluna única em telas estreitas; duas colunas quando há espaço */
.doc-detail-modal .detail-layout {
    grid-template-columns: 1fr;
    padding-bottom: 0;
    gap: 1rem;
    min-width: 0;
}

@media (min-width: 900px) {
    .doc-detail-modal .detail-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
        align-items: start;
    }
}

.doc-detail-modal .detail-main,
.doc-detail-modal .detail-sidebar {
    gap: 1rem;
    min-width: 0;
}

.doc-detail-modal .modal-body {
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
    flex: 1;
    min-height: 0;
}

.doc-detail-modal .info-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .doc-detail-modal .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.doc-detail-modal .detail-sidebar {
    position: static;
    top: auto;
}

.doc-vault-journey-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.25rem 0 0.5rem 1.25rem;
    margin-left: 0.75rem;
    border-left: 1px solid var(--color-border-light);
}

/* Solicitação e processos lado a lado — pastas usam a largura disponível.
   Abrem/fecham junto com a jornada (não têm toggle próprio). */
.doc-vault-journey-body > .doc-vault-stage {
    flex: 1 1 280px;
    min-width: 0;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    background: var(--color-surface, #fff);
    padding: 0.375rem;
}

.doc-vault-stage {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.doc-vault-stage-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
}

.doc-vault-stage-head-minimal {
    justify-content: flex-end;
    padding: 0 0.25rem 0.25rem;
}

/* Grade de arquivos: tiles de tamanho fixo (não esticam com a pasta) */
.doc-vault-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, 11rem);
    gap: 0.5rem;
    padding: 0.25rem 0 0.5rem 0;
    justify-content: start;
}

a.doc-vault-file {
    position: relative;
    width: 11rem;
    max-width: 11rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.625rem 0.5rem 0.5rem;
    gap: 0.375rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    background: var(--color-bg);
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

a.doc-vault-file:hover {
    background: var(--color-border-light);
    border-color: var(--color-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

a.doc-vault-file .file-icon {
    width: 2.5rem;
    height: 2.5rem;
}

a.doc-vault-file .file-info {
    width: 100%;
    min-width: 0;
}

a.doc-vault-file .file-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    font-size: 0.8125rem;
    line-height: 1.25;
    transition: color var(--transition-fast);
}

a.doc-vault-file:hover .file-name {
    color: var(--color-primary);
}

a.doc-vault-file .file-meta {
    font-size: 0.6875rem;
    line-height: 1.3;
    margin-top: 0.125rem;
}

.doc-vault-file .file-meta .status-badge {
    margin-left: 0;
    margin-top: 0.125rem;
    vertical-align: middle;
    font-size: 0.625rem;
}

.doc-vault-dl {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    flex-shrink: 0;
    opacity: 0;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    padding: 0.25rem;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.08));
    transition: opacity var(--transition-fast), background var(--transition-fast);
}

.doc-vault-dl:hover {
    background: var(--color-border-light);
}

a.doc-vault-file:hover .doc-vault-dl,
a.doc-vault-file:focus-within .doc-vault-dl {
    opacity: 1;
}

@media (hover: none) {
    .doc-vault-dl {
        opacity: 1;
    }
}

/* -----------------------------------------------------------------------------
   Timeline
   ----------------------------------------------------------------------------- */
.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-left: 2px solid var(--color-border);
    margin-left: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.timeline-item:last-child {
    border-left-color: transparent;
}

.timeline-marker {
    position: absolute;
    left: -6px;
    top: 1.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-border);
    border: 2px solid var(--color-surface);
}

.timeline-comentario .timeline-marker { background: var(--color-info); }
.timeline-status .timeline-marker { background: var(--color-primary); }
.timeline-documento .timeline-marker { background: var(--color-success); }
.timeline-solicitacao_info .timeline-marker { background: var(--color-warning); }
.timeline-aprovado .timeline-marker { background: var(--color-success); }
.timeline-reprovado .timeline-marker,
.timeline-cancelado .timeline-marker { background: var(--color-danger); }
.timeline-alteracao .timeline-marker { background: var(--color-warning); }

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

.timeline-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.timeline-author {
    font-weight: 500;
    color: var(--color-text);
}

.timeline-type {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

.timeline-body {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* -----------------------------------------------------------------------------
   Process Timeline
   ----------------------------------------------------------------------------- */
.process-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 1rem 0;
}

.process-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-border);
    transform: translateY(-50%);
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.step-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: all var(--transition);
}

.process-step.active .step-marker {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

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

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
}

.process-step.active .step-label {
    color: var(--color-primary);
}

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

/* -----------------------------------------------------------------------------
   Checklists
   ----------------------------------------------------------------------------- */
.checklists-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.checklist-section {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.checklist-section-atual {
    border-color: var(--color-primary, #0f4c75);
    box-shadow: 0 0 0 1px rgba(15, 76, 117, 0.12);
}

.checklist-section-passada {
    opacity: 0.92;
}

.checklist-section-futura {
    border-style: dashed;
    border-color: #cbd5e1;
    background: #f8fafc;
}

.checklist-section-collapsible > summary {
    list-style: none;
    cursor: pointer;
}

.checklist-section-collapsible > summary::-webkit-details-marker {
    display: none;
}

.checklist-section-collapsible > summary.checklist-header-summary::after {
    content: '▸';
    margin-left: auto;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    transition: transform 150ms ease;
}

.checklist-section-collapsible[open] > summary.checklist-header-summary::after {
    transform: rotate(90deg);
}

.checklist-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.checklist-legend-item {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

.checklist-legend-atual {
    background: rgba(15, 76, 117, 0.1);
    color: var(--color-primary, #0f4c75);
}

.checklist-legend-passada {
    background: #f1f5f9;
    color: #64748b;
}

.checklist-legend-futura {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

.checklist-header-inner {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    width: 100%;
}

.checklist-header-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 10rem;
}

.checklist-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    margin-right: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 50%;
    background: var(--color-primary, #0f4c75);
    color: #fff;
    vertical-align: middle;
}

.checklist-section-futura .checklist-step-num,
.checklist-section-passada .checklist-step-num {
    background: #94a3b8;
}

.checklist-header-title h3 {
    margin: 0;
}

.checklist-header-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.checklist-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex-basis: 100%;
    margin-top: 0.25rem;
}

.checklist-count {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.checklist-count-ok {
    background: #d1fae5;
    color: #059669;
}

.checklist-count-pendente {
    background: #fef3c7;
    color: #b45309;
}

.checklist-fase-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

.checklist-fase-atual {
    background: rgba(15, 76, 117, 0.12);
    color: var(--color-primary, #0f4c75);
}

.checklist-fase-passada {
    background: #f1f5f9;
    color: #64748b;
}

.checklist-fase-futura {
    background: #fff;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

.checklist-fase-hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

.checklist-item-futuro {
    opacity: 0.65;
}

.status-futuro {
    background: #f1f5f9;
    color: #94a3b8;
}

.checklist-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.checklist-section-atual .checklist-header {
    background: rgba(15, 76, 117, 0.04);
}

.checklist-section-collapsible:not([open]) .checklist-header {
    border-bottom: none;
}

.checklist-section-collapsible[open] .checklist-header {
    border-bottom: 1px solid var(--color-border);
}

.checklist-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    flex: 1;
}

.progress-bar {
    width: 120px;
    height: 6px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-success);
    transition: width var(--transition);
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 40px;
    text-align: right;
}

.checklist-items {
    padding: 0.5rem 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.checklist-item.completed {
    opacity: 0.6;
}

.checklist-toggle,
.checklist-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    padding: 0;
}

.checklist-toggle svg,
.checklist-status svg {
    width: 20px;
    height: 20px;
    color: var(--color-border);
}

.checklist-item.completed .checklist-toggle svg,
.checklist-item.completed .checklist-status svg {
    color: var(--color-success);
}

.checklist-item-content {
    flex: 1;
}

.checklist-item-name {
    display: block;
    font-weight: 500;
    color: var(--color-text);
}

.checklist-item.completed .checklist-item-name {
    text-decoration: line-through;
}

.checklist-item-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.checklist-item {
    flex-wrap: wrap;
    align-items: flex-start;
}

.checklist-item-highlight {
    background: #eff6ff;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px #93c5fd;
}

.checklist-item-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.checklist-item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-left: auto;
}

.checklist-item-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.checklist-doc-chip {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
}

.checklist-doc-chip-link {
    text-decoration: none;
    background: #e0e7ff;
    color: #3730a3;
}

.checklist-doc-chip-link:hover {
    background: #c7d2fe;
}

.checklist-doc-empty {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.checklist-item-source {
    display: block;
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: 0.125rem;
}

.checklist-rejeicao {
    margin: 0.375rem 0 0;
    font-size: 0.75rem;
    color: #b45309;
}

.status-pendente { background: #fef3c7; color: #b45309; }
.status-aceito { background: #d1fae5; color: #059669; }
.status-rejeitado { background: #fee2e2; color: #dc2626; }

.badge-required {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.125rem 0.375rem;
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-radius: 4px;
}

/* -----------------------------------------------------------------------------
   Simulation Summary
   ----------------------------------------------------------------------------- */
.simulation-summary {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
    border: none;
}

.simulation-summary .card-header {
    border-color: rgba(255, 255, 255, 0.1);
}

.simulation-summary .card-title {
    color: white;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.summary-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-item {
    text-align: right;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.summary-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.summary-sub {
    display: block;
    font-size: 0.6875rem;
    opacity: 0.6;
    margin-top: 0.125rem;
}

.summary-total {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin: -1.25rem;
    margin-left: 0;
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
}

.summary-total .summary-value {
    font-size: 1.5rem;
}

.simulation-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.simulation-details-grid .card.col-span-2 {
    grid-column: span 2;
}

/* -----------------------------------------------------------------------------
   Evaluation Form
   ----------------------------------------------------------------------------- */
.evaluation-layout {
    max-width: 800px;
}

.decision-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.decision-option {
    cursor: pointer;
}

.decision-option input {
    display: none;
}

.decision-content {
    padding: 1.5rem;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: all var(--transition);
}

.decision-option:hover .decision-content {
    border-color: var(--color-text-muted);
}

.decision-option input:checked + .decision-content {
    border-color: var(--color-primary);
    background: rgba(15, 76, 117, 0.05);
}

.decision-approve input:checked + .decision-content {
    border-color: var(--color-success);
    background: rgba(5, 150, 105, 0.05);
}

.decision-reject input:checked + .decision-content {
    border-color: var(--color-danger);
    background: rgba(220, 38, 38, 0.05);
}

.decision-changes input:checked + .decision-content {
    border-color: var(--color-warning);
    background: rgba(217, 119, 6, 0.05);
}

.decision-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--color-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decision-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-text-muted);
}

.decision-approve .decision-icon { background: var(--color-success-bg); }
.decision-approve .decision-icon svg { color: var(--color-success); }

.decision-reject .decision-icon { background: var(--color-danger-bg); }
.decision-reject .decision-icon svg { color: var(--color-danger); }

.decision-changes .decision-icon { background: var(--color-warning-bg); }
.decision-changes .decision-icon svg { color: var(--color-warning); }

.decision-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.decision-content p {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.decision-consequence {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    padding-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
    margin-top: 0.5rem;
}

.decision-consequence svg {
    flex-shrink: 0;
}

.decision-approve input:checked + .decision-content .decision-consequence {
    color: var(--color-success);
}

.decision-changes input:checked + .decision-content .decision-consequence {
    color: var(--color-warning);
}

.decision-consequence-warning {
    color: #b45309;
}

.decision-reject input:checked + .decision-content .decision-consequence-warning {
    color: var(--color-danger);
}

/* -----------------------------------------------------------------------------
   Analysis
   ----------------------------------------------------------------------------- */
.analysis-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.analysis-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.analysis-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
}

.analysis-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.analysis-option-icon svg {
    width: 24px;
    height: 24px;
}

.analysis-option-accept .analysis-option-icon {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.analysis-option-request .analysis-option-icon {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.analysis-option-content {
    flex: 1;
}

.analysis-option-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.analysis-option-content p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.analysis-option-content .form-textarea {
    margin-bottom: 1rem;
}

/* -----------------------------------------------------------------------------
   Pagination
   ----------------------------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0 0.5rem;
    border-top: 1px solid var(--color-border-light);
    margin-top: 1rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* -----------------------------------------------------------------------------
   Notifications
   ----------------------------------------------------------------------------- */
.notifications-list {
    display: flex;
    flex-direction: column;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

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

.notification-item.unread {
    background: var(--color-bg);
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 20px;
    height: 20px;
}

.notification-info .notification-icon { background: var(--color-info-bg); color: var(--color-info); }
.notification-acao .notification-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.notification-sucesso .notification-icon { background: var(--color-success-bg); color: var(--color-success); }
.notification-alerta .notification-icon { background: var(--color-danger-bg); color: var(--color-danger); }

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

.notification-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.notification-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.notification-action {
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   Process Detail
   ----------------------------------------------------------------------------- */
.process-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.process-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.process-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.process-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}

/* -----------------------------------------------------------------------------
   Dossie
   ----------------------------------------------------------------------------- */
.dossie-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dossie-summary .card-body {
    padding: 2rem;
}

.dossie-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.dossie-section h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

/* -----------------------------------------------------------------------------
   Modal
   ----------------------------------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-content-lg {
    width: min(1280px, calc(100vw - 2.5rem));
    max-width: min(1280px, calc(100vw - 2.5rem));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: var(--border-radius);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 1.25rem;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

/* -----------------------------------------------------------------------------
   Comment Form
   ----------------------------------------------------------------------------- */
.comment-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.comment-form .form-textarea {
    flex: 1;
    min-height: 80px;
}

/* -----------------------------------------------------------------------------
   Client Info Banner
   ----------------------------------------------------------------------------- */
.client-info-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--border-radius);
}

.client-info-banner svg {
    width: 40px;
    height: 40px;
    color: var(--color-primary);
}

.client-info-banner strong {
    display: block;
    font-weight: 600;
    color: var(--color-text);
}

.client-info-banner span {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

/* -----------------------------------------------------------------------------
   Tax Row
   ----------------------------------------------------------------------------- */
.tax-row {
    margin-bottom: 1.5rem;
}

.tax-row:last-child {
    margin-bottom: 0;
}

.tax-row h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

/* -----------------------------------------------------------------------------
   Section Divider
   ----------------------------------------------------------------------------- */
.section-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: 1.5rem 0;
}

.section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* -----------------------------------------------------------------------------
   Action Buttons
   ----------------------------------------------------------------------------- */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

/* -----------------------------------------------------------------------------
   List filter bar (checklists, pendências, GED)
   ----------------------------------------------------------------------------- */
.card-header--filter {
    display: block;
    padding: 0.625rem 1rem;
}

.list-filter-bar {
    width: 100%;
}

.list-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
}

.list-filter-fields {
    flex: 1;
    min-width: 0;
}

.list-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.625rem;
    align-items: flex-end;
}

.list-filter-grid .form-group {
    flex: 1 1 7.5rem;
    min-width: 7.5rem;
    max-width: 11rem;
    gap: 0.2rem;
}

.list-filter-grid .form-group.col-span-2 {
    flex: 2 1 12rem;
    min-width: 12rem;
    max-width: 20rem;
}

.list-filter-bar .form-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
}

.list-filter-bar .form-input,
.list-filter-bar .form-select {
    padding: 0.4375rem 0.625rem;
    font-size: 0.8125rem;
}

.list-filter-grid .form-group input[type="date"] {
    min-width: 8.5rem;
}

.list-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
    flex-shrink: 0;
    padding-bottom: 1px;
}

.list-filter-actions .btn {
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
}

.list-filter-actions .btn svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 768px) {
    .list-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .list-filter-grid .form-group,
    .list-filter-grid .form-group.col-span-2 {
        max-width: none;
        flex: 1 1 calc(50% - 0.5rem);
    }

    .list-filter-actions {
        justify-content: stretch;
    }

    .list-filter-actions .btn {
        flex: 1;
    }
}

/* -----------------------------------------------------------------------------
   Filter Form
   ----------------------------------------------------------------------------- */
.filter-form,
.search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.filter-form .input-wrapper,
.search-form .input-wrapper {
    flex: 1;
    max-width: 300px;
}

.filter-form .form-select {
    width: auto;
}

/* Dropdown com checkboxes para filtro de status */
.filter-dropdown-checkboxes {
    position: relative;
}

.filter-dropdown-details {
    position: relative;
}

.filter-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    min-height: 2.5rem;
    min-width: 160px;
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.filter-dropdown-trigger::-webkit-details-marker {
    display: none;
}

.filter-dropdown-trigger:hover {
    border-color: var(--color-primary);
}

.filter-dropdown-label {
    font-weight: 500;
}

.filter-dropdown-summary {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.filter-dropdown-chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.filter-dropdown-details[open] .filter-dropdown-chevron {
    transform: rotate(180deg);
}

.filter-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    padding: 0.5rem;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 4px;
}

.filter-checkbox-item:hover {
    background: var(--color-bg-alt);
}

.filter-checkbox-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--color-primary);
}

.filter-dropdown-clear {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-primary);
    background: none;
    border: none;
    border-top: 1px solid var(--color-border);
    cursor: pointer;
    text-align: left;
}

.filter-dropdown-clear:hover {
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Auth Page
   ----------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.auth-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-secondary) 100%);
    overflow: hidden;
}

.auth-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.08) 0%, transparent 50%);
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo svg {
    width: 32px;
    height: 32px;
    stroke: white;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
}

.auth-header p {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-error-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-error-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
}

.auth-footer p {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .detail-layout,
    .process-content {
        grid-template-columns: 1fr;
    }
    
    .detail-sidebar,
    .process-sidebar {
        position: static;
    }
    
    .simulation-details-grid {
        grid-template-columns: 1fr;
    }
    
    .simulation-details-grid .card.col-span-2 {
        grid-column: span 1;
    }
    
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .summary-total {
        margin: 0;
        border-radius: var(--border-radius);
        margin-top: 1rem;
        grid-column: span 3;
    }
    
    .decision-options {
        grid-template-columns: 1fr;
    }
    
    .dossie-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header {
        padding: 1rem;
    }
    
    .content-body {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.col-span-2,
    .form-group.col-span-3,
    .form-group.col-span-4 {
        grid-column: span 1;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid .info-item.col-span-2 {
        grid-column: span 1;
    }
    
    .process-timeline {
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .header-right {
        flex-wrap: wrap;
    }
    
    .filter-form,
    .search-form {
        flex-wrap: wrap;
    }
    
    .filter-form .input-wrapper,
    .search-form .input-wrapper {
        max-width: none;
        width: 100%;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-total {
        grid-column: span 2;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------------------------------------------
   Credential Alert (for new user creation)
   ----------------------------------------------------------------------------- */
.credential-alert {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #10b981;
    border-radius: var(--border-radius-lg);
    margin-bottom: 1.5rem;
}

.credential-alert-icon {
    width: 48px;
    height: 48px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.credential-alert-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.credential-alert-content {
    flex: 1;
}

.credential-alert-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 0.5rem;
}

.credential-alert-content > p {
    font-size: 0.875rem;
    color: #047857;
    margin-bottom: 1rem;
}

.credential-box {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.credential-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    min-width: 60px;
}

.credential-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
}

.credential-hint {
    font-size: 0.75rem;
    color: #047857;
    font-style: italic;
}

/* -----------------------------------------------------------------------------
   Access Info Box (form)
   ----------------------------------------------------------------------------- */
.access-info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-info-bg);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.access-info-box svg {
    width: 20px;
    height: 20px;
    color: var(--color-info);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.access-info-box p {
    font-size: 0.875rem;
    color: var(--color-info);
    margin: 0;
}

/* -----------------------------------------------------------------------------
   Checkbox Label
   ----------------------------------------------------------------------------- */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* -----------------------------------------------------------------------------
   Notifications List (enhanced)
   ----------------------------------------------------------------------------- */
.notification-item {
    position: relative;
}

.notification-link {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    text-decoration: none;
    color: inherit;
    padding-right: 1rem;
}

.notification-link:hover .notification-title {
    color: var(--color-primary);
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.notification-action-form {
    display: inline-flex;
}

.notification-read-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    padding: 0.25rem 0.5rem;
}

.notification-read-badge svg {
    width: 14px;
    height: 14px;
}

.notifications-list .notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
}

.notifications-list .notification-item:hover {
    background: var(--color-bg-hover);
}

.notifications-list .notification-item:last-child {
    border-bottom: none;
}

.notifications-list .notification-item.unread {
    background: var(--color-info-bg);
}

.notifications-list .notification-item.unread:hover {
    background: #dbeafe;
}

/* -----------------------------------------------------------------------------
   Alert Boxes
   ----------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 1.5rem;
}

.alert svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert strong {
    display: block;
    margin-bottom: 0.25rem;
}

.alert p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.alert-content {
    flex: 1;
}

.alert-content p {
    margin-top: 0.25rem;
}

/* -----------------------------------------------------------------------------
   Editable Mode Badge
   ----------------------------------------------------------------------------- */
.badge-editable {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid #3b82f6;
}

/* -----------------------------------------------------------------------------
   NCM Autocomplete Dropdown
   ----------------------------------------------------------------------------- */
.ncm-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 4px;
    list-style: none;
    margin: 0;
}

.ncm-autocomplete-dropdown::-webkit-scrollbar {
    width: 4px;
}
.ncm-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.ncm-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.1s ease;
    list-style: none;
}

.ncm-dropdown-item:hover,
.ncm-dropdown-item.highlighted {
    background: #eef4fb;
}

.ncm-item-code {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-primary-light);
    background: #e8f0f8;
    border: 1px solid #c9ddf0;
    padding: 2px 7px;
    border-radius: 5px;
    flex-shrink: 0;
    letter-spacing: 0.04em;
    margin-top: 1px;
    white-space: nowrap;
}

.ncm-item-desc {
    font-size: 0.8125rem;
    color: var(--color-text);
    line-height: 1.45;
}

/* Itens de hierarquia (posição/subposição — drill-down, não NCM folha) */
.ncm-dropdown-item.is-hierarquia {
    opacity: 0.88;
}

.ncm-dropdown-item.is-hierarquia .ncm-item-code {
    color: var(--color-text-secondary);
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ncm-dropdown-item.is-hierarquia .ncm-item-desc {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.ncm-item-drill {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    padding-left: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.ncm-item-drill svg {
    width: 10px;
    height: 10px;
    opacity: 0.6;
}

/* -----------------------------------------------------------------------------
   Fixed Action Bar
   ----------------------------------------------------------------------------- */
.action-bar-fixed {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: white;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    z-index: 100;
    transition: left 0.2s ease;
}

.action-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.action-bar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.action-bar-info svg {
    width: 20px;
    height: 20px;
    color: var(--color-warning);
    flex-shrink: 0;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

/* Ajuste para o conteúdo não ficar atrás da barra fixa */
.detail-layout {
    padding-bottom: 5rem;
}

@media (max-width: 768px) {
    .action-bar-fixed {
        left: 0;
        padding: 1rem;
    }
    
    .action-bar-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .action-bar-info {
        text-align: center;
    }
    
    .action-bar-info svg {
        display: none;
    }
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    color: #92400e;
}

.alert-warning svg {
    color: #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.alert-info svg {
    color: #3b82f6;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid #10b981;
    color: #065f46;
}

.alert-success svg {
    color: #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #ef4444;
    color: #991b1b;
}

.alert-danger svg {
    color: #ef4444;
}

/* -----------------------------------------------------------------------------
   Table Row Highlights
   ----------------------------------------------------------------------------- */
.row-highlight-warning {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, transparent 100%);
    border-left: 3px solid #f59e0b;
}

.row-highlight-warning:hover {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.05) 100%) !important;
}

.row-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    color: #f59e0b;
}

.row-indicator svg {
    width: 14px;
    height: 14px;
}

/* -----------------------------------------------------------------------------
   Status Stack (multiple badges)
   ----------------------------------------------------------------------------- */
.status-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

.status-stack .status-badge {
    display: inline-flex;
    align-items: center;
}

/* Status alteracao badge styling */
.status-alteracao {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* -----------------------------------------------------------------------------
   Filter Checkbox
   ----------------------------------------------------------------------------- */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: all 0.15s ease;
}

.filter-checkbox:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-hover);
}

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

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.filter-checkbox-label svg {
    width: 16px;
    height: 16px;
}

.filter-checkbox input[type="checkbox"]:checked + .filter-checkbox-label {
    color: var(--color-primary);
}

/* -----------------------------------------------------------------------------
   Form Validation Errors
   ----------------------------------------------------------------------------- */
.error-list {
    list-style: disc;
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.error-list li {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.form-error-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-error-inline svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.form-label-required {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.decision-options.has-error {
    border: 2px solid #dc2626;
    border-radius: var(--border-radius-lg);
    padding: 0.5rem;
    background: #fef2f2;
}

.decision-options.has-error .decision-option {
    background: white;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select {
    border-color: #dc2626;
    background: #fef2f2;
}

.form-group.has-error .form-input:focus,
.form-group.has-error .form-textarea:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* -----------------------------------------------------------------------------
   Clickable Table Rows
   ----------------------------------------------------------------------------- */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.clickable-row:hover {
    background-color: var(--color-bg-hover) !important;
}

.clickable-row:active {
    transform: scale(0.995);
}

/* Indicador visual sutil que a linha é clicável */
.clickable-row td:first-child {
    position: relative;
}

.clickable-row:hover td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
    border-radius: 0 2px 2px 0;
}

/* =============================================================================
   Importacao de Legado (Phase 06)
   ============================================================================= */

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-lg);
    background: var(--color-bg);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}

.drop-zone.drag-over {
    border-color: var(--color-primary);
    background: #eff6ff;
    color: var(--color-primary);
}

.drop-zone.has-files {
    border-style: solid;
    border-width: 1px;
    border-color: var(--color-border);
    min-height: auto;
    padding: 1rem;
}

.drop-zone svg {
    width: 64px;
    height: 64px;
    color: var(--color-text-muted);
}

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

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

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
}

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

.step-indicator .step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    background: var(--color-surface);
}

.step-indicator .step.current .step-circle {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

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

.step-indicator .step-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.step-indicator .step.current .step-label {
    color: var(--color-text);
    font-weight: 700;
}

.step-indicator .step.completed .step-label {
    color: var(--color-text);
}

.step-indicator .step-connector {
    width: 48px;
    height: 2px;
    background: var(--color-border);
    margin: 0 0.5rem;
}

.step-indicator .step-connector.completed {
    background: var(--color-success);
}

/* File Row classification states */
.file-row {
    min-height: 48px;
    border-left: 3px solid transparent;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.file-row:hover {
    background: var(--color-bg);
}

.file-row.incomplete {
    border-left-color: var(--color-warning);
}

.file-row.complete {
    border-left-color: var(--color-success);
}

/* Folder Group */
.folder-group {
    margin-bottom: 1.5rem;
}

.folder-group .card-header {
    background: var(--color-bg);
}

/* Legado badge — shown on processo list for imported legacy processes */
.status-badge-legado {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 700;
}

/* -----------------------------------------------------------------------------
   Form Submit Spinner
   ----------------------------------------------------------------------------- */
@keyframes navan-spin {
    to { transform: rotate(360deg); }
}

.btn-spinner {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: navan-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 0.4em;
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   PTAX / Exchange Rate Widget
   ----------------------------------------------------------------------------- */
.ptax-widget {
    margin-bottom: 1.5rem;
}

.ptax-widget .card-body {
    padding: 1rem 1.5rem;
}

.ptax-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.ptax-currencies {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ptax-currency {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ptax-currency-badge {
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
}

.ptax-currency-badge--usd {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.ptax-currency-badge--eur {
    background: linear-gradient(135deg, #1a5276 0%, #2e86c1 100%);
}

.ptax-value-group {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.ptax-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
}

.ptax-value--eur {
    color: #1a5276;
}

.ptax-date {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}

.ptax-error {
    color: var(--color-danger);
    font-size: 0.85rem;
}

.ptax-source {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}


/* -----------------------------------------------------------------------------
   Stepper Component (Phase 12)
   ----------------------------------------------------------------------------- */
.stepper-wrapper {
    width: 100%;
    overflow-x: auto; /* Permite rolagem em telas muito pequenas */
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 800px; /* Garante que os passos nao fiquem esmagados */
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    transition: all var(--transition-slow);
    margin-bottom: 0.5rem;
}

.step-circle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    transition: all var(--transition-slow);
}

.step-line {
    flex: 1;
    height: 3px;
    background: var(--color-border);
    margin: 0 -5%;
    transform: translateY(-12px); /* Alinha com os circulos */
    z-index: 1;
    position: relative;
}

.step-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width var(--transition-slow);
}

/* Status Classes */
.step.active .step-circle {
    background: var(--color-surface);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(15, 76, 117, 0.15);
}

.step.active .step-label {
    color: var(--color-primary);
    font-weight: 700;
}

.step.completed .step-circle {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-color: transparent;
    color: white;
}

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

.step-line.filled::after {
    width: 100%;
}

/* -----------------------------------------------------------------------------
   Chart Cards (Phase 13 - Dashboard Interativo)
   ----------------------------------------------------------------------------- */
.chart-card {
    min-height: 280px;
}

.chart-card .card-body {
    position: relative;
    height: 250px;
}

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------------------------------------------
   Pendências documentais
   ----------------------------------------------------------------------------- */
.pendencias-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pendencias-stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pendencias-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

.pendencias-stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.pendencias-stat-pendente .pendencias-stat-value { color: #b45309; }
.pendencias-stat-rejeitado .pendencias-stat-value { color: #dc2626; }
.pendencias-stat-urgente .pendencias-stat-value { color: #c2410c; }

.pendencias-grupo {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: visible;
}

.pendencias-grupo:last-child {
    margin-bottom: 0;
}

.pendencias-grupo-header {
    padding: 0.875rem 1rem;
    background: var(--color-bg-subtle);
    cursor: pointer;
    list-style: none;
}

.pendencias-grupo-header::-webkit-details-marker {
    display: none;
}

.pendencias-grupo-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pendencias-grupo-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    color: var(--color-text-muted);
}

.pendencias-grupo-desc {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.pendencias-grupo-rejeitado { border-color: #fecaca; }
.pendencias-grupo-critico { border-color: #fed7aa; }

.pendencia-prioridade-cell {
    overflow: visible;
    position: relative;
}

.pendencia-prioridade {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    cursor: help;
}

.pendencia-th-hint {
    cursor: help;
    border-bottom: 1px dotted var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.pendencia-prioridade-rejeitado { background: #fee2e2; color: #b91c1c; }
.pendencia-prioridade-critico { background: #ffedd5; color: #c2410c; }
.pendencia-prioridade-alto { background: #fef3c7; color: #b45309; }
.pendencia-prioridade-normal { background: #ecfdf5; color: #047857; }

.pendencias-table tbody tr.pendencia-row:hover {
    background: var(--color-bg-subtle);
}

.pendencia-doc-nome {
    display: block;
    margin-bottom: 0.125rem;
}

.pendencia-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pendencia-motivo {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #b91c1c;
    font-style: italic;
}

.pendencia-idade {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--color-text-muted);
}

.pendencia-idade-alta { color: #b45309; }
.pendencia-idade-critica { color: #dc2626; }

.badge-doc {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-task {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    background: #f3e8ff;
    color: #7e22ce;
}

@media (max-width: 900px) {
    .pendencias-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pendencias-stats {
        grid-template-columns: 1fr;
    }

    .pendencias-table th:nth-child(4),
    .pendencias-table td:nth-child(4) {
        display: none;
    }
}

/* ── Fase 24: UX Polish Simulação ── */

.simulation-form details.form-section-accordion {
    margin-bottom: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.simulation-form details.form-section-accordion:last-of-type {
    border-bottom: none;
}

.simulation-form details.form-section-accordion > summary {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    padding-bottom: 0.5rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.simulation-form details.form-section-accordion > summary::-webkit-details-marker {
    display: none;
}

.simulation-form details.form-section-accordion > summary::after {
    content: "▸";
    transition: transform 0.15s ease;
}

.simulation-form details.form-section-accordion[open] > summary::after {
    transform: rotate(90deg);
}

.simulation-form details.form-section-accordion > summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

#ncm-excecao-info {
    border-left: 4px solid var(--color-warning);
    font-weight: 500;
}

.ncm-loading::after {
    content: "";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border: 2px solid var(--color-border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: ncm-spin 0.6s linear infinite;
    pointer-events: none;
}

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

/* Painel resumo de custos: barra compacta expansível no mobile.
   Desktop (>768px) permanece com o comportamento sticky/pin existente. */
@media (max-width: 768px) {
    /* sticky (não fixed): ocupa espaço no fluxo — sem sobreposição nem
       padding compensatório; .painel-fixado inline já define sticky/top */
    #custo-painel {
        position: sticky;
        top: 0;
        z-index: 300;
        margin-bottom: 0;
        max-height: 10vh;
        overflow: hidden;
        border-radius: 0;
    }

    #custo-painel.painel-mobile-expandido {
        max-height: 90vh;
        overflow-y: auto;
    }

    #custo-painel .card-header {
        cursor: pointer;
    }

    #painel-total-mobile {
        display: inline !important;
    }

    #custo-painel .card-body {
        display: none;
    }

    #custo-painel.painel-mobile-expandido .card-body {
        display: block;
    }

    #custo-painel #btn-pin-painel {
        display: none;
    }
}

