@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --info: #06b6d4;
    --info-light: #cffafe;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --light: #f8fafc;
    --dark: #1e293b;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-title-color: #1e293b;
    --section-title-color: #1e293b;
    --text: #1e293b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --accent: #06b6d4;
    --accent-light: #67e8f9;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #182644;
    --card-bg: #22345a;
    /* Mais claro que o fundo para contraste */
    --card-title-color: #ffffff;
    --text: #f8fafc;
    --section-title-color: #ffffff;
    --secondary: #94a3b8;
    /* Aumentado contraste do texto secundário */
    --text-muted: #64748b;
    --border: #334155;
    /* Bordas mais nítidas */
    --light: #1e2d4d;
    --dark: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    /* Sombra mais profunda */
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 30px rgba(0, 0, 0, 0.6);

    --success-light: rgba(16, 185, 129, 0.2);
    --info-light: rgba(6, 182, 212, 0.2);
    --warning-light: rgba(245, 158, 11, 0.2);
    --danger-light: rgba(239, 68, 68, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.section-title {
    margin: 0 !important;
    border: none !important;
    font-size: 1.5rem !important;
    color: var(--section-title-color) !important;
}

h1 {
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════
   UNIFIED HEADER & NAVIGATION
   ═══════════════════════════════════════════ */
.header-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 14px;
    margin-bottom: 20px;
    background: #ffffff;
    padding: 8px 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.brand-link {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    line-height: 0;
}

.main-logo {
    height: 40px;
    width: auto;
    max-height: 40px;
    max-width: min(150px, 28vw);
    object-fit: contain;
    transition: transform var(--transition);
}

.brand-link:hover .main-logo {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 8px;
    min-width: 0;
    flex-wrap: nowrap;
}

.nav-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nav-tail {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding-left: 8px;
    margin-left: 4px;
    border-left: 1px solid var(--border);
}

.user-greeting {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.78rem;
    max-width: min(11rem, 22vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

@media (min-width: 1100px) {
    .user-greeting {
        max-width: 18rem;
        font-size: 0.85rem;
    }
}

.nav-item {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.8rem;
    transition: all var(--transition);
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-item i {
    font-size: 18px;
}

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

.nav-item.active {
    background: var(--primary-light);
    color: white !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.nav-divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

@media (max-width: 920px) {
    .nav-item-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .nav-item {
        padding: 8px 10px;
    }
}

/* Card de alerta eproc (abaixo da navbar) */
#globalEprocAlertBar[hidden] {
    display: none !important;
}

.eproc-alert-card {
    margin-bottom: 18px;
    border: 1px solid rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, var(--warning-light) 0%, #fff8eb 100%);
    color: #92400e;
    box-shadow: var(--shadow-sm);
}

.eproc-alert-card__layout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.eproc-alert-card__icon-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.eproc-alert-card__icon {
    font-size: 28px !important;
    color: #b45309;
}

.eproc-alert-card__main {
    flex: 1 1 auto;
    min-width: 0;
}

.eproc-alert-card__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #92400e;
    line-height: 1.3;
}

.eproc-alert-card__body {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #78350f;
}

.eproc-alert-card__actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(180, 83, 9, 0.2);
}

.eproc-alert-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-xs);
    background: var(--primary);
    color: #fff !important;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: filter var(--transition);
}

.eproc-alert-card__cta:hover {
    filter: brightness(1.05);
}

[data-theme="dark"] .eproc-alert-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(34, 52, 90, 0.95) 100%);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

[data-theme="dark"] .eproc-alert-card__title {
    color: #fde68a;
}

[data-theme="dark"] .eproc-alert-card__body {
    color: #fcd34d;
    opacity: 0.95;
}

[data-theme="dark"] .eproc-alert-card__icon {
    color: #fbbf24;
}

[data-theme="dark"] .eproc-alert-card__actions {
    border-top-color: rgba(251, 191, 36, 0.2);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

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

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

/* Dark Mode Header */
[data-theme="dark"] .header-container {
    background: #ffffff !important;
    /* Mantido branco para a logo */
    border-color: #e2e8f0;
}

[data-theme="dark"] .user-greeting {
    color: #4b5563;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer-credits {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-credits strong {
    color: var(--primary);
}

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

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

.card h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--card-title-color);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════
   RESULTS SECTION
   ═══════════════════════════════════════════ */
