/**
 * =========================================================================
 * SGP - SISTEMA DE GESTÃO DE PRESTADORES
 * Arquivo: assets/css/style.css
 * Descrição: Estilos customizados do sistema
 * =========================================================================
 */

/* =========================================================================
   VARIÁVEIS CSS - PALETA DE CORES
   ========================================================================= */
:root {
    /* Cores Primárias */
    --primary: #007bff;
    --primary-hover: #0056b3;
    --primary-light: #e3f2fd;
    
    /* Cores Secundárias */
    --secondary: #6c757d;
    --secondary-hover: #545b62;
    
    /* Cores de Status */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Cores de Fundo e Texto */
    --bg-body: #f8f9fa;
    --bg-white: #ffffff;
    --bg-dark: #343a40;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-light: #f8f9fa;
    
    /* Sombras */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.125);
    
    /* Bordas */
    --border-radius: 8px;
    --border-color: #dee2e6;
    
    /* Dimensões */
    --sidebar-width: 250px;
    --topbar-height: 60px;
    
    /* Transições */
    --transition: all 0.3s ease;
}

/* =========================================================================
   RESET E BASE
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.9375rem; /* Ajuste para fonte padrão ligeiramente menor e mais elegante (15px) */
}

/* Utilitários de Peso de Fonte */
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }

/* =========================================================================
   LAYOUT PRINCIPAL
   ========================================================================= */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

.page-content {
    flex: 1;
    padding: 20px;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

/* Marca / Logo */
.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand a {
    color: var(--text-light);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 8px;
}

.sidebar-title {
    font-size: 1.1rem;
}

.sidebar-title small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Navegação */
.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: rgba(0, 123, 255, 0.2);
    color: var(--text-light);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Separadores do Menu */
.nav-separator {
    padding: 15px 20px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Rodapé da Sidebar */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* =========================================================================
   TOPBAR
   ========================================================================= */
.topbar {
    background: var(--bg-white);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

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

/* =========================================================================
   FOOTER
   ========================================================================= */
.page-footer {
    background: var(--bg-white);
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

/* =========================================================================
   CARDS
   ========================================================================= */
.card {
    background: var(--bg-white);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: var(--transition);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
}

/* Cards de Dashboard */
.dashboard-card {
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

.dashboard-card.card-success { border-left-color: var(--success); }
.dashboard-card.card-warning { border-left-color: var(--warning); }
.dashboard-card.card-danger { border-left-color: var(--danger); }
.dashboard-card.card-info { border-left-color: var(--info); }

.dashboard-card .card-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.dashboard-card .card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-card .card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================================================
   TABELAS
   ========================================================================= */
.table-container {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 12px;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
}

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

/* Botões de Ação na Tabela */
.btn-action {
    padding: 4px 8px;
    font-size: 0.875rem;
    margin: 0 2px;
}

/* DataTables Customização */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--border-radius);
    padding: 6px 12px;
}

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

/* =========================================================================
   FORMULÁRIOS
   ========================================================================= */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}

.invalid-feedback {
    font-size: 0.8rem;
}

/* =========================================================================
   BOTÕES
   ========================================================================= */
.btn {
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

/* =========================================================================
   BADGES
   ========================================================================= */
.badge {
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 50px;
}

/* =========================================================================
   ALERTAS
   ========================================================================= */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success { border-left-color: var(--success); }
.alert-danger { border-left-color: var(--danger); }
.alert-warning { border-left-color: var(--warning); }
.alert-info { border-left-color: var(--info); }

/* =========================================================================
   PÁGINA DE LOGIN
   ========================================================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

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

.login-logo img {
    max-width: 80px;
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form .form-control {
    height: 50px;
    padding-left: 45px;
}

.login-form .input-group-icon {
    position: relative;
}

.login-form .input-group-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 10;
}

.login-form .btn-login {
    height: 50px;
    font-size: 1rem;
    font-weight: 600;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* =========================================================================
   RESPONSIVIDADE
   ========================================================================= */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table-container {
        padding: 15px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

/* =========================================================================
   UTILITÁRIOS
   ========================================================================= */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Formas de Ícones e Backgrounds Sutis */
.icon-shape {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-lg {
    width: 72px;
    height: 72px;
}
.icon-shape i {
    line-height: 0;
}

.bg-primary-subtle { background-color: rgba(0, 123, 255, 0.1) !important; color: var(--primary) !important; }
.bg-success-subtle { background-color: rgba(40, 167, 69, 0.1) !important; color: var(--success) !important; }
.bg-warning-subtle { background-color: rgba(255, 193, 7, 0.1) !important; color: var(--warning) !important; }
.bg-danger-subtle { background-color: rgba(220, 53, 69, 0.1) !important; color: var(--danger) !important; }
.bg-info-subtle { background-color: rgba(23, 162, 184, 0.1) !important; color: var(--info) !important; }

/* Transições Suaves */
.transition-all { transition: var(--transition); }
.hover-translate-y:hover { transform: translateY(-5px); }
.hover-shadow:hover { box-shadow: var(--shadow) !important; }
