:root {
    --brand-primary: #0f8f9f;
    --brand-primary-dark: #0b6670;
    --brand-accent: #ff6f47;
    --bg-page: #f3f6f9;
    --bg-panel: #ffffff;
    --bg-subtle: #f7fafc;
    --text-main: #1e2d38;
    --text-muted: #5f7485;
    --line: #d9e3eb;
    --line-strong: #c4d2de;
    --success: #0c7a57;
    --danger: #b22f1f;
    --warning-bg: #fff6e8;
    --warning-line: #f2d49b;
    --radius: 10px;
    --shadow-soft: 0 2px 8px rgba(17, 49, 74, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Public Sans', 'Manrope', sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at 0% 0%, #edf8fa 0%, #f3f6f9 35%, #f3f6f9 100%);
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: 'Sora', 'Public Sans', sans-serif;
    margin: 0;
    color: #12344a;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    margin-top: 0;
}

code {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.86em;
    background: #eef3f7;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 0.08rem 0.32rem;
}

.small {
    font-size: 0.84rem;
}

.muted {
    color: var(--text-muted);
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
    z-index: 0;
}

.bg-orb--one {
    width: 24rem;
    height: 24rem;
    left: -8rem;
    top: -7rem;
    background: radial-gradient(circle at 35% 35%, rgba(15, 143, 159, 0.2) 0%, rgba(15, 143, 159, 0) 74%);
}

.bg-orb--two {
    width: 20rem;
    height: 20rem;
    right: -8rem;
    top: 28%;
    background: radial-gradient(circle at 40% 40%, rgba(255, 111, 71, 0.18) 0%, rgba(255, 111, 71, 0) 72%);
}

.bg-orb--three {
    width: 18rem;
    height: 18rem;
    left: 42%;
    bottom: -8rem;
    background: radial-gradient(circle at 40% 40%, rgba(11, 102, 112, 0.14) 0%, rgba(11, 102, 112, 0) 70%);
}

.install-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.install-card {
    width: min(760px, 100%);
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.35rem;
}

.stack-form {
    display: grid;
    gap: 0.75rem;
}

.stack-form label {
    display: grid;
    gap: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    padding: 0.56rem 0.64rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(15, 143, 159, 0.22);
    border-color: var(--brand-primary);
}

textarea {
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1px solid var(--brand-primary);
    background: var(--brand-primary);
    color: #ffffff;
    border-radius: 6px;
    min-height: 35px;
    padding: 0.42rem 0.78rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
}

.btn--ghost {
    background: #fff;
    color: #174760;
    border-color: var(--line-strong);
}

.btn--ghost:hover {
    background: #f5f8fb;
    border-color: #a9bbca;
}

.btn--small {
    min-height: 30px;
    padding: 0.3rem 0.62rem;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.alert {
    border-radius: 8px;
    padding: 0.62rem 0.75rem;
    margin-bottom: 0.85rem;
    border: 1px solid transparent;
    background: #fff;
}

.alert p {
    margin: 0.2rem 0;
}

.alert--error {
    border-color: #efcdc8;
    background: #fff4f2;
    color: var(--danger);
}

.alert--success {
    border-color: #bfe5d7;
    background: #f1fcf8;
    color: var(--success);
}

.portal-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1860px);
    margin: 0 auto;
    padding: 0.8rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0.85rem;
}

.sidebar {
    position: sticky;
    top: 0.8rem;
    align-self: start;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 0.85rem;
    padding: 0.9rem;
    max-height: calc(100vh - 1.6rem);
    overflow: auto;
}

.brand {
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.7rem;
}

.brand__kicker {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    color: var(--brand-primary);
    margin-bottom: 0.2rem;
}

.brand h1 {
    font-size: 1.03rem;
    line-height: 1.32;
}

.user-card {
    border-radius: 8px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    padding: 0.7rem;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.16rem;
}

