/* InfoGO v3 Minimal IT UI */
:root {
    --blue: #126BFF;
    --blue-2: #0B5BFF;
    --blue-soft: #EAF2FF;
    --ink: #0B1220;
    --muted: #64748B;
    --bg: #F6F8FC;
    --panel: #FFFFFF;
    --line: #E5EAF2;
    --line-2: #D8E0EC;
    --success: #16A34A;
    --warning: #F59E0B;
    --danger: #EF4444;

    --sidebar: 286px;
    --sidebar-mini: 86px;

    --radius: 22px;
    --radius-lg: 30px;
    --shadow: 0 20px 55px rgba(11, 18, 32, .08);
    --shadow-soft: 0 10px 28px rgba(11, 18, 32, .06);

    --font: "IBM Plex Sans", "Inter", "Segoe UI", Arial, sans-serif;
    --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
    --ease: cubic-bezier(.2,.8,.2,1);
}

body.dark {
    --ink: #F8FAFC;
    --muted: #94A3B8;
    --bg: #070B14;
    --panel: #0D1320;
    --line: rgba(148, 163, 184, .18);
    --line-2: rgba(148, 163, 184, .26);
    --blue-soft: rgba(18, 107, 255, .14);
    --shadow: 0 22px 70px rgba(0,0,0,.45);
    --shadow-soft: 0 12px 34px rgba(0,0,0,.30);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(circle at 18% -4%, rgba(18,107,255,.12), transparent 32%),
        radial-gradient(circle at 92% 12%, rgba(14,165,233,.11), transparent 28%),
        var(--bg);
    transition: background .28s var(--ease), color .28s var(--ease);
}

a { color: inherit; text-decoration: none; }
button, input { font-family: var(--font); }
svg { width: 22px; height: 22px; stroke-width: 2.1; }

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar) 1fr;
    transition: grid-template-columns .28s var(--ease);
}
body.sidebar-collapsed .app {
    grid-template-columns: var(--sidebar-mini) 1fr;
}

/* SIDEBAR */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(26px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
body.dark .sidebar { background: rgba(13,19,32,.78); }

.brand {
    height: 62px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 10px;
}
.brand-logo {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 14px 26px rgba(18,107,255,.22);
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.brand-title {
    font-weight: 900;
    font-size: 27px;
    letter-spacing: -1.2px;
}
.brand-title span { color: var(--blue); }
.brand-subtitle {
    margin-top: 5px;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    letter-spacing: .3px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.nav-item {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 14px;
    border-radius: 16px;
    color: var(--muted);
    font-weight: 780;
    position: relative;
    transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav-item:hover {
    color: var(--ink);
    background: rgba(18,107,255,.07);
    transform: translateX(2px);
}
.nav-item.active {
    color: var(--blue);
    background: var(--blue-soft);
}
.nav-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: grid;
    place-items: center;
}
.nav-text {
    white-space: nowrap;
    transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.nav-section {
    margin: 12px 12px 5px;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-family: var(--mono);
    transition: opacity .18s var(--ease);
}
.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* collapsed */
body.sidebar-collapsed .brand {
    justify-content: center;
    padding: 0;
}
body.sidebar-collapsed .brand-logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
}
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-section {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
    position: absolute;
}
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 0;
}
body.sidebar-collapsed .nav-item:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 62px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink);
    color: var(--panel);
    padding: 8px 10px;
    border-radius: 10px;
    white-space: nowrap;
    font-size: 12px;
    z-index: 20;
    box-shadow: var(--shadow-soft);
}

/* MAIN */
.main {
    min-width: 0;
    padding: 26px;
}
.topbar {
    height: 76px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(24px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
body.dark .topbar { background: rgba(13,19,32,.72); }

.left-tools, .right-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}
.icon-btn {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel);
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(11,18,32,.04);
    transition: transform .2s var(--ease), border .2s var(--ease), background .2s var(--ease);
}
.icon-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(18,107,255,.28);
}
.search {
    height: 46px;
    width: 320px;
    border-radius: 15px;
    border: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    color: var(--muted);
}
.search input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    width: 100%;
}
.user-pill {
    height: 46px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
}
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), #0EA5E9);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.user-meta { line-height: 1.1; }
.user-name { font-weight: 850; font-size: 13px; }
.user-role { color: var(--muted); font-size: 11px; font-family: var(--mono); }

