:root {
    --md-primary: #0b57d0;
    --md-on-primary: #ffffff;
    --md-primary-container: #d3e3fd;
    --md-on-primary-container: #041e49;
    --md-secondary-container: #c2e7ff;
    --md-tertiary: #006c51;
    --md-tertiary-container: #7ef8d0;
    --md-error: #ba1a1a;
    --md-error-container: #ffdad6;
    --md-surface: #f8f9ff;
    --md-surface-low: #f3f4fa;
    --md-surface-container: #eceef4;
    --md-surface-high: #e6e8ee;
    --md-surface-highest: #e0e2e8;
    --md-on-surface: #1a1c1e;
    --md-on-variant: #44474e;
    --md-outline: #74777f;
    --md-outline-var: #c4c6d0;
    --md-inv: #2f3033;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 28px;
    --nav-h: 72px;
    --bar-h: 56px;
    --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { background: var(--md-surface); }
body {
    font-family: "Roboto", system-ui, sans-serif;
    background: var(--md-surface);
    color: var(--md-on-surface);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    touch-action: manipulation;
}

.material-symbols-rounded {
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
    font-size: 22px;
    line-height: 1;
    user-select: none;
}
.nav-item.active .material-symbols-rounded,
.icon-btn .material-symbols-rounded.filled {
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.stage {
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background: var(--md-surface);
}

.device {
    width: 100%;
    max-width: 480px;
    min-height: 100dvh;
    min-height: 100vh;
    background: var(--md-surface);
    position: relative;
}

.device-screen {
    min-height: 100dvh;
    min-height: 100vh;
    height: 100dvh;
    background: var(--md-surface);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
}

.app-bar {
    height: var(--bar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 16px;
    flex: none;
    view-transition-name: app-bar;
    z-index: 2;
}
.app-bar-sub { padding-left: 4px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}
.brand-mark {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.4px;
    color: var(--md-primary);
}
.app-title {
    font-size: 20px;
    font-weight: 600;
    flex: 1;
    text-align: left;
    letter-spacing: 0.1px;
}
.app-bar-actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--md-on-surface);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.icon-btn.ghost { visibility: hidden; }
.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--md-error);
    color: #fff;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.avatar-btn {
    width: 36px;
    height: 36px;
    margin: 0 8px 0 4px;
    border-radius: 50%;
    background: linear-gradient(145deg, #0b57d0, #7bafef);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 16px 16px;
    animation: enter-fwd 320ms var(--ease);
    scrollbar-width: none;
    view-transition-name: content;
    -webkit-overflow-scrolling: touch;
}
.app-content::-webkit-scrollbar { display: none; }
.app-content.login-content {
    padding: 24px 22px calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
}
html[data-nav="back"] .app-content { animation-name: enter-back; }
html[data-nav="tab"] .app-content { animation-name: enter-tab; }
.app-content.leave { animation: leave-fwd 150ms var(--ease) forwards; }
.app-content.leave-back { animation: leave-back 150ms var(--ease) forwards; }
.app-content.leave-tab { animation: leave-tab 140ms var(--ease) forwards; }

@keyframes enter-fwd {
    from { opacity: 0; transform: translateX(22px); }
    to { opacity: 1; transform: none; }
}
@keyframes enter-back {
    from { opacity: 0; transform: translateX(-22px); }
    to { opacity: 1; transform: none; }
}
@keyframes enter-tab {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
@keyframes leave-fwd {
    to { opacity: 0; transform: translateX(-14px); }
}
@keyframes leave-back {
    to { opacity: 0; transform: translateX(14px); }
}
@keyframes leave-tab {
    to { opacity: 0; }
}
[hidden] { display: none !important; }

.bottom-nav {
    flex: none;
    min-height: var(--nav-h);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--md-surface-low);
    border-top: 1px solid rgba(26, 28, 30, 0.06);
    view-transition-name: bottom-nav;
    z-index: 2;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--md-on-variant);
    font-size: 12px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding-top: 2px;
}
.nav-indicator {
    width: 56px;
    height: 32px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    transition: background 180ms var(--ease);
}
.nav-item.active { color: var(--md-on-surface); }
.nav-item.active .nav-indicator { background: var(--md-secondary-container); }
.nav-item.active .nav-indicator .material-symbols-rounded { color: var(--md-on-primary-container); }
.nav-item,
.nav-indicator,
.nav-item .material-symbols-rounded {
    transition: color 180ms var(--ease), background 180ms var(--ease);
}

