@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* ==========================================================================
   1. VARIÁVEIS E TEMAS
   ========================================================================== */
:root {
    /* PADRÃO (AZUL) */
    --bg-body: #f2f7fc;
    --bg-header: #0077b6;
    --bg-footer: #0077b6;
    --text-color: #2c3e50;
    --text-muted: #555555;
    --bg-card: #ffffff;
    --border-color: #d1d5db;
    
    --btn-primary-bg: #2563eb;
    --btn-primary-hover: #1d4ed8;
    --btn-primary-text: #ffffff;

    --btn-secondary-bg: #6c757d;
    --btn-secondary-hover: #5a6268;

    --link-color: #2563eb;
    
    --input-bg: #ffffff;
    --input-text: #000000;
    
    --table-header-bg: #3b82f6;
    --table-header-text: #ffffff;
    --table-row-hover: #e3f2fd;
    --table-row-even: #f9fafb;
    
    --timeline-line: #dee2e6;
    --timeline-bg: #f1f3f5;
    
    --nav-icon-color: #0077b6;
    --nav-hover-bg: #e0f2fe;
}

/* TEMA OUTUBRO ROSA */
[data-theme="pink"] {
    --bg-header: #d63384;
    --bg-footer: #d63384;
    --btn-primary-bg: #e83e8c;
    --btn-primary-hover: #c2175b;
    --link-color: #e83e8c;
    --nav-icon-color: #d63384;
    --nav-hover-bg: #fce4ec;
    --table-header-bg: #e83e8c;
    --table-row-hover: #f8d7da;
}

/* TEMA VERDE */
[data-theme="green"] {
    --bg-header: #198754;
    --bg-footer: #198754;
    --btn-primary-bg: #198754;
    --btn-primary-hover: #146c43;
    --link-color: #198754;
    --nav-icon-color: #198754;
    --nav-hover-bg: #d1e7dd;
    --table-header-bg: #198754;
    --table-row-hover: #d1e7dd;
}

/* TEMA ESCURO (DARK MODE) */
[data-theme="dark"] {
    --bg-body: #121212;
    --bg-header: #1f1f1f;
    --bg-footer: #1f1f1f;
    --text-color: #e0e0e0;
    --text-muted: #adb5bd;
    --bg-card: #1e1e1e;
    --border-color: #333333;
    
    --btn-primary-bg: #3b82f6;
    --btn-primary-hover: #2563eb;
    
    --btn-secondary-bg: #4a4a4a;
    --btn-secondary-hover: #606060;

    --link-color: #60a5fa;

    --input-bg: #2d2d2d;
    --input-text: #ffffff;

    --table-header-bg: #2d2d2d;
    --table-header-text: #e0e0e0;
    --table-row-hover: #333333;
    --table-row-even: #181818;
    
    --timeline-line: #444;
    --timeline-bg: #2d2d2d;
    
    --nav-icon-color: #60a5fa;
    --nav-hover-bg: #333;
}

/* TEMA CLARO (PASTEL) */
[data-theme="pastel"] {
    --bg-body: #fdfbf7;
    --bg-header: #8d99ae;
    --bg-footer: #8d99ae;
    --text-color: #4a4e69;
    --btn-primary-bg: #9a8c98;
    --btn-primary-hover: #4a4e69;
    --nav-icon-color: #4a4e69;
    --table-header-bg: #9a8c98;
    --table-row-hover: #f2e9e4;
}

/* ==========================================================================
   2. RESET E ESTILOS GERAIS
   ========================================================================== */
