﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: var(--font-sans)
}

.wrap {
    background: #12151a;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    color: #e2e8f0
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 0.5px solid #2a2f3a
}

.title-block h2 {
    font-size: 16px;
    font-weight: 500;
    color: #f1f5f9
}

.title-block p {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px
}

.date-pill {
    background: #1e2330;
    border: 0.5px solid #2a2f3a;
    border-radius: var(--border-radius-md);
    padding: 8px 14px;
    text-align: right
}

    .date-pill .day {
        font-size: 11px;
        color: #64748b;
        letter-spacing: 0.05em
    }

    .date-pill .date-val {
        font-size: 14px;
        font-weight: 500;
        color: #94a3b8;
        margin-top: 2px
    }

.sec-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 10px
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    margin-bottom: 20px
}

.ccard {
    background: #1e2330;
    border: 0.5px solid #2a2f3a;
    border-radius: var(--border-radius-md);
    padding: 14px 12px;
    transition: border-color 0.2s
}

    .ccard:focus-within {
        border-color: #378add
    }

.ccard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px
}

    .ccard-header .cls-name {
        font-size: 16px;
        font:bold;
        font-weight: 500;
        letter-spacing: 0.06em
    }

.saved-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    display: none
}

.ccard .inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.ccard label {
    font-size: 10px;
    color: #475569;
    display: block;
    margin-bottom: 4px
}

.ccard input {
    width: 100%;
    background: #12151a;
    border: 0.5px solid #2a2f3a;
    border-radius: 6px;
    padding: 6px 4px;
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    outline: none
}

    .ccard input:focus {
        border-color: #378add
    }

.save-btn {
    width: 100%;
    margin-top: 10px;
    padding: 7px 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 0.5px solid;
    background: transparent;
    transition: all 0.15s;
    letter-spacing: 0.04em
}

    .save-btn:active {
        transform: scale(0.98)
    }

.pp-name {
    color: #7F77DD
}

.pp-btn {
    color: #7F77DD;
    border-color: #534AB7
}

    .pp-btn:hover {
        background: #1a1830
    }

.c1-name {
    color: #1D9E75;
    font-weight:bold;
    display: flex;
    align-items: center;
}

.c1-btn {
    color: #1D9E75;
    border-color: #0F6E56

}

    .c1-btn:hover {
        background: #0f1f1a
    }

.c2-name {
    color: #1D9E75;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.c2-btn {
    color: #1D9E75;
    border-color: #0F6E56
}

    .c2-btn:hover {
        background: #0f1f1a
    }

.c3-name {
    color: #1D9E75;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.c3-btn {
    color: #1D9E75;
    border-color: #0F6E56
}

    .c3-btn:hover {
        background: #0f1f1a
    }

.c4-name {
    color: #1D9E75;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.c4-btn {
    color: #1D9E75;
    border-color: #0F6E56
}

    .c4-btn:hover {
        background: #0f1f1a
    }

.c5-name {
    color: #D85A30;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.c5-btn {
    color: #D85A30;
    border-color: #993C1D
}

    .c5-btn:hover {
        background: #1e1510
    }

.pp-badge {
    background: #1a1830;
    color: #7F77DD
}

.mid-badge {
    background: #0f1f1a;
    color: #1D9E75
}

.v-badge {
    background: #1e1510;
    color: #D85A30
}

.divider {
    height: 0.5px;
    background: #2a2f3a;
    margin-bottom: 20px
}

.output-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
    margin-bottom: 12px
}

.out-box {
    border-radius: var(--border-radius-md);
    padding: 16px;
    border: 0.5px solid
}

.out-box-pp {
    background: #1a1830;
    border-color: #534AB7
}

.out-box-mid {
    background: #0f1f1a;
    border-color: #0F6E56
}

.out-box-v {
    background: #1e1510;
    border-color: #993C1D
}

.ob-tag {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 12px
}

.out-box-pp .ob-tag {
    color: #7F77DD
}

.out-box-mid .ob-tag {
    color: #1D9E75
}

.out-box-v .ob-tag {
    color: #D85A30
}

.ob-class-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 2px
}

.ob-present {
    font-size: 28px;
    font-weight: 500;
    line-height: 1
}

.out-box-pp .ob-present {
    color: #AFA9EC
}

.out-box-mid .ob-present {
    color: #5DCAA5
}

.out-box-v .ob-present {
    color: #F0997B
}

.ob-total {
    font-size: 12px;
    color: #475569;
    margin-top: 4px
}

.ob-pct {
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 0.5px solid
}

.out-box-pp .ob-pct {
    border-color: #534AB7;
    color: #AFA9EC
}

.out-box-mid .ob-pct {
    border-color: #0F6E56;
    color: #5DCAA5
}

.out-box-v .ob-pct {
    border-color: #993C1D;
    color: #F0997B
}

.pct-bar {
    height: 4px;
    border-radius: 2px;
    background: #2a2f3a;
    margin-top: 8px;
    overflow: hidden
}

.pct-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease
}

.pp-fill {
    background: #7F77DD
}

.mid-fill {
    background: #1D9E75
}

.v-fill {
    background: #D85A30
}

.grand-row {
    background: #1e2330;
    border: 0.5px solid #2a2f3a;
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px
}

    .grand-row .g-label {
        font-size: 12px;
        color: #64748b
    }