.hero {
    margin-top: 22px;
    border-radius: 32px;
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(18,107,255,.08), transparent 45%),
        var(--panel);
    box-shadow: var(--shadow);
    padding: 30px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    position: relative;
}
.hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -120px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(18,107,255,.18), transparent 68%);
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 850;
    font-family: var(--mono);
    font-size: 12px;
}
.hero h1 {
    margin: 16px 0 10px;
    font-size: clamp(30px, 3vw, 44px);
    letter-spacing: -1.8px;
    line-height: 1.06;
}
.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}
.hero-actions {
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}
.byte-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FFF7D6, #FDE68A);
    color: #8A5A00;
    font-weight: 900;
    border: 1px solid rgba(245,158,11,.22);
}
.byte-mark {
    font-family: var(--mono);
    color: var(--warning);
}

.stats {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.stat {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    min-height: 136px;
    transition: transform .22s var(--ease), border .22s var(--ease);
}
.stat:hover {
    transform: translateY(-4px);
    border-color: rgba(18,107,255,.26);
}
.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-weight: 760;
}
.stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--blue-soft);
    color: var(--blue);
}
.stat-num {
    margin-top: 18px;
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -1.5px;
    font-family: var(--mono);
}
.stat-foot {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 16px;
}
.panel {
    min-height: 300px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    padding: 22px;
}
.panel h2 {
    margin: 14px 0 8px;
    font-size: 25px;
    letter-spacing: -1px;
}
.pygo-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.pygo-avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 19px;
    background: var(--blue-soft);
    display: grid;
    place-items: center;
    color: var(--blue);
    animation: float 3s var(--ease) infinite;
}
.code-strip {
    margin-top: 18px;
    padding: 14px;
    border-radius: 18px;
    background: #0B1220;
    color: #DCEBFF;
    font-family: var(--mono);
    font-size: 13px;
    overflow: hidden;
}
body.dark .code-strip { background: #020617; border: 1px solid var(--line); }

.btn {
    border: 0;
    border-radius: 15px;
    padding: 13px 18px;
    background: var(--blue);
    color: white;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(18,107,255,.24);
}
.btn.secondary {
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

@keyframes float {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@media (max-width: 1050px) {
    .stats { grid-template-columns: repeat(2,1fr); }
    .grid { grid-template-columns: 1fr; }
    .search { display: none; }
}
@media (max-width: 760px) {
    .app { grid-template-columns: 1fr; }
    .main { padding: 16px; }
    .stats { grid-template-columns: 1fr; }
    .hero { flex-direction: column; }
}

/* InfoGO Responsive System v2
   Shared shell rules for admin, teacher, student and parent workspaces. */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}
img, video, canvas, iframe { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }
.app, .main, .topbar, .left-tools, .right-tools,
.hero > *, [class*="-hero"] > *, [class*="-layout"] > *,
[class*="-grid"] > *, [class*="-card"] > *, [class*="-panel"] > * {
    min-width: 0;
}
.main { width: 100%; }
.sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.sidebar-mobile-backdrop,
.sidebar-mobile-close { display: none; }

/* Wide laptop: keep the workspace airy without wasting screen space. */
@media (max-width: 1366px) {
    .main { padding: 20px; }
    .topbar { padding-inline: 16px; }
    .search { width: min(260px, 25vw); }
    .hero, [class$="-hero"] { padding: 26px; }
}

/* Tablet and below: the permanent sidebar becomes an accessible drawer. */
@media (max-width: 1024px) {
    :root { --sidebar: 300px; }
    .app,
    body.sidebar-collapsed .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar,
    body.sidebar-collapsed .sidebar {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1000;
        width: min(320px, 88vw);
        height: 100vh;
        height: 100dvh;
        padding: 20px 16px;
        border-right: 1px solid var(--line);
        background: color-mix(in srgb, var(--panel) 95%, transparent);
        box-shadow: 30px 0 80px rgba(2, 6, 23, .22);
        transform: translateX(-105%);
        transition: transform .28s var(--ease);
        visibility: hidden;
    }
    body.mobile-menu-open .sidebar {
        transform: translateX(0);
        visibility: visible;
    }
    body.sidebar-collapsed .sidebar .brand {
        justify-content: flex-start;
        padding: 0 10px;
    }
    body.sidebar-collapsed .sidebar .brand-logo {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }
    body.sidebar-collapsed .sidebar .brand-text,
    body.sidebar-collapsed .sidebar .nav-text,
    body.sidebar-collapsed .sidebar .nav-section {
        opacity: 1;
        pointer-events: auto;
        transform: none;
        position: static;
    }
    body.sidebar-collapsed .sidebar .nav-item {
        justify-content: flex-start;
        padding: 0 14px;
    }
    body.sidebar-collapsed .sidebar .nav-item:hover::after { display: none; }
    .sidebar-mobile-close {
        display: grid;
        place-items: center;
        position: absolute;
        top: 18px;
        right: 14px;
        z-index: 2;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: var(--panel);
        color: var(--ink);
        font-size: 25px;
        line-height: 1;
        cursor: pointer;
    }
    .sidebar-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 990;
        border: 0;
        padding: 0;
        background: rgba(2, 6, 23, .56);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .24s var(--ease), visibility .24s var(--ease);
    }
    body.mobile-menu-open .sidebar-mobile-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    body.mobile-menu-open { overflow: hidden; }
    .main { padding: 18px; }
    .topbar {
        position: sticky;
        top: 10px;
        z-index: 70;
        min-height: 68px;
        height: auto;
        padding: 10px 14px;
        border-radius: 22px;
        gap: 10px;
    }
    .left-tools, .right-tools { min-width: 0; gap: 8px; }
    .right-tools { justify-content: flex-end; }
    .search { display: none; }
    .hero, [class$="-hero"] { border-radius: 26px; }
    .drawer, .profile-drawer {
        height: 100vh;
        height: 100dvh;
        max-width: 92vw;
    }
    [class*="table-wrap"], .table-wrap {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }
    table { max-width: 100%; }
    .aw-footer, .tcb-footer, .v4-bottom-bar,
    .pp-footer, .igb-footer-bar { left: 0 !important; }
}

/* Phone: compact topbar, readable cards and full-width controls. */
@media (max-width: 640px) {
    .main { padding: 10px; }
    .topbar {
        top: 6px;
        min-height: 60px;
        padding: 7px 9px;
        border-radius: 18px;
    }
    .icon-btn {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border-radius: 13px;
    }
    .teacher-top-title, .student-link, .pp-top-title,
    .user-pill .user-meta { display: none; }
    .user-pill {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        padding: 5px;
        justify-content: center;
        border-radius: 13px;
    }
    .user-pill .avatar {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
    }
    .right-tools > * { flex-shrink: 0; }
    .hero, [class$="-hero"] {
        margin-top: 12px;
        padding: 20px 16px;
        border-radius: 22px;
        gap: 16px;
    }
    .hero h1, [class$="-hero"] h1 {
        font-size: clamp(28px, 9vw, 38px);
        letter-spacing: -1.25px;
        overflow-wrap: anywhere;
    }
    .hero-actions, [class$="-hero-actions"],
    .builder-actions, .lesson-card-actions,
    .course-actions, .class-actions, .teacher-actions {
        width: 100%;
        align-items: stretch;
        flex-wrap: wrap;
    }
    .hero-actions > .btn, [class$="-hero-actions"] > button,
    [class$="-hero-actions"] > a { flex: 1 1 150px; text-align: center; }
    .stats { gap: 10px; }
    .stat, .panel, .student-panel, .s-card {
        padding: 16px;
        border-radius: 20px;
    }
    .filters {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }
    .filters > *, .filters select, .filters input, .filters button,
    .filters .btn { width: 100%; min-width: 0; }
    .drawer, .profile-drawer {
        width: 100%;
        max-width: 100%;
        padding: 18px 14px max(18px, env(safe-area-inset-bottom));
    }
    .drawer-head h2 { font-size: 25px; }
    .date-grid { grid-template-columns: minmax(0, 1fr); }
    .btn, .mini-btn, button, a {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Small phones (320–390 px). */
@media (max-width: 390px) {
    .main { padding: 8px; }
    .topbar { padding-inline: 7px; gap: 6px; }
    .left-tools, .right-tools { gap: 5px; }
    .right-tools .user-pill { display: none; }
    .hero, [class$="-hero"] { padding: 18px 14px; }
    .badge { max-width: 100%; height: auto; min-height: 32px; white-space: normal; }
    .stat-num { font-size: 32px; }
    .sidebar { width: 92vw; }
}

/* Short landscape screens: keep navigation and dialogs usable. */
@media (max-height: 560px) and (orientation: landscape) {
    .sidebar { padding-block: 10px; gap: 8px; }
    .sidebar .brand { height: 48px; }
    .sidebar .brand-logo { width: 40px; height: 40px; min-width: 40px; }
    .sidebar .nav { gap: 3px; }
    .sidebar .nav-item { height: 42px; min-height: 42px; }
    .sidebar .nav-section { margin-block: 5px 2px; }
    .drawer, .profile-drawer { padding-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar, .sidebar-mobile-backdrop { transition: none; }
}
