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

:root {
    --primary-color: #0f4c80;
    --primary-hover: #0d3d67;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #0f4c80;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Container Principal */
.container {
    max-width: 100%;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Header */
header {
    background: var(--surface);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo:not([src]),
.logo[src=""],
.logo[src="#"] {
    display: none;
}

.logo-container h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin: 0;
}

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

.user-info span {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.tab {
    padding: 12px 24px;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tab:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Filtros */
.filters {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Tabela */
.table-container {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

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

thead {
    background: var(--background);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background: var(--background);
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px !important;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-aberto {
    background: #dbeafe;
    color: #1e40af;
}

.status-em-andamento {
    background: #fef3c7;
    color: #92400e;
}

.status-aguardando-transportadora {
    background: #ede9fe;
    color: #5b21b6;
}

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

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

/* Botões */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

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

/* Botão icônico compacto */
.btn-icon {
    padding: 8px 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Formulários */
.form-container {
    background: var(--surface);
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.form-container.large-container {
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.form-container h2 {
    margin-bottom: 30px;
    margin-top: 0;
    color: var(--primary-color);
    font-size: 28px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Textarea específico */
.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

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

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f4c80 0%, #0d3d67 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

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

.login-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

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

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

/* Mensagens */
.message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    display: block;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
    display: block;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
    display: block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--surface);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Database Info */
.database-info {
    margin-top: 30px;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.database-info h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.database-info pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.database-info code {
    font-family: 'Courier New', monospace;
}

.info {
    padding: 15px;
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-bottom: 20px;
    color: #1e40af;
}

.test-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.test-result.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    display: block;
}

.test-result.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
    display: block;
}

/* Detalhes da Ocorrência */
.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.detail-value {
    color: var(--text-primary);
    font-size: 15px;
}

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

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .logo-container {
        justify-content: center;
    }

    .logo {
        height: 40px;
    }

    .logo-container h1 {
        font-size: 20px;
    }

    .tabs {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters select {
        min-width: 100%;
    }

    table {
        font-size: 12px;
    }

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

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

    .form-actions button {
        width: 100%;
    }

    .modal-content {
        margin: 10% 10px;
        padding: 20px;
    }

    .login-box {
        padding: 30px 20px;
    }
}

/* Seção de Relatórios */
.reports-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f5ff;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
}

.reports-section h3 {
    color: #7c3aed;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reports-section .info {
    background: #f3e8ff;
    border-color: #ddd6fe;
    color: #6b21a8;
    margin-bottom: 20px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.report-card {
    background: white;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.report-card:hover {
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

.report-card h4 {
    color: #7c3aed;
    margin-bottom: 10px;
    font-size: 14px;
}

.report-card p {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.report-filters {
    background: white;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.report-filters h4 {
    color: #7c3aed;
    margin-bottom: 12px;
    font-size: 14px;
}

.report-filters .form-group {
    margin-bottom: 10px;
}

.report-filters label {
    font-size: 13px;
    color: #5b21b6;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.report-filters input,
.report-filters select {
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid #e9d5ff;
    border-radius: 6px;
    background: white;
    width: 100%;
}

/* ========== TABELA DE PREVIEW RELATÓRIO ========== */
.report-preview-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.report-preview-table thead {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.report-preview-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.report-preview-table th:last-child {
    border-right: none;
}

.report-preview-table td {
    padding: 10px;
    border-bottom: 1px solid #f3e8ff;
    font-size: 12px;
    color: #374151;
}

.report-preview-table tbody tr {
    transition: background-color 0.2s ease;
}

.report-preview-table tbody tr:hover {
    background: #f9f5ff;
}

.report-preview-table tbody tr:nth-child(even) {
    background: #faf5ff;
}


.report-filters input:focus,
.report-filters select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.report-status {
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    min-height: 20px;
}

.report-status.loading {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.report-status.success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid var(--success-color);
}

.report-status.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

/* Página de Configurações */
.config-page {
    max-width: 1000px;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.form-container {
    background: var(--surface);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.sql-section {
    margin: 25px 0;
    padding: 20px;
    background: #f5f5f5;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.sql-section h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sql-section pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
    margin: 10px 0;
}

.sql-section code {
    font-family: 'Courier New', Courier, monospace;
}

.database-info {
    margin: 30px 0;
    padding: 20px;
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.database-info h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.database-info p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* Status do Sistema */
.system-status {
    margin: 30px 0;
    padding: 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.system-status h3 {
    color: var(--success-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--success-color);
}

.status-ok {
    font-size: 18px;
    min-width: 25px;
}

.status-error {
    font-size: 18px;
    min-width: 25px;
}

.status-warning {
    font-size: 18px;
    min-width: 25px;
    color: var(--warning-color);
}

/* Informações Úteis */
.helpful-info {
    margin: 30px 0;
    padding: 20px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
}

.helpful-info h3 {
    color: #92400e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.helpful-info ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.helpful-info li {
    margin-bottom: 10px;
}

.helpful-info strong {
    color: var(--text-primary);
}

.helpful-info code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
}

/* Botão pequeno */
.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
    height: auto;
}

/* Info message */
.info {
    padding: 12px;
    margin-bottom: 20px;
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    color: #1e40af;
}

/* Test Result */
.test-result {
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
    display: none;
}

.test-result.info {
    display: block;
    background: #dbeafe;
    border-left-color: var(--primary-color);
    color: #1e40af;
}

.test-result.success {
    display: block;
    background: #dcfce7;
    border-left: 4px solid var(--success-color);
    color: #166534;
}

.test-result.error {
    display: block;
    background: #fee2e2;
    border-left: 4px solid var(--danger-color);
    color: #991b1b;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ============================================================================
   MELHORIAS - TABELA DE OCORRÊNCIAS
   ============================================================================ */

.occurrences-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
}

.occurrences-table thead {
    background: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.occurrences-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    white-space: nowrap;
}

.occurrences-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.occurrences-table .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.occurrences-table tbody tr {
    transition: background-color 0.2s ease;
}

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

.occurrences-table .loading {
    text-align: center;
    padding: 40px;
}

@media (max-width: 768px) {
    .occurrences-table {
        font-size: 13px;
    }

    .occurrences-table th,
    .occurrences-table td {
        padding: 10px;
    }

    .occurrences-table th {
        font-size: 11px;
    }
}

/* ============================================================================
   MELHORIAS - GRID RESPONSIVO PARA RELATÓRIOS
   ============================================================================ */

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   MELHORIAS - FORMULÁRIOS RESPONSIVOS
   ============================================================================ */

.report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .report-filters {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .report-filters {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
}

/* ============================================================================
   MELHORIAS - VALIDAÇÃO E EFEITOS VISUAIS
   ============================================================================ */

.form-group input:invalid,
.form-group textarea:invalid,
.form-group select:invalid {
    border-color: var(--danger-color);
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown),
.form-group select:valid {
    border-color: var(--success-color);
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
    background: var(--background);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Label com asterisco para required */
.form-group label[required]::after {
    content: ' *';
    color: var(--danger-color);
}

/* ============================================================================
   MELHORIAS - EFEITOS DE LOADING E STATUS
   ============================================================================ */

.report-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    animation: slideIn 0.3s ease;
}

.report-status.loading {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
    display: block;
}

.report-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    display: block;
}

.report-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
    display: block;
}

/* ============================================================================
   MELHORIAS - MOBILE FIRST
   ============================================================================ */

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

    .form-container {
        padding: 20px;
        margin: 0 10px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .user-info {
        flex-direction: row;
        justify-content: space-around;
        gap: 5px;
    }

    .user-info button {
        padding: 8px 10px;
        font-size: 12px;
    }

    .tabs {
        gap: 10px;
    }

    .tab {
        flex: 1;
        padding: 10px 5px;
        font-size: 12px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 90%;
    }

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

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }
}

/* Tabela com scroll altura fixa */
.table-wrapper {
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ========== LOADING SPINNER ========== */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 9999;
    min-width: 200px;
}

.loading-spinner.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
}

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

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast.info .toast-icon {
    color: var(--primary-color);
}

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

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-icon {
    font-size: 20px;
    min-width: 24px;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hide {
    animation: slideOut 0.3s ease-out forwards;
}

/* ========== SEARCH/FILTER ========== */
.search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-box {
    min-width: 200px;
}

.filter-box select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

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

/* ========== PAGINATION ========== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 0 10px;
}

.pagination-button {
    background: var(--surface);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-select {
    background: var(--surface);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* ========== MODAL CONFIRMAÇÃO ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9998;
}

.modal-overlay.show {
    display: block;
}

.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    z-index: 9999;
    display: none;
}

.confirm-modal.show {
    display: block;
}

.confirm-modal h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.confirm-modal p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 14px;
}

.confirm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-modal-actions button {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.confirm-modal-actions .btn-confirm {
    background: var(--danger-color);
    color: white;
}

.confirm-modal-actions .btn-confirm:hover {
    background: #dc2626;
}

.confirm-modal-actions .btn-cancel {
    background: var(--secondary-color);
    color: white;
}

.confirm-modal-actions .btn-cancel:hover {
    background: #475569;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
    }

    .toast {
        min-width: 250px;
        font-size: 12px;
        padding: 12px 16px;
    }

    .search-container {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .pagination-container {
        gap: 5px;
    }

    .pagination-button,
    .pagination-select {
        padding: 6px 10px;
        font-size: 12px;
    }

    .confirm-modal {
        max-width: 90%;
        padding: 20px;
    }
}

