/* ============================================================
   GP WORKFLOW — Sistema de Gestao Interna
   Paleta: Azul #124C8C | Amarelo BB #FDB913 | Vermelho #DC2626
   Design: Clean, leve, profissional — azul como destaque
   ============================================================ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
    --blue: #124C8C;
    --blue-dark: #0e3d6f;
    --blue-light: #1a6bc4;
    --blue-pale: #edf4fc;
    --blue-muted: #a3c4e4;
    --yellow: #FDB913;
    --yellow-dark: #d99e0a;
    --yellow-pale: #fef9e7;
    --red: #DC2626;
    --red-light: #fca5a5;
    --red-pale: #fef2f2;
    --green: #16a34a;
    --green-pale: #ecfdf5;
    --orange: #ea580c;
    --orange-pale: #fff7ed;
    --white: #ffffff;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --r: 14px;
    --rs: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(18,76,140,0.08), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 30px rgba(18,76,140,0.12), 0 2px 8px rgba(0,0,0,0.06);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--gray-800);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============ SCREENS ============ */
.screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ LOGIN SCREEN ============ */
#screenLogin {
    background: var(--bg);
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Decorative background shapes */
#screenLogin::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(18,76,140,0.06), rgba(253,185,19,0.06));
    pointer-events: none;
}

#screenLogin::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(253,185,19,0.05), rgba(18,76,140,0.03));
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 44px;
}

.login-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--yellow);
    color: var(--blue-dark);
    font-size: 28px;
    font-weight: 900;
    border-radius: 18px;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(253,185,19,0.3);
}

.login-logo h1 {
    color: var(--blue);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--gray-400);
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.login-form .field label i {
    font-size: 12px;
    color: var(--blue);
}

.login-form .field input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--rs);
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: all 0.2s;
}

.login-form .field input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(18,76,140,0.1);
}

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

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--rs);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--red-pale);
    border: 1px solid var(--red-light);
    border-radius: var(--rs);
    color: var(--red);
    font-size: 13px;
    font-weight: 500;
}

.login-error i {
    font-size: 14px;
    flex-shrink: 0;
}

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

/* ============ APP HEADER ============ */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    display: flex;
    flex-direction: column;
}

.header-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

.header-role {
    font-size: 10px;
    color: var(--gray-400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logo-center {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: var(--blue);
}

.logo-gp {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--yellow);
    color: var(--blue-dark);
    font-size: 13px;
    font-weight: 900;
    border-radius: 8px;
}

.header-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--rs);
    color: var(--gray-600);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    position: relative;
}

.btn-icon:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); border-radius: 8px; }
.btn-icon:active { transform: scale(0.94); }

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--white);
}

/* ============ STATUS TABS ============ */
.status-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--white);
    padding: 0 12px;
    gap: 2px;
}

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

.status-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

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

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

.status-tab .tab-count {
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
    transition: all 0.2s;
}

.status-tab.active .tab-count {
    background: var(--blue);
    color: white;
}

/* ============ SUMMARY BAR ============ */
.summary-bar {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    overflow-x: auto;
    background: var(--bg);
}

.summary-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--white);
    color: var(--blue);
    border: 1px solid var(--gray-200);
}

.summary-item i { font-size: 11px; }

.summary-item.summary-urgent {
    background: var(--red-pale);
    color: var(--red);
    border-color: var(--red-light);
    animation: pulse 2s infinite;
}

.summary-item.summary-done {
    background: var(--green-pale);
    color: var(--green);
    border-color: #bbf7d0;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.65} }

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    gap: 8px;
}
.filter-period {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active { background: var(--blue); color: white; border-color: var(--blue); }
.filter-view {
    display: flex;
    gap: 2px;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 2px;
}
.view-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
}
.view-btn:hover { color: var(--blue); }
.view-btn.active { background: var(--blue); color: white; box-shadow: var(--shadow-sm); }

/* ============ TASK TABLE (LIST VIEW) ============ */
.task-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 80px;
}
.task-table thead th {
    background: var(--blue);
    color: white;
    padding: 8px 6px;
    font-size: 10px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}
