/* Reset e configurações básicas */
*{margin: 0;padding: 0;box-sizing: border-box;}

body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
line-height: 1.6;
font-size: 14px;
font-weight: 400;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

/* Variáveis CSS */
:root {
--primary-color: #1e3a8a;
--primary-light: #3b82f6;
--secondary-color: #1f2937;
--success-color: #10b981;
--danger-color: #ef4444;
--warning-color: #f59e0b;
--info-color: #06b6d4;
--text-color: #374151;
--text-light: #6b7280;
--text-white: #ffffff;
--bg-color: #f8fafc;
--white: #ffffff;
--border-color: #e5e7eb;
--sidebar-bg: #1e293b;
--sidebar-hover: #334155;
--sidebar-active: #0f172a;
--sidebar-width: 250px;
--header-height: 60px;
--chart-blue: #3b82f6;
--chart-green: #10b981;
--chart-red: #ef4444;
--chart-yellow: #f59e0b;
--chart-purple: #8b5cf6;
--chart-cyan: #06b6d4;
}

/* Layout principal */
.app-container {
display: flex;
min-height: 100vh;
}

/* Header */
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--header-height);
background: var(--white);
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
z-index: 1000;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-left {
display: flex;
align-items: center;
gap: 15px;
}

.logo {
font-size: 20px;
font-weight: bold;
color: var(--primary-color);
}

.header-right {
display: flex;
align-items: center;
gap: 15px;
}

.user-info {
display: flex;
align-items: center;
gap: 10px;
color: var(--text-color);
}

.user-info .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Sidebar */
.sidebar {
position: fixed;
top: var(--header-height);
left: 0;
width: var(--sidebar-width);
height: calc(100vh - var(--header-height));
background: var(--sidebar-bg);
border-right: none;
overflow-y: auto;
z-index: 999;
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-nav {
padding: 20px 0;
}

.nav-item {
display: block;
padding: 12px 20px;
color: #cbd5e1;
text-decoration: none;
transition: all 0.3s ease;
border-left: 3px solid transparent;
font-weight: 500;
}

.nav-item:hover {
background: var(--sidebar-hover);
color: var(--text-white);
border-left-color: var(--primary-light);
}

.nav-item.active {
background: var(--sidebar-active);
color: var(--text-white);
border-left-color: var(--primary-light);
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.nav-item i {
margin-right: 10px;
width: 16px;
}

/* Conteúdo principal */
.main-content {
margin-left: var(--sidebar-width);
margin-top: var(--header-height);
padding: 20px;
flex: 1;
min-height: calc(100vh - var(--header-height));
}

/* Cards */
.card {
background: var(--white);
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
margin-bottom: 24px;
border: 1px solid rgba(226, 232, 240, 0.8);
}

.card-header {
padding: 24px 24px 20px 24px;
border-bottom: 1px solid rgba(226, 232, 240, 0.6);
display: flex;
justify-content: space-between;
align-items: center;
}

.card-title {
font-size: 20px;
font-weight: 700;
color: var(--text-color);
letter-spacing: -0.025em;
}

.card-body {
padding: 24px;
}

/* Estatísticas do Dashboard */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 30px;
}

.stat-card {
background: var(--white);
padding: 24px;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
border-left: 4px solid var(--primary-light);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card.stat-primary {
border-left-color: var(--chart-blue);
}

.stat-card.stat-success {
border-left-color: var(--chart-green);
}

.stat-card.stat-warning {
border-left-color: var(--chart-yellow);
}

.stat-card.stat-danger {
border-left-color: var(--chart-red);
}

.stat-card.stat-info {
border-left-color: var(--chart-cyan);
}

.stat-value {
font-size: 36px;
font-weight: 700;
color: var(--primary-color);
margin-bottom: 8px;
line-height: 1;
}

.stat-label {
color: var(--text-light);
font-size: 14px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}

/* Botões */
.btn {
display: inline-flex;
align-items: center;
padding: 8px 16px;
border: none;
border-radius: 4px;
font-size: 14px;
font-weight: 500;
text-decoration: none;
cursor: pointer;
transition: all 0.2s;
gap: 8px;
}

.btn-primary {
background: var(--primary-color);
color: white;
}

.btn-primary:hover {
background: #1D4ED8;
}

.btn-success {
background: var(--success-color);
color: white;
}

.btn-success:hover {
background: #059669;
}

.btn-danger {
background: var(--danger-color);
color: white;
}

.btn-danger:hover {
background: #DC2626;
}

.btn-secondary {
background: #6B7280;
color: white;
}

.btn-secondary:hover {
background: #4B5563;
}

.btn-sm {
padding: 6px 12px;
font-size: 12px;
}

/* Formulários */
.form-group {
margin-bottom: 20px;
}

.form-label {
display: block;
margin-bottom: 5px;
font-weight: 500;
color: var(--text-color);
}

.form-control {
width: 100%;
padding: 10px 12px;
border: 1px solid var(--border-color);
border-radius: 4px;
font-size: 14px;
transition: border-color 0.2s;
}

.form-control:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
background-position: right 8px center;
background-repeat: no-repeat;
background-size: 16px 12px;
padding-right: 40px;
}

/* Tabelas */
.table-container {
overflow-x: auto;
}

.table {
width: 100%;
border-collapse: collapse;
background: var(--white);
}

.table th,
.table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid var(--border-color);
}