body {
    margin: 20px;
    padding: 20px;
    padding-top: 120px;
    padding-bottom: 8px;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3 {
    text-align: center;
    color: var(--nav-icon-color);
    margin-bottom: 20px;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   3. LAYOUT (Header, Footer, Main, Containers)
   ========================================================================== */
header {
    background-color: var(--bg-header);
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1202;
    transition: background-color 0.3s;
}

footer {
    background-color: var(--bg-footer);
    color: #fff;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    z-index: 9999; /* Garante prioridade */
}

main {
    margin-bottom: 60px;
}

.main-content {
    margin-top: 128px;
}

/* Containers de Layout (Unificados) */
.ticket-container, 
.ticket-container-full {
    max-width: 98%;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

@media (min-width: 2500px) {
    .ticket-container, 
    .ticket-container-full {
        max-width: 2400px; 
    }
}

.center-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* ==========================================================================
   4. NAVEGAÇÃO (Sidebar, Navbar)
   ========================================================================== */
.minimal-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    color: var(--nav-icon-color);
    height: 56px;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    z-index: 1201;
    box-sizing: border-box;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.menu-icon {
    background: none;
    border: none;
    color: var(--nav-icon-color);
    font-size: 1.5em;
    cursor: pointer;
    margin-right: 15px;
    padding: 0;
    transition: color 0.2s;
}

.menu-icon:hover {
    opacity: 0.2;
}

.navbar-title {
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--nav-icon-color);
}

/* Switcher de Tema (Navbar) */
.theme-switcher-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.theme-btn {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
    color: var(--nav-icon-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s, color 0.2s;
}

.theme-btn:hover {
    transform: scale(1.1);
    background-color: var(--nav-hover-bg);
    color: var(--link-color);
}

/* Menu Lateral */
.side-menu {
    position: fixed;
    top: 128px;
    left: -260px;
    width: 240px;
    height: calc(100% - 128px);
    background: var(--bg-card);
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    padding-top: 20px;
    transition: left 0.25s cubic-bezier(.4,0,.2,1);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.side-menu.open {
    left: 0;
}

.side-menu .close-menu {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--nav-icon-color);
    font-size: 1.3em;
    cursor: pointer;
}

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.side-menu ul li {
    width: 100%;
}

.side-menu ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1em;
    border-left: 3px solid transparent;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.side-menu ul li a:hover {
    background: var(--nav-hover-bg);
    border-left: 3px solid var(--nav-icon-color);
    color: var(--nav-icon-color);
}

.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 1100;
    transition: opacity 0.2s;
    opacity: 0;
}

.overlay.open {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   5. COMPONENTES (Forms, Buttons, Cards, Modals, Alerts)
   ========================================================================== */

/* --- Formulários --- */
form {
    background-color: var(--bg-card);
    padding: 30px;
    max-width: 900px;
    margin: 50px auto;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

/* Formulário de Ticket (Wrapper para não conflitar) */
form.ticket-form-wrapper {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
    border: none;
}

.form-adicionar-informacao {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 20px;
}

.form-container {
    display: flex;
    gap: 20px;
}

.form-column {
    flex: 1;
}

input[type="text"],
input[type="password"],
input[type="file"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: var(--input-bg);
    color: var(--input-text);
}

textarea {
    resize: vertical;
}

input[readonly] {
    background-color: rgba(0,0,0,0.05);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    width: 100%;
    box-sizing: border-box;
    cursor: not-allowed;
    opacity: 0.8;
}

.file-input-wrapper { margin-bottom: 10px; }

.password-container {
    position: relative;
}

.password-container i {
    position: absolute;
    right: 14px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    color: var(--link-color);
    font-size: 1rem;
    cursor: pointer;
}

.password-container i.fa-eye-slash {
    color: #e11d48;
}

/* --- Botões --- */
button, input[type="submit"], 
.btn-primary, .btn-secondary, 
.btn-success, .btn-danger {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
    transition: background-color 0.3s ease;
    display: inline-block;
    width: auto;
}

/* Cores dos Botões */
button, input[type="submit"], .btn-primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}
button:hover, input[type="submit"]:hover, .btn-primary:hover {
    background-color: var(--btn-primary-hover);
}

.btn-secondary {
    background-color: var(--btn-secondary-bg);
    color: white;
}
.btn-secondary:hover {
    background-color: var(--btn-secondary-hover);
}

.btn-success {
    background-color: #28a745;
    color: white;
}
.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.button-container form {
    display: contents; /* Permite que o form não quebre o flex layout */
}

/* --- Tabelas (Padrão) --- */
table {
    width: 90%;
    margin: 20px auto;
    border-collapse: collapse;
    background-color: var(--bg-card);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 1em;
    color: var(--text-color);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tr:nth-child(even) {
    background-color: var(--table-row-even);
}

tr:hover {
    background-color: var(--table-row-hover);
    cursor: pointer;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border-color);
}

/* Garante expansão no container full */
.ticket-container .card,
.ticket-container-full .card {
    width: 100%;
}

.card-header {
    background-color: var(--nav-hover-bg);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    color: var(--nav-icon-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
    color: var(--text-color);
}

/* --- Alertas --- */
.alert {
    display: flex;
    justify-content: center;
    align-items: center;

    min-width: 300px;
    max-width: 500px;
    width: 100%;

    text-align: center;
    margin-bottom: 10px;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-messages,
#ticket-message,
#msg-container-os,
#msg-container-usuario,
#reset-password-message {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-top: 24px;
}


/* --- Modais --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 30%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    color: var(--text-color);
}

.modal-content form {
    background-color: transparent; /* Remove o fundo branco */
    box-shadow: none;              /* Remove a sombra */
    border: none;                  /* Remove a borda */
    padding: 0;                    /* Remove o espaçamento interno extra */
    margin: 0 auto;                /* Centraliza e remove margem vertical excessiva */
    max-width: 100%;               /* Garante que use a largura do modal */
}

/* Ajuste opcional para o título dentro do modal ficar mais perto dos campos */
.modal-content h2, 
.modal-content h3 {
    margin-top: 0;
    margin-bottom: 25px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* ==========================================================================
   6. DATATABLES (Estilização Unificada)
   ========================================================================== */
.dataTables_wrapper {
    padding: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Controles Superiores (Length e Filter) */
.dataTables_wrapper .dataTables_length {
    float: left;
    margin-bottom: 15px;
    width: auto;
    color: var(--text-color);
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter {
    float: right;
    margin-bottom: 15px;
    width: auto;
    text-align: right;
    color: var(--text-color);
    font-weight: 500;
}

/* Inputs do DataTables */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 15px;
    margin-left: 10px;
    background-color: var(--input-bg);
    color: var(--input-text);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 200px;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--nav-icon-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 24px 4px 10px;
    margin: 0 5px;
    background-color: var(--input-bg);
    color: var(--input-text);
    cursor: pointer;
    width: auto !important;
    min-width: 70px;
    display: inline-block;
    vertical-align: middle;
}

/* Paginação e Informação */
.dataTables_wrapper .dataTables_info {
    padding-top: 15px;
    color: var(--text-color) !important;
    opacity: 0.8;
    font-size: 0.9rem;
    clear: both;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    color: var(--text-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 12px;
    margin: 0;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-color) !important;
    background: transparent;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--nav-hover-bg) !important;
    color: var(--nav-icon-color) !important;
    border: 1px solid var(--border-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--nav-icon-color) !important;
    color: #fff !important;
    border: 1px solid var(--nav-icon-color) !important;
    font-weight: bold;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled, 
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    cursor: default;
    color: var(--text-color) !important;
    opacity: 0.4;
    background: transparent !important;
    box-shadow: none;
}

/* Clear fix para tabela */
table.dataTable {
    clear: both;
    margin-top: 10px !important;
}

/* Responsividade DataTables */
@media screen and (max-width: 600px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 60%;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        justify-content: center;
        margin-top: 10px;
    }

    .modal-content {
        width: 90%; 
        margin: 20% auto; 
    }
}

/* Filtros com Badges (Custom) */
.filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.filter-badge input { display: none; }
.filter-badge span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    user-select: none;
}
.filter-badge input:checked + span {
    background-color: var(--nav-icon-color);
    color: #fff;
    border-color: var(--nav-icon-color);
}

/* ==========================================================================
   7. PÁGINAS ESPECÍFICAS (Tickets, Login, Calendar, Erros)
   ========================================================================== */

/* --- Tickets / Chamados --- */
.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Status Badges (Unificados e Corrigidos) */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    color: white !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    display: inline-block;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.2;
    min-width: 85px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid transparent;
}

.status-aberto { background-color: #28a745 !important; border-color: #28a745 !important; }
.status-andamento { background-color: #0d6efd !important; border-color: #0d6efd !important; }
.status-pendente { background-color: #ffc107 !important; border-color: #ffc107 !important; }
.status-reaberto { background-color: #fd7e14 !important; border-color: #fd7e14 !important; }
.status-resolvido { background-color: #6c757d !important; border-color: #6c757d !important; }
.status-deletado, .status-cancelado { background-color: #dc3545 !important; border-color: #dc3545 !important; }
.status-pausado { background-color: #6f42c1 !important; border-color: #6f42c1 !important; } /* Roxo para pausada */

/* Grid de Informações do Ticket */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 3px;
}

.info-item span {
    font-weight: 600;
    color: var(--text-color);
    display: block;
    word-break: break-all; 
}

.description-box {
    background-color: rgba(0,0,0,0.03);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap; 
    color: var(--text-color);
}

.resolution-box {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
}

/* Timeline */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 3px solid var(--timeline-line);
    position: relative;
}

.timeline-item::before {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--nav-icon-color);
    border-radius: 50%;
    position: absolute;
    left: -7.5px;
    top: 0;
}

.timeline-meta {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 5px;
}

.timeline-content {
    background: var(--timeline-bg);
    padding: 10px 15px;
    border-radius: 6px;
    color: var(--text-color);
}

.action-area textarea {
    min-height: 100px;
}

/* --- Página de Erro --- */
.error-card {
    max-width: 500px;
    text-align: center;
    width: 100%;
}
.error-icon {
    font-size: 4rem;
    color: var(--nav-icon-color);
    margin-bottom: 20px;
    opacity: 0.8;
}

/* --- Login --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px); 
    width: 100%;
    padding: 0;
}

.login-card {
    max-width: 550px;
    width: 100%;
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    padding: 40px 30px 10px;
}

.login-logo {
    max-height: 100px;
    margin-bottom: 20px;
    transition: transform 0.3s;
}
.login-logo:hover { transform: scale(1.05); }

.login-title {
    color: var(--nav-icon-color);
    font-weight: 700;
    margin: 0;
    font-size: 1.6rem;
}

.login-subtitle {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 1rem;
    margin-top: 8px;
}

.login-body { padding: 30px 40px 40px; }

.login-theme-switcher {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.login-theme-switcher .theme-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
    background-color: var(--bg-body);
}

.login-input-group { margin-bottom: 20px; }
.login-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--nav-icon-color);
    font-size: 0.95rem;
}
.login-input-group input { margin-bottom: 0; padding: 14px; }

.btn-login {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-footer-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer-links a {
    color: var(--text-color);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
    transition: all 0.2s;
}
.login-footer-links a:hover {
    opacity: 1;
    color: var(--link-color);
    text-decoration: none;
    transform: translateY(-2px);
}

/* --- Agendamento de Salas (FullCalendar) --- */
.grid-layout {
    display: grid; 
    grid-template-columns: 350px 1fr;
    gap: 20px; 
    align-items: start;
}

@media (max-width: 900px) {
    .grid-layout { grid-template-columns: 1fr; }
}

.calendar-page-container {
    padding-bottom: 150px !important;
    display: block;
    min-height: 100vh;
}

/* Overrides do FullCalendar */
.fc-col-header-cell {
    background-color: var(--table-header-bg) !important;
    border-color: var(--border-color) !important;
}
.fc-col-header-cell-cushion {
    color: #ffffff !important; 
    text-decoration: none !important;
    font-weight: bold;
    padding: 8px 0 !important;
    display: block;
}
.fc-event-main {
    font-size: 0.75rem !important;
    line-height: 1.1 !important;
    padding: 2px !important;
}
.fc-event-time {
    font-size: 0.7rem !important;
    font-weight: bold;
}
.fc a { text-decoration: none !important; }
.fc-timegrid-axis-cushion { display: none !important; }

/* ==========================================================================
   8. UTILITÁRIOS E MISCELÂNEA
   ========================================================================== */

/* Toggle Switch (Versão Arredondada Corrigida) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0;
    vertical-align: middle;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--nav-icon-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--nav-icon-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* ==========================================================================
   ESTILO DAS ABAS DO PAINEL ADMINISTRATIVO
   ========================================================================== */
.admin-tabs-container {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 10px 10px 0 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 5px;
    overflow-x: auto; /* Permite rolagem em telas pequenas */
    white-space: nowrap;
}

.admin-tab {
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    opacity: 0.7;
}

.admin-tab:hover {
    background-color: var(--nav-hover-bg);
    color: var(--nav-icon-color);
    border-radius: 5px 5px 0 0;
    opacity: 1;
    text-decoration: none;
}

.admin-tab.active {
    color: var(--nav-icon-color);
    border-bottom-color: var(--nav-icon-color);
    opacity: 1;
}

.admin-tab i {
    font-size: 1.1em;
}

.notification-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #ff4444; /* Vermelho alerta */
    border-radius: 50%;
    margin-left: 8px;
    position: relative;
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 1);
    animation: pulse-red 2s infinite;
    vertical-align: middle;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(255, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Botão Flutuante da IA (Estilo Pílula) */
.btn-ia {
    position: absolute;
    bottom: 8px;    /* Distância curta da borda inferior */
    right: 8px;     /* Distância curta da borda direita */
    
    background-color: #ffffff;
    border: 1px solid #e0e0e0; /* Borda bem sutil */
    color: #666;
    
    /* Formato Redondinho */
    border-radius: 20px; 
    padding: 6px 14px;
    
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 10; /* Garante que fique ACIMA do input */
    
    /* Sombra projetada para baixo (dá a sensação de altura) */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

/* Efeito Hover: Sobe um pouquinho e a sombra aumenta */
.btn-ia:hover {
    background-color: #f8f9fa;
    color: #007bff;
    border-color: #b3d7ff;
    transform: translateY(-2px); /* Movimento de subida */
    box-shadow: 0 6px 15px rgba(0,123,255,0.15); /* Sombra azulada */
}

.btn-ia:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-ia i {
    font-size: 0.9em;
}

/* Animação suave no textarea ao receber o texto */
.ia-updated {
    animation: highlightSuccess 1.5s ease-out;
}

@keyframes highlightGreen { 0% { border-color: #28a745; box-shadow: 0 0 5px rgba(40, 167, 69, 0.5); } 100% { border-color: #ced4da; box-shadow: none; } }
.ia-updated { animation: highlightGreen 2s ease-out; }

.pending-volume-display {
    display: flex;
    gap: 2px;
    background: #e9ecef;
    border-radius: 4px;
    padding: 2px;
    width: 100%;
    max-width: 150px;
}

.volume-segment {
    flex: 1;
    height: 8px;
    background-color: #cbd3da;
    border-radius: 2px;
}

.volume-segment.active-daae { background-color: #007bff; } /* Azul */
.volume-segment.active-cebi { background-color: #fd7e14; } /* Laranja */
.volume-segment.active-terceiros { background-color: #dc3545; } /* Vermelho */

.pending-label {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
}

/*Badge pulsante roxo */
@keyframes pulse-purple {
    0% { box-shadow: 0 0 0 0 rgba(111, 66, 193, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(111, 66, 193, 0); }
    100% { box-shadow: 0 0 0 0 rgba(111, 66, 193, 0); }
}

.badge-purple-pulse {
    background-color: #6f42c1 !important; 
    color: white;
    animation: pulse-purple 2s infinite;
}

/* Estilo para o seletor de volume (Segmented Control) */
.btn-group-volume .btn {
    flex: 1;
    font-size: 0.85rem;
    font-weight: bold;
}
.btn-group-volume .btn-outline-daae.active { background-color: #007bff; color: white; border-color: #007bff; }
.btn-group-volume .btn-outline-daae { color: #007bff; border-color: #007bff; }
    
.btn-group-volume .btn-outline-cebi.active { background-color: #fd7e14; color: white; border-color: #fd7e14; }
.btn-group-volume .btn-outline-cebi { color: #fd7e14; border-color: #fd7e14; }

.btn-group-volume .btn-outline-terceiros.active { background-color: #dc3545; color: white; border-color: #dc3545; }
.btn-group-volume .btn-outline-terceiros { color: #dc3545; border-color: #dc3545; }

/* Efeito visual para saber que é clicável */
.interactive-volume .volume-segment:hover {
    opacity: 0.8 !important;
    transform: scaleY(1.1); /* Cresce um pouquinho */
}

/* --- Estilos do Slider Deslizante --- */
.custom-range-slider {
    -webkit-appearance: none; /* Remove estilo padrão do Chrome/Safari */
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #e9ecef; /* Cor de fundo padrão (cinza) */
    outline: none;
    opacity: 0.9;
    transition: opacity .2s;
    cursor: pointer;
    margin: 0;
}

.custom-range-slider:hover {
    opacity: 1;
}

/* Bolinha do Slider (Thumb) - Chrome/Safari */
.custom-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--slider-color, #007bff); /* Usa variável CSS */
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: background 0.3s, transform 0.1s;
    margin-top: -7px; /* Centraliza na trilha (24px - 10px) / 2 neg */
}

/* Bolinha do Slider (Thumb) - Firefox */
.custom-range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--slider-color, #007bff);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: background 0.3s;
}

/* Trilha colorida (Opcional: se quiser que a trilha mude de cor também) */
.custom-range-slider {
    /* Hack visual: background linear-gradient controlado via JS se quiser trilha preenchida */
    /* Por simplicidade, mantivemos a trilha cinza e a bolinha colorida, 
       mas você pode descomentar abaixo para colorir a trilha toda: */
    /* background: var(--slider-color, #007bff); opacity: 0.5; */
}

/* Efeito ao clicar */
.custom-range-slider:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

/* Legendas */
.slider-label {
    color: #adb5bd; /* Cinza inativo */
    transition: color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Badges Customizados --- */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

/* Cores dos Badges (baseado nas suas classes de lógica) */
.badge-primary { background-color: #007bff; }
.badge-secondary { background-color: #6c757d; }
.badge-success { background-color: #28a745; }
.badge-danger { background-color: #dc3545; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-info { background-color: #17a2b8; }
.badge-light { background-color: #f8f9fa; color: #212529; }
.badge-dark { background-color: #343a40; }

/* Suas cores personalizadas de prazo */
.badge-purple-pulse { 
    background-color: #6f42c1; 
    animation: pulse-purple 2s infinite; 
}

/* Se você tiver outras cores vindas do 'ticket.date_status_color' como 'orange', defina aqui */
.badge-orange { background-color: #fd7e14; }

.attachment-flex-container {
    display: flex;
    flex-wrap: wrap; /* Se tiver muitos arquivos, quebra linha */
    align-items: center; /* Centraliza verticalmente */
    gap: 10px; /* Espaço entre o botão e o primeiro arquivo */
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Transforma a lista em horizontal */
    flex-wrap: wrap; /* Permite quebrar linha se encher */
    gap: 8px; /* Espaço entre os arquivos */
}

.file-item {
    background: #e9ecef; /* Cor de fundo mais clean */
    border: 1px solid #ced4da;
    color: #495057;
    padding: 0 12px;
    border-radius: 20px; /* Formato de etiqueta arredondada */
    display: inline-flex; /* Ocupa apenas o tamanho do conteúdo */
    align-items: center;
    font-size: 0.85rem;
    height: 32px; /* Mesma altura do botão */
    animation: fadeIn 0.3s;
    width: auto; /* IMPORTANTE: Não ocupa a linha toda */
    max-width: 100%; /* Segurança para mobile */
}

.file-name {
    margin-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.btn-remove-file {
    color: #dc3545;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    transition: all 0.2s;
    margin-left: 5px;
}

.btn-remove-file:hover {
    background: #dc3545;
    color: white;
}

.btn-add-file {
    background-color: var(--nav-icon-color, #0077b6);
    color: white;
    border: none;
    padding: 6px 15px; /* Ajustei para ficar mais compacto */
    border-radius: 20px; /* Borda arredondada (Pill shape) */
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
    height: 32px; /* Altura fixa para alinhar com os arquivos */
    white-space: nowrap; /* Não deixa o texto do botão quebrar */
}

.btn-add-file:hover {
    opacity: 0.9;
}

.card-status:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.ia-updated {
    animation: pulse-border 1.5s;
}
@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(111, 66, 193, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(111, 66, 193, 0); }
    100% { box-shadow: 0 0 0 0 rgba(111, 66, 193, 0); }
}

.timeline-item {
    border-left: 2px solid #dee2e6;
    margin-left: 10px;
}

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: #007bff;
    border-radius: 50%;
    border: 2px solid #fff;
}

.os-description-box {
    white-space: pre-wrap; /* Mantém as quebras de linha do usuário */
    font-size: 0.95rem;
}

.tech-label {
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    background-color: #ffffff;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tech-selector {
    display: inline-flex;
    margin: 4px;
}

.tech-checkbox:checked + .tech-label {
    background-color: #e7f1ff;
    border-color: #0d6efd;
    color: #0d6efd;
    transform: translateY(-2px);
}

.modal {
    display: none; 
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center; 
    justify-content: center;
}
.modal-content {
    background: var(--bg-card, #fff);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.status-badge-estatutario {
    display: block; 
    color: #dc3545; 
    font-size: 0.75rem; 
    font-weight: bold; 
    margin-top: 5px;
}

/* Container que centraliza o conteúdo e restringe largura extra-larga */
.dashboard-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* Estilo do Card Superior de Boas Vindas */
.welcome-card {
    background: var(--bg-card);
    padding: 2rem 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--btn-primary-bg); /* Borda azul espessa */
    margin-bottom: 2.5rem;
}

/* Sobrescrevemos o centralizado do style.css e forçamos para a esquerda */
.welcome-card h2 {
    text-align: left !important;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.6rem;
}

.welcome-card p {
    text-align: left;
    color: var(--text-muted);
    margin: 0;
    font-size: 1rem;
}

/* Título 'Acesso Rápido' */
.section-title {
    text-align: left !important;
    color: var(--text-muted) !important;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Grid Dinâmico dos Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* O Card de acesso rápido */
.dashboard-card {
    display: flex;
    flex-direction: column; /* Coloca os itens empilhados de cima para baixo */
    align-items: flex-start; /* Alinha tudo à esquerda */
    background: var(--bg-card);
    padding: 2rem 1.8rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none !important; /* Tira sublinhado no hover */
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.dashboard-icon {
    font-size: 2.2rem;
    color: var(--btn-primary-bg);
    margin-bottom: 1.2rem;
}

.dashboard-card strong {
    color: var(--text-color);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.dashboard-card .card-desc {
    font-size: 0.9em;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Estilo Especial para o Botão de Segurança (Amarelo/Laranja) */
.card-security {
    border-left: 4px solid #f59e0b;
}

.card-security .dashboard-icon {
    color: #f59e0b;
}

/* Estilos para Zona de Drop (Invoice/Boletos) */
.invoice-form-layout {
    max-width: 800px; 
    margin: 0 auto;
}

.instruction-box {
    background: var(--bg-body, #f8f9fa); 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    border: 1px solid var(--border-color);
}

.form-actions-center {
    margin-top: 25px; 
    text-align: center;
}

.drop-zone {
    max-width: 100%;
    height: 180px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    color: #cccccc;
    border: 2px dashed var(--btn-primary-bg);
    border-radius: 10px;
    background-color: var(--bg-body);
    transition: all 0.3s ease;
}

.drop-zone.dragover {
    background-color: var(--nav-hover-bg);
    border-color: var(--btn-primary-hover);
    color: var(--btn-primary-bg);
}

.drop-zone-success {
    border-color: #28a745;
}

.drop-zone-success.dragover {
    background-color: #e8f5e9;
    border-color: #1e7e34;
    color: #1e7e34;
}

.drop-zone-icon, .drop-zone-icon-success {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.drop-zone-icon { color: var(--btn-primary-bg); }
.drop-zone-icon-success { color: #28a745; }

.drop-zone-input { display: none; }

.file-list-preview {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-color);
    max-height: 70px;
    overflow-y: auto;
    width: 100%;
}

.file-preview-item {
    padding: 2px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.chat-container-fixed {
    position: fixed;
    bottom: 0; /* Garante que fique colado na margem inferior do navegador */
    right: 20px;
    display: flex;
    flex-direction: row-reverse;
    gap: 15px;
    z-index: 99999 !important; /* Força sobreposição sob rodapés ou modals */
    pointer-events: none;
}

.chat-window {
    width: 320px;
    height: 400px;
    background: #fff;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transition: transform 0.3s ease;
}

.chat-window.minimized {
    transform: translateY(350px);
}

.chat-header {
    background: #004a99; /* Cor DAAE */
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.chat-body {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.chat-msg.sent {
    background: #d1e7dd;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chat-msg.received {
    background: #fff;
    border: 1px solid #dee2e6;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.chat-footer {
    padding: 10px;
    border-top: 1px solid #dee2e6;
    background: #fff;
    display: flex;
    gap: 5px;
}

/* --- Botões de Ação Sutis (Protocolos) --- */
.btn-action-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    background-color: transparent;
    cursor: pointer;
}

/* Azul (Visualizar) */
.btn-action-soft.blue { color: #0d6efd; border-color: rgba(13, 110, 253, 0.15); background-color: rgba(13, 110, 253, 0.05); }
.btn-action-soft.blue:hover { background-color: #0d6efd; color: #fff; transform: translateY(-2px); }

/* Verde (Receber) */
.btn-action-soft.green { color: #198754; border-color: rgba(25, 135, 84, 0.15); background-color: rgba(25, 135, 84, 0.05); }
.btn-action-soft.green:hover { background-color: #198754; color: #fff; transform: translateY(-2px); }

/* Roxo (Encaminhar) */
.btn-action-soft.purple { color: #6f42c1; border-color: rgba(111, 66, 193, 0.15); background-color: rgba(111, 66, 193, 0.05); }
.btn-action-soft.purple:hover { background-color: #6f42c1; color: #fff; transform: translateY(-2px); }

/* Laranja (Desativar) */
.btn-action-soft.orange { color: #fd7e14; border-color: rgba(253, 126, 20, 0.15); background-color: rgba(253, 126, 20, 0.05); }
.btn-action-soft.orange:hover { background-color: #fd7e14; color: #fff; transform: translateY(-2px); }

/* Vermelho (Excluir) */
.btn-action-soft.red { color: #dc3545; border-color: rgba(220, 53, 69, 0.15); background-color: rgba(220, 53, 69, 0.05); }
.btn-action-soft.red:hover { background-color: #dc3545; color: #fff; transform: translateY(-2px); }

/* Escuro / Cinza (Arquivo Morto) */
.btn-action-soft.dark { 
    color: #343a40; 
    border-color: rgba(52, 58, 64, 0.15); 
    background-color: rgba(52, 58, 64, 0.05); 
}
.btn-action-soft.dark:hover { 
    background-color: #343a40; 
    color: #fff; 
    transform: translateY(-2px); 
}

/* Efeito Faded para Processos Desativados */
.protocolo-desativado td {
    opacity: 0.5;
    background-color: #f8f9fa;
    text-decoration: line-through;
}
.protocolo-desativado td a { text-decoration: none; }

/* Força o Select2 a seguir a altura e cor do Bootstrap dentro do modal de intervenção */
#modalIntervencao .select2-container .select2-selection--single { 
    height: 38px !important; 
    border: 1px solid var(--border-color) !important; 
    border-radius: 0.375rem !important; 
    background-color: var(--input-bg) !important;
}

#modalIntervencao .select2-container--default .select2-selection--single .select2-selection__rendered { 
    line-height: 36px !important; 
    color: var(--input-text) !important; 
}

#modalIntervencao .select2-container--default .select2-selection--single .select2-selection__arrow { 
    height: 36px !important; 
}

/* Customizações específicas para a tela de configurações do Protocolo */

#tabela-divisoes td {
    vertical-align: middle;
}

/* Deixa a linha de uma divisão desativada com aparência de bloqueada */
#tabela-divisoes tr.text-muted {
    opacity: 0.7;
}

#tabela-divisoes tr.text-muted td.fw-bold {
    text-decoration: line-through;
}

/* Classes para o gerenciamento de contratos */
.badge-scarcity {
    background-color: #dc3545;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    animation: pulseRed 2s infinite;
}

.btn-action-table {
    background-color: #28a745;
    color: white !important;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s ease;
}

.btn-action-table:hover {
    background-color: #218838;
}

@keyframes pulseRed {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}