/* ============================================
   IMPLS - SISTEMA DE GESTÃO ESCOLAR
   CSS PURO - SEM DEPENDÊNCIAS EXTERNAS
   ============================================ */

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #06a87e;
    --danger: #ef476f;
    --warning: #f8961e;
    --info: #4cc9f0;
    --dark: #1a1e2b;
    --darker: #0f1119;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-hover: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f0f2f5;
    color: var(--dark);
    overflow-x: hidden;
}

/* ========================================== */
/* ANIMAÇÕES */
/* ========================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================== */
/* TELA DE SPLASH */
/* ========================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease-out;
}

.splash-content {
    text-align: center;
    color: white;
    animation: fadeInUp 1s ease-out;
}

.splash-logo {
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    backdrop-filter: blur(10px);
    animation: pulse 1.5s infinite;
    font-size: 60px;
}

.splash-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.splash-content .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.splash-progress {
    width: 200px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.splash-progress-bar {
    height: 100%;
    background: white;
    width: 0%;
    animation: loading 2s ease-out forwards;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ========================================== */
/* TELA DE LOGIN */
/* ========================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: rgba(255,255,255,0.98);
    border-radius: 30px;
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.8s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-lg);
    font-size: 40px;
    color: white;
}

.login-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.login-card .subtitle {
    color: var(--gray);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--gradient-hover);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
    color: var(--gray);
    font-size: 0.85rem;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid transparent;
}

.alert-danger {
    background: #f8d7da;
    border-color: #ef476f;
    color: #721c24;
}

/* ========================================== */
/* SIDEBAR */
/* ========================================== */
.sidebar {
    background: linear-gradient(180deg, #1a1e2b 0%, #0f1119 100%);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.sidebar-logo-text h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.sidebar-logo-text p {
    color: var(--gray);
    font-size: 0.7rem;
    margin: 0;
}

.sidebar-menu {
    padding: 15px;
}

.sidebar-menu .menu-section-title {
    color: var(--gray);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 15px 6px;
    font-weight: 600;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: #a0a0b0;
    border-radius: 12px;
    transition: all 0.3s;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu .nav-link.active {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.sidebar-menu .divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 10px 15px;
}

/* ========================================== */
/* MAIN CONTENT */
/* ========================================== */
.main-content {
    margin-left: 260px;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Top Bar */
.top-bar {
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

.page-title p {
    color: var(--gray);
    font-size: 0.85rem;
    margin: 2px 0 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.user-details h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.user-details small {
    font-size: 11px;
    color: #888;
}

/* ========================================== */
/* CARDS */
/* ========================================== */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.stat-info p {
    color: var(--gray);
    margin: 2px 0 0;
    font-size: 14px;
}

.stat-trend {
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
}

.content-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 16px;
}

/* ========================================== */
/* BOTÕES */
/* ========================================== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary { background: var(--gradient); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #05906b; transform: translateY(-2px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #d6305a; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #e08a1a; }

.btn-secondary { background: #e9ecef; color: #333; }
.btn-secondary:hover { background: #dde1e6; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ========================================== */
/* TABELAS */
/* ========================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table thead {
    background: #f8f9fa;
}

table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
}

table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

table tbody tr:hover {
    background: #f8f9fa;
}

/* ========================================== */
/* BADGES */
/* ========================================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: var(--success); color: white; }
.badge-danger { background: var(--danger); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-info { background: var(--info); color: white; }
.badge-secondary { background: #6c757d; color: white; }
.badge-primary { background: var(--primary); color: white; }

/* ========================================== */
/* GRID RESPONSIVO */
/* ========================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col { flex: 1; padding: 0 10px; }
.col-1 { flex: 0 0 8.33%; max-width: 8.33%; padding: 0 10px; }
.col-2 { flex: 0 0 16.66%; max-width: 16.66%; padding: 0 10px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 10px; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; padding: 0 10px; }
.col-5 { flex: 0 0 41.66%; max-width: 41.66%; padding: 0 10px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 10px; }
.col-7 { flex: 0 0 58.33%; max-width: 58.33%; padding: 0 10px; }
.col-8 { flex: 0 0 66.66%; max-width: 66.66%; padding: 0 10px; }
.col-9 { flex: 0 0 75%; max-width: 75%; padding: 0 10px; }
.col-10 { flex: 0 0 83.33%; max-width: 83.33%; padding: 0 10px; }
.col-11 { flex: 0 0 91.66%; max-width: 91.66%; padding: 0 10px; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; }

.g-1 { gap: 5px; }
.g-2 { gap: 10px; }
.g-3 { gap: 15px; }
.g-4 { gap: 20px; }

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

.text-center { text-align: center; }
.text-start { text-align: left; }
.text-end { text-align: right; }
.text-muted { color: #888; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }

.w-100 { width: 100%; }
.d-block { display: block; }
.d-none { display: none; }

/* ========================================== */
/* RESPONSIVO */
/* ========================================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex !important;
    }
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--gradient);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 2rem;
        margin: 20px;
    }
    .row {
        flex-direction: column;
    }
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========================================== */
/* SCROLLBAR */
/* ========================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f2f5; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ========================================== */
/* IMPRESSÃO */
/* ========================================== */
@media print {
    .sidebar, .sidebar-toggle, .sidebar-overlay, .btn, .top-bar .btn {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .stat-card, .content-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
}