.grand-right {
    display: flex;
    align-items: baseline;
    gap: 6px
}

.g-val {
    font-size: 22px;
    font-weight: 500;
    color: #f1f5f9
}

.g-pct {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 8px
}

.total-box {
    background: #0d1117;
    border: 0.5px solid #1d4ed8;
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    margin-bottom: 20px
}

.total-box-inner {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 0
}

.t-cell {
    padding: 0 16px;
    border-right: 0.5px solid #1e293b;
    text-align: center
}

    .t-cell:first-child {
        padding-left: 0
    }

    .t-cell:last-child {
        border-right: none
    }

.t-label {
    font-size: 10px;
    color: #475569;
    letter-spacing: 0.05em;
    margin-bottom: 6px
}

.t-val {
    font-size: 22px;
    font-weight: 500
}

.t-sub {
    font-size: 11px;
    color: #475569;
    margin-top: 3px
}

.enrolled-val {
    color: #378add
}

.absent-val {
    color: #E24B4A
}

.present-val {
    color: #5DCAA5
}

.pct-val {
    color: #94a3b8
}

.total-tag {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #378add;
    margin-bottom: 14px
}

.saved-log {
    background: #0d1117;
    border: 0.5px solid #2a2f3a;
    border-radius: var(--border-radius-md);
    padding: 16px
}

.saved-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px
}

    .saved-log-header span {
        font-size: 10px;
        font-weight: 500;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #475569
    }

.clear-btn {
    font-size: 11px;
    color: #E24B4A;
    background: transparent;
    border: 0.5px solid #A32D2D;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer
}

    .clear-btn:hover {
        background: #1a0a0a
    }

.log-empty {
    font-size: 12px;
    color: #334155;
    text-align: center;
    padding: 16px 0
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px
}

    .log-table th {
        font-size: 10px;
        color: #475569;
        font-weight: 500;
        text-align: left;
        padding: 0 8px 8px 0;
        border-bottom: 0.5px solid #1e293b;
        white-space: nowrap
    }

    .log-table td {
        padding: 8px 8px 8px 0;
        border-bottom: 0.5px solid #1a1f2a;
        color: #94a3b8;
        vertical-align: middle
    }

    .log-table tr:last-child td {
        border-bottom: none
    }

.log-cls-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px
}

.toast {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    border-radius: var(--border-radius-md);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    background: #1D9E75;
    color: #E1F5EE
}
/* TABLE STYLING */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

    .modern-table thead {
        background: #1e293b;
    }

    .modern-table th {
        text-align: left;
        padding: 12px;
        color: #cbd5f5;
        font-weight: 500;
    }

    .modern-table td {
        padding: 12px;
        border-bottom: 1px solid #1f2937;
    }

    .modern-table tbody tr:hover {
        background: #0f172a;
        transition: 0.2s;
    }

/* COLORS */
.present {
    color: #5DCAA5;
    font-weight: 500;
}

.absent {
    color: #f87171;
    font-weight: 500;
}

/* BADGES */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

    .badge.good {
        background: #064e3b;
        color: #34d399;
    }

    .badge.avg {
        background: #78350f;
        color: #fbbf24;
    }

    .badge.bad {
        background: #7f1d1d;
        color: #f87171;
    }
/* ===== BASE ===== */
.layout {
    display: flex;
    min-height: 100vh;
    background: #0f172a;
}

.sidebar {
    width: 220px;
    background: #020617;
    padding: 20px;
}

.logo {
    color: #38bdf8;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 30px;
}

/* NAV */
.nav-item {
    display: block;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
}

    .nav-item:hover {
        background: #1e293b;
        color: #e2e8f0;
    }

    /* ACTIVE LINK */
    .nav-item.active {
        background: #2563eb;
        color: white;
    }

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 20px;
}
/* ===== BASE ===== */


/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #020617;
    padding: 12px 16px;
    color: white;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: white;
    cursor: pointer;
}

/* ===== OVERLAY ===== */
.overlay {
    display: none;
}

    .overlay.show {
        display: block;
        position: fixed;
        z-index: 900;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
    }
/* Sidebar inner */
.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Nav menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* ===== MOBILE MODE ===== */
@media (max-width: 768px) {

    .mobile-header {
        display: flex;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 220px;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .sidebar-inner {
        padding-top: 20px;
    }
        .sidebar.show {
            left: 0;
        }

    .main-content {
        padding: 10px;
    }

    .wrap {
        padding: 10px;
    }

    /* GRID FIX */
    .class-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    /* KPI STACK */
    .total-box-inner {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .t-cell {
        width: 100%;
    }

    /* TABLE SCROLL */
    .modern-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .chart-card {
        height: 180px; /* 🔥 compact */
    }
}
.chart-card {
    height: 250px;
}
/* TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #22c55e;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.3s;
    z-index: 2000;
}

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }
/* CLASS TITLE */
.class-title {
    display: flex;
    align-items: center;
}

.class-badge {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* SAVED BADGE */
.saved-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #064e3b;
    color: #34d399;
}

.ccard {
    transition: 0.2s;
}

    .ccard:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    }

.save-btn {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

    .save-btn:hover {
        opacity: 0.9;
    }