/* assets/css/style.css */

/* ============================================
   VARIÁVEIS E RESET
   ============================================ */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --sidebar-width: 260px;
    --header-height: 60px;
}

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

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

/* Sidebar melhorada */
.sidebar {
    min-height: calc(100vh - var(--header-height));
    background: linear-gradient(135deg, #2c3e50 0%, #1a2632 100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.sidebar .nav-link {
    color: #ecf0f1;
    padding: 0.875rem 1.25rem;
    margin: 0.25rem 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Logo na sidebar */
.sidebar .sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar .sidebar-header h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
}

.sidebar .sidebar-header p {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    margin: 5px 0 0;
}

/* Navbar superior */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #2c3e50 0%, #1a2632 100%) !important;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar-brand i {
    margin-right: 8px;
}

/* Conteúdo principal */
.content-wrapper {
    padding: 20px;
    min-height: calc(100vh - var(--header-height));
}

/* ============================================
   CARDS E ESTATÍSTICAS
   ============================================ */
.card-stats {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card-stats:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.card-stats .card-body {
    padding: 1.5rem;
}

.card-stats .stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
}

.card-stats .stats-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0;
}

.card-stats .stats-title {
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cores específicas para cards de estatísticas */
.card-stats.bg-primary-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-stats.bg-success-gradient {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.card-stats.bg-warning-gradient {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.card-stats.bg-info-gradient {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

/* ============================================
   TABELAS
   ============================================ */
.table-custom {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table-custom thead th {
    background-color: var(--dark-color);
    color: white;
    border: none;
    padding: 12px 15px;
    font-weight: 600;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease;
}

.table-custom tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

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

/* Status badges */
.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending {
    background-color: #ffc107;
    color: #856404;
}

.badge-completed {
    background-color: #28a745;
    color: white;
}

.badge-sent {
    background-color: #17a2b8;
    color: white;
}

.badge-cancelled {
    background-color: #dc3545;
    color: white;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.form-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    border: none;
}

.form-card .card-header i {
    margin-right: 8px;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Botões */
.btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #bb2d3b);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #198754, #157347);
    border: none;
}

/* ============================================
   MODO ESCURO (Dark Mode)
   ============================================ */
body.dark-mode {
    background-color: #1a1a2e;
    color: #eee;
}

body.dark-mode .card,
body.dark-mode .table-custom,
body.dark-mode .form-card {
    background-color: #16213e;
    color: #eee;
}

body.dark-mode .table-custom tbody tr:hover {
    background-color: rgba(255,255,255,0.05);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #0f3460;
    border-color: #1a1a2e;
    color: #eee;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 1000;
        width: 250px;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .card-stats .stats-number {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   SCROLLBAR PERSONALIZADA
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

/* ============================================
   IMPRESSÃO
   ============================================ */
@media print {
    .sidebar, .navbar, .no-print, .btn, .card-header .btn {
        display: none !important;
    }
    
    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    body {
        background-color: white !important;
    }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avatar-sm {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-md {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}