.results-section {
    margin-top: 28px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.action-btn-clear {
    background-color: var(--secondary) !important;
}

.action-btn-download {
    background-color: var(--success) !important;
}

/* ═══════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════ */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    animation: slideInUp 0.4s ease;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-total {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.stat-found {
    background: linear-gradient(135deg, #059669, #10b981);
}

.stat-not-found {
    background: linear-gradient(135deg, #dc2626, #f87171);
}

.stat-processes {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
}

.stat-icon {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.stat-icon i {
    font-size: 28px;
    color: white;
}

.stat-content {
    flex: 1;
    z-index: 1;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

/* ═══════════════════════════════════════════
   FILTER CARD
   ═══════════════════════════════════════════ */
.filter-card {
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.filter-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    user-select: none;
}

.filter-header:hover {
    opacity: 0.8;
}

.filter-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.filter-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease;
    opacity: 1;
    margin-top: 16px;
}

.filter-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

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

.filter-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-input-group label i {
    font-size: 16px;
    color: var(--primary);
}

.filter-input-group input {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition);
    background: white;
}

.filter-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input-group input::placeholder {
    color: #cbd5e0;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.active-filter-tag {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

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

.filter-clear-btn {
    background-color: var(--secondary) !important;
}

.filter-clear-btn:hover {
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.25) !important;
}

/* ═══════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════ */
.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

input[type="text"],
input[type="file"],
input[type="date"] {
    flex: 1;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition);
    background: white;
    color: #1e293b;
    /* Texto escuro para alto contraste no fundo branco */
}

input[type="file"]::file-selector-button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    padding: 6px 12px;
    margin-right: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color var(--transition);
}

input[type="file"]::file-selector-button:hover {
    background-color: var(--primary-dark);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="file"] {
    background: #1e263a;
    color: #ffffff;
    border-color: #334155;
}

[data-theme="dark"] input::placeholder {
    color: #64748b;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-xs);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: var(--primary);
    color: white;
    white-space: nowrap;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    filter: brightness(1.05);
}

button:active {
    transform: translateY(0);
}

button.secondary {
    background-color: var(--success);
}

button.secondary:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

button.small-btn {
    padding: 7px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-xs);
}

/* ═══════════════════════════════════════════
   MAIN TABLE
   ═══════════════════════════════════════════ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    overflow: hidden;
    table-layout: fixed;
}

th {
    background-color: var(--light);
    /* Fundo sutilmente diferente para destacar o cabeçalho */
    color: var(--text);
    /* Texto mais claro no modo escuro */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 12px;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
    font-size: 0.9rem;
}

td:first-child {
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

.col-icon,
.col-cpf {
    text-align: left;
}

.col-status {
    text-align: center;
}

.col-resumo {
    text-align: left;
}

.col-data {
    text-align: center;
    font-size: 0.85em;
    color: var(--secondary);
}

/* ═══════════════════════════════════════════
   ACCORDION ROWS
   ═══════════════════════════════════════════ */
.parent-row {
    cursor: pointer;
    transition: all var(--transition);
}

.parent-row:hover {
    background-color: var(--light);
}

.parent-row.expanded {
    background: linear-gradient(90deg, var(--light) 0%, var(--card-bg) 100%);
    border-left: 4px solid var(--primary);
}

.child-row {
    display: none;
    animation: expandRow 0.25s ease;
}

.child-row.visible {
    display: table-row;
}

@keyframes expandRow {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.details-container {
    padding: 20px;
    background: linear-gradient(135deg, var(--light) 0%, var(--card-bg) 100%);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-sm);
    margin: 8px;
}

/* ═══════════════════════════════════════════
   PROCESS TABLE (simple fallback)
   ═══════════════════════════════════════════ */
.process-table {
    width: 100%;
    margin-top: 8px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.process-table th {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 0.72rem;
    padding: 10px 12px;
    font-weight: 600;
}

.process-table td {
    padding: 10px 12px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
}

.process-table tr:hover {
    background-color: var(--light);
}

/* ═══════════════════════════════════════════
   ENRICHED PROCESS CARDS
   ═══════════════════════════════════════════ */
.enriched-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.enriched-badge i {
    font-size: 13px;
}

.process-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.process-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
    animation: slideInUp 0.3s ease both;
}

.process-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.process-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--light), var(--bg));
    border-bottom: 1px solid var(--border);
    gap: 8px;
    flex-wrap: wrap;
}

.process-card-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--primary-dark);
    letter-spacing: -0.01em;
}

.process-card-number i {
    font-size: 18px;
    color: var(--primary);
}

.process-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.process-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.tag-date {
    background: var(--info-light);
    color: #0e7490;
}

.tag-situation-active {
    background: var(--success-light);
    color: #065f46;
}

.tag-situation-inactive {
    background: #f1f5f9;
    color: var(--secondary);
}

.tag-classe {
    background: #ede9fe;
    color: #6d28d9;
}

