/* Nova School: Bootstrap foundation + a focused, token-based visual layer. */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
    --ns-primary: #6357d9;
    --ns-sidebar: #1e2248;
    --ns-bg: #f1f1f1;
    --ns-text: #24283f;
    --ns-muted: #7b8196;
    --ns-border: #eceef5;
    --ns-radius: 16px;
    --ns-sidebar-width: 248px;
    --bs-primary: #6357d9;
    --bs-body-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bs-body-color: var(--ns-text);
    --bs-border-color: var(--ns-border)
}

body {
    background: var(--ns-bg);
    font-size: 15px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    text-decoration: none
}

button,
a,
input,
select {
    touch-action: manipulation
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #a69ef3;
    outline-offset: 3px
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.8;
    vertical-align: middle
}

.btn {
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    padding: .65rem 1rem;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center
}

.btn-primary {
    --bs-btn-bg: var(--ns-primary);
    --bs-btn-border-color: var(--ns-primary);
    --bs-btn-hover-bg: #5146c2;
    --bs-btn-hover-border-color: #5146c2
}

.btn-light {
    background: white;
    border-color: var(--ns-border)
}

.text-muted {
    color: var(--ns-muted) !important
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700
}

.card {
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius);
    box-shadow: 0 3px 12px #20244003
}

.card-header {
    background: none;
    border-color: var(--ns-border);
    padding: 20px 22px
}

.card-body {
    padding: 22px
}

.card-title {
    font-size: 15px;
    font-weight: 650;
    margin: 0
}

.form-control,
.form-select {
    border-radius: 9px;
    font-size: 14px;
    padding: .7rem .85rem
}

.form-control:focus,
.form-select:focus {
    border-color: #a69ef3;
    box-shadow: 0 0 0 3px #6357d915
}

.form-label {
    font-size: 12px;
    font-weight: 650
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eeecfc;
    color: var(--ns-primary);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0
}

.avatar-lg {
    width: 76px;
    height: 76px;
    font-size: 25px
}

.badge-soft {
    font-size: 10px;
    border-radius: 6px;
    padding: 5px 8px;
    font-weight: 600;
    background: #eeecfc;
    color: #6357d9
}

.badge-soft.green {
    background: #e9f7f0;
    color: #248a67
}

.badge-soft.orange {
    background: #fff2e2;
    color: #b78129
}

.badge-soft.red {
    background: #fcebed;
    color: #c05f6a
}

.sidebar {
    --bs-offcanvas-width: var(--ns-sidebar-width);
    background: var(--ns-sidebar) !important;
    color: #a7a9c7;
    width: var(--ns-sidebar-width);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: var(--bs-offcanvas-zindex, 1045);
    transition: width .2s ease, transform .3s ease-in-out;
    display: flex;
    flex-direction: column
}

.sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    padding: 26px 17px;
    overflow-y: auto
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: white;
    font-size: 20px;
    font-weight: 700;
    padding: 0 10px;
    letter-spacing: -.6px
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    background: #8c80f6;
    color: white
}

.brand-mark .icon {
    width: 23px;
    height: 23px
}

.school-switch {
    margin: 32px 0 24px;
    padding: 12px 10px;
    border: 1px solid #ffffff16;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px
}

.school-switch .avatar {
    border-radius: 8px;
    background: #ffffff12;
    color: #d5d4f2
}

.nav-caption {
    font-size: 9px;
    letter-spacing: 1.5px;
    padding: 0 14px;
    margin: 18px 0 10px;
    color: #737896
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 9px;
    color: #acafcc;
    padding: 12px 14px;
    font-size: 12px;
    margin-bottom: 4px;
    white-space: nowrap
}

.side-link:hover {
    background: #ffffff09;
    color: white
}

.side-link.active {
    background: #6357d9;
    color: white;
    box-shadow: 0 5px 18px #0a0d2725
}

.side-link .count {
    margin-left: auto;
    font-size: 9px;
    border-radius: 5px;
    background: #ffffff18;
    padding: 2px 6px
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 34px
}

.sidebar-foot {
    border-top: 1px solid #ffffff12;
    margin-top: 18px;
    padding: 18px 10px 0;
    font-size: 10px;
    color: #777d9f
}

.app-main {
    margin-left: var(--ns-sidebar-width);
    transition: margin-left .2s
}

