/* Reset e Variáveis */
:root {
    --primary: #1e3c72;
    --secondary: #2a5298;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --purple: #6f42c1;
    --dark: #1e1e1e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --sidebar-width: 280px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 25px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header img.logo-icon {
    width: 10px !important;
    height: 20px !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.login-header h1 {
    font-size: 32px;
    margin: 10px 0;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

.login-form {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 8px;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.alert i {
    margin-right: 10px;
    font-size: 20px;
}

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

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

.login-footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #6c757d;
}

.version {
    margin-top: 5px;
    font-size: 11px;
    opacity: 0.7;
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, #2d2d2d 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}

.sidebar-header h3 {
    font-size: 24px;
    margin: 0;
}

.user-profile {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-info strong {
    display: block;
    font-size: 16px;
}

.user-info small {
    display: block;
    opacity: 0.7;
    font-size: 12px;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu li a.active {
    background: var(--primary);
    color: white;
}

.sidebar-menu li a i {
    width: 25px;
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-menu .badge {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

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

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

.menu-divider {
    padding: 20px 20px 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.5;
    letter-spacing: 1px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s;
    text-decoration: none;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

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

.topbar {
    height: var(--topbar-height);
    background: white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.page-title {
    font-size: 24px;
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #e8f5e9;
    border-radius: 20px;
    font-size: 13px;
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.notification-icon {
    position: relative;
    cursor: pointer;
    font-size: 22px;
    color: #555;
    transition: all 0.3s;
}

.notification-icon:hover {
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.content {
    padding: 30px;
    flex: 1;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-danger { background: var(--danger); }
.bg-warning { background: var(--warning); }
.bg-info { background: var(--info); }
.bg-purple { background: var(--purple); }

.stat-content h3 {
    font-size: 32px;
    margin: 0 0 5px;
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
}

.card-header i {
    margin-right: 10px;
    color: var(--primary);
}

.card-body {
    padding: 25px;
}

/* Grid Layout */
.row {
    display: flex;
    margin: 0 -10px;
    flex-wrap: wrap;
}

.col-md-4 { flex: 0 0 33.333%; padding: 0 10px; }
.col-md-6 { flex: 0 0 50%; padding: 0 10px; }
.col-md-8 { flex: 0 0 66.666%; padding: 0 10px; }
.col-md-12 { flex: 0 0 100%; padding: 0 10px; }

.mt-4 { margin-top: 20px; }

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom: 2px solid #e0e0e0;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Badge */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary { background: var(--primary); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-danger { background: var(--danger); color: white; }
.badge-warning { background: var(--warning); color: #000; }
.badge-info { background: var(--info); color: white; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast i {
    font-size: 20px;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-error i { color: var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning i { color: var(--warning); }
.toast-info { border-left: 4px solid var(--info); }
.toast-info i { color: var(--info); }

.toast button {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal.active {
    display: flex;
}

.modal-dialog {
    width: 90%;
    max-width: 600px;
}

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

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Ranking List */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ranking-position {
    width: 35px;
    height: 35px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.ranking-info {
    flex: 1;
}

.ranking-info strong {
    display: block;
}

.ranking-info small {
    color: #6c757d;
}

.ranking-medal {
    font-size: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .btn-menu-toggle {
        display: block;
    }
    
    .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        flex: 0 0 100%;
    }
}

.text-center { text-align: center; }
.text-muted { color: #6c757d; }
