/* =====================================================================
   SchoolMate - Theme
   Palette: deep teal institution + warm amber highlight, calm neutrals.
   ===================================================================== */
:root {
    --sm-primary:      #0d9488;
    --sm-primary-dark: #0f766e;
    --sm-ink:          #0c2b29;   /* sidebar background */
    --sm-ink-soft:     #14403c;   /* sidebar hover      */
    --sm-accent:       #f59e0b;   /* amber highlight    */
    --sm-bg:           #eef2f1;   /* app background     */
    --sm-surface:      #ffffff;
    --sm-border:       #e2e8e6;
    --sm-text:         #14201f;
    --sm-muted:        #6b7c7a;
    --sm-sidebar-w:    252px;
    --sm-topbar-h:     64px;
    --sm-radius:       12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--sm-bg);
    color: var(--sm-text);
    font-size: 15px;
    line-height: 1.5;
}

/* ---------------- Shell ---------------- */
.sm-shell { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sm-sidebar {
    width: var(--sm-sidebar-w);
    background: var(--sm-ink);
    color: #cfe4e1;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.sm-brand {
    height: var(--sm-topbar-h);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1.4rem;
    font-size: 1.25rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sm-brand:hover { color: #fff; }
.sm-brand .bi { color: var(--sm-primary); font-size: 1.5rem; }
.sm-brand strong { color: var(--sm-primary); font-weight: 700; }
.sm-brand span { font-weight: 500; letter-spacing: .2px; }

.sm-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; }
.sm-nav ul { list-style: none; margin: 0; padding: 0; }
.sm-nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: .75rem .5rem; }

.sm-nav-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .62rem .85rem;
    margin-bottom: 2px;
    border-radius: 9px;
    color: #b7cfcb;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: background .15s, color .15s;
}
.sm-nav-link .bi { font-size: 1.05rem; width: 20px; text-align: center; }
.sm-nav-link:hover { background: var(--sm-ink-soft); color: #fff; }
.sm-nav-link.active { background: var(--sm-primary); color: #fff; }
.sm-nav-link.active::before {
    content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--sm-accent);
}
.sm-nav-link.sm-soon { opacity: .55; cursor: default; }
.sm-nav-link.sm-soon:hover { background: transparent; color: #b7cfcb; }
.sm-badge-soon {
    margin-left: auto; font-size: .62rem; font-weight: 600;
    background: rgba(245,158,11,.18); color: var(--sm-accent);
    padding: .1rem .4rem; border-radius: 20px;
}

/* ---------------- Main ---------------- */
.sm-main {
    flex: 1;
    margin-left: var(--sm-sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sm-topbar {
    height: var(--sm-topbar-h);
    background: var(--sm-surface);
    border-bottom: 1px solid var(--sm-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.sm-page-title {
    font-size: 1.15rem; font-weight: 600; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sm-toggle {
    display: none; border: 0; background: transparent;
    font-size: 1.4rem; color: var(--sm-text); cursor: pointer;
}
.sm-topbar-right { margin-left: auto; }

.sm-user {
    display: flex; align-items: center; gap: .6rem;
    background: transparent; border: 0; cursor: pointer; padding: .3rem;
    border-radius: 8px; color: var(--sm-text);
}
.sm-user:hover { background: var(--sm-bg); }
.sm-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--sm-primary); color: #fff;
    display: grid; place-items: center; font-weight: 600;
}
.sm-user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.sm-user-name { font-weight: 600; font-size: .9rem; }
.sm-user-role { font-size: .75rem; color: var(--sm-muted); }

.sm-content { padding: 1.75rem; flex: 1; }

/* ---------------- Cards / helpers ---------------- */
.sm-card {
    background: var(--sm-surface);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 1.25rem 1.4rem;
}
.sm-card-title { font-size: .95rem; font-weight: 600; margin: 0 0 1rem; }

.sm-stat {
    background: var(--sm-surface);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 1.25rem 1.4rem;
    display: flex; align-items: center; gap: 1rem;
}
.sm-stat-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.4rem;
    background: rgba(13,148,136,.1); color: var(--sm-primary);
}
.sm-stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.sm-stat-label { color: var(--sm-muted); font-size: .85rem; }

.sm-page-lead { color: var(--sm-muted); margin-top: -.25rem; }

/* Bootstrap accent overrides */
.btn-primary {
    --bs-btn-bg: var(--sm-primary); --bs-btn-border-color: var(--sm-primary);
    --bs-btn-hover-bg: var(--sm-primary-dark); --bs-btn-hover-border-color: var(--sm-primary-dark);
    --bs-btn-active-bg: var(--sm-primary-dark); --bs-btn-active-border-color: var(--sm-primary-dark);
}
a { color: var(--sm-primary-dark); }

/* ---------------- Login ---------------- */
.sm-login-body {
    min-height: 100vh; display: grid; place-items: center;
    background: radial-gradient(circle at 30% 20%, #14403c, var(--sm-ink) 70%);
    padding: 1.5rem;
}
.sm-login-card {
    width: 100%; max-width: 400px;
    background: var(--sm-surface); border-radius: 16px;
    padding: 2.25rem; box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.sm-login-brand {
    display: flex; align-items: center; gap: .55rem;
    font-size: 1.5rem; font-weight: 500; margin-bottom: .35rem;
}
.sm-login-brand .bi { color: var(--sm-primary); }
.sm-login-brand strong { color: var(--sm-primary); font-weight: 700; }
.sm-login-sub { color: var(--sm-muted); margin-bottom: 1.5rem; font-size: .9rem; }
.sm-login-card .form-label { font-weight: 500; font-size: .85rem; }
.sm-login-card .form-control { padding: .6rem .8rem; }
.sm-login-card .form-control:focus {
    border-color: var(--sm-primary); box-shadow: 0 0 0 .2rem rgba(13,148,136,.15);
}
.sm-login-hint {
    margin-top: 1.25rem; font-size: .78rem; color: var(--sm-muted);
    background: var(--sm-bg); border-radius: 8px; padding: .6rem .8rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 992px) {
    .sm-sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .sm-shell.sm-open .sm-sidebar { transform: translateX(0); }
    .sm-main { margin-left: 0; }
    .sm-toggle { display: inline-flex; }
    .sm-user-meta { display: none; }
    .sm-shell.sm-open::after {
        content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035;
    }
}

@media (max-width: 576px) {
    body { font-size: 14px; }
    .sm-topbar { padding: 0 1rem; }
    .sm-content { padding: 1.1rem; }
    .sm-stat { padding: 1rem; gap: .75rem; }
    .sm-stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .sm-stat-value { font-size: 1.35rem; }
    .sm-card { padding: 1.1rem; }
    .sm-login-card { padding: 1.75rem; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
    .sm-sidebar, .sm-nav-link, .sm-user { transition: none; }
}

/* Print — used by the student result sheet */
@media print {
    .sm-sidebar, .sm-topbar, .sm-flash, .d-print-none { display: none !important; }
    .sm-main, .sm-content { margin: 0 !important; padding: 0 !important; }
    .sm-card { box-shadow: none !important; border: none !important; }
    body { background: #fff !important; }
}