.topbar {
    height: 78px;
    background: white;
    border-bottom: 1px solid var(--ns-border);
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.icon-button {
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    color: #83889d
}

.icon-button:hover {
    background: #f1effb
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #989daf;
    width: 320px
}

.search-wrap input {
    border: 0;
    outline: 0;
    font-size: 12px;
    background: transparent;
    width: 100%
}

.keycap {
    font-size: 9px;
    border: 1px solid #e9eaf1;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px
}

.year-pill {
    font-size: 11px;
    border: 1px solid var(--ns-border);
    padding: 8px 10px;
    border-radius: 8px
}

.content {
    padding: 30px 34px;
    max-width: 1600px;
    margin: auto
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.8px
}

.page-subtitle {
    font-size: 12px;
    color: var(--ns-muted);
    margin: 8px 0 0
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 41px;
    height: 41px;
    border-radius: 12px;
    background: #eeecfc;
    color: #6357d9
}

.stat-icon.green {
    background: #eaf6f1;
    color: #3b9a7b
}

.stat-icon.orange {
    background: #fff3e7;
    color: #db9b48
}

.stat-icon.blue {
    background: #eaf1ff;
    color: #5b88d7
}

.stat-label {
    color: var(--ns-muted);
    font-size: 11px;
    margin: 14px 0 6px
}

.stat-number {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.8px
}

.stat-footer {
    font-size: 10px;
    color: #9397a8;
    margin-top: 12px
}

.trend {
    color: #319b75;
    font-weight: 650;
    margin-right: 5px
}

.chart-box {
    height: 216px;
    position: relative;
    margin-top: 15px
}

.chart-box svg {
    width: 100%;
    height: 100%;
    overflow: visible
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    color: #9297a9;
    font-size: 10px;
    padding: 0 8px 0 38px
}

.chart-legend {
    display: flex;
    gap: 15px;
    color: #8c91a4;
    font-size: 10px
}

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7367e3;
    margin-right: 5px
}

.dot.mint {
    background: #a8d9ce
}

.donut {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#6f63dc 0 48%, #a59be9 48% 76%, #d3ccf5 76% 91%, #eeebfc 91%);
    position: relative;
    display: grid;
    place-items: center;
    margin: 15px auto 23px
}

.donut:before {
    content: "";
    position: absolute;
    inset: 20px;
    background: white;
    border-radius: 50%
}

.donut-value {
    z-index: 1;
    text-align: center
}

.donut-value strong {
    display: block;
    font-size: 25px;
    letter-spacing: -.7px
}

.donut-value span {
    font-size: 10px;
    color: #9297a9
}

.table {
    font-size: 12px;
    --bs-table-bg: transparent;
    vertical-align: middle;
    margin-bottom: 0
}

.table thead th {
    font-size: 10px;
    color: #9297a7;
    font-weight: 600;
    background: #fafbfe;
    padding: 12px 20px;
    white-space: nowrap
}

.table td {
    padding: 15px 20px;
    border-color: #f0f1f6
}

.table tbody tr:last-child td {
    border-bottom: 0
}

.student-name {
    font-size: 12px;
    font-weight: 600
}

.student-meta {
    font-size: 10px;
    color: #9499aa;
    margin-top: 3px
}

.event {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--ns-border)
}

.event:last-child {
    border: 0;
    padding-bottom: 0
}

.date-box {
    width: 43px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f1effc;
    color: #7569d5;
    text-align: center;
    padding: 7px
}

.date-box strong {
    font-size: 17px;
    display: block
}

.date-box span {
    font-size: 9px
}

.event-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px
}

.event-sub {
    font-size: 10px;
    color: #969aaa
}

.quick-link {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    color: #5c6279;
    font-size: 12px
}

.welcome-strip {
    border-radius: 14px;
    background: #efedfb;
    padding: 17px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e4dff8
}

.welcome-strip strong {
    font-size: 12px;
    color: #5951a2
}

.welcome-strip p {
    margin: 4px 0 0;
    font-size: 11px;
    color: #9690b7
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: white
}

.auth-art {
    background: #1e2248;
    color: white;
    padding: 55px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden
}

.auth-art:after {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    border: 1px solid #ffffff12;
    border-radius: 50%;
    bottom: -150px;
    right: -80px;
    box-shadow: 0 0 0 70px #ffffff03, 0 0 0 140px #ffffff02
}

.auth-art h1 {
    font-size: 44px;
    line-height: 1.2;
    letter-spacing: -1.5px;
    max-width: 470px;
    margin-top: 80px
}