.hello {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.4px;
    line-height: 1.2;
    margin: 6px 0 4px;
}
.muted { color: var(--md-on-variant); font-size: 13px; line-height: 1.45; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--md-surface-container);
    font-size: 12px;
    font-weight: 500;
    color: var(--md-on-variant);
}
.chip .material-symbols-rounded { font-size: 16px; }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.stat {
    background: var(--md-surface-container);
    border-radius: var(--radius-lg);
    padding: 14px 10px 12px;
    text-align: center;
    min-height: 96px;
}
.stat .label {
    font-size: 11px;
    font-weight: 500;
    color: var(--md-on-variant);
    letter-spacing: 0.3px;
}
.stat .value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: -0.5px;
}
.stat.primary { background: var(--md-primary); color: #fff; }
.stat.primary .label { color: rgba(255,255,255,.82); }
.stat.teal { background: var(--md-tertiary-container); }
.stat.teal .value { color: #00382a; }

.section-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 10px;
    font-size: 14px;
    font-weight: 650;
}
.section-h a {
    font-size: 12px;
    font-weight: 600;
    color: var(--md-primary);
    text-decoration: none;
}

.exam-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(145deg, #083fa8 0%, #0b57d0 55%, #4f86f7 140%);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 16px 16px 14px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.exam-card::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    right: -40px;
    top: -48px;
}
.exam-kicker {
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.85;
    font-weight: 600;
}
.exam-card h3 { font-size: 18px; margin: 8px 0 12px; font-weight: 650; }
.due-card {
    background: linear-gradient(145deg, #7a2e00 0%, #c45c00 58%, #f4a261 140%);
}
.due-card.clear {
    background: linear-gradient(145deg, #0d5c3a 0%, #1b8a5a 60%, #6ee7b7 140%);
}
.taka-due { color: #9a3412; }
.method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 4px 0 12px;
}
.method-btn {
    border: 0;
    border-radius: 20px;
    padding: 18px 12px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.method-btn b { font-size: 16px; }
.method-btn small { font-size: 11px; opacity: 0.8; }
.method-btn.bkash { background: #fce4ec; color: #ad1457; }
.method-btn.nagad { background: #fff3e0; color: #e65100; }
.method-btn.rocket { background: #f3e5f5; color: #6a1b9a; }
.method-btn.card { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.receipt { text-align: center; padding: 12px 4px 24px; }
.receipt-ok {
    width: 72px;
    height: 72px;
    margin: 8px auto 10px;
    border-radius: 50%;
    background: var(--md-tertiary-container);
    color: #00382a;
    display: grid;
    place-items: center;
}
.receipt-ok .material-symbols-rounded { font-size: 40px; }
.receipt-amount {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--md-primary);
}
.exam-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,.14);
    border-radius: 99px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
}
.exam-meta .material-symbols-rounded { font-size: 15px; }

.card {
    background: var(--md-surface-container);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 14px;
}
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.row + .row { margin-top: 2px; }
.row:active { background: rgba(26, 28, 30, 0.05); }
.leading {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--md-primary-container);
    color: var(--md-on-primary-container);
    flex: none;
}
.leading.teal { background: var(--md-tertiary-container); color: #00382a; }
.leading.warn { background: #ffe08c; color: #3d2f00; }
.row .body { flex: 1; min-width: 0; }
.row .body b { display: block; font-weight: 600; font-size: 14px; }
.row .body small { color: var(--md-on-variant); font-size: 12px; }
.row .trail { color: var(--md-on-variant); font-size: 12px; font-weight: 600; text-align: right; }
.time-pill {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 650;
    color: var(--md-primary);
    min-width: 72px;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: var(--md-surface-container);
    padding: 4px;
    border-radius: 99px;
    margin: 4px 0 16px;
}
.tabs a {
    text-align: center;
    text-decoration: none;
    color: var(--md-on-variant);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 8px;
    border-radius: 99px;
}
.tabs a.active {
    background: var(--md-primary);
    color: #fff;
}

.day-head {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--md-primary);
    margin: 14px 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.day-head.today::after {
    content: "Today";
    background: var(--md-primary-container);
    color: var(--md-on-primary-container);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 99px;
    letter-spacing: 0;
    text-transform: none;
}

.course-top {
    background: var(--md-primary-container);
    border-radius: var(--radius-xl);
    padding: 16px;
    margin-bottom: 14px;
}
.course-top h2 { font-size: 16px; margin-bottom: 4px; }
.course-code {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--md-primary);
}

.grade {
    min-width: 42px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
}
.grade.ap { background: #c4eed0; color: #0b3b1e; }
.grade.a { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.grade.am { background: #ffe08c; color: #3d2f00; }

.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 8px 18px;
}
.profile-hero .ava {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(160deg, #0b57d0, #7bafef);
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(11, 87, 208, 0.28);
}
.profile-hero h2 { font-size: 24px; font-weight: 700; }
.profile-list {
    background: var(--md-surface-container);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 16px;
}
.profile-list .row {
    border-radius: 0;
    padding: 14px 16px;
}
.profile-list .row + .row { border-top: 1px solid rgba(26,28,30,.06); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 99px;
    border: 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.btn-filled { background: var(--md-primary); color: #fff; width: 100%; }
.btn-tonal { background: var(--md-primary-container); color: var(--md-on-primary-container); width: 100%; }
.btn-text { background: transparent; color: var(--md-primary); }
.btn-outline {
    background: transparent;
    color: var(--md-error);
    border: 1px solid var(--md-outline-var);
    width: 100%;
}
.btn-danger { background: var(--md-error); color: #fff; }
.btn:active { transform: scale(0.98); }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.field input {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--md-surface-container);
    padding: 0 16px;
    font: 16px/48px "Roboto", sans-serif;
    color: var(--md-on-surface);
    outline: none;
}
.field input:focus {
    border-color: var(--md-primary);
    background: var(--md-surface);
    box-shadow: 0 0 0 1px var(--md-primary);
}
.field span {
    font-size: 12px;
    font-weight: 500;
    color: var(--md-on-variant);
    padding-left: 4px;
}
#loginForm .btn-filled { margin-top: 6px; }
.login-logo {
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
    flex: none;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    margin: 4px auto 14px;
    box-shadow: 0 12px 32px rgba(11, 87, 208, 0.32);
}
.login-head { text-align: center; margin-bottom: 16px; }
.login-head h1 { font-size: 26px; font-weight: 700; }
.login-head p { color: var(--md-on-variant); margin-top: 6px; font-size: 14px; }
.login-foot { margin-top: 10px; padding-top: 0; }
.error-banner {
    background: var(--md-error-container);
    color: #410002;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    font-weight: 500;
}
.demo-hint {
    text-align: center;
    font-size: 12px;
    color: var(--md-on-variant);
    margin: 0 0 10px;
}

.notice-cat {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--md-primary);
}
.notice-article { padding: 4px 4px 24px; }
.notice-article h2 { font-size: 24px; line-height: 1.25; margin: 8px 0 12px; }
.notice-article p { font-size: 15px; line-height: 1.6; color: var(--md-on-variant); white-space: pre-wrap; }

.empty {
    text-align: center;
    padding: 36px 12px;
    color: var(--md-on-variant);
}
.empty .material-symbols-rounded { font-size: 40px; opacity: 0.5; display: block; margin-bottom: 8px; }

.sheet {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    transform: none;
    background: var(--md-surface-low);
    border-radius: 28px;
    padding: 10px 20px 18px;
    z-index: 90;
    box-shadow: 0 16px 48px rgba(0,0,0,.28);
}
.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 80;
}
.sheet-handle {
    width: 32px;
    height: 4px;
    border-radius: 4px;
    background: var(--md-outline-var);
    margin: 6px auto 14px;
}
.sheet h2 { font-size: 20px; margin-bottom: 6px; }
.sheet p { color: var(--md-on-variant); font-size: 14px; margin-bottom: 18px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }

.dialog-wrap {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 28px 22px;
}
.dialog-card {
    width: 100%;
    max-width: 320px;
    background: var(--md-surface-low);
    border-radius: 28px;
    padding: 22px 22px 16px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}
.dialog-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--md-primary);
    margin-bottom: 6px;
}
.dialog-card h2 {
    font-size: 22px;
    margin: 0 0 10px;
}
.dialog-card p {
    color: var(--md-on-variant);
    font-size: 14px;
    margin: 0 0 6px;
}
.dialog-name {
    color: var(--md-on-surface) !important;
    font-size: 18px !important;
    font-weight: 700;
    margin: 8px 0 4px !important;
}
.dialog-meta {
    margin-bottom: 18px !important;
}
.dialog-card .btn { width: 100%; margin-top: 6px; }

.ripple { position: relative; overflow: hidden; }
.ripple-ink {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple .5s linear;
    background: currentColor;
    opacity: .18;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(2.6); opacity: 0; }
}

.cgpa-bar {
    height: 8px;
    background: var(--md-surface-highest);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 10px;
}
.cgpa-bar > i {
    display: block;
    height: 100%;
    background: var(--md-primary);
    border-radius: inherit;
}

.result-sum {
    background: var(--md-surface-container);
    border-radius: var(--radius-xl);
    padding: 16px;
    margin-bottom: 14px;
}
.result-sum .big { font-size: 40px; font-weight: 700; letter-spacing: -1px; color: var(--md-primary); }

@supports (view-transition-name: none) {
    .app-content {
        animation: none;
    }
}
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; height: 100%; }
::view-transition-group(app-bar),
::view-transition-group(bottom-nav) { animation-duration: 1ms; }
html[data-nav="fwd"]::view-transition-old(content) { animation: leave-fwd 180ms var(--ease) both; }
html[data-nav="fwd"]::view-transition-new(content) { animation: enter-fwd 280ms var(--ease) both; }
html[data-nav="back"]::view-transition-old(content) { animation: leave-back 180ms var(--ease) both; }
html[data-nav="back"]::view-transition-new(content) { animation: enter-back 280ms var(--ease) both; }
html[data-nav="tab"]::view-transition-old(content) { animation: leave-tab 160ms var(--ease) both; }
html[data-nav="tab"]::view-transition-new(content) { animation: enter-tab 240ms var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
    .app-content,
    .app-content.leave,
    .app-content.leave-back,
    .app-content.leave-tab {
        animation: none !important;
    }
    ::view-transition-old(content),
    ::view-transition-new(content) {
        animation: none !important;
    }
}
