/* ==========================================================================
   Dev's Center - Admin / Teacher / Student panel stylesheet
   Brand colors follow the public site: purple #6B016F, green #009245, navy #1E3A8A
   ========================================================================== */

:root {
    --brand: #6B016F;
    --brand-dark: #4E0151;
    --brand-soft: #F3E8FF;
    --accent: #009245;
    --navy: #1E3A8A;
    --sidebar-width: 250px;
    --bs-primary: #6B016F;
    --bs-primary-rgb: 107, 1, 111;
    --bs-link-color: #6B016F;
    --bs-link-color-rgb: 107, 1, 111;
    --bs-link-hover-color: #009245;
}

body.panel-body {
    font-family: 'Hind Siliguri', Arial, sans-serif;
    background: #F4F5F9;
    font-size: 14.5px;
    color: #212529;
}

/* ---------------- Sidebar ---------------- */
.panel-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
}

.sidebar-brand strong { display: block; font-size: 17px; line-height: 1.2; }
.sidebar-brand small { opacity: .75; font-size: 12px; }
.sidebar-brand:hover { color: #fff; }

.sidebar-nav { padding: 10px 0 30px; }

.sidebar-heading {
    padding: 14px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .55;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.sidebar-link.active {
    background: rgba(255, 255, 255, .14);
    border-left-color: #7CF2B0;
    color: #fff;
    font-weight: 600;
}

.sidebar-backdrop { display: none; }

/* ---------------- Main area ---------------- */
.panel-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.panel-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.topbar-title { font-size: 18px; font-weight: 600; margin: 0; }

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}

.panel-content { flex: 1; padding: 24px; }

.panel-footer {
    padding: 12px 24px;
    font-size: 12.5px;
    color: #6B7280;
    border-top: 1px solid #E5E7EB;
    background: #fff;
}

/* ---------------- Components ---------------- */
.card { border: 1px solid #E5E7EB; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #EEF0F3; }

.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.purple { background: var(--brand-soft); color: var(--brand); }
.stat-icon.green { background: #DCFCE7; color: var(--accent); }
.stat-icon.navy { background: #DBEAFE; color: var(--navy); }
.stat-icon.orange { background: #FFEDD5; color: #C2410C; }
.stat-icon.red { background: #FEE2E2; color: #B91C1C; }

.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 13px; color: #6B7280; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
}

.form-control:focus, .form-select:focus {
    border-color: #B266B5;
    box-shadow: 0 0 0 .2rem rgba(107, 1, 111, .15);
}

.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { background: #F9FAFB; font-weight: 600; font-size: 13px; white-space: nowrap; }

.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand); }

/* ---------------- Login ---------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, var(--brand-soft) 0%, #ECFDF5 100%);
}

.login-card { width: 100%; max-width: 420px; }
.login-card .card-body { padding: 32px; }
.login-logo { width: 72px; height: 72px; object-fit: contain; }

/* ---------------- Responsive ---------------- */
@media (max-width: 991.98px) {
    .panel-sidebar { transform: translateX(-100%); }
    .panel-main { margin-left: 0; }
    .panel-content { padding: 16px; }
    .panel-topbar { padding: 10px 16px; }

    body.sidebar-open .panel-sidebar { transform: translateX(0); }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 1030;
    }
}

@media print {
    .panel-sidebar, .panel-topbar, .panel-footer, .no-print { display: none !important; }
    .panel-main { margin-left: 0; }
    .panel-content { padding: 0; }
    body.panel-body { background: #fff; }
    .print-doc { border: 0 !important; box-shadow: none !important; }
    .print-doc .badge { border: 1px solid #999; color: #000 !important; background: none !important; }
}

.print-doc { max-width: 820px; }

/* Column chart (partials/column-chart). Bars use a validated lighter step of the brand purple. */
.col-chart-wrap { --chart-bar: #8B2A8F; --chart-bar-muted: #C9A3CB; --chart-grid: #EEF0F3; --chart-ink: #6B7280; }
.col-chart { position: relative; height: 200px; margin-left: 44px; }
.col-chart-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--chart-grid); }
.col-chart-grid span { position: absolute; right: 100%; transform: translateY(-50%); padding-right: 8px; font-size: 11px; color: var(--chart-ink); white-space: nowrap; }
.col-chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.col-chart-slot { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.col-chart-bar { width: 100%; max-width: 24px; background: var(--chart-bar-muted); border-radius: 4px 4px 0 0; min-height: 0; transition: background .15s; }
.col-chart-bar.is-current { background: var(--chart-bar); }
.col-chart-slot:hover .col-chart-bar, .col-chart-slot:focus .col-chart-bar { background: var(--chart-bar); }
.col-chart-value { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 600; color: #374151; }
.col-chart-tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); z-index: 5; background: #111827; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.col-chart-slot:hover .col-chart-tip, .col-chart-slot:focus .col-chart-tip { display: block; }
.col-chart-labels { display: flex; margin-left: 44px; margin-top: 4px; }
.col-chart-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--chart-ink); }

/* Simple horizontal meter for per-class counts */
.meter { height: 8px; background: var(--brand-soft); border-radius: 4px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: #8B2A8F; border-radius: 4px; }
