:root {
    --navy: #0b1f3a;
    --navy-2: #12345b;
    --gold: #e6b935;
    --gold-dark: #b88912;
    --teal: #1f9d8a;
    --paper: #ffffff;
    --soft: #f4f7fb;
    --line: #dce4ef;
    --text: #172033;
    --muted: #6d7a8d;
    --danger: #c24141;
    --success: #15815d;
    --shadow: 0 14px 34px rgba(14, 31, 58, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--soft);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
}

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

img {
    max-width: 100%;
}

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

button {
    cursor: pointer;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
    font-size: 22px;
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--navy);
    background: var(--gold);
    border-radius: 8px;
    font-weight: 900;
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 10px 20px;
    color: var(--navy);
    background: var(--gold);
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(184, 137, 18, 0.18);
}

.btn:hover {
    background: #f2c846;
}

.btn-secondary {
    color: var(--navy);
    background: #e8edf5;
    box-shadow: none;
}

.btn-small {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 14px;
}

.btn-large {
    min-height: 56px;
    padding: 14px 32px;
    font-size: 18px;
}

.btn-full {
    width: 100%;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold-dark);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.muted {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 6%;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
}

.public-nav,
.student-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 700;
}

.public-nav a:not(.btn):hover,
.student-nav a:hover,
.student-nav a.active {
    color: var(--gold-dark);
}

.hero {
    position: relative;
    min-height: calc(100vh - 79px);
    display: flex;
    align-items: center;
    padding: 86px 6% 118px;
    background: url("../img/hero-study.png") center/cover no-repeat;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 96px;
    background: var(--soft);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 20, 39, 0.58);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(650px, 100%);
    color: white;
}

.hero-content .eyebrow {
    color: var(--gold);
}

.hero h1 {
    margin: 0;
    color: white;
    font-size: 76px;
    line-height: 1;
    font-weight: 900;
}

.hero-subtitle {
    margin: 20px 0 0;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.hero-text {
    max-width: 560px;
    margin: 18px 0 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
}

.btn-hero {
    min-width: 180px;
}

.section {
    padding: 78px 6%;
    background: var(--paper);
}

.section-soft {
    background: var(--soft);
}

.section-header {
    max-width: 760px;
    margin-bottom: 34px;
}

.section-header h2,
.cta-band h2 {
    margin: 0;
    color: var(--navy);
    font-size: 38px;
    line-height: 1.12;
}

.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 38px;
    align-items: start;
    max-width: 1120px;
}

.split-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 19px;
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-list span {
    padding: 16px 18px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.card-grid,
.benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.feature-card,
.panel-card,
.content-card,
.profile-card,
.stat-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.feature-card {
    padding: 28px;
}

.feature-card h3,
.content-card h3,
.content-card h2 {
    margin: 16px 0 8px;
    color: var(--navy);
}

.feature-card p,
.content-card p {
    margin: 0;
    color: var(--muted);
}

.feature-icon {
    display: inline-grid;
    min-width: 52px;
    height: 42px;
    place-items: center;
    padding: 0 10px;
    color: white;
    background: var(--navy-2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
}

.benefits > div {
    padding: 22px 0;
    border-top: 4px solid var(--gold);
}

.benefits strong {
    color: var(--navy);
    font-size: 20px;
}

.benefits p {
    margin: 8px 0 0;
    color: var(--muted);
}

.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 54px 6%;
    color: white;
    background: var(--navy);
}

.cta-band h2 {
    color: white;
}

.cta-band p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.public-footer {
    padding: 28px 6%;
    color: white;
    background: #061527;
}

.public-footer div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.auth-page,
.error-page {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
    padding: 54px 6%;
}

.auth-card {
    width: min(460px, 100%);
    padding: 34px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0 0 24px;
    color: var(--navy);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    color: white;
    background: var(--navy);
}

.brand-panel {
    color: white;
    margin-bottom: 34px;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a,
.logout-link {
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    font-weight: 800;
}

.side-nav a:hover,
.side-nav a.active,
.logout-link:hover {
    color: var(--navy);
    background: var(--gold);
}

.logout-link {
    margin-top: auto;
}

.main-area {
    min-width: 0;
}

.panel-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 32px;
    background: rgba(244, 247, 251, 0.94);
    border-bottom: 1px solid var(--line);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    color: var(--navy);
    background: white;
    font-weight: 800;
}

.content-area,
.student-main {
    padding: 32px;
}

.student-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 6%;
    background: white;
    border-bottom: 1px solid var(--line);
}

.student-main {
    max-width: 1180px;
    margin: 0 auto;
}

.page-heading,
.panel-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-heading h1 {
    margin: 0;
    color: var(--navy);
    font-size: 34px;
}

.panel-card {
    margin-bottom: 24px;
    padding: 24px;
}

.panel-card h2 {
    margin: 0 0 18px;
    color: var(--navy);
    font-size: 22px;
}

.panel-card-head h2 {
    margin: 0;
}

.panel-card-head a {
    color: var(--gold-dark);
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    color: var(--navy);
    font-size: 38px;
    line-height: 1;
}