.task-table tbody td {
    padding: 6px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-table tbody tr:nth-child(even) { background: var(--gray-50); }
.task-table tbody tr:hover { background: var(--blue-pale); }
.task-table .tbl-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
}
.task-table .tbl-status.s-pendente { background: #FFF3CD; color: #856404; }
.task-table .tbl-status.s-em_andamento { background: #CCE5FF; color: #004085; }
.task-table .tbl-status.s-concluida_legalmail { background: #D4EDDA; color: #155724; }
.task-table .tbl-status.s-concluida_pasta { background: #E2E3E5; color: #383D41; }
.task-table .tbl-status.s-protocolada { background: #D1ECF1; color: #0C5460; }
.task-table .tbl-status.s-revisao { background: #F8D7DA; color: #721C24; }
.task-table .tbl-status.s-cancelada { background: #F5C6CB; color: #721C24; }
.task-table .tbl-actions { display: flex; gap: 4px; }
.task-table .tbl-actions button {
    padding: 4px 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: white;
}
.task-table .tbl-actions .btn-info { background: var(--blue); }
.task-table .tbl-actions .btn-start { background: var(--green); }
.task-table .tbl-actions .btn-conclude { background: var(--yellow-dark); color: #333; }
.task-table .tbl-actions .btn-cancel-tbl { background: var(--red); }
.tbl-prioridade-alta { color: var(--orange); font-weight: 600; }
.tbl-prioridade-urgente { color: var(--red); font-weight: 700; }

@media (max-width: 768px) {
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-period { overflow-x: auto; }
    .task-table { font-size: 10px; }
    .task-table thead th, .task-table tbody td { padding: 4px 3px; }
}

body.dark-mode .filter-bar { background: #1e293b; border-color: #334155; }
body.dark-mode .filter-btn { background: #0f172a; border-color: #334155; color: #94a3b8; }
body.dark-mode .filter-btn.active { background: var(--blue); color: white; }
body.dark-mode .view-btn { color: #94a3b8; }
body.dark-mode .filter-view { background: #334155; }
body.dark-mode .task-table thead th { background: #0f172a; }
body.dark-mode .task-table tbody td { border-color: #334155; }
body.dark-mode .task-table tbody tr:nth-child(even) { background: #1e293b; }
body.dark-mode .task-table tbody tr:hover { background: rgba(18,76,140,0.2); }

/* ============ TASK LIST ============ */
.task-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 100px;
    -webkit-overflow-scrolling: touch;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
}

/* ============ TASK CARD ============ */
.task-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--r);
    padding: 18px 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue-muted);
}

.task-card .priority-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--r) var(--r) 0 0;
}

.priority-bar.urgente { background: linear-gradient(90deg, var(--red), #ef4444); }
.priority-bar.alta { background: linear-gradient(90deg, var(--yellow), #fbbf24); }
.priority-bar.normal { background: linear-gradient(90deg, var(--blue), var(--blue-light)); }

.task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.task-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
}

.task-card-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-pendente { background: var(--orange-pale); color: var(--orange); }
.badge-em-andamento { background: var(--blue-pale); color: var(--blue); }
.badge-concluida-legalmail { background: #f3f0ff; color: #7c3aed; }
.badge-concluida-pasta { background: var(--green-pale); color: var(--green); }
.badge-protocolar { background: var(--yellow-pale); color: var(--yellow-dark); border: 1px solid rgba(253,185,19,0.3); }
.badge-protocolada { background: var(--green-pale); color: var(--green); }
.badge-revisao { background: var(--red-pale); color: var(--red); border: 1px solid rgba(220,38,38,0.2); }
.badge-cancelada { background: var(--gray-100); color: var(--gray-400); text-decoration: line-through; }

.task-card-cliente {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

.task-card-cliente i {
    color: var(--blue-muted);
    font-size: 12px;
}

.task-card-processo {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.meta-tipo { background: var(--blue-pale); color: var(--blue); }
.meta-destino { background: var(--yellow-pale); color: var(--yellow-dark); }
.meta-prazo { background: var(--gray-100); color: var(--gray-500); }
.meta-prazo.vencido { background: var(--red-pale); color: var(--red); font-weight: 700; }

.task-card-obs {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--rs);
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.5;
    border-left: 3px solid var(--blue-muted);
}

.task-card-problema {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--red-pale);
    border-radius: var(--rs);
    font-size: 12px;
    color: var(--red);
    line-height: 1.5;
    border-left: 3px solid var(--red);
    font-weight: 600;
}

/* Timesheet */
.task-card-timesheet {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--rs);
    border: 1px solid var(--gray-100);
    font-size: 11px;
    color: var(--gray-500);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ts-row {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.ts-row i {
    width: 14px;
    text-align: center;
    color: var(--gray-400);
    font-size: 10px;
}

.ts-badge {
    background: var(--blue-pale);
    color: var(--blue);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    margin-left: auto;
}

.ts-current {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--gray-200);
    color: var(--blue);
    font-size: 12px;
}

.ts-current i { color: var(--blue); }

body.dark-mode .task-card-timesheet { background: #0f172a; border-color: #334155; }
body.dark-mode .ts-badge { background: rgba(18,76,140,0.2); }

/* Autocomplete */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1.5px solid var(--blue);
    border-radius: 0 0 var(--rs) var(--rs);
    box-shadow: var(--shadow-md);
    z-index: 600;
    max-height: 180px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.autocomplete-item:hover {
    background: var(--blue-pale);
    color: var(--blue);
}

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

body.dark-mode .autocomplete-list { background: #1e293b; border-color: var(--blue); }
body.dark-mode .autocomplete-item { color: #e2e8f0; border-color: #334155; }
body.dark-mode .autocomplete-item:hover { background: rgba(18,76,140,0.2); }

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.task-card-time {
    font-size: 11px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-card-actions {
    display: flex;
    gap: 6px;
}

.btn-action {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-action:active { transform: scale(0.95); }

.btn-action.start { background: #2563eb; color: #fff; }
.btn-action.start:hover { background: #1d4ed8; }
.btn-action.conclude { background: #16a34a; color: #fff; }
.btn-action.conclude:hover { background: #15803d; }
.btn-action.protocol { background: #d97706; color: #fff; }
.btn-action.protocol:hover { background: #b45309; }
.btn-action.edit { background: #3b82f6; color: #fff; }
.btn-action.edit:hover { background: #2563eb; }
.btn-action.details { background: #e2e8f0; color: #475569; }
.btn-action.details:hover { background: #cbd5e1; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 44px;
    margin-bottom: 16px;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 16px;
    color: var(--gray-500);
    margin-bottom: 6px;
    font-weight: 700;
}

.empty-state p {
    font-size: 13px;
    color: var(--gray-400);
}

/* ============ FAB ============ */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 16px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(18,76,140,0.35);
    cursor: pointer;
    z-index: 90;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(18,76,140,0.4); background: var(--blue-light); }
.fab:active { transform: scale(0.92); }

/* ============ MODALS ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.4);
    z-index: 500;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.modal-overlay.visible { display: flex; }

.modal-sheet {
    background: var(--white);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: sheetUp 0.35s cubic-bezier(0.22,1,0.36,1);
}

.modal-large { max-width: 680px; }

@keyframes sheetUp {
    from { transform: translateY(100%); opacity: 0.5; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 12px auto 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h2 i { color: var(--blue); font-size: 16px; }

.btn-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    color: var(--gray-400);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-close:hover { background: var(--gray-200); color: var(--gray-600); }

.modal-body { padding: 10px 24px 28px; }

.modal-footer {
    padding: 14px 24px 24px;
    border-top: 1px solid var(--gray-100);
}

/* ============ PRINT FILTERS ============ */
.print-filters { display:flex; flex-wrap:wrap; gap:8px; }
.print-filter-item { display:flex; align-items:center; gap:6px; padding:8px 12px; background:var(--gray-50); border-radius:8px; cursor:pointer; border:2px solid transparent; transition:all .2s; }
.print-filter-item:hover { border-color:var(--blue); }
.print-filter-item input[type=checkbox] { width:16px; height:16px; accent-color:var(--blue); cursor:pointer; }
.print-filter-item .status-badge { font-size:12px; }

/* ============ AUDIT TABLE ============ */
.audit-table { width:100%; border-collapse:collapse; font-size:11px; }
.audit-table thead th { background:var(--blue); color:#fff; padding:6px 8px; font-size:10px; text-align:left; white-space:nowrap; position:sticky; top:0; z-index:2; }
.audit-table tbody td { padding:5px 8px; border-bottom:1px solid var(--gray-100); vertical-align:top; }
.audit-table tbody tr:nth-child(even) { background:var(--gray-50); }
.audit-table tbody tr:hover { background:var(--blue-pale); }
body.dark-mode .audit-table thead th { background:#0f172a; }
body.dark-mode .audit-table tbody td { border-color:#334155; }
body.dark-mode .audit-table tbody tr:nth-child(even) { background:#1e293b; }

/* ============ FORM FIELDS ============ */
.field { margin-bottom: 18px; }
.field-row { display: flex; gap: 12px; margin-bottom: 18px; }
.field-row .field { flex: 1; margin-bottom: 0; }

.field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--rs);
    color: var(--gray-800);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(18,76,140,0.08);
}

.field input::placeholder, .field textarea::placeholder { color: var(--gray-300); }

.field textarea { resize: vertical; }

/* ============ DESTINATION OPTIONS ============ */
.destination-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dest-option { cursor: pointer; }
.dest-option input { display: none; }

.dest-card {
    padding: 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r);
    text-align: center;
    transition: all 0.2s;
    background: var(--white);
}

.dest-card i {
    font-size: 22px;
    color: var(--gray-300);
    margin-bottom: 6px;
    display: block;
    transition: all 0.2s;
}

.dest-card span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
}

.dest-card small {
    display: block;
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 3px;
}

.dest-option input:checked + .dest-card {
    border-color: var(--blue);
    background: var(--blue-pale);
    box-shadow: 0 0 0 3px rgba(18,76,140,0.08);
}

.dest-option input:checked + .dest-card i { color: var(--blue); }

/* ============ BUTTONS ============ */
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid var(--gray-100);
    margin-top: 12px;
}

.actions-right { display: flex; gap: 8px; }

.btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: var(--rs);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover { background: var(--blue-light); box-shadow: 0 2px 10px rgba(18,76,140,0.25); }
.btn-primary:active { transform: scale(0.97); }

.btn-success {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: var(--rs);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover { background: #15803d; }

.btn-danger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    background: var(--white);
    color: var(--red);
    border: 1.5px solid var(--red);
    border-radius: var(--rs);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-cancel {
    padding: 11px 18px;
    background: var(--gray-100);
    color: var(--gray-500);
    border: none;
    border-radius: var(--rs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cancel:hover { background: var(--gray-200); }

.btn-large {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
    margin-bottom: 10px;
}

/* ============ PROTOCOL / CONCLUDE INFO ============ */
.conclude-info, .protocol-info {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--r);
    padding: 16px 18px;
    margin-bottom: 18px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
}

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

.info-row .label {
    color: var(--gray-400);
    font-weight: 600;
}

.info-row .value {
    color: var(--gray-800);
    font-weight: 600;
    text-align: right;
}

.protocol-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============ REPORT ============ */
.report-section {
    margin-bottom: 22px;
}

.report-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--blue-pale);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-item {
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--rs);
    margin-bottom: 6px;
    font-size: 13px;
    border-left: 3px solid var(--blue-muted);
}

.report-item.in-legalmail {
    border-left-color: var(--yellow);
    background: var(--yellow-pale);
}

.report-item.in-pasta {
    border-left-color: var(--green);
    background: var(--green-pale);
}

.report-item.protocolado { border-left-color: var(--green); }

.report-item.problema {
    border-left-color: var(--red);
    background: var(--red-pale);
}

.report-item strong { color: var(--gray-800); }

.report-item .report-detail {
    color: var(--gray-500);
    font-size: 11px;
    margin-top: 4px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.report-stat {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--r);
    padding: 16px;
    text-align: center;
}

.report-stat .number {
    font-size: 28px;
    font-weight: 800;
    color: var(--blue);
}

.report-stat .label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 600;
    margin-top: 2px;
}

.report-stat.yellow .number { color: var(--yellow-dark); }
.report-stat.green .number { color: var(--green); }
.report-stat.red .number { color: var(--red); }

/* ============ NOTIFICATION ITEMS ============ */
.notif-item {
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: var(--rs);
    margin-bottom: 8px;
    font-size: 13px;
    border-left: 3px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.15s;
}

.notif-item:hover { background: var(--gray-100); }

.notif-item.unread {
    background: var(--blue-pale);
    border-left-color: var(--yellow);
}

.notif-item .notif-time { font-size: 10px; color: var(--gray-400); margin-top: 4px; }
.notif-item .notif-text { color: var(--gray-700); line-height: 1.4; }

.notif-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
    font-size: 14px;
}

/* ============ DETAIL MODAL ============ */
.detail-section { margin-bottom: 14px; }

.detail-section h4 {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    color: var(--gray-800);
    line-height: 1.5;
}

.detail-timeline {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-100);
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blue);
    margin-top: 5px;
    flex-shrink: 0;
}

.timeline-dot.yellow { background: var(--yellow); }
.timeline-dot.green { background: var(--green); }
.timeline-dot.red { background: var(--red); }

.timeline-content { flex: 1; }
.timeline-text { font-size: 13px; color: var(--gray-700); }
.timeline-time { font-size: 10px; color: var(--gray-400); margin-top: 2px; }

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast i { font-size: 16px; flex-shrink: 0; }
.toast.success { border-left: 4px solid var(--green); }
.toast.success i { color: var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.error i { color: var(--red); }
.toast.warning { border-left: 4px solid var(--yellow); }
.toast.warning i { color: var(--yellow); }
.toast.info { border-left: 4px solid var(--blue); }
.toast.info i { color: var(--blue); }

@keyframes toastIn { from{opacity:0;transform:translateX(30px)} to{opacity:1;transform:translateX(0)} }
.toast-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to{opacity:0;transform:translateX(30px)} }

/* ============ DESKTOP ============ */
@media (min-width: 768px) {
    .modal-sheet {
        border-radius: 24px;
        margin-bottom: 24px;
    }
    .modal-overlay { align-items: center; }
    @keyframes sheetUp { from{opacity:0;transform:translateY(20px) scale(0.98)} to{opacity:1;transform:translateY(0) scale(1)} }
}

@media (min-width: 1024px) {
    .task-list { max-width: 800px; }
    .login-container { max-width: 440px; }
    .fab { bottom: 32px; right: 40px; }
}

/* ============ DARK MODE ============ */
body.dark-mode {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --white: #1e293b;
    --gray-50: #1e293b;
    --gray-100: #263348;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #94a3b8;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --blue-pale: rgba(18,76,140,0.2);
    --yellow-pale: rgba(253,185,19,0.1);
    --red-pale: rgba(220,38,38,0.15);
    --green-pale: rgba(22,163,74,0.15);
    --orange-pale: rgba(234,88,12,0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);
    background: var(--bg);
    color: var(--gray-800);
}

body.dark-mode .app-header { background: #1e293b; border-color: #334155; }
body.dark-mode .status-tabs { background: #1e293b; }
body.dark-mode .summary-bar { background: #0f172a; }
body.dark-mode .task-card { background: #1e293b; border-color: #334155; }
body.dark-mode .meta-tipo { background: rgba(18,76,140,0.3) !important; color: #5bb8ff !important; }
body.dark-mode .meta-destino { background: rgba(200,150,0,0.2) !important; color: #fbbf24 !important; }
body.dark-mode .meta-vara { background: rgba(59,130,246,0.2) !important; color: #93c5fd !important; }
body.dark-mode .meta-responsavel { background: rgba(59,130,246,0.2) !important; color: #bfdbfe !important; }
body.dark-mode .meta-prazo { background: rgba(100,116,139,0.3) !important; color: #94a3b8 !important; }
body.dark-mode .meta-prazo.vencido { background: rgba(220,38,38,0.2) !important; color: #f87171 !important; }
body.dark-mode .meta-tag { color: #e2e8f0 !important; }
body.dark-mode .modal-sheet { background: #1e293b; }
body.dark-mode .modal-handle { background: #475569; }
body.dark-mode .field input,
body.dark-mode .field select,
body.dark-mode .field textarea { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark-mode .dest-card { background: #0f172a; border-color: #334155; }
body.dark-mode .dest-option input:checked + .dest-card { background: rgba(18,76,140,0.2); }
body.dark-mode .btn-cancel { background: #334155; color: #94a3b8; }
body.dark-mode .toast { background: #1e293b; border-color: #334155; }
body.dark-mode .conclude-info,
body.dark-mode .protocol-info { background: #0f172a; border-color: #334155; }
body.dark-mode .info-row { border-color: #334155; }
body.dark-mode .notif-item { background: #0f172a; }
body.dark-mode .notif-item.unread { background: rgba(18,76,140,0.15); }
body.dark-mode #screenLogin { background: #0f172a; }
body.dark-mode #screenLogin::before { background: linear-gradient(135deg, rgba(18,76,140,0.12), rgba(253,185,19,0.08)); }
body.dark-mode #screenLogin::after { background: linear-gradient(135deg, rgba(253,185,19,0.06), rgba(18,76,140,0.04)); }
body.dark-mode .role-card { background: #1e293b; border-color: #334155; color: #f1f5f9; }
body.dark-mode .login-logo h1 { color: var(--blue-light); }
body.dark-mode .login-error { background: rgba(220,38,38,0.15); }

/* ============ RESPONSAVEL SELECTOR ============ */
.responsavel-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.filter-mine { border-left: 2px solid var(--gray-200) !important; margin-left: 4px !important; padding-left: 10px !important; }
.filter-mine.active { background: var(--blue) !important; color: #fff !important; }
.filter-mine i { margin-right: 2px; }

.login-domain-notice { text-align:center; margin-top:16px; padding:10px 14px; background:rgba(18,76,140,0.08); border-radius:8px; font-size:12px; color:var(--gray-500); }
.login-domain-notice strong { color:var(--blue); }
.login-domain-notice i { color:var(--blue); margin-right:4px; }
body.dark-mode .login-domain-notice { background:rgba(59,130,246,0.1); }
body.dark-mode .login-domain-notice strong { color:#93c5fd; }

.responsavel-options.resp-3col {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.resp-option {
    cursor: pointer;
}

.resp-option input[type="radio"] {
    display: none;
}

.resp-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--rs);
    transition: all 0.2s;
    background: var(--white);
}
.resp-card.compact {
    padding: 8px 10px;
    gap: 6px;
    justify-content: center;
}

.resp-option input[type="radio"]:checked + .resp-card {
    border-color: var(--blue);
    background: var(--blue-pale);
    box-shadow: 0 0 0 1px var(--blue);
}

.resp-card i {
    font-size: 20px;
    color: var(--gray-400);
    width: 28px;
    text-align: center;
}

.resp-option input[type="radio"]:checked + .resp-card i {
    color: var(--blue);
}

.resp-info {
    display: flex;
    flex-direction: column;
}

.resp-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.resp-info small {
    font-size: 11px;
    color: var(--gray-400);
}

.resp-option input[type="radio"]:checked + .resp-card .resp-name {
    color: var(--blue);
}

.meta-responsavel {
    background: var(--blue-pale) !important;
    color: var(--blue) !important;
    font-weight: 500;
}

.meta-vara {
    background: var(--orange-pale) !important;
    color: var(--orange) !important;
    font-weight: 500;
}

/* ============ DISTRIBUTION VIEW ============ */
.dist-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.dist-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--rs);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.dist-card.marla {
    border-left: 4px solid var(--blue);
}

.dist-card.matheus {
    border-left: 4px solid var(--yellow);
}

.dist-card .dist-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
}

.dist-card .dist-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 4px;
}

.dist-card .dist-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.dist-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
}

.dist-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.dist-tab:hover {
    color: var(--blue);
}

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

.dist-content {
    max-height: 500px;
    overflow-y: auto;
}

#modalDistribuicao .modal-sheet {
    max-width: 800px;
    width: 95%;
}

.dist-section {
    margin-bottom: 20px;
}

.dist-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--rs);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
}

.dist-section-header .dist-section-count {
    background: var(--blue);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.dist-section-header.matheus-header {
    border-left: 3px solid var(--yellow);
}

.dist-section-header.marla-header {
    border-left: 3px solid var(--blue);
}

.dist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

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

.dist-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dist-item-title {
    font-weight: 600;
    color: var(--gray-800);
}

.dist-item-detail {
    font-size: 11px;
    color: var(--gray-500);
}

.dist-item-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.dist-item-status.s-pendente { background: #fff7ed; color: #ea580c; }
.dist-item-status.s-em_andamento { background: #eff6ff; color: #2563eb; }
.dist-item-status.s-concluida_legalmail { background: #f5f3ff; color: #7c3aed; }
.dist-item-status.s-concluida_pasta { background: #ecfdf5; color: #16a34a; }
.dist-item-status.s-protocolada { background: #ecfdf5; color: #16a34a; }
.dist-item-status.s-revisao { background: #fef2f2; color: #dc2626; }

/* ============ DISTRIBUTION FILTER ============ */
.dist-filter {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
}

.dist-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dist-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dist-filter-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
}

.dist-filter-field input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-700);
    background: var(--white);
}

.dist-filter-field input[type="date"]:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(18,76,140,0.1);
}

.dist-filter-buttons {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.dist-quick-btn {
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--white);
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.dist-quick-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.dist-quick-btn.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* Print styles for distribution */
@media print {
    body { background: #fff !important; }
    .modal-overlay { position: static !important; background: none !important; display: block !important; }
    .modal-overlay:not(#modalDistribuicao) { display: none !important; }
    .modal-sheet { box-shadow: none !important; max-width: 100% !important; max-height: none !important; overflow: visible !important; border-radius: 0 !important; padding: 0 !important; }
    .modal-handle, .modal-footer, .btn-close, .dist-tabs, .dist-filter, .app-header, .summary-bar, .filter-bar, .fab, #screenLogin, .toast-container, #screenApp { display: none !important; }
    #modalDistribuicao { display: block !important; }
    .dist-content { max-height: none !important; overflow: visible !important; }
    .dist-summary { display: flex !important; gap: 20px; margin-bottom: 16px; break-inside: avoid; }
    .dist-card { border: 1px solid #ccc !important; padding: 10px !important; }
    .dist-section { break-inside: avoid; margin-bottom: 12px; }
    .dist-section-header { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .dist-item { padding: 6px 14px; border-bottom: 1px solid #e0e0e0; }
    .dist-item-title { font-size: 12px; }
    .dist-item-detail { font-size: 10px; }
    .dist-item-status { font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .modal-header h2 { font-size: 16px; }
    .modal-header h2::after { content: " - GP Advogados"; font-weight: 400; font-size: 12px; color: #666; }
}

/* ============ SEARCHABLE SELECT ============ */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    padding: 0 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.searchable-input-wrap:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(18,76,140,0.1);
}

.searchable-icon {
    color: var(--gray-400);
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.searchable-input-wrap input[type="text"] {
    border: none;
    outline: none;
    background: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    padding: 10px 0;
    width: 100%;
    min-width: 320px;
}

.searchable-input-wrap input[type="text"]::placeholder {
    color: var(--gray-400);
}

.searchable-arrow {
    color: var(--gray-400);
    font-size: 12px;
    margin-left: 8px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.searchable-select.open .searchable-arrow {
    transform: rotate(180deg);
}

.searchable-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.searchable-select.open .searchable-dropdown {
    display: block;
}

.searchable-option {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--gray-50);
}

.searchable-option:last-child {
    border-bottom: none;
}

.searchable-option:hover {
    background: var(--blue-pale);
    color: var(--blue);
}

.searchable-option.selected {
    background: var(--blue-pale);
    color: var(--blue);
    font-weight: 600;
}

.searchable-option .search-highlight {
    background: var(--yellow-pale);
    color: var(--gray-800);
    font-weight: 700;
    border-radius: 2px;
}

.searchable-no-results {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--gray-400);
    text-align: center;
    font-style: italic;
}

/* ============ SORT SELECT ============ */
.filter-sort {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-icon {
    color: var(--gray-400);
    font-size: 13px;
    cursor: help;
    position: relative;
}

.sort-icon:hover::after {
    content: "Ordenar tarefas por";
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

.sort-icon:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-800);
    z-index: 100;
    pointer-events: none;
}

.filter-sort select {
    padding: 5px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: var(--gray-600);
    background: var(--white);
    cursor: pointer;
}

.filter-sort select:focus {
    outline: none;
    border-color: var(--blue);
}

/* ============ AUTOCOMPLETE ============ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1.5px solid var(--blue);
    border-top: none;
    border-radius: 0 0 var(--rs) var(--rs);
    max-height: 200px;
    overflow-y: auto;
    z-index: 600;
    box-shadow: var(--shadow-md);
}

.autocomplete-dropdown.visible {
    display: block;
}

.autocomplete-item {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--blue-pale);
    color: var(--blue);
}

.autocomplete-item .ac-highlight {
    font-weight: 700;
    color: var(--blue);
}

.autocomplete-item .ac-sub {
    display: block;
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

.autocomplete-wrapper input.ac-filled {
    border-color: var(--green);
    background: var(--green-pale);
}

/* ============ IMPORT PROCESSOS MODAL ============ */
.import-info {
    margin-bottom: 18px;
}

.import-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.import-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--gray-600);
}

.import-stat i {
    color: var(--blue);
    font-size: 16px;
}

.import-stat .stat-number {
    font-size: 20px;
    font-weight: 800;
    color: var(--blue);
}

.import-stat .stat-label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 600;
}

.import-section {
    margin-bottom: 18px;
}

.import-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-section h3 i {
    color: var(--green);
}

.import-help {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 14px;
    line-height: 1.5;
}

.import-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.import-mode-option {
    cursor: pointer;
}

.import-mode-option input {
    display: none;
}

.import-mode-card {
    padding: 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r);
    text-align: center;
    transition: all 0.2s;
    background: var(--white);
}

.import-mode-card i {
    font-size: 20px;
    color: var(--gray-300);
    margin-bottom: 6px;
    display: block;
    transition: all 0.2s;
}

.import-mode-card span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
}

.import-mode-card small {
    display: block;
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 3px;
}

.import-mode-option input:checked + .import-mode-card {
    border-color: var(--blue);
    background: var(--blue-pale);
    box-shadow: 0 0 0 3px rgba(18,76,140,0.08);
}

.import-mode-option input:checked + .import-mode-card i {
    color: var(--blue);
}

.import-log {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-100);
}

.import-log h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-log h3 i {
    color: var(--blue);
}

.import-log-result {
    padding: 12px 14px;
    background: var(--green-pale);
    border: 1px solid #bbf7d0;
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--green);
    font-weight: 600;
}

.import-log-result.error {
    background: var(--red-pale);
    border-color: var(--red-light);
    color: var(--red);
}

/* Admin button in header */
.btn-admin-processos {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r);
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.btn-admin-processos:hover {
    border-color: var(--blue);
    background: var(--blue-pale);
    color: var(--blue);
}

.btn-admin-processos i {
    font-size: 16px;
    color: var(--blue);
}
