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

:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #3385FF;
    --primary-lighter: #E6F0FF;

    --secondary: #00B8D9;
    --success: #00C853;
    --warning: #FFA500;
    --danger: #FF3D57;

    --bg-primary: #0A0E27;
    --bg-secondary: #131829;
    --bg-tertiary: #1A1F3A;
    --bg-card: #FFFFFF;

    --text-primary: #1A1F36;
    --text-secondary: #697386;
    --text-tertiary: #9BA3B7;
    --text-white: #FFFFFF;

    --border: #E3E8EF;
    --border-hover: #CBD2E0;

    --sidebar-width: 280px;
    --header-height: 80px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F7F9FC;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0A0E27 0%, #131829 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
}

.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-white);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo i {
    font-size: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(0, 102, 255, 0.5));
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 6px;
    color: var(--text-tertiary);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 102, 255, 0.15) 0%, rgba(0, 102, 255, 0.05) 100%);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 13px;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px rgba(0, 102, 255, 0.6);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-help {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-help:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: #F7F9FC;
}

/* ============================================
   HEADER
   ============================================ */

img.w-50 {
    width: 12.5rem !important;
}

.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    flex: 1;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
}

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

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #003D99 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 255, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #F7F9FC;
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #CC2E43 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 61, 87, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #CC2E43 0%, #992231 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 61, 87, 0.4);
}

.btn-pagination {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-pagination:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

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

/* ============================================
   LOADING STATE
   ============================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--primary-lighter);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: auto;
    margin-bottom: 24px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
}

.toast-success {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 1px solid #A5D6A7;
    border-left: 4px solid var(--success);
    color: #2E7D32;
}

.toast-error {
    background: linear-gradient(135deg, #FFF5F5 0%, #FFE8E8 100%);
    border: 1px solid #FFCDD2;
    border-left: 4px solid var(--danger);
    color: #C62828;
}

.toast i {
    font-size: 20px;
}

.toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 18px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */

.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 40px 40px 0;
}

.section-header i {
    font-size: 28px;
    color: var(--primary);
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

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

/* ============================================
   CARD
   ============================================ */

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin: 0 40px 24px;
}

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

.card.mb-3 {
    margin-bottom: 24px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

#campaignForm .form-grid {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.col-span-2 {
    grid-column: span 2;
}

.form-group.col-span-3 {
    grid-column: span 3;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-style: italic;
}

/* ============================================
   BRAND-SPECIFIC FIELDS ANIMATION
   ============================================ */

#economyFormulaGroup,
#voucherIdNumericGroup {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   REQUIRED FIELD INDICATOR
   ============================================ */

.form-group label[required]::after,
.form-group label[data-required="true"]::after {
    content: " *";
    color: var(--danger);
    font-weight: bold;
}

/* ============================================
   NUMBER INPUT STYLING
   ============================================ */

input[type="number"] {
    appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ============================================
   FIELD VALIDATION STATES
   ============================================ */

.form-group .valid {
    border-color: var(--success) !important;
}

.form-group .invalid {
    border-color: var(--danger) !important;
}

.form-group .validating {
    border-color: var(--warning) !important;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

label i {
    color: var(--primary);
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

/* Estilo para input com erro de validação */
input:invalid.voucher-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(255, 61, 87, 0.1);
}

/* Estilo para input válido */
input:valid.voucher-valid {
    border-color: var(--success);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-lighter);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23697386' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 20px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================
   TABLE
   ============================================ */

.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
}

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

.campaigns-table thead {
    background: #F7F9FC;
    border-bottom: 2px solid var(--border);
}

.campaigns-table th {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.campaigns-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-primary);
}

.campaigns-table tbody tr {
    transition: var(--transition);
}

.campaigns-table tbody tr:hover {
    background: #F7F9FC;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active {
    background: #E8F5E9;
    color: var(--success);
}

.status-inactive {
    background: #FFF3E0;
    color: var(--warning);
}

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

.btn-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-action:hover {
    background: #F7F9FC;
    transform: translateY(-2px);
}

.btn-action.edit:hover {
    color: var(--primary);
}

.btn-action.delete:hover {
    color: var(--danger);
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.table-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   TABLE CELL ALIGNMENT
   ============================================ */

/* Centralizar todas as células da coluna de status e ações */
.campaigns-table td:nth-child(7),  /* Status column */
.campaigns-table td:nth-child(8) {  /* Actions column */
    text-align: center;
    vertical-align: middle;
}

/* Garantir que o conteúdo dentro dessas células também fique centralizado */
.campaigns-table td:nth-child(7) .toggle-status,
.campaigns-table td:nth-child(8) .table-actions {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Centralizar também os cabeçalhos */
.campaigns-table th:nth-child(7),
.campaigns-table th:nth-child(8) {
    text-align: center;
}

/* Ajustar para o toggle switch ficar perfeitamente centralizado */
.toggle-status {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ============================================
   TABLE BODY FIX
   ============================================ */

/* Garantir que o tbody sempre seja visível quando há dados */
#campaignsTableBody {
    display: table-row-group;
}

/* Remover qualquer estilo inline que possa estar ocultando */
#campaignsTableBody[style*="display: none"] {
    display: table-row-group !important;
}

/* ============================================
   TABLE ENHANCEMENTS
   ============================================ */

/* Garantir que todas as células tenham alinhamento vertical middle */
.campaigns-table td {
    vertical-align: middle !important;
}

/* Centralizar o conteúdo das colunas específicas */
.campaigns-table td:nth-child(1),  /* ID */
.campaigns-table td:nth-child(3),  /* Desconto */
.campaigns-table td:nth-child(4),  /* Voucher ID */
.campaigns-table td:nth-child(5),  /* Data Início */
.campaigns-table td:nth-child(6),  /* Data Fim */
.campaigns-table td:nth-child(7),  /* Status */
.campaigns-table td:nth-child(8) { /* Ações */
    text-align: center !important;
}

/* Cabeçalhos também centralizados */
.campaigns-table th:nth-child(1),
.campaigns-table th:nth-child(3),
.campaigns-table th:nth-child(4),
.campaigns-table th:nth-child(5),
.campaigns-table th:nth-child(6),
.campaigns-table th:nth-child(7),
.campaigns-table th:nth-child(8),
.campaigns-table th:nth-child(9) {
    text-align: center !important;
}

/* Apenas a coluna de NOME fica alinhada à esquerda */
.campaigns-table td:nth-child(2),
.campaigns-table th:nth-child(2) {
    text-align: left !important;
}

/* Ajuste específico para o container do toggle */
.toggle-status {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 5px 0;
}

/* Container dos botões de ação */
.table-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
}