.auth-art p {
    color: #a6aace;
    max-width: 370px;
    line-height: 1.8
}

.auth-preview {
    margin-top: 36px;
    transform: rotate(-3deg);
    padding: 22px;
    border-radius: 15px;
    border: 1px solid #ffffff20;
    background: #ffffff08;
    max-width: 380px;
    z-index: 1
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 45px
}

.auth-form {
    width: 100%;
    max-width: 380px
}

.auth-form h2 {
    font-size: 29px;
    font-weight: 700;
    letter-spacing: -.8px
}

.auth-form .form-control {
    padding: 13px
}

.auth-note {
    font-size: 11px;
    background: #f6f5fc;
    border: 1px solid #ebe7f9;
    border-radius: 9px;
    padding: 12px;
    color: #86809f
}

.profile-cover {
    height: 125px;
    background: linear-gradient(110deg, #eeeafa, #d9d3f6);
    border-radius: 16px 16px 0 0
}

.profile-heading {
    padding: 0 26px 25px;
    margin-top: -34px
}

.profile-heading .avatar {
    border: 5px solid white
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #a0a5b5;
    font-size: 10px;
    padding: 24px 0 0
}

.nav-pills .nav-link {
    font-size: 12px;
    color: #878da2
}

.nav-pills .nav-link.active {
    background: #eeecfc;
    color: #6357d9
}

.empty-note {
    padding: 30px;
    color: var(--ns-muted);
    text-align: center
}

body.collapsed {
    --ns-sidebar-width: 82px
}

body.collapsed .sidebar .brand-text,
body.collapsed .sidebar .side-label,
body.collapsed .sidebar .count,
body.collapsed .school-switch,
body.collapsed .nav-caption,
body.collapsed .sidebar-foot {
    display: none
}

body.collapsed .sidebar .brand {
    padding: 0 5px
}

body.collapsed .sidebar .side-link {
    justify-content: center;
    padding: 14px 8px
}

body.collapsed .sidebar nav {
    margin-top: 35px
}

.activity-tile {
    padding: 20px;
    border: 1px solid var(--ns-border);
    border-radius: 14px;
    background: white
}

.resource-art {
    height: 120px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f0edfc;
    color: #8376d8;
    margin-bottom: 18px
}

.resource-art .icon {
    width: 45px;
    height: 45px
}

.toast-container {
    z-index: 1100
}

.table-search {
    max-width: 230px
}

.offcanvas-header {
    border-bottom: 1px solid #ffffff15
}

.skip-link {
    position: absolute;
    left: -9999px
}

.skip-link:focus {
    left: 10px;
    top: 10px;
    z-index: 1200;
    background: white;
    padding: 10px
}

@media(min-width:992px) {
    .sidebar.offcanvas-lg {
        height: 100vh
    }

    .sidebar .offcanvas-body {
        flex-grow: 1
    }
}

@media(max-width:1199px) {

    .topbar,
    .content {
        padding-left: 24px;
        padding-right: 24px
    }

    .topbar-right {
        gap: 10px
    }

    .search-wrap {
        width: 220px
    }
}

@media(max-width:991px) {
    .app-main {
        margin-left: 0
    }

    .sidebar {
        width: 248px !important
    }

    body.collapsed .sidebar .brand-text,
    body.collapsed .sidebar .side-label,
    body.collapsed .sidebar .school-switch,
    body.collapsed .sidebar .nav-caption,
    body.collapsed .sidebar .sidebar-foot {
        display: block
    }

    body.collapsed .sidebar .side-link {
        justify-content: flex-start
    }

    body.collapsed .sidebar nav {
        margin-top: 0
    }

    .auth-art {
        padding: 35px
    }

    .auth-art h1 {
        font-size: 34px
    }

    .search-wrap {
        width: auto;
        flex: 1
    }

    .keycap {
        display: none
    }
}

@media(max-width:767px) {
    .topbar {
        height: 68px;
        padding: 0 16px
    }

    .content {
        padding: 24px 16px
    }

    .page-title {
        font-size: 23px
    }

    .topbar .year-pill,
    .topbar .user-label {
        display: none
    }

    .topbar-right {
        gap: 5px
    }

    .search-wrap input {
        width: 110px
    }

    .page-heading {
        align-items: flex-start
    }

    .page-heading .btn {
        padding: 9px;
        font-size: 11px
    }

    .auth-shell {
        grid-template-columns: 1fr
    }

    .auth-art {
        display: none
    }

    .auth-panel {
        padding: 26px;
        min-height: 100vh
    }

    .footer {
        flex-direction: column
    }

    .card-body {
        padding: 18px
    }

    .card-header {
        padding: 18px
    }

    .chart-legend {
        gap: 8px
    }

    .welcome-strip {
        align-items: flex-start
    }

    .welcome-strip .btn {
        white-space: nowrap
    }

    .table td,
    .table thead th {
        padding: 12px
    }

    .page-actions {
        flex-wrap: wrap;
        justify-content: flex-end
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important
    }
}

/* Nested navigation: Bootstrap owns visibility and transitions. */
.nav-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left
}

