/* Admin PHP - Estilos Customizados */

/* Select2 Custom Styles */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--default .select2-selection--multiple {
    min-height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 6px 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--primary-color);
    color: white;
}

/* DataGrid Search */
.datagrid-search {
    margin-bottom: 1rem;
}

.datagrid-search .form-control {
    border-radius: 0.375rem;
}

.table-responsive {
    border-radius: 0.35rem;
}

/* Variáveis de cores */
:root {
    --primary-color: #4e73df;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --secondary-color: #858796;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
}

/* Estilos gerais */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
}

/* Main Container - Central area divided between sidebar and content */
.main-container {
    display: flex;
    min-height: calc(100vh - 56px - 60px);
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-width: 250px;
    background-color: white;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
}

.sidebar-content {
    padding: 1rem 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 0 1.5rem;
    overflow-y: auto;
    background-color: var(--light-color);
}

.sidebar .nav-link {
    font-weight: 800;
    color: var(--dark-color);
    padding: 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.1);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.1);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, .15);
    border-radius: 0.35rem;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #e3e6f0;
    font-weight: 700;
}

.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 0.25rem solid var(--danger-color) !important;
}

/* Textos */
.text-xs {
    font-size: .7rem;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: var(--dark-color) !important;
}

/* Botões */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #17a673;
    border-color: #169b6b;
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Tabelas */
.table {
    background-color: white;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, .15);
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #e3e6f0;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

/* Formulários */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* Jumbotron */
.jumbotron {
    background-color: white;
    padding: 2rem;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, .15);
}

/* Header */
header {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, .15);
}

/* Footer */
footer {
    box-shadow: 0 -0.15rem 1.75rem 0 rgba(58, 59, 69, .15);
}

/* Alertas */
.alert {
    border-radius: 0.35rem;
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, .15);
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.5em 0.75em;
}

/* Paginação */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #e3e6f0;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Modal */
.modal-header {
    background-color: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Impressão */
@media print {
    .sidebar,
    header,
    footer,
    .btn-toolbar,
    .no-print {
        display: none !important;
    }
    
    .main-container {
        display: block !important;
    }
    
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.hamburger:hover {
    color: var(--light-color);
}

/* Responsividade */
@media (max-width: 992px) {
    .hamburger {
        display: block;
    }
    
    .main-container {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 56px;
        left: -250px;
        width: 250px;
        height: calc(100vh - 56px);
        background-color: white;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        height: calc(100vh - 56px);
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        width: 100%;
        padding: 0 1rem;
    }
    
    .sidebar .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .col-md-9 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        margin-left: 0 !important;
    }
    
    .col-lg-10 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -250px;
        width: 250px;
        height: calc(100vh - 56px);
        background-color: white;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        width: 100%;
        padding: 0 0.75rem;
    }
    
    .sidebar .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-toolbar .btn {
        margin-bottom: 0.5rem;
    }
    
    h1.h2 {
        font-size: 1.5rem;
    }
    
    .h4 {
        font-size: 1rem;
    }
    
    .col-xl-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .col-xl-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .row.g-2 > * {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-toolbar {
        width: 100%;
    }
    
    .btn-toolbar .btn {
        width: 100%;
    }
}

/* Melhorias para tablets */
@media (min-width: 769px) and (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    
    .col-md-9 {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
}

/* Ajustes para telas muito grandes */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1600px;
        margin: 0 auto;
    }
}

/* Melhorias para impressão em mobile */
@media print and (max-width: 768px) {
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
    }
}

/* Animações */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status badges */
.status-aberto {
    background-color: var(--info-color);
}

.status-confirmado {
    background-color: var(--success-color);
}

.status-cancelado {
    background-color: var(--danger-color);
}

/* Ações na tabela */
.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* Filtros */
.filter-section {
    background-color: white;
    padding: 1rem;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, .15);
    margin-bottom: 1rem;
}

/* Dashboard stats */
.stat-card {
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* Orçamento impressão */
.orcamento-header {
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.orcamento-footer {
    border-top: 2px solid var(--primary-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.orcamento-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}