.process-card-body {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.process-card-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

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

.field-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-label i {
    font-size: 13px;
}

.field-value {
    font-size: 0.86rem;
    color: var(--text);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.field-value.truncate {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.process-card-footer {
    padding: 10px 16px;
    background: var(--light);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.process-detail-btn {
    padding: 5px 12px !important;
    font-size: 0.78rem !important;
    border-radius: var(--radius-xs) !important;
    background: var(--primary) !important;
    gap: 4px !important;
}

.process-detail-btn:hover {
    background: var(--primary-dark) !important;
}

.process-event-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════ */
.status-cell {
    font-weight: 600;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
    display: inline-block;
    white-space: nowrap;
    transition: all var(--transition);
}

.status-pending {
    color: #b45309;
    background-color: var(--warning-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-success {
    color: #065f46;
    background-color: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-not-found {
    color: #991b1b;
    background-color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-error {
    color: #991b1b;
    background-color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Dark Mode Overrides for Status Badges */
[data-theme="dark"] .status-pending {
    color: #fbbf24;
    background-color: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .status-success {
    color: #34d399;
    background-color: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .status-not-found,
[data-theme="dark"] .status-error {
    color: #f87171;
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ═══════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════ */
#progressContainer {
    margin-top: 12px;
    background: var(--bg);
    border-radius: var(--radius-xs);
    overflow: hidden;
    height: 22px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

progress {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

progress::-webkit-progress-bar {
    background-color: transparent;
}

progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s;
    border-radius: var(--radius-xs);
}

#progressText {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    left: 0;
    font-size: 0.78rem;
    color: var(--dark);
    font-weight: 700;
    line-height: 22px;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* ═══════════════════════════════════════════
   MODERN SKELETON SCREENS
   ═══════════════════════════════════════════ */
.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f1f5f9 4%, #e2e8f0 25%, #f1f5f9 36%);
    background-size: 1000px 100%;
    border-radius: var(--radius-xs);
    display: inline-block;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(to right, #1e2d4d 4%, #2d3b5a 25%, #1e2d4d 36%);
}

.skeleton-text {
    height: 12px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* ═══════════════════════════════════════════
   RESPONSIVE - Tablet
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-card-body {
        grid-template-columns: 1fr 1fr;
        gap: 8px 16px;
    }
}

/* ═══════════════════════════════════════════
   RESPONSIVE - Mobile
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    h1 {
        font-size: 1.2rem;
    }

    .header-container {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        gap: 8px 10px;
        padding: 8px 12px;
    }

    .card {
        padding: 16px;
        margin-bottom: 14px;
        border-radius: var(--radius-sm);
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;

        /* ═══════════════════════════════════════════
   MODERN PROGRESS BAR
   ═══════════════════════════════════════════ */
        progress {
            width: 100%;
            height: 10px;
            appearance: none;
            border-radius: 10px;
            overflow: hidden;
            border: none;
            background-color: var(--light);
            margin: 10px 0;
        }

        progress::-webkit-progress-bar {
            background-color: var(--light);
            border-radius: 10px;
        }

        progress::-webkit-progress-value {
            background: linear-gradient(90deg, var(--primary) 0%, #34d399 100%);
            border-radius: 10px;
            transition: width 0.4s cubic-bezier(0.1, 0.7, 0.1, 1);
        }

        [data-theme="dark"] progress::-webkit-progress-bar {
            background-color: #1e2d4d;
        }

        #progressText {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--primary);
            display: block;
            text-align: right;
        }

        gap: 10px;
    }

    .stat-icon {
        padding: 8px;
    }

    .stat-icon i {
        font-size: 22px;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

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

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group button {
        width: 100%;
    }

    table {
        font-size: 0.82rem;
    }

    th,
    td {
        padding: 8px 6px;
    }

    .status-cell {
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    .process-card-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .process-card-body {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 8px;
    }

    .process-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .process-event-text {
        max-width: 100%;
        white-space: normal;
    }

    .process-detail-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ═══════════════════════════════════════════
   RESPONSIVE - Small Mobile
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
    body {
        padding: 6px;
    }

    h1 {
        font-size: 1.05rem;
    }

    .header-container {
        padding: 12px;
        border-radius: var(--radius-xs);
    }

    button.small-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .stats-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }

    .stat-value {
        font-size: 1.15rem;
    }

    .card {
        padding: 12px;
        border-radius: var(--radius-xs);
    }

    .process-card-number {
        font-size: 0.82rem;
    }

    .field-value {
        font-size: 0.82rem;
    }
}

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

.spinning {
    animation: spin 1s linear infinite;
}