/* ============================================
   RESPONSIVE TABLE FIX
   ============================================ */

@media (max-width: 768px) {
    /* Em telas pequenas, garantir que tudo fique legível */
    .campaigns-table td,
    .campaigns-table th {
        padding: 12px 8px !important;
    }
    
    .toggle-switch {
        transform: scale(0.9);
    }
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--success) 0%, #00BFA5 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-switch input:disabled + .toggle-slider:before {
    background-color: #f5f5f5;
}

/* Toggle status text */
.toggle-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.toggle-status-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-switch input:checked + .toggle-slider + .toggle-status-text {
    color: var(--success);
}

.toggle-switch input:not(:checked) + .toggle-slider + .toggle-status-text {
    color: #9E9E9E;
}

/* Hover effects */
.toggle-switch:hover input:not(:disabled) + .toggle-slider {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch:hover input:not(:disabled):checked + .toggle-slider {
    box-shadow: inset 0 1px 3px rgba(0, 123, 85, 0.3);
}

/* ============================================
   TABLE COLUMN WIDTH ADJUSTMENTS
   ============================================ */

.campaigns-table th:nth-child(7),
.campaigns-table td:nth-child(7) {
    width: 150px; /* Aumentado para acomodar o toggle */
    text-align: center;
}

.campaigns-table th:nth-child(8),
.campaigns-table td:nth-child(8) {
    width: 100px;
    text-align: center;
}

/* Adicionar ao styles.css */

/* Melhorar visualização dos textos na tabela */
.campaigns-table td {
    vertical-align: middle;
}

/* Estilo para texto muted */
.text-muted {
    color: var(--text-tertiary) !important;
    opacity: 0.7;
}

/* Ajustar espaçamento dos badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active {
    background: rgba(0, 200, 83, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.status-inactive {
    background: rgba(255, 165, 0, 0.1);
    color: var(--warning);
    border: 1px solid rgba(255, 165, 0, 0.2);
}

/* Ajustar botões de ação */
.btn-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.btn-action:hover {
    background: #F7F9FC;
    transform: translateY(-2px);
}

.btn-action.edit:hover {
    color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
}

.btn-action.delete:hover {
    color: var(--danger);
    background: rgba(255, 61, 87, 0.1);
}

/* Responsividade para a tabela */
@media (max-width: 1024px) {
    .campaigns-table {
        font-size: 13px;
    }
    
    .toggle-switch {
        width: 50px;
        height: 26px;
    }
    
    .toggle-slider:before {
        height: 18px;
        width: 18px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(24px);
    }
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
    padding: 20px; /* Adicionado padding para evitar tocar nas bordas em mobile */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.loading-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    min-width: 200px;
    box-shadow: var(--shadow-xl);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: var(--shadow-xl);
    margin: auto; /* Garante centralização */
}

/* ============================================
   RESPONSIVE - Modal
   ============================================ */

@media (max-width: 768px) {
    .modal {
        padding: 10px;
        align-items: flex-start; /* Em mobile, alinha no topo para melhor visualização */
        padding-top: 20px;
    }
    
    .modal-content {
        width: 95%;
        max-height: calc(100vh - 40px); /* Altura máxima considerando padding */
        margin: 0 auto;
    }
}

@media (max-height: 600px) {
    /* Para telas muito curtas */
    .modal {
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal-content {
        max-height: calc(100vh - 40px);
    }
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: #F7F9FC;
    color: var(--text-primary);
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.delete-confirm {
    text-align: center;
    padding: 20px;
}

.delete-confirm i {
    font-size: 48px;
    color: var(--warning);
    margin-bottom: 16px;
}

.delete-confirm p {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.delete-warning {
    color: var(--danger) !important;
    font-weight: 600;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ============================================
   UTILITIES
   ============================================ */

.mb-3 {
    margin-bottom: 24px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1400px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

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

    .form-group.col-span-2,
    .form-group.col-span-3 {
        grid-column: span 1;
    }

    .section-header {
        padding: 24px 24px 0;
    }

    .card {
        margin: 0 24px 24px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 0 20px;
        height: auto;
        min-height: var(--header-height);
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .header-right {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        padding: 20px 20px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card {
        margin: 0 20px 20px;
        padding: 20px;
    }

    .table-footer {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}