.active-parent {
    color: #fff;
    background: #ffffff08
}

.menu-chevron {
    margin-left: auto;
    display: flex;
    align-items: center;
    transition: transform .2s
}

.menu-chevron .icon {
    width: 13px;
    height: 13px
}

.nav-toggle[aria-expanded="true"] .menu-chevron {
    transform: rotate(90deg)
}

.nav-submenu {
    margin: 3px 0 8px 23px;
    padding-left: 10px;
    border-left: 1px solid #ffffff15
}

.nav-submenu .side-link {
    font-size: 11px;
    padding: 9px 10px;
    gap: 9px;
    white-space: normal
}

.nav-bullet {
    width: 4px;
    height: 4px;
    flex-shrink: 0;
    background: currentColor;
    opacity: .55;
    border-radius: 50%
}

.nav-submenu .nav-submenu {
    margin-left: 12px;
    padding-left: 8px
}

.nav-submenu .side-link.active {
    background: #ffffff10;
    color: #cfc7ff;
    box-shadow: none
}

@media(min-width:992px) {

    body.collapsed .nav-submenu,
    body.collapsed .menu-chevron {
        display: none
    }
}

@media(max-width:991px) {
    .sidebar {
        --bs-offcanvas-width: 248px
    }

    .sidebar .offcanvas-body {
        min-height: 0;
        overscroll-behavior: contain
    }

    .sidebar .school-switch {
        display: flex
    }

    .sidebar .menu-chevron {
        display: flex
    }
}
/* Record detail pages */
.detail-view {
    max-width: 1200px;
    margin-inline: auto;
}
.detail-view .page-heading {
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e8eaf1;
}
.detail-view .page-title {
    display: flex;
    align-items: center;
    gap: .85rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.detail-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #eeeafd;
    color: #6958c9;
    font-size: 1.35rem;
}
.detail-view > .card {
    border: 1px solid #e8eaf1 !important;
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(32, 37, 67, .035) !important;
    padding: clamp(1.25rem, 3vw, 2rem) !important;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2rem;
    margin: 0 0 1.5rem;
}
.detail-field {
    min-width: 0;
    padding: 1.15rem 0;
    border-bottom: 1px solid #eef0f5;
}
.detail-field dt {
    width: auto;
    padding: 0;
    margin: 0 0 .45rem;
    color: #83899b;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.detail-field dd {
    width: auto;
    padding: 0;
    margin: 0;
    color: #30364b;
    font-size: .9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: normal;
}
.detail-field-wide { grid-column: 1 / -1; }
.detail-field dd:has(.table) { white-space: normal; }
.detail-actions {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: .65rem;
    padding-top: .75rem;
}
.detail-actions form { margin: 0; }
.detail-view .btn { border-radius: 9px; }
.detail-view > .card > img {
    border-radius: 16px !important;
    object-fit: cover;
    box-shadow: 0 3px 12px rgba(32, 37, 67, .08);
}
.detail-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    list-style: none;
    padding: 1rem 0 1.5rem;
    margin: 0;
}
.detail-permissions li {
    padding: .5rem .8rem;
    background: #f4f2fc;
    border: 1px solid #e9e4fa;
    border-radius: 8px;
    color: #63588a;
    font-size: .78rem;
    overflow-wrap: anywhere;
}
.detail-view pre {
    border: 1px solid #e8eaf1;
    border-radius: 12px;
    font-size: .78rem;
    line-height: 1.7;
}
@media (max-width: 575.98px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-icon { width: 40px; height: 40px; border-radius: 12px; }
    .detail-view .page-heading { align-items: flex-start; flex-direction: column; }
}
