/* Modern Dashboard Variables - CAPREM THEME */
:root {
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --bg-card-hover: #2a2a2a;
    --border-glass: #333333;
    --text-primary: #e0e0e0;
    --text-muted: #9e9e9e;

    --accent-blue: #1b7a41;
    /* Mapeando o primary para o verde do Caprem */
    --accent-blue-hover: #239b53;
    --accent-blue-light: rgba(27, 122, 65, 0.15);

    --success: #2ecc71;
    --success-light: rgba(46, 204, 113, 0.15);

    --warning: #f5b041;
    --warning-light: rgba(245, 176, 65, 0.15);

    --danger: #e74c3c;
    --danger-light: rgba(231, 76, 60, 0.15);

    --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 8px;
    --shadow-main: none;
    /* Caprem no foca muito em shadow, mas sim em bordas */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    margin: 0;
}

/* Base Styles */
.wd-equip-dashboard * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wd-equip-dashboard {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Layout */
.wd-equip-dashboard .dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Main Content */
.wd-equip-dashboard .main-content {
    flex: 1;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header */
.wd-equip-dashboard .top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 20px 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-glass);
    border-top: 4px solid var(--accent-blue);
}

.wd-equip-dashboard .header-titles h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wd-equip-dashboard .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.wd-equip-dashboard .header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Buttons (CAPREM style) */
.wd-equip-dashboard .btn,
.swal2-popup .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font-family);
}

.wd-equip-dashboard .btn-primary,
.wd-equip-dashboard #btn-novo-termo,
.swal2-popup .btn-primary,
.swal2-popup .btn-success {
    background-color: var(--accent-blue);
    color: #fff;
}

.wd-equip-dashboard .btn-primary:hover,
.wd-equip-dashboard #btn-novo-termo:hover,
.swal2-popup .btn-primary:hover,
.swal2-popup .btn-success:hover {
    background-color: var(--accent-blue-hover);
}

.wd-equip-dashboard .btn-secondary,
.swal2-popup .btn-secondary {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.wd-equip-dashboard .btn-secondary:hover,
.swal2-popup .btn-secondary:hover {
    background-color: var(--border-glass);
}

.wd-equip-dashboard .btn-danger,
.swal2-popup .btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.wd-equip-dashboard .btn-danger:hover,
.swal2-popup .btn-danger:hover {
    background-color: #c0392b;
}

.wd-equip-dashboard .btn-icon {
    background: transparent;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
}

.wd-equip-dashboard .btn-icon:hover {
    color: var(--text-primary);
    background-color: var(--bg-card-hover);
}

/* Specific Action Buttons in Table */
.wd-equip-dashboard .btn-ver-edita-detalhes,
.wd-equip-dashboard .btn-reenvia-termo,
.wd-equip-dashboard .btn-ver-termo,
.wd-equip-dashboard .btn-delete-termo {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    margin-right: 4px;
    background: transparent;
    transition: 0.2s;
}

.wd-equip-dashboard .btn-ver-edita-detalhes {
    color: #3498db;
    border: 1px solid #3498db;
}

.wd-equip-dashboard .btn-ver-edita-detalhes:hover {
    background: #3498db;
    color: #fff;
}

.wd-equip-dashboard .btn-reenvia-termo {
    color: var(--warning);
    border: 1px solid var(--warning);
}

.wd-equip-dashboard .btn-reenvia-termo:hover {
    background: var(--warning);
    color: #fff;
}

.wd-equip-dashboard .btn-ver-termo {
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.wd-equip-dashboard .btn-ver-termo:hover {
    background: var(--text-primary);
    color: var(--bg-main);
}

.wd-equip-dashboard .btn-delete-termo {
    color: var(--danger);
    border: 1px solid var(--danger);
}

.wd-equip-dashboard .btn-delete-termo:hover {
    background: var(--danger);
    color: #fff;
}


/* Cards (CAPREM style) */
.wd-equip-dashboard .card,
.wd-equip-dashboard .glass-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 24px;
    border-top: 4px solid var(--accent-blue);
    box-shadow: none;
    backdrop-filter: none;
}

.wd-equip-dashboard .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wd-equip-dashboard .card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Middle Row Layout */
.wd-equip-dashboard .middle-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

/* Summary Cards specific adjustments */
.wd-equip-dashboard .summary-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: none;
    padding: 0;
    background: transparent;
    border: none;
}

.wd-equip-dashboard .summary-cards>.card-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 16px 24px;
    margin-bottom: 0;
}

.wd-equip-dashboard .summary-cards .card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
    /* Removed top highlight */
    border-left: 4px solid var(--accent-blue);
}

.wd-equip-dashboard .summary-cards .card.semAssinatura {
    border-left-color: var(--danger);
}

.wd-equip-dashboard .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.wd-equip-dashboard .card-icon.blue {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.wd-equip-dashboard .card-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.wd-equip-dashboard .card-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}

.wd-equip-dashboard .card-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.wd-equip-dashboard .card-info .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Forms & Filters */
.wd-equip-dashboard .form-group {
    margin-bottom: 16px;
}

.wd-equip-dashboard .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.wd-equip-dashboard .form-control,
.wd-equip-dashboard input[type="text"],
.wd-equip-dashboard select,
.wd-equip-dashboard textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    transition: 0.2s;
}

.wd-equip-dashboard .form-control:focus,
.wd-equip-dashboard input[type="text"]:focus,
.wd-equip-dashboard select:focus,
.wd-equip-dashboard textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.wd-equip-dashboard select.form-control option {
    background: var(--bg-main);
    color: var(--text-primary);
}

