:root {
    --bg: #f2f5f8;
    --surface: #ffffff;
    --surface-strong: #0f2a33;
    --text: #12303a;
    --muted: #5e7280;
    --line: rgba(18, 48, 58, 0.10);
    --brand: #0c5a6b;
    --brand-strong: #083c48;
    --accent: #d9a441;
    --success: #147a44;
    --danger: #b23c3c;
    --shadow: 0 18px 40px rgba(11, 31, 39, 0.10);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(12, 90, 107, 0.14), transparent 28%),
        radial-gradient(circle at right top, rgba(217, 164, 65, 0.10), transparent 20%),
        linear-gradient(180deg, #f8fafc, #edf3f7 60%, #eaf1f5);
}

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

img {
    max-width: 100%;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--brand), #0e7a92);
    color: #fff;
    box-shadow: 0 10px 24px rgba(12, 90, 107, 0.20);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.75);
    border-color: var(--line);
    color: var(--text);
}

.button-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
}

.button-block {
    width: 100%;
}

.ghost-link {
    color: var(--muted);
    font-weight: 600;
}

.site-topbar,
.dashboard-topbar,
.panel,
.hero-panel,
.auth-card,
.stat-card,
.sidebar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.site-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-lockup.compact {
    gap: 0.7rem;
}

.brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand-strong), var(--brand));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-logo {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 18px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.88);
    padding: 0.2rem;
    border: 1px solid var(--line);
}

.hero-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 22px;
    margin-bottom: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-subtitle,
.muted-text,
.page-kicker,
.mini-card-meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.landing-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 1.25rem auto 3rem;
}

.hero-panel,
.content-grid,
.panel {
    border-radius: var(--radius-xl);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
    gap: 1.25rem;
    padding: 1.4rem;
    border: 1px solid var(--line);
}

.hero-copy,
.hero-card,
.panel,
.auth-card,
.section-block,
.stat-card {
    position: relative;
}

.hero-copy {
    padding: 1.5rem;
}

.eyebrow {
    display: inline-flex;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(12, 90, 107, 0.10);
    color: var(--brand-strong);
    font-size: 0.85rem;
    font-weight: 700;
}

