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

/* Reset e Configurações Gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --dark: #0f172a;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 12px;

    /* Aliases para compatibilidade */
    --primary-color: var(--primary);
    --secondary-color: var(--secondary);
    --success-color: var(--success);
    --warning-color: var(--warning);
    --error-color: var(--error);
    --info-color: var(--info);
    --dark-color: var(--dark);
    --border-color: var(--border);
    --text-color: var(--text);
    --light-color: #f1f5f9;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Página de Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #2d3436 0%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 20%);
    opacity: 0.1;
    animation: pulse 20s infinite linear;
}

@keyframes pulse {
    0% {
        transform: translate(-25%, -25%) rotate(0deg);
    }

    100% {
        transform: translate(-25%, -25%) rotate(360deg);
    }
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    z-index: 10;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 48px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--dark);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Navbar */
.navbar {
    /* Força variáveis padrão do modo claro dentro do header para imunizá-lo contra o dark mode */
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --dark: #0f172a;

    background: #ffffff;
    border-bottom: 2px solid var(--border);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin-left: 20px;
}

.navbar-brand a {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    max-height: 40px;
}

.navbar-brand i {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 12px;
}

.navbar-menu li {
    position: relative;
}

.navbar-menu li a {
    padding: 10px 18px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu li a i {
    font-size: 16px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.navbar-menu li a:hover {
    background: #ffffff;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.navbar-menu li a:hover i {
    color: var(--primary);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    min-width: 200px;
    display: none;
    z-index: 1001;
    list-style: none;
    margin-top: 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Ponte para o hover não fechar ao mover o mouse para o menu */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
}

.dropdown-menu li a:hover {
    background: #f1f5f9;
    transform: none;
    box-shadow: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f1f5f9;
    padding: 6px 6px 6px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 20px;
    color: var(--primary);
}

.navbar-user span {
    color: var(--dark);
    font-weight: 700;
    font-size: 14px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: #dc2626;
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
}

/* Responsividade Geral */
@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
        flex-direction: column;
        height: auto;
        align-items: flex-start;
    }

    .navbar-brand {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 72px;
    }

    .mobile-toggle {
        display: block;
    }

    .navbar-container {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        padding-bottom: 20px;
        gap: 20px;
    }

    .navbar-container.active {
        display: flex;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .navbar-menu li a {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: #f8fafc;
        margin-top: 5px;
        width: 100%;
        padding-left: 20px;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .navbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .container {
        padding: 20px;
    }

    .row {
        flex-direction: column;
    }

    .col-4,
    .col-6,
    .col-8,
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100% !important;
    }

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

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .table-responsive {
        border: 0;
    }
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
    min-height: calc(100vh - 144px);
}

/* Títulos */
h1 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
    word-break: break-word;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.card-body {
    padding: 40px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
}

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

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

.stat-card.stat-error {
    border-left-color: var(--error-color);
}

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

.stat-icon {
    font-size: 32px;
    background: var(--light-color);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.stat-info h3 {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    /* Garante alinhamento no topo */
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.form-row .form-group label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 8px 12px;
    height: 38px;
    /* Altura padronizada menor */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    /* Fonte padronizada menor */
    background: var(--card-bg);
    transition: all 0.3s;
    color: var(--text);
}

.form-group textarea {
    height: auto !important;
    min-height: 120px;
    line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-sm {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text);
    transition: all 0.3s;
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Botões */
.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: #f1f5f9;
    color: var(--text);
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

/* Variantes de Cores dos Botões - Reforçadas */
.btn-primary {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: #64748b !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: none;
}

.btn-warning {
    background-color: #f59e0b !important;
    color: #ffffff !important;
    border: none;
}

.btn-info {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border: none;
}

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

.btn-info {
    background: var(--info-color);
    color: white;
    border: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
}

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

.table thead th {
    background: var(--bg);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table tbody td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.table tbody tr {
    transition: background 0.2s;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-baixa {
    background: #dbeafe;
    color: #1e40af;
}

.badge-media {
    background: #fef3c7;
    color: #92400e;
}

.badge-alta {
    background: #fed7aa;
    color: #9a3412;
}

.badge-urgente {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-aberto {
    background: #dcfce7;
    color: #15803d;
}

.badge-status-em_andamento {
    background: #fef9c3;
    color: #a16207;
}

.badge-status-aguardando {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-status-resolvido {
    background: #d1fae5;
    color: #065f46;
}

.badge-status-fechado {
    background: #f3f4f6;
    color: #374151;
}

.badge-usuario {
    background: #dbeafe;
    color: #1e40af;
}

.badge-tecnico {
    background: #fef3c7;
    color: #92400e;
}

.badge-admin {
    background: #fee2e2;
    color: #991b1b;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Alerts */
.alert {
    padding: 16px 24px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
    animation: slideDown 0.4s ease-out;
    border: 1px solid transparent;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

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

.alert-persistent {
    position: sticky;
    top: 88px;
    z-index: 90;
    box-shadow: var(--shadow-md);
    background: var(--card-bg) !important;
    border: 2px solid var(--primary) !important;
    color: var(--text) !important;
}

.btn-close-notify:hover {
    transform: scale(1.2);
    opacity: 0.7;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fee2e2;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fef3c7;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 4px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 17px;
    bottom: -30px;
    width: 2px;
    background: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-content {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-left: 10px;
    box-shadow: var(--shadow-sm);
}

.timeline-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

/* Grid Layout */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
    margin-bottom: 20px;
}

[class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
}

.col-4 {
    flex: 0 0 33.333%;
}

.col-6 {
    flex: 0 0 50%;
}

.col-8 {
    flex: 0 0 66.666%;
}

/* Grid Helpers Adicionais */
.col-1 {
    flex: 0 0 8.333%;
}

.col-2 {
    flex: 0 0 16.666%;
}

.col-3 {
    flex: 0 0 25%;
}

.col-4 {
    flex: 0 0 33.333%;
}

.col-5 {
    flex: 0 0 41.666%;
}

.col-9 {
    flex: 0 0 75%;
}

.col-10 {
    flex: 0 0 83.333%;
}

.col-11 {
    flex: 0 0 91.666%;
}

.col-12 {
    flex: 0 0 100%;
}

@media (min-width: 769px) {
    .col-md-1 {
        flex: 0 0 8.333%;
    }

    .col-md-2 {
        flex: 0 0 16.666%;
    }

    .col-md-3 {
        flex: 0 0 25%;
    }

    .col-md-4 {
        flex: 0 0 33.333%;
    }

    .col-md-5 {
        flex: 0 0 41.666%;
    }

    .col-md-6 {
        flex: 0 0 50%;
    }

    .col-md-7 {
        flex: 0 0 58.333%;
    }

    .col-md-8 {
        flex: 0 0 66.666%;
    }

    .col-md-9 {
        flex: 0 0 75%;
    }

    .col-md-10 {
        flex: 0 0 83.333%;
    }

    .col-md-11 {
        flex: 0 0 91.666%;
    }

    .col-md-12 {
        flex: 0 0 100%;
    }
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.ml-2 {
    margin-left: 8px !important;
}

.mr-2 {
    margin-right: 8px !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 24px;
    background: var(--light-color);
    border-radius: 12px;
    overflow: hidden;
}

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

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-color);
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.footer a,
.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 15px;
}

.ai-chat-panel {
    background: var(--light-color);
}

.ai-chat-fallback {
    padding: 10px 20px;
    background: var(--card-bg);
    text-align: center;
    border-top: 1px solid var(--border);
}

.ai-chat-fallback small {
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.ai-chat-ticket-btn {
    background: var(--primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-chat-input-wrap {
    background: var(--card-bg);
    padding: 15px 20px;
}

.ai-chat-lgpd {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}

.form-group small {
    color: var(--text-muted);
}

/* Utilitários */
.text-muted {
    color: var(--text-muted);
}

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

/* Utilitários Extras */
.mb-4 {
    margin-bottom: 24px !important;
}

.mt-3 {
    margin-top: 16px !important;
}

/* Dashboard Notice Mural */
.mural-avisos .alert {
    border-left: 8px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    background: white;
    box-shadow: var(--shadow);
}

.mural-avisos h4 {
    font-size: 20px;
    margin-bottom: 12px;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 24px;
    }

    .navbar {
        padding: 0 20px;
    }

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

    .navbar {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        margin: 10px 0;
    }

    .row {
        flex-direction: column;
    }

    .col-4,
    .col-6,
    .col-8 {
        flex: 0 0 100%;
    }

    .form-row {
        flex-direction: column;
    }
}

/* Estilos para Anexos */
.anexos-list {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.anexos-list ul {
    list-style: none;
    padding: 0;
}

.anexos-list li {
    margin-bottom: 5px;
}

.anexos-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.anexo-item {
    display: inline-block;
    background: var(--light-color);
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.anexo-item:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* Botão de Suporte Flutuante */
.support-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    animation: float-pulse 2s infinite;
}

.support-float-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
    background: var(--primary-hover);
}

.support-float-btn i {
    transition: transform 0.3s ease;
}

.support-float-btn:hover i {
    transform: scale(1.2);
}

.support-float-btn .tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: var(--dark);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 75px;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

.support-float-btn .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 25px;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark) transparent transparent transparent;
}

.support-float-btn:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 768px) {
    .support-float-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .support-float-btn .tooltip-text {
        display: none;
    }
}

@keyframes float-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* Modal de Suporte Direto */
.support-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.support-modal-content {
    background-color: var(--card-bg);
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.support-modal-header {
    background: var(--primary);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.support-modal-close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.support-modal-body {
    padding: 25px;
}

.support-form-group {
    margin-bottom: 20px;
}

.support-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.support-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: var(--card-bg);
    color: var(--text);
}

.support-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.support-form-control[readonly] {
    background-color: var(--light-color);
    cursor: not-allowed;
    color: var(--text-muted);
}

.btn-support-send {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-support-send:hover {
    background: var(--primary-hover);
}

.btn-support-send:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================
   DARK MODE
========================================== */
[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --dark: #f8fafc;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --light-color: #1e293b;
}

/* Removido o suporte dark para navbar conforme pedido do usuario */

[data-theme="dark"] .dropdown-menu li a:hover {
    background-color: var(--bg);
}

[data-theme="dark"] .table thead th {
    background-color: var(--bg);
    border-color: var(--border);
    color: var(--text-muted);
}

[data-theme="dark"] .table tbody td {
    border-color: var(--border);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: var(--bg);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-control-sm,
[data-theme="dark"] .support-form-control,
[data-theme="dark"] select.form-control,
[data-theme="dark"] input.form-control,
[data-theme="dark"] textarea.form-control {
    background-color: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus,
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .support-form-control:focus {
    background-color: var(--bg) !important;
    color: var(--text) !important;
}

[data-theme="dark"] option,
[data-theme="dark"] optgroup {
    background-color: var(--bg) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .stat-card {
    background-color: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .stat-icon {
    background-color: var(--bg);
}

[data-theme="dark"] .support-modal-content,
[data-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .support-modal-header,
[data-theme="dark"] .modal-header {
    border-color: var(--border);
}

[data-theme="dark"] .support-form-group label {
    color: var(--text);
}

[data-theme="dark"] .navbar a,
[data-theme="dark"] .navbar-user span,
[data-theme="dark"] .navbar-brand i,
[data-theme="dark"] .btn-theme-toggle {
    color: var(--text) !important;
}

[data-theme="dark"] .navbar-menu li a i {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .navbar-menu li a:hover i {
    color: var(--text) !important;
}

[data-theme="dark"] .footer {
    background-color: var(--card-bg) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .footer p {
    color: var(--text-muted) !important;
}

/* Correções de Classes e Inlines Utilitárias Legadas */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .text-secondary,
[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* Alertas persistentes e murais */
[data-theme="dark"] .alert-persistent {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

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

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

[data-theme="dark"] .alert-info {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .badge-status-fechado {
    background-color: var(--border) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .timeline-content {
    background-color: var(--card-bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* Botões base não coloridos */
[data-theme="dark"] .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info) {
    background-color: var(--bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Forçamento de elementos com inlines absolutos de cor branca (arquivos legados e relatórios) */
[data-theme="dark"] body *[style*="background: white"],
[data-theme="dark"] body *[style*="background-color: white"] {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
}

/* Tratamento Exclusivo para Select2 (Campo Solicitante e outros com busca) */
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-dropdown,
[data-theme="dark"] .select2-search--dropdown .select2-search__field,
[data-theme="dark"] .select2-results__option {
    background-color: var(--bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text) !important;
}

[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .container,
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .chamado-info,
[data-theme="dark"] .article-content,
[data-theme="dark"] .article-content p,
[data-theme="dark"] .article-content li,
[data-theme="dark"] .article-content td,
[data-theme="dark"] .article-content span {
    color: var(--text);
}

[data-theme="dark"] .container h1,
[data-theme="dark"] .container h2,
[data-theme="dark"] .container h3,
[data-theme="dark"] .container h4,
[data-theme="dark"] .card-header h2,
[data-theme="dark"] .stat-info h3,
[data-theme="dark"] .kb-section-header h2,
[data-theme="dark"] .kb-article-title,
[data-theme="dark"] .kb-category-title,
[data-theme="dark"] .kb-empty-state h3,
[data-theme="dark"] .ticket-card-title {
    color: var(--text) !important;
}

[data-theme="dark"] .form-group label,
[data-theme="dark"] .form-group small,
[data-theme="dark"] .container small,
[data-theme="dark"] .kb-article-excerpt,
[data-theme="dark"] .kb-category-desc,
[data-theme="dark"] .kb-article-meta,
[data-theme="dark"] .article-meta {
    color: var(--text-muted);
}

[data-theme="dark"] .form-group label {
    color: var(--text);
}

[data-theme="dark"] hr {
    border-color: var(--border);
}

[data-theme="dark"] .kb-category-card,
[data-theme="dark"] .kb-article-card,
[data-theme="dark"] .kb-empty-state {
    background: var(--card-bg) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .kb-article-category,
[data-theme="dark"] .kb-category-count {
    background: var(--bg) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .article-content pre {
    background: var(--bg) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .article-content [style*="color: #000"],
[data-theme="dark"] .article-content [style*="color:#000"],
[data-theme="dark"] .article-content [style*="color: black"] {
    color: var(--text) !important;
}

[data-theme="dark"] .container [style*="color: #666"],
[data-theme="dark"] .container [style*="color:#666"],
[data-theme="dark"] .container [style*="color: #888"],
[data-theme="dark"] .container [style*="color:#888"],
[data-theme="dark"] .container [style*="color: #555"],
[data-theme="dark"] .container [style*="color: #777"],
[data-theme="dark"] .container [style*="color: #999"],
[data-theme="dark"] .container [style*="color:#999"],
[data-theme="dark"] .footer a {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .container [style*="background-color: #f8f9fa"],
[data-theme="dark"] .container [style*="background-color: #f9f9f9"],
[data-theme="dark"] .container [style*="background: #f8f9fa"],
[data-theme="dark"] .container [style*="background-color: #f0f2f5"] {
    background-color: var(--bg) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .support-modal-body,
[data-theme="dark"] .ai-chat-panel,
[data-theme="dark"] .ai-chat-fallback {
    background: var(--bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .ai-chat-typing {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .card-calendar-custom,
[data-theme="dark"] #calendar {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .fc .fc-toolbar-title,
[data-theme="dark"] .fc .fc-col-header-cell-cushion,
[data-theme="dark"] .fc .fc-list-day-cushion,
[data-theme="dark"] .fc .fc-list-event-title,
[data-theme="dark"] .fc .fc-daygrid-day-number,
[data-theme="dark"] .fc .fc-timegrid-slot-label,
[data-theme="dark"] .fc .fc-list-event-time {
    color: var(--text) !important;
}

[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th,
[data-theme="dark"] .fc-theme-standard .fc-scrollgrid,
[data-theme="dark"] .fc-theme-standard .fc-list {
    border-color: var(--border) !important;
}

[data-theme="dark"] .fc .fc-daygrid-day.fc-day-today,
[data-theme="dark"] .fc .fc-timegrid-col.fc-day-today {
    background: rgba(37, 99, 235, 0.18) !important;
}

[data-theme="dark"] .fc .fc-button {
    background: var(--bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .fc .fc-button-primary:not(:disabled).fc-button-active,
[data-theme="dark"] .fc .fc-button-primary:not(:disabled):active {
    background: var(--primary) !important;
    color: #fff !important;
}

[data-theme="dark"] .fc-list-event:hover td {
    background: var(--bg) !important;
}

[data-theme="dark"] .fc .fc-list-day-cushion {
    background: var(--bg) !important;
}

.hide-desktop {
    display: none !important;
}

.tickets-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 12px;
    align-items: end;
}

.tickets-filter-form .form-group {
    margin-bottom: 0;
}

.tickets-filter-actions .btn {
    width: 100%;
}

.page-ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.page-ticket-head h1 {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.page-ticket-title {
    font-weight: 500;
    color: var(--text-muted);
}

.chamado-info p {
    margin: 0 0 10px;
}

.chamado-info p:last-child {
    margin-bottom: 0;
}

.ticket-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticket-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.ticket-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ticket-card-num {
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
}

.ticket-card-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 6px;
    word-break: break-word;
}

.ticket-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ticket-card-sla {
    margin-top: 8px;
    font-size: 12px;
}

.ticket-card-sla-bar {
    width: 100%;
    height: 6px;
    margin-top: 4px;
    background: rgba(128, 128, 128, 0.18);
    border-radius: 3px;
    overflow: hidden;
}

.ticket-card-sla-bar > div {
    height: 100%;
}

.ticket-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 12px;
    margin-bottom: 8px;
}

.ticket-form-grid .form-group {
    margin-bottom: 12px;
}

.form-group input[type="file"] {
    height: auto;
    min-height: 44px;
    padding: 8px 12px;
}

.page-ticket-head .subtitle {
    margin-bottom: 0;
    margin-top: 4px;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

/* Layout compacto em tablet e celular */
@media (max-width: 992px) {
    .navbar {
        padding: 0 16px;
        height: 56px;
    }

    .navbar-brand a {
        font-size: 16px;
        gap: 8px;
        max-width: calc(100% - 48px);
        overflow: hidden;
    }

    .logo-img {
        max-height: 28px;
    }

    .navbar-brand i {
        font-size: 20px;
    }

    .container {
        padding: 16px 12px 88px;
        min-height: auto;
    }

    h1 {
        font-size: 1.35rem;
        line-height: 1.25;
        word-break: break-word;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .card {
        margin-bottom: 16px;
        border-radius: 10px;
    }

    .card-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-header h2 {
        font-size: 15px;
    }

    .card-body {
        padding: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

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

    .stat-icon {
        font-size: 22px !important;
        min-width: 36px;
    }

    .stat-info h3 {
        font-size: 1.15rem;
    }

    .stat-info p,
    .stat-info span {
        font-size: 11px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .form-actions .btn,
    .page-header .btn,
    .actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .table-responsive,
    .card-body > .table,
    .card .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 560px;
        font-size: 13px;
    }

    .table thead th,
    .table tbody td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    .row {
        margin-left: 0;
        margin-right: 0;
    }

    .form-control,
    select.form-control,
    textarea.form-control {
        font-size: 16px;
        min-height: 44px;
    }

    textarea.form-control {
        min-height: 88px;
    }

    .support-float-btn {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
        font-size: 18px;
    }

    .footer {
        padding: 16px 12px 24px;
        font-size: 12px;
        text-align: center;
    }

    .page-header,
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .timeline-header {
        flex-wrap: wrap;
    }

    .select2-container {
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .hide-desktop {
        display: block !important;
    }

    .ticket-cards.hide-desktop {
        display: flex !important;
    }

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

    .ticket-form-grid {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row .form-group label {
        white-space: normal;
    }

    .page-ticket-head {
        flex-direction: column;
        align-items: stretch;
    }

    .page-ticket-title {
        display: block;
        font-size: 0.95rem;
        margin-top: 4px;
        line-height: 1.35;
        word-break: break-word;
    }

    .btn-block-mobile {
        width: 100%;
        text-align: center;
    }

    .chamado-info {
        display: grid;
        gap: 8px;
    }

    .chamado-info p {
        margin: 0;
        font-size: 14px;
        word-break: break-word;
    }

    .timeline-content {
        margin-left: 0;
        padding: 12px;
    }

    .timeline-header {
        align-items: flex-start;
        gap: 6px;
    }

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

    .navbar-brand {
        height: 56px;
    }

    .navbar-menu li a {
        padding: 10px 12px;
        font-size: 14px;
    }

    .navbar-user {
        flex-wrap: wrap;
        gap: 8px;
    }

    .navbar-user .user-info {
        max-width: calc(100% - 80px);
    }

    .navbar-user .user-info span {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }

    .login-box {
        padding: 24px 18px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .mural-avisos {
        padding: 12px;
    }

    .mural-avisos h4 {
        font-size: 16px;
        padding-right: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px 10px 96px;
    }

    h1 {
        font-size: 1.2rem;
    }

    .stat-card {
        padding: 10px;
    }

    .btn-logout {
        padding: 8px 10px;
        font-size: 13px;
    }

    .btn-logout span,
    .btn-logout {
        white-space: nowrap;
    }
}