:root {
    --primary-color: #1D360C;
    --secondary-color: #F7F31C;
    --accent-color: #2E5C1D;
    --text-light: #F0F0F0;
    --text-dark: #333333;
    --background-light: #FFFFFF;
    --background-dark: #0A1A05;
    --sidebar-width: 280px;
    --header-height: 70px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Layout Principal */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    color: var(--text-light);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(247, 243, 28, 0.2);
    background: var(--background-dark);
}

.sidebar-header img {
    height: 50px;
    margin-bottom: 15px;
}

.sidebar-header h3 {
    color: var(--secondary-color);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.sidebar-header p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
    position: relative;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: rgba(247, 243, 28, 0.1);
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
}

.sidebar-menu a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.badge {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: auto;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    background: #f8f9fa;
}

/* Header */
.content-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.content-header h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.content-header p {
    color: #666;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    color: var(--primary-color);
}

.user-info i {
    margin-right: 8px;
    color: var(--accent-color);
}

/* Alertas */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 20px 30px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Cards de Estatísticas */
.dashboard-stats {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(247, 243, 28, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    background: #d4edda;
    color: #155724;
}

.stat-change.negative {
    background: #f8d7da;
    color: #721c24;
}

/* Grid de Conteúdo */
.content-grid {
    padding: 0 30px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.card-body {
    padding: 25px;
}

/* Listas */
.distribution-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.distribution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.distribution-item:last-child {
    border-bottom: none;
}

.route-name {
    font-weight: 500;
    color: var(--primary-color);
}

.route-percentage {
    font-weight: 600;
    color: var(--secondary-color);
}

.message-list,
.access-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item,
.access-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email {
    color: #666;
    font-size: 0.9rem;
}

.subject {
    color: var(--primary-color);
    font-weight: 500;
}

.access-route {
    font-weight: 500;
    color: var(--primary-color);
}

.access-time {
    color: #666;
    font-size: 0.9rem;
}

/* Ações Rápidas */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
    text-align: center;
}

.action-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.action-btn span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Estados Vazios */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Botões */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: #e6e219;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Tabelas */
.data-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 30px;
}

.table-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    color: var(--primary-color);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--primary-color);
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8f9fa;
}

/* Ações */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Modais */
.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    margin-bottom: 20px;
}

/* Login */
.login-body {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header img {
    height: 60px;
    margin-bottom: 15px;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    background: #e6e219;
    transform: translateY(-2px);
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 10px;
        border-radius: 6px;
        cursor: pointer;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        padding: 0 20px 20px;
    }
    
    .data-table {
        margin: 20px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
}

/* Utilitários */
.text-muted {
    color: #999 !important;
    font-style: italic;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}