.role-pill {
    display: inline-block;
    margin-top: 0.45rem;
    border-radius: 4px;
    padding: 0.18rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.role-pill--admin {
    color: #064b55;
    background: #ddf4f7;
    border-color: #a9d7df;
}

.role-pill--student {
    color: #88402e;
    background: #fff0ea;
    border-color: #f1c6ba;
}

.sidebar-form {
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem;
}

.side-nav {
    display: grid;
    gap: 0.28rem;
}

.side-nav a {
    font-size: 0.9rem;
    font-weight: 600;
    color: #174760;
    border-radius: 5px;
    padding: 0.44rem 0.56rem;
    border: 1px solid transparent;
}

.side-nav a:hover {
    background: #f2f8fb;
    border-color: #d3e2ed;
}

.main-content {
    display: grid;
    gap: 0.75rem;
}

.topbar,
.card,
.modal-card,
.command-bar {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-top: 3px solid var(--brand-primary);
}

.topbar h2 {
    margin-top: 0.18rem;
    font-size: 1.32rem;
}

.active-student {
    display: grid;
    text-align: right;
}

.command-bar {
    padding: 0.62rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.command-bar__group {
    display: flex;
    align-items: center;
    gap: 0.44rem;
    flex-wrap: wrap;
}

.command-chip {
    border: 1px solid #d4e1eb;
    background: #f7fbfe;
    color: #1a4c67;
    border-radius: 5px;
    padding: 0.32rem 0.56rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.command-chip:hover {
    background: #ecf5fb;
    border-color: #bdd4e5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 0.62rem;
}

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.72rem;
}

.stat-card p {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.stat-card strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.04rem;
}

.stat-card--highlight {
    border-color: #f0cabd;
    background: #fff6f3;
}

.stat-card--warn {
    border-color: var(--warning-line);
    background: var(--warning-bg);
}

.section-card {
    padding: 0.9rem 1rem;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}

.section-head h3 {
    font-size: 1rem;
}

.section-head p {
    margin-top: 0.24rem;
    margin-bottom: 0;
}

.section-head__actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-panel);
    border: 1px solid var(--line);
}

th,
td {
    padding: 0.62rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5c7283;
    background: #f8fbfd;
}

tr:last-child td {
    border-bottom: 0;
}

.list-grid {
    display: grid;
    gap: 0.5rem;
}

.list-item {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-left: 3px solid #d4e6f2;
    border-radius: 7px;
    padding: 0.62rem;
    display: flex;
    justify-content: space-between;
    gap: 0.72rem;
}

.item-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.search-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.search-column h4 {
    margin-bottom: 0.4rem;
}

.agenda-grid,
.admin-grid {
    display: grid;
    gap: 0.72rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid .stack-form {
    background: #fafcfe;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.7rem;
}

.admin-grid h4 {
    font-size: 0.94rem;
    margin-bottom: 0.12rem;
}

.admin-actions-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.modal {
    border: 0;
    padding: 0;
    background: transparent;
}

.modal::backdrop {
    background: rgba(8, 25, 37, 0.45);
}

.modal-card {
    width: min(760px, 94vw);
    margin: 5vh auto;
    padding: 0.95rem;
    background: var(--bg-panel);
}

.modal-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.55rem;
}

.modal-body h4 {
    margin: 0.72rem 0 0.2rem;
    font-size: 0.95rem;
}

@media (max-width: 1180px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .agenda-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .install-wrap {
        padding: 0.75rem;
    }

    .portal-shell {
        padding: 0.48rem;
        gap: 0.55rem;
    }

    .topbar,
    .section-card,
    .sidebar,
    .command-bar,
    .modal-card,
    .install-card {
        border-radius: 8px;
    }

    .topbar {
        flex-direction: column;
        align-items: start;
    }

    .active-student {
        text-align: left;
    }

    .section-head {
        flex-direction: column;
        align-items: start;
    }

    .section-head__actions {
        justify-content: flex-start;
        width: 100%;
    }

    .list-item {
        flex-direction: column;
    }

    .item-actions {
        width: 100%;
    }
}

