/* ====================================
   DESIGN SYSTEM - OUVIDORIA MODERNA
   ==================================== */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --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: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Container Principal */
.ouvidoria-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header da Página */
.page-header-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
    animation: slideDown 0.4s ease-out;
}

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

.page-header-modern .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header-modern .header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header-modern .header-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.page-header-modern h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.page-header-modern .header-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin: 4px 0 0 0;
}

/* Botões Modernos */
.btn-modern {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-modern:active {
    transform: translateY(0);
}

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

.btn-modern-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-modern-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-modern-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-modern-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-modern-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-modern-outline:hover {
    background: var(--primary-gradient);
    color: white;
}

.btn-modern-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-modern-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* Cards Modernos */
.card-modern {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 24px;
    border: none;
    transition: all 0.3s ease;
}

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

.card-modern-header {
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-100);
}

.card-modern-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-modern-title i {
    color: var(--primary-color);
}

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

.form-label-modern {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-label-modern i {
    margin-right: 6px;
    color: var(--primary-color);
}

.form-label-modern .required {
    color: var(--danger-color);
    margin-left: 4px;
}

.form-control-modern {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.3s;
    background: var(--gray-50);
    color: var(--gray-800);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control-modern::placeholder {
    color: var(--gray-400);
}

/* Selects - fundo branco e texto escuro */
select.form-control-modern {
    background: white !important;
    color: #1f2937 !important;
}

.form-select-modern {
    appearance: none;
    background-color: white !important;
    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='%236b7280' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
    color: #1f2937 !important;
}

/* Forçar opções do select com texto escuro */
select.form-control-modern option,
select.form-select-modern option,
.form-control-modern.form-select-modern option {
    color: #000000 !important;
    background-color: #ffffff !important;
    font-weight: normal !important;
}

/* Tabelas Modernas */
.table-modern-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: visible;
    margin-bottom: 24px;
}

.table-modern {
    width: 100%;
    margin: 0;
    table-layout: auto;
}

.table-modern thead {
    background: var(--primary-gradient);
    color: white;
}

.table-modern thead th {
    padding: 8px 1px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0;
    border: none;
}

.table-modern tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s;
}

.table-modern tbody tr:hover {
    background: var(--gray-50);
}

.table-modern tbody td {
    padding: 6px 1px;
    color: var(--gray-700);
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Larguras específicas de cada coluna em porcentagens */
.table-modern thead th:nth-child(1),
.table-modern tbody td:nth-child(1) {
    width: 7.5%;
}

.table-modern thead th:nth-child(2),
.table-modern tbody td:nth-child(2) {
    width: 10%;
}

.table-modern thead th:nth-child(3),
.table-modern tbody td:nth-child(3) {
    width: 7.5%;
}

.table-modern thead th:nth-child(4),
.table-modern tbody td:nth-child(4) {
    width: 11%;
}

.table-modern thead th:nth-child(5),
.table-modern tbody td:nth-child(5) {
    width: 6.5%;
    text-align: center;
}

.table-modern thead th:nth-child(6),
.table-modern tbody td:nth-child(6) {
    width: 4.5%;
    text-align: center;
}

.table-modern thead th:nth-child(7),
.table-modern tbody td:nth-child(7) {
    width: 8.5%;
}

.table-modern thead th:nth-child(8),
.table-modern tbody td:nth-child(8) {
    width: 8.5%;
}

.table-modern thead th:nth-child(9),
.table-modern tbody td:nth-child(9) {
    width: 5.5%;
    text-align: center;
}

/* Badges Modernos */
.badge-modern {
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-modern-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.badge-modern-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.badge-modern-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.badge-modern-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.badge-modern-primary {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
}

/* Filtros de Pesquisa */
.filter-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 24px;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    cursor: pointer;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
}

.filter-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-section-title i {
    color: var(--primary-color);
}

.filter-toggle-icon {
    color: var(--gray-400);
    transition: transform 0.3s;
}

.filter-toggle-icon.active {
    transform: rotate(180deg);
}

.filter-section-body {
    padding-top: 20px;
}

/* Alertas Modernos */
.alert-modern {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
    animation: alertSlide 0.4s ease-out;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-modern i {
    font-size: 24px;
}

.alert-modern-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
    color: #065f46;
}

.alert-modern-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #ef4444;
    color: #991b1b;
}

.alert-modern-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-modern-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #3b82f6;
    color: #1e40af;
}

/* Ações da Tabela */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-action {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 9px;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-action-view {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-action-edit {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-action-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

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

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

    .page-header-modern {
        padding: 20px;
    }

    .page-header-modern h1 {
        font-size: 24px;
    }

    .page-header-modern .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-modern {
        padding: 16px;
    }

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

    .action-buttons {
        justify-content: center;
    }

    .table-modern-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-modern thead th {
        font-size: 9px;
        padding: 8px 4px;
    }

    .table-modern tbody td {
        padding: 8px 4px;
        font-size: 10px;
    }

    .badge-modern {
        font-size: 9px;
        padding: 4px 8px;
    }
}

/* DataTables Customização */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin: 0 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    margin: 0 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-gradient) !important;
    border: none !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--gray-600);
    font-size: 14px;
}
