/* ===== VFTMAIL GLOBAL CSS - SISTEMA UNIFICADO ===== */

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

/* Variáveis CSS */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Configurações globais */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Layout principal */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar .logo {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.sidebar .logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.sidebar .logo img {
    max-width: 120px;
    height: auto;
}

.sidebar ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar ul li {
    margin: 0;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: var(--gray-100);
    color: var(--primary-color);
    border-left-color: var(--secondary-color);
    transform: translateX(5px);
}

.sidebar ul li strong {
    font-weight: 600;
    color: var(--primary-color);
    background: var(--gray-100);
    padding: 0.5rem 2rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar ul li ul {
    background: var(--gray-50);
    margin: 0;
    padding: 0;
}

.sidebar ul li ul li a {
    padding: 0.75rem 2rem 0.75rem 3rem;
    font-size: 0.9rem;
    border-left: none;
    background: transparent;
}

.sidebar ul li ul li a:hover {
    background: var(--gray-100);
    color: var(--primary-color);
    transform: none;
}

/* Main content */
.main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    transition: var(--transition);
}

/* Header */
.header {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

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

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: var(--gray-100);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

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

.card-body {
    padding: 2rem;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .label {
    color: var(--gray-600);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.table th {
    background: var(--gray-100);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Tabela compacta */
.table-compact th {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.table-compact td {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.table-compact .form-check-input {
    width: 0.875rem;
    height: 0.875rem;
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

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

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

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

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1050;
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .login-container {
        padding: 2rem;
        margin: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--border-radius);
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-color);
    color: var(--white);
}

.badge-danger {
    background: var(--accent-color);
    color: var(--white);
}

.badge-warning {
    background: var(--warning-color);
    color: var(--white);
}

.badge-info {
    background: var(--info-color);
    color: var(--white);
}

.badge-secondary {
    background: var(--gray-600);
    color: var(--white);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination .page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.pagination .page-link:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.pagination .page-link.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
}

.pagination .page-link.disabled {
    color: var(--gray-500);
    cursor: not-allowed;
    background: var(--gray-100);
}

.pagination-container {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.pagination-info {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Sidebar menu styles */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    gap: 0.75rem;
}

.menu-link:hover,
.menu-link.active {
    background: var(--gray-100);
    color: var(--primary-color);
    border-left-color: var(--secondary-color);
    transform: translateX(5px);
}

.menu-link.logout-link {
    color: var(--accent-color);
    border-top: 1px solid var(--gray-200);
    margin-top: 1rem;
}

.menu-link.logout-link:hover {
    background: #fdf2f2;
    color: var(--accent-color);
}

.submenu-toggle {
    justify-content: space-between;
}

.submenu-arrow {
    transition: var(--transition);
    font-size: 0.8rem;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    background: var(--gray-50);
}

.submenu.active {
    max-height: 500px;
}

.submenu li {
    margin: 0;
}

.submenu li a {
    padding: 0.75rem 2rem 0.75rem 3rem;
    font-size: 0.9rem;
    border-left: none;
    background: transparent;
}

.submenu li a:hover {
    background: var(--gray-100);
    color: var(--primary-color);
    transform: none;
}

/* Sidebar colapsado */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .logo img {
    max-width: 40px;
}

.sidebar.collapsed .menu-text,
.sidebar.collapsed .submenu-arrow {
    display: none;
}

.sidebar.collapsed .menu-link {
    padding: 1rem 1.5rem;
    justify-content: center;
}

.sidebar.collapsed .submenu {
    position: absolute;
    left: 100%;
    top: 0;
    width: 200px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: 0 8px 8px 0;
    max-height: none;
    display: none;
    z-index: 1001;
}

/* DESABILITADO - Causava comportamento inadequado de hover
.sidebar.collapsed .menu-item:hover .submenu {
    display: block;
}
*/

.sidebar.collapsed .submenu li a {
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.sidebar.collapsed .submenu li a .menu-text {
    display: inline;
}

/* Responsividade do menu */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1050;
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1051;
        background: var(--secondary-color);
        color: var(--white);
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
    }
    
    .main {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }
}

/* Sistema de Abas */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

.nav-link.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    background: var(--white);
}

.tab-content {
    padding: 2rem 0;
}

.tab-pane {
    display: none;
}

.tab-pane.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: block;
}

/* Form checkboxes */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-check-input {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    margin: 0;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.modal.show {
    display: block;
}

.modal-dialog {
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 2rem;
}

/* List group */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.list-group-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: var(--gray-50);
}

/* Row and column utilities */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-md-2,
.col-md-3,
.col-md-4,
.col-md-6,
.col-md-8 {
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }

@media (max-width: 768px) {
    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .row {
        margin: 0;
    }
    
    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        padding: 0;
    }
}