/* SharePoint-like skin overrides */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body.portal-body {
    margin: 0;
    padding: 0;
    background: #f4f4f6;
}

.sp-global-wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

.sp-global {
    min-height: 56px;
    border-radius: 0;
    background: linear-gradient(90deg, #4b6fbe 0%, #4f7aca 60%, #0f8f9f 100%);
    color: #fff;
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    align-items: center;
    gap: 0.8rem;
    padding: 0.45rem 0.9rem;
}

.sp-global__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.sp-grid-icon {
    font-size: 1rem;
    opacity: 0.95;
}

.sp-wordmark {
    font-size: 1.02rem;
    letter-spacing: 0.01em;
}

.sp-global__search input {
    height: 38px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #ffffff;
    padding: 0.5rem 0.75rem;
    color: #1a2b3a;
}

.sp-search-form {
    margin: 0;
}

.sp-global__search input::placeholder {
    color: #6b7c8c;
}

.sp-global__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
}

.sp-icon {
    font-size: 1rem;
    opacity: 0.92;
}

.sp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sp-action-row {
    min-height: 46px;
    background: #f3f3f1;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid #dfe3e8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
}

.sp-action-link {
    color: #174760;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 3px;
    padding: 0.34rem 0.52rem;
}

.sp-action-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sp-action-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.sp-action-link:hover {
    background: #e8edf3;
}

.portal-shell {
    width: 100%;
    margin: 0;
    grid-template-columns: 300px 1fr;
    padding: 0;
    gap: 0.75rem;
}

.sidebar {
    position: sticky;
    top: 0.75rem;
    background: #ffffff;
    border: 1px solid #d8dde5;
    border-radius: 0;
    box-shadow: none;
    padding: 0.9rem;
    max-height: calc(100vh - 1rem);
}

.user-card {
    border-radius: 0;
    background: #f6f8fb;
    border: 1px solid #dce4ed;
}

.sp-nav-block {
    border-top: 1px solid #e5eaf0;
    padding-top: 0.7rem;
}

.sp-nav-block h3 {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: #1e2d38;
}

.sp-site-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.24rem;
}

.sp-site-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem;
    border-radius: 3px;
    padding: 0.22rem 0.3rem;
}

.sp-site-list li:hover {
    background: #f3f7fb;
}

.sp-site-list a {
    font-size: 1.03rem;
    color: #243847;
}

.sp-star {
    color: #2f7a83;
    font-size: 1.1rem;
    line-height: 1;
}

.topbar {
    border-radius: 0;
    border-top: 0;
    box-shadow: none;
    padding: 0.95rem 1rem 0.8rem;
    background: #ffffff;
}

.topbar h2 {
    font-size: 2rem;
    font-weight: 600;
}

.command-bar {
    border-radius: 0;
    box-shadow: none;
    background: #ffffff;
    border-top: 0;
}

.command-chip {
    border-radius: 2px;
    background: #f7fafc;
    border-color: #d5e0ea;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    border: 1px solid #d4deea;
    padding-top: 2.1rem;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1.35rem;
    background: linear-gradient(90deg, #4c72c3 0%, #4f7aca 72%, #0f8f9f 100%);
}

.section-card {
    border-radius: 0;
    box-shadow: none;
    border: 1px solid #d7dee8;
    background: #ffffff;
}

.section-head {
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e5ebf1;
}

table {
    border-radius: 0;
}

.list-item {
    border-radius: 0;
    border-left: 3px solid #4c72c3;
}

@media (max-width: 1180px) {
    .sp-global {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding: 0.55rem 0.7rem;
    }

    .sp-global__right {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .sp-action-row {
        flex-wrap: wrap;
        gap: 0.2rem;
        min-height: auto;
    }

    .sp-nav-block h3 {
        font-size: 1.55rem;
    }

    .topbar h2 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
