/* ==========================================
   MODERN THEME - Sistema de Gestão de Condomínio
   Criado para melhorar a experiência visual
   ========================================== */

/* === VARIÁVEIS DE CORES === */
:root {
    --primary-color: #4a90e2;
    --primary-dark: #357abd;
    --secondary-color: #6c757d;
    --success-color: #10b981;
    --info-color: #3b82f6;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --header-bg: #eef2f7;
    --header-text: #1f2937;
    --header-border: #d7dee8;
    --sidebar-bg: #1f2937;
    --sidebar-text: #cbd5e1;
    --sidebar-text-muted: #94a3b8;
    --sidebar-hover-bg: rgba(22, 128, 93, 0.18);
    --sidebar-active-bg: #16805d;
    --sidebar-active-text: #ecfeff;
    --accent-color: #16805d;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === TIPOGRAFIA GLOBAL === */
body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* === LAYOUT E CARDS === */
.content-wrapper {
    background-color: #f8fafc !important;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

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

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    padding: 1rem 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.card-body {
    padding: 1.5rem;
}
    letter-spacing: 0.02em;
    line-height: 1.1;
/* === BOTÕES MODERNOS === */
.btn {
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-transform: none;
    letter-spacing: 0.025em;
}

.btn:hover {
    transform: translateY(-1px);
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-md);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2563ab 100%);
}

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

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

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

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

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

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

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

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

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

.btn-secondary:hover {
    background: #5a6268;
}

/* === TABELAS MODERNAS === */
.table-responsive-sm {
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-primary);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfc;
}

.table-hover tbody tr {
    transition: var(--transition);
    cursor: default;
}

.table-hover tbody tr:hover {
    background-color: #f0f9ff !important;
    transform: scale(1.001);
}

.table-hover-cursor tbody tr:hover {
    cursor: pointer;
}

/* === DATATABLES CUSTOMIZAÇÃO === */
.dataTables_wrapper {
    padding: 1.5rem;
}

.dataTables_filter input {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
}

.dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.375rem 2rem 0.375rem 0.75rem;
}

.dataTables_info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.paginate_button {
    border-radius: 6px !important;
    margin: 0 2px !important;
}

/* === FORMULÁRIOS === */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: var(--transition);
    background-color: var(--white);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    outline: none;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* === SELECT2 MODERNO === */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: auto;
    padding: 0.375rem 0.875rem;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    line-height: 1.5;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 0.5rem;
}

.select2-dropdown {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
}

/* === MODAIS MODERNOS === */
.modal {
    z-index: 1050 !important;
}

.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-dialog {
    z-index: 1051 !important;
}

.modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background-color: #fafbfc;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Modal Backdrop com blur moderno */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1040 !important;
}

/* Garantir que modais apareçam corretamente */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

/* === ALERTAS === */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

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

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

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    border-left: 4px solid var(--info-color);
}

/* === BREADCRUMB === */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 0;
    border-radius: 8px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.125rem;
    color: var(--text-secondary);
}

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

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* === INPUT GROUP === */
.input-group {
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.input-group-prepend .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* === BADGES === */
.badge {
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

/* === TOOLTIPS === */
.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    box-shadow: var(--shadow-lg);
}

/* === CONTENT HEADER === */
.content-header {
    padding: 1.5rem 1.5rem 1rem;
    background: var(--white);
    margin-bottom: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* === BARRA DE BUSCA/FILTROS === */
.search-bar-container {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .content-header h1 {
        font-size: 1.5rem;
    }

    .btn {
        font-size: 0.8125rem;
        padding: 0.5rem 0.875rem;
    }

    .table {
        font-size: 0.8125rem;
    }

    .table thead th {
        font-size: 0.6875rem;
        padding: 0.75rem;
    }

    .table tbody td {
        padding: 0.625rem;
    }
}

/* === ANIMAÇÕES === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* === SCROLL SUAVE === */
html {
    scroll-behavior: smooth;
}

/* === SCROLLBAR CUSTOMIZADA === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* === LOADING SPINNER === */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* === MELHORIAS NO HEADER === */
.main-header.navbar,
.main-header .navbar {
    background: var(--header-bg) !important;
    border-bottom: 1px solid var(--header-border) !important;
}

.main-header .nav-link,
.main-header .navbar-nav .nav-link,
.main-header .navbar-brand,
.main-header .navbar-text,
.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-brand {
    color: var(--header-text) !important;
}

.main-header .nav-link:hover,
.main-header .navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
}

.main-header .nav-link i,
.main-header .navbar-nav .nav-link i {
    color: inherit !important;
}

.main-header .navbar-nav .user-menu .nav-link,
.main-header .navbar-nav .user-menu .nav-link span,
.main-header .navbar-nav .user-menu .nav-link .d-none {
    color: var(--header-text) !important;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-brand img {
    border-radius: 8px;
}

/* === SIDEBAR === */
.main-sidebar {
    background-color: var(--sidebar-bg) !important;
}

.main-sidebar .brand-link {
    background: var(--sidebar-bg) !important;
    color: var(--sidebar-active-text) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-sidebar .sidebar,
.main-sidebar .nav-sidebar {
    background-color: var(--sidebar-bg) !important;
}

.main-sidebar .brand-link .brand-text {
    color: var(--sidebar-active-text) !important;
    font-weight: 600;
}

.sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.nav-sidebar > .nav-item > .nav-link {
    border-radius: 8px;
    margin: 0.25rem 0.5rem;
    transition: var(--transition);
    color: var(--sidebar-text) !important;
}

.nav-sidebar > .nav-item > .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-active-text) !important;
}

.nav-sidebar > .nav-item > .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text) !important;
    box-shadow: var(--shadow-md);
}

.nav-sidebar .nav-treeview > .nav-item > .nav-link {
    color: var(--sidebar-text-muted) !important;
}

/* === CUSTOM UTILITIES === */
.shadow-modern {
    box-shadow: var(--shadow-md);
}

.rounded-modern {
    border-radius: 12px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === IMPRESSÃO === */
@media print {
    .btn, .breadcrumb, .input-group {
        display: none;
    }
}