.table th {
background: #F9FAFB;
font-weight: 600;
color: var(--text-color);
}

.table tbody tr:hover {
background: #F9FAFB;
}

/* Filtros */
.filters {
display: flex;
gap: 15px;
margin-bottom: 20px;
flex-wrap: wrap;
align-items: end;
}

.filter-group {
display: flex;
flex-direction: column;
gap: 5px;
}

/* Paginação */
.pagination {
display: flex;
justify-content: center;
gap: 5px;
margin-top: 20px;
}

.pagination a,
.pagination span {
padding: 8px 12px;
border: 1px solid var(--border-color);
text-decoration: none;
color: var(--text-color);
}

.pagination a:hover {
background: var(--primary-color);
color: white;
}

.pagination .current {
background: var(--primary-color);
color: white;
}

/* Modais */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 2000;
}

.modal.show {
display: flex;
align-items: center;
justify-content: center;
}

.modal-content {
background: var(--white);
border-radius: 6px;
max-width: 500px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
}

.modal-header {
padding: 20px;
border-bottom: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
}

.modal-title {
font-size: 18px;
font-weight: 600;
}

.modal-close {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: var(--text-light);
}

.modal-body {
padding: 20px;
}

.modal-footer {
padding: 20px;
border-top: 1px solid var(--border-color);
display: flex;
gap: 10px;
justify-content: end;
}

/* Alertas */
.alert {
padding: 12px 16px;
border-radius: 4px;
margin-bottom: 20px;
}

.alert-success {
background: #D1FAE5;
color: #065F46;
border: 1px solid #A7F3D0;
}

.alert-danger {
background: #FEE2E2;
color: #991B1B;
border: 1px solid #FECACA;
}

.alert-warning {
background: #FEF3C7;
color: #92400E;
border: 1px solid #FDE68A;
}

/* Badges */
.badge {
display: inline-block;
padding: 4px 8px;
font-size: 12px;
font-weight: 500;
border-radius: 12px;
}

.badge-success {
background: #D1FAE5;
color: #065F46;
}

.badge-danger {
background: #FEE2E2;
color: #991B1B;
}

.badge-warning {
background: #FEF3C7;
color: #92400E;
}

/* Estilos para gráficos */
.chart-container {
background: var(--white);
border-radius: 12px;
padding: 24px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
border: 1px solid rgba(226, 232, 240, 0.8);
}

.chart-title {
font-size: 18px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 16px;
text-align: center;
}

.chart-subtitle {
font-size: 14px;
color: var(--text-light);
text-align: center;
margin-bottom: 24px;
}

/* Cores para gráficos */
.chart-bar-blue { background-color: var(--chart-blue) !important; }
.chart-bar-green { background-color: var(--chart-green) !important; }
.chart-bar-red { background-color: var(--chart-red) !important; }
.chart-bar-yellow { background-color: var(--chart-yellow) !important; }
.chart-bar-purple { background-color: var(--chart-purple) !important; }
.chart-bar-cyan { background-color: var(--chart-cyan) !important; }

/* Página de login */
.login-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, var(--sidebar-bg), var(--primary-color));
}

.login-card {
background: var(--white);
padding: 40px;
border-radius: 16px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
border: 1px solid rgba(226, 232, 240, 0.8);
}

.login-title {
text-align: center;
margin-bottom: 30px;
color: var(--text-color);
font-size: 24px;
font-weight: 600;
}

.login-logo{
    width: 100%;
    height: 300px;
}

/* Menu Toggle Button */
.menu-toggle {
background: none !important;
border: none !important;
color: var(--text-color) !important;
font-size: 18px;
padding: 8px !important;
cursor: pointer;
border-radius: 4px !important;
transition: all 0.2s ease;
display: none;
}

.menu-toggle:hover {
background: var(--border-color) !important;
color: var(--primary-color) !important;
}

.menu-toggle i {
display: block;
}

/* Overlay para mobile */
.sidebar-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 998;
display: none;
opacity: 0;
transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
display: block;
opacity: 1;
}

/* Utilitários */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.desktop-view {
    display: inline-block;
}

.mobile-view {
    display: none;
}