.wd-equip-dashboard input[type="checkbox"] {
    accent-color: var(--accent-blue);
    width: 20px;
    height: 20px;
}

/* Table */
.wd-equip-dashboard .table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    margin-top: 10px;
}

.wd-equip-dashboard .data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: var(--bg-card);
}

.wd-equip-dashboard .data-table th {
    padding: 12px 16px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    background-color: var(--bg-card-hover);
    border-bottom: 1px solid var(--border-glass);
}

.wd-equip-dashboard .data-table td {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-muted);
}

.wd-equip-dashboard .data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.wd-equip-dashboard .bdg {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
}

.wd-equip-dashboard .badge-assigned {
    background-color: var(--success-light);
    color: var(--success);
}

.wd-equip-dashboard .badge-pending {
    background-color: var(--warning-light);
    color: var(--warning);
}

.wd-equip-dashboard .badge-unassigned {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Pagination */
.wd-equip-dashboard .pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
}

.wd-equip-dashboard .pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.wd-equip-dashboard .pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wd-equip-dashboard .btn-page {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid var(--border-glass);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.2s;
}

.wd-equip-dashboard .btn-page:hover:not(:disabled) {
    background: var(--bg-card-hover);
}

.wd-equip-dashboard .btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wd-equip-dashboard .btn-page.active {
    background: var(--accent-blue);
    color: #FFF;
    border-color: var(--accent-blue);
}

/* Modal */
.wd-equip-dashboard .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.wd-equip-dashboard .modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.wd-equip-dashboard .modal {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 24px;
    transform: translateY(20px);
    transition: var(--transition);
    border-top: 4px solid var(--accent-blue);
}

.wd-equip-dashboard .modal-overlay.active .modal {
    transform: translateY(0);
}

.wd-equip-dashboard .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.wd-equip-dashboard .modal-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.wd-equip-dashboard .btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.wd-equip-dashboard .btn-close:hover {
    color: var(--text-primary);
}

.wd-equip-dashboard .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

.wd-equip-dashboard .form-row {
    display: flex;
    gap: 16px;
}

.wd-equip-dashboard .form-group.half {
    flex: 1;
}

label[for="fileNew"],
label[for="fileDevolve"] {
    border: 1px dashed var(--border-glass);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    min-height: 42px;
    text-align: center;
}

label[for="fileNew"]:hover,
label[for="fileDevolve"]:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
    background-color: var(--bg-card-hover);
    box-shadow: 0 4px 12px rgba(27, 122, 65, 0.1);
}

.hide {
    display: none !important;
}



/* Select2 Dark Theme Overrides */
/* Altera a cor do 'X' em repouso */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #ff0000; /* Substitua pela cor que você desejar (ex: #ffffff para branco, #gold, etc) */
    opacity: 0.7;    /* Ajusta a opacidade padrão se achar necessário */
}

/* Altera a cor do 'X' quando o usuário passa o mouse por cima (Hover) */
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #ff5555; /* Cor de destaque ao passar o mouse */
    opacity: 1;
}

.select2-container--default .select2-selection--single {
    background-color: var(--bg-main) !important;
    border: 1px solid var(--border-glass) !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    padding-left: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
}

.select2-dropdown {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-glass) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-glass) !important;
}

.select2-container--default .select2-results__option {
    color: var(--text-primary) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--accent-blue) !important;
}

@media(max-width: 1200px) {
    .wd-equip-dashboard .middle-row {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 900px) {
    .wd-equip-dashboard .main-content {
        padding: 20px;
    }

    .wd-equip-dashboard .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .wd-equip-dashboard .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ========================================================= */
/* SWEETALERT2 OVERRIDES (CAPREM DARK THEME)                 */
/* ========================================================= */

.swal2-popup {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-glass) !important;
    border-top: 4px solid var(--accent-blue) !important;
    border-radius: var(--border-radius) !important;
    font-family: var(--font-family) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
    text-align: left !important;
    padding: 10px !important;
    font-size: 1.25rem !important;
    margin-bottom: 20px !important;
}

.swal2-html-container {
    color: var(--text-primary) !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow-x: hidden !important;
}

.swal2-html-container * {
    box-sizing: border-box !important;
}

.swal2-html-container .form-control {
    width: 100% !important;
    max-width: 100% !important;
}

/* Modal form elements specific to Swal (labels and inputs) */
.swal2-html-container label {
    color: var(--text-primary) !important;
}

/* Estilo específico para Toasts (Notificações) */
.swal2-toast {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-glass) !important;
    border-left: 4px solid var(--accent-blue) !important;
    border-top: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.swal2-toast .swal2-title {
    color: var(--text-primary) !important;
    margin: 0 !important;
}

.swal2-toast .swal2-success-circular-line-left,
.swal2-toast .swal2-success-circular-line-right,
.swal2-toast .swal2-success-fix {
    background-color: transparent !important;
    /* Corrige glitch de fundo do checkmark */
}

/* ========================================================= */
/* ESTILOS DE FORMULÁRIO (INPUTS, SELECTS, TEXTAREA)         */
/* ========================================================= */

.form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    box-shadow: none !important;
}

.form-control:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 2px var(--accent-blue-light) !important;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bg-card) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Fix para selects nativos terem a setinha padrão mas combinando com tema */
select.form-control {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%239e9e9e%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Select2 Form Control Overrides para ficar idêntico ao input normal */
.select2-container--default .select2-selection--single {
    background-color: var(--bg-main) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--border-radius) !important;
    height: 42px !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    line-height: 40px !important;
    padding-left: 12px !important;
}

.select2-container--open .select2-selection--single {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 2px var(--accent-blue-light) !important;
}