.hero-copy h1 {
    margin: 1rem 0 0.75rem;
    font-size: clamp(2.2rem, 4vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero-copy p {
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-actions,
.hero-pills,
.export-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-pills span {
    display: inline-flex;
    padding: 0.42rem 0.7rem;
    background: rgba(12, 90, 107, 0.08);
    border-radius: 999px;
    color: var(--brand-strong);
    font-size: 0.84rem;
    font-weight: 700;
}

.hero-card {
    margin: 0.5rem;
    padding: 1.2rem;
    border-radius: 24px;
    background: linear-gradient(180deg, #0b3d49, #124f5f 55%, #0c5a6b);
    color: #fff;
    overflow: hidden;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: auto -10% -30% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(217, 164, 65, 0.16);
    filter: blur(10px);
}

.metric-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.metric-grid article,
.hero-note {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem;
}

.metric-grid strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.metric-grid span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.hero-note {
    margin-top: 1rem;
}

.hero-note h2 {
    margin: 0 0 0.4rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

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

.panel {
    padding: 1.25rem;
    border: 1px solid var(--line);
}

.panel-head,
.section-head,
.list-row,
.timeline-item,
.admin-item,
.sidebar-top,
.sidebar-footer,
.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

.mini-card,
.timeline-item,
.admin-item,
.list-row {
    border-top: 1px solid var(--line);
    padding: 1rem 0 0;
    margin-top: 1rem;
}

.mini-card:first-of-type,
.timeline-item:first-of-type,
.admin-item:first-of-type,
.list-row:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.mini-card h3,
.timeline-item h3,
.admin-item strong,
.list-row strong {
    margin: 0.2rem 0 0.35rem;
}

.rich-content {
    line-height: 1.8;
    color: var(--text);
}

.rich-content > *:first-child {
    margin-top: 0;
}

.rich-content > *:last-child {
    margin-bottom: 0;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.rich-content img,
.rich-content video,
.rich-content iframe,
.rich-content object,
.rich-content embed {
    max-width: 100%;
    border-radius: 18px;
}

.rich-content a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.timeline-item {
    align-items: center;
}

.timeline-date {
    min-width: 110px;
    padding: 0.7rem 0.85rem;
    border-radius: 16px;
    background: rgba(12, 90, 107, 0.08);
    color: var(--brand-strong);
    font-weight: 700;
    text-align: center;
}

.feature-list {
    margin: 1rem 0 1.25rem;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.8;
}

.accent-panel {
    background: linear-gradient(180deg, rgba(12, 90, 107, 0.95), rgba(12, 90, 107, 0.84));
    color: #fff;
    border: 0;
}

.accent-panel .feature-list,
.accent-panel .muted-text {
    color: rgba(255, 255, 255, 0.82);
}

.auth-page {
    min-height: 100vh;
    padding: 0.5rem;
}

.auth-shell {
    width: min(560px, 100%);
}

.public-shell {
    width: 100%;
    margin: 0;
    padding: 0.5rem;
}

.auth-card {
    border-radius: 32px;
    padding: 1.4rem;
    border: 1px solid var(--line);
}

.auth-brand {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-brand h1 {
    margin: 0;
}

.demo-accounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem 0;
    align-items: center;
    color: var(--muted);
}

.demo-accounts code {
    background: rgba(12, 90, 107, 0.08);
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    color: var(--brand-strong);
}

.auth-form,
.editor-form {
    display: grid;
    gap: 1rem;
}

.field,
.auth-form label {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-size: 0.92rem;
    color: var(--muted);
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(12, 90, 107, 0.45);
    box-shadow: 0 0 0 4px rgba(12, 90, 107, 0.08);
}

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

.flash {
    margin: 1rem 0;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    font-weight: 700;
}

.flash-success {
    background: rgba(20, 122, 68, 0.12);
    color: var(--success);
}

.flash-error {
    background: rgba(178, 60, 60, 0.12);
    color: var(--danger);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-weight: 700;
    font-size: 0.83rem;
    background: rgba(12, 90, 107, 0.08);
    color: var(--brand-strong);
}

.badge-admin {
    background: rgba(12, 90, 107, 0.12);
}

.badge-guru {
    background: rgba(20, 122, 68, 0.12);
    color: var(--success);
}

.badge-murid {
    background: rgba(217, 164, 65, 0.16);
    color: #8a5f00;
}

.dashboard-page {
    overflow-x: hidden;
}

.public-shell,
.app-shell {
    width: 100%;
    margin: 0;
    padding: 0.5rem;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.sidebar {
    position: relative;
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    max-width: min(88vw, 320px);
    height: auto;
    max-height: calc(100vh - 1rem);
    overflow: hidden;
    border-radius: 28px;
    border: 0 solid transparent;
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    z-index: 40;
    opacity: 0;
    transform: translateX(-0.75rem);
    transition:
        width 0.24s ease,
        flex-basis 0.24s ease,
        opacity 0.18s ease,
        transform 0.24s ease,
        padding 0.24s ease,
        border-color 0.24s ease,
        border-width 0.24s ease,
        box-shadow 0.24s ease;
}

.app-shell.sidebar-open .sidebar,
.public-shell.sidebar-open .sidebar {
    flex-basis: min(88vw, 320px);
    width: min(88vw, 320px);
    opacity: 1;
    transform: translateX(0);
    padding: 1rem;
    border-width: 1px;
    border-color: var(--line);
    overflow: auto;
}

.sidebar-fab {
    position: relative;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    min-width: 2.25rem;
    align-self: center;
    margin: 0 0.35rem;
    height: 4.2rem;
    border-radius: 0 18px 18px 0;
    border: 1px solid rgba(12, 90, 107, 0.18);
    border-left: 0;
    background: linear-gradient(135deg, rgba(12, 90, 107, 0.96), rgba(14, 122, 146, 0.92));
    color: #fff;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 14px 30px rgba(12, 90, 107, 0.22);
    cursor: pointer;
    z-index: 5;
    display: grid;
    place-items: center;
    transition: transform 0.24s ease, background 0.16s ease, flex-basis 0.24s ease, width 0.24s ease;
}

.sidebar-fab:hover {
    background: linear-gradient(135deg, rgba(8, 60, 72, 0.98), rgba(12, 90, 107, 0.96));
}

.app-shell.sidebar-open .sidebar-fab,
.public-shell.sidebar-open .sidebar-fab {
    flex-basis: 2.25rem;
    width: 2.25rem;
}

.public-main,
.auth-main {
    padding: 0.5rem 0.5rem 2rem 0;
}

.public-main,
.auth-main,
.main-panel {
    flex: 1 1 auto;
    min-width: 0;
}

.auth-main {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 1rem);
}

.public-topbar {
    margin-bottom: 1rem;
}

.site-topbar,
.dashboard-topbar {
    width: 100%;
}

.sidebar-nav {
    display: grid;
    gap: 0.45rem;
    margin: 1rem 0;
}

.sidebar-nav a {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: var(--text);
    font-weight: 700;
    background: transparent;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(12, 90, 107, 0.10);
    color: var(--brand-strong);
}

.sidebar-footer {
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.sidebar-user {
    flex: 1;
    min-width: 0;
}

.sidebar-user span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.settings-preview {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.settings-logo {
    width: 5rem;
    height: 5rem;
    border-radius: 22px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    padding: 0.35rem;
}

.settings-mark {
    width: 5rem;
    height: 5rem;
    border-radius: 22px;
    font-size: 1rem;
}

.settings-banner {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 22px;
    margin: 0.5rem 0 1rem;
    border: 1px solid var(--line);
}

.theme-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0.5rem 0 1rem;
}

.theme-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem 0.45rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.84rem;
    font-weight: 700;
}

.theme-swatch::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    background: var(--swatch);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.main-panel {
    padding: 0.5rem 0.5rem 2rem 0;
}

.public-main,
.auth-main,
.main-panel {
    width: 100%;
    min-width: 0;
}

.dashboard-topbar {
    align-items: center;
    padding: 1rem 1.15rem;
    border-radius: 24px;
    border: 1px solid var(--line);
}

.section-block {
    margin-top: 1rem;
}

.section-head {
    margin: 0.25rem 0 1rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    padding: 1.15rem;
    border-radius: 22px;
    border: 1px solid var(--line);
}

.stat-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

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

.icon-button {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    cursor: pointer;
}

.mobile-menu-trigger {
    width: auto;
    min-width: 3.9rem;
    padding: 0 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    background: rgba(12, 90, 107, 0.10);
    color: var(--brand-strong);
    border-color: rgba(12, 90, 107, 0.18);
    box-shadow: 0 8px 20px rgba(12, 90, 107, 0.08);
}

.mobile-menu-trigger:hover {
    background: rgba(12, 90, 107, 0.14);
}

.site-topbar .mobile-menu-trigger,
.dashboard-topbar .mobile-menu-trigger {
    flex: 0 0 auto;
    align-self: center;
}

.backdrop {
    display: none;
}

.admin-item {
    align-items: center;
}

.admin-item > div {
    flex: 1;
}

.calendar-panel {
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.6rem;
}

.calendar-header {
    margin-bottom: 0.6rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.calendar-day {
    min-height: 88px;
    padding: 0.7rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-day strong {
    font-size: 1.1rem;
}

.calendar-day span