/* ============================================
   STYLE CSS - Sistema de Informação Escolar
   ============================================ */

/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== ROOT VARIABLES ===== */
:root {
    --primary: #4e73df;
    --primary-dark: #2e59d9;
    --secondary: #858796;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --light: #f8f9fc;
    --dark: #5a5c69;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #4e73df;
    --sidebar-width: 260px;
    --header-height: 65px;
    --border-radius: 12px;
    --shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: loginBg 15s linear infinite;
}

@keyframes loginBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card .logo-section {
    text-align: center;
    margin-bottom: 35px;
}

.login-card .logo-section .logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4e73df, #764ba2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 36px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(78, 115, 223, 0.4);
}

.login-card .logo-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
}

.login-card .logo-section p {
    color: #94a3b8;
    font-size: 14px;
}

.login-card .form-group {
    margin-bottom: 20px;
    position: relative;
}

.login-card .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-card .form-group .input-wrapper {
    position: relative;
}

.login-card .form-group .input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    transition: var(--transition);
}

.login-card .form-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: #f8fafc;
    color: #1e293b;
}

.login-card .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(78, 115, 223, 0.1);
}

.login-card .form-group input:focus + i,
.login-card .form-group input:focus ~ i {
    color: var(--primary);
}

.login-card .btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4e73df, #764ba2);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.login-card .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(78, 115, 223, 0.4);
}

.login-card .btn-login:active {
    transform: translateY(0);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #e2e8f0;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-header .sidebar-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #4e73df, #36b9cc);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header .sidebar-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.sidebar-header .sidebar-subtitle {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu .menu-category {
    padding: 12px 24px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
}

.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 11px 24px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    gap: 12px;
    cursor: pointer;
}

.sidebar-menu .menu-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: #4e73df;
}

.sidebar-menu .menu-item.active {
    background: rgba(78, 115, 223, 0.15);
    color: #4e73df;
    border-left-color: #4e73df;
    font-weight: 600;
}

.sidebar-menu .menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-menu .menu-item .menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

/* ===== HEADER ===== */
.main-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: #fff;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.06);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    transition: var(--transition);
}

.main-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-header .header-left .toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #475569;
    cursor: pointer;
    padding: 5px;
}

.main-header .header-left h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.main-header .header-left .breadcrumb-text {
    font-size: 13px;
    color: #94a3b8;
}

.main-header .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-header .header-right .header-notification {
    position: relative;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: var(--transition);
}

.main-header .header-right .header-notification:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.main-header .header-right .header-notification .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.header-profile:hover {
    background: #f1f5f9;
}

.header-profile .profile-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4e73df, #36b9cc);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.header-profile .profile-info {
    text-align: left;
}

.header-profile .profile-info .profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.header-profile .profile-info .profile-role {
    font-size: 11px;
    color: #94a3b8;
    text-transform: capitalize;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
    transition: var(--transition);
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header .page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.page-header .page-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 2px;
}

/* ===== STAT CARDS ===== */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--success); }
.stat-card.yellow::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }
.stat-card.cyan::before { background: var(--info); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card.blue .stat-icon { background: rgba(78, 115, 223, 0.1); color: var(--primary); }
.stat-card.green .stat-icon { background: rgba(28, 200, 138, 0.1); color: var(--success); }
.stat-card.yellow .stat-icon { background: rgba(246, 194, 62, 0.1); color: var(--warning); }
.stat-card.red .stat-icon { background: rgba(231, 74, 59, 0.1); color: var(--danger); }
.stat-card.cyan .stat-icon { background: rgba(54, 185, 204, 0.1); color: var(--info); }

.stat-card .stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-info p {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

/* ===== CONTENT CARD ===== */
.content-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.content-card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.content-card .card-header h5 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card .card-header h5 i {
    color: var(--primary);
}

.content-card .card-body {
    padding: 24px;
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: #f8fafc;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody td:first-child {
    font-weight: 600;
    color: #1e293b;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: rgba(28, 200, 138, 0.12); color: #0f9d58; }
.badge-danger { background: rgba(231, 74, 59, 0.12); color: #e74a3b; }
.badge-warning { background: rgba(246, 194, 62, 0.12); color: #c49a1c; }
.badge-info { background: rgba(54, 185, 204, 0.12); color: #1a8a9b; }
.badge-primary { background: rgba(78, 115, 223, 0.12); color: #4e73df; }
.badge-secondary { background: rgba(133, 135, 150, 0.12); color: #858796; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-secondary { background: #e2e8f0; color: #475569; }

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-group {
    display: flex;
    gap: 6px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: #fff;
    color: #1e293b;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 16px) center;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ===== ALERT ===== */
.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(28, 200, 138, 0.12); color: #0f9d58; border: 1px solid rgba(28, 200, 138, 0.2); }
.alert-danger { background: rgba(231, 74, 59, 0.12); color: #e74a3b; border: 1px solid rgba(231, 74, 59, 0.2); }
.alert-warning { background: rgba(246, 194, 62, 0.12); color: #c49a1c; border: 1px solid rgba(246, 194, 62, 0.2); }
.alert-info { background: rgba(54, 185, 204, 0.12); color: #1a8a9b; border: 1px solid rgba(54, 185, 204, 0.2); }

/* ===== USER AVATAR ===== */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #cbd5e1;
}

.empty-state h5 {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* ===== FOOTER ===== */
.main-footer {
    padding: 20px 30px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== MODAL CONFIRM ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .main-header .header-left .toggle-sidebar {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 20px 15px;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 30px 25px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== SEARCH BOX ===== */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box input {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== PROFILE PHOTO TABLE ===== */
.photo-thumb {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1100;
    border: 1px solid #e2e8f0;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #475569;
    border-radius: 8px;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.dropdown-menu a i {
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 0;
}

/* ===== CHARTS WRAPPER ===== */
.chart-container {
    position: relative;
    height: 300px;
}

/* ===== QUICK INFO ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}

.info-item .info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.info-item .info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}