.form-stack,
.form-grid,
.filters,
.inline-form {
    display: grid;
    gap: 16px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filters {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    align-items: end;
    margin-bottom: 18px;
}

.inline-form {
    grid-template-columns: 1fr auto auto;
}

label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--text);
    background: white;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(230, 185, 53, 0.28);
    border-color: var(--gold);
}

.full-width {
    grid-column: 1 / -1;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    align-items: end;
    gap: 12px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

th {
    color: var(--navy);
    font-size: 13px;
    text-transform: uppercase;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.actions a,
.actions button {
    border: 0;
    padding: 0;
    color: var(--gold-dark);
    background: transparent;
    font-weight: 800;
}

.actions button {
    color: var(--danger);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    color: var(--navy);
    background: #eef3fa;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.pill-green {
    color: #07523a;
    background: #dff7ed;
}

.pill-muted {
    color: #5b6575;
    background: #edf0f5;
}

.alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 800;
}

.alert-success {
    color: #07523a;
    background: #dff7ed;
    border: 1px solid #9de5c7;
}

.alert-error {
    color: #842222;
    background: #ffe7e7;
    border: 1px solid #f5b4b4;
}

.empty-state {
    color: var(--muted);
    text-align: center;
}

.student-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
    padding: 30px;
    color: white;
    background: var(--navy);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.student-hero h1 {
    margin: 0;
    font-size: 34px;
}

.student-hero p:last-child {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.subject-list a {
    padding: 11px 15px;
    color: var(--navy);
    background: #eef3fa;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 800;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.content-card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
}

.content-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 14px;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-actions.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.content-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.content-meta-wide {
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
}

.preview-description {
    margin: 18px 0 0;
    color: var(--muted);
}

.preview-note {
    padding: 10px 12px;
    color: var(--navy);
    background: #fff7d7;
    border: 1px solid #f2d26c;
    border-radius: 8px;
    font-weight: 800;
}

.preview-card {
    min-height: 520px;
    overflow: hidden;
}

.file-preview-frame {
    width: 100%;
    height: 72vh;
    min-height: 520px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.file-preview-image {
    display: block;
    max-height: 78vh;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
}

.preview-unavailable {
    display: grid;
    min-height: 360px;
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
}

.preview-unavailable h2 {
    margin: 0;
}

.preview-unavailable p {
    margin: 0;
    color: var(--muted);
}

.office-preview {
    display: grid;
    gap: 18px;
}

.office-preview p {
    margin: 0 0 10px;
}

.doc-preview {
    max-width: 900px;
    margin: 0 auto;
    color: var(--text);
    font-size: 17px;
    line-height: 1.7;
}

.slide-preview,
.sheet-preview,
.zip-preview {
    padding: 20px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.slide-preview h2,
.sheet-preview h2,
.zip-preview h2 {
    margin: 0 0 14px;
    color: var(--navy);
}

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

.preview-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.preview-table {
    min-width: 0;
    background: white;
}

.preview-table th,
.preview-table td {
    padding: 10px 12px;
    border: 1px solid var(--line);
}

.content-meta div,
.details-list div,
.metric-list div {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.content-meta dt,
.details-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.content-meta dd,
.details-list dd {
    margin: 4px 0 0;
    color: var(--navy);
    font-weight: 800;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    padding: 24px;
}

.profile-avatar {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    color: var(--navy);
    background: var(--gold);
    border-radius: 8px;
    font-size: 30px;
    font-weight: 900;
}

.profile-card h2 {
    margin: 0;
    color: var(--navy);
}

.profile-card p {
    margin: 4px 0 0;
    color: var(--muted);
}

.details-list,
.metric-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.details-list {
    grid-template-columns: repeat(4, 1fr);
}

.metric-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.metric-list strong {
    color: var(--navy);
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1100px) {
    .stats-grid,
    .content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .public-header,
    .student-topbar,
    .cta-band,
    .student-hero,
    .public-footer div {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-nav,
    .student-nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .hero {
        min-height: 640px;
        padding-top: 70px;
    }

    .hero h1 {
        font-size: 50px;
    }

    .hero-subtitle {
        font-size: 23px;
    }

    .section-header h2,
    .cta-band h2 {
        font-size: 30px;
    }

    .split-grid,
    .card-grid,
    .benefits,
    .two-columns,
    .details-list {
        grid-template-columns: 1fr;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: 270px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .menu-toggle {
        display: inline-flex;
    }

    .content-area,
    .student-main {
        padding: 22px 16px;
    }

    .panel-topbar {
        padding: 14px 16px;
    }

    .form-grid,
    .form-grid.compact,
    .filters,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    body {
        font-size: 15px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 21px;
    }

    .stats-grid,
    .content-grid,
    .content-meta,
    .content-meta-wide,
    .card-actions.two {
        grid-template-columns: 1fr;
    }

    .panel-card,
    .auth-card,
    .feature-card,
    .content-card {
        padding: 18px;
    }

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

    .content-card footer {
        align-items: stretch;
        flex-direction: column;
    }
}
