:root {
    --bg: #f5f7fb;
    --bg-soft: #eef2ff;
    --panel: rgba(255, 255, 255, .92);
    --panel-solid: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --border: #e2e8f0;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning: #d97706;
    --warning-soft: #ffedd5;
    --sidebar: #0f172a;
    --sidebar-soft: #172554;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --shadow: 0 20px 45px rgba(15, 23, 42, .10);
    --shadow-lg: 0 34px 70px rgba(15, 23, 42, .16);
    --radius: 22px;
    --radius-lg: 30px;
    --ring: 0 0 0 4px rgba(79, 70, 229, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, .12), transparent 30rem),
        radial-gradient(circle at 80% 0%, rgba(14, 165, 233, .10), transparent 28rem),
        var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; }
small, .muted { color: var(--muted); }

/* Landing page */
.landing {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, .20), transparent 28rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, .18), transparent 25rem),
        linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #ffffff 100%);
    padding: 28px;
    overflow-x: hidden;
}
.landing::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
    pointer-events: none;
}
.landing-nav {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1180px;
    margin: 0 auto 66px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
}
.landing-hero {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 34px;
    align-items: center;
}
.landing h1 {
    font-size: clamp(2.55rem, 5vw, 5rem);
    line-height: .98;
    margin: 16px 0 22px;
    letter-spacing: -.07em;
    color: #111827;
}
.landing p { color: var(--muted); font-size: 1.12rem; line-height: 1.8; max-width: 720px; }
.hero-card {
    position: relative;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 34px;
    box-shadow: var(--shadow-lg);
    padding: 30px;
    backdrop-filter: blur(18px);
    overflow: hidden;
}
.hero-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 7px;
    background: linear-gradient(90deg, #4f46e5, #06b6d4, #22c55e);
}
.hero-card h2 { margin: 0 0 18px; font-size: 1.35rem; }
.feature-list { display: grid; gap: 14px; margin-top: 20px; }
.feature-list div {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.feature-list strong { color: #1e293b; }

/* Auth */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(79, 70, 229, .22), transparent 30rem),
        radial-gradient(circle at 80% 70%, rgba(14, 165, 233, .16), transparent 28rem),
        linear-gradient(135deg, #f8fafc, #eef2ff);
    padding: 22px;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 32px;
    padding: 34px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { margin: 0; font-size: 2rem; letter-spacing: -.035em; }
.auth-card p { color: var(--muted); line-height: 1.7; }
.auth-card form { margin-top: 18px; }

/* App shell */
.app-shell {
    display: grid;
    grid-template-columns: 304px minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, .34), transparent 18rem),
        radial-gradient(circle at 80% 20%, rgba(14, 165, 233, .14), transparent 17rem),
        linear-gradient(180deg, #0f172a 0%, #111827 55%, #020617 100%);
    color: #e5e7eb;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    border-right: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 18px 0 45px rgba(15, 23, 42, .08);
    z-index: 60;
}
.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
.sidebar-inner::-webkit-scrollbar { width: 8px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .28); border-radius: 999px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}
.sidebar-brand {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -2px 0 16px;
    padding: 10px 8px 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(15, 23, 42, .76));
    backdrop-filter: blur(12px);
    border-radius: 20px;
}
.brand span { min-width: 0; }
.brand strong {
    display: block;
    letter-spacing: -.025em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand small {
    display: block;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-mark {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(79, 70, 229, .35);
}
.brand-logo {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .28);
    padding: 5px;
    box-shadow: 0 12px 26px rgba(2, 6, 23, .16);
}
.landing .brand-logo,
.auth-card .brand-logo {
    border-color: var(--border);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .10);
}
.sidebar-profile {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0 0 12px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .20);
    border-radius: 20px;
    background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.sidebar-profile strong,
.sidebar-profile small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 178px;
}
.sidebar-profile strong { font-size: .92rem; color: #fff; }
.sidebar-profile small { color: #cbd5e1; margin-top: 2px; font-size: .77rem; }
.school-context {
    margin: 0 0 16px;
    padding: 13px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.055));
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
}
.school-context small {
    display: block;
    opacity: .70;
    text-transform: uppercase;
    letter-spacing: .10em;
    font-size: .68rem;
    font-weight: 900;
    margin-bottom: 5px;
}
.school-context strong {
    display: block;
    font-size: .88rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #22c55e);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(79, 70, 229, .24);
}
.avatar.small { width: 36px; height: 36px; flex-basis: 36px; font-size: .9rem; }
.side-nav,
.nav {
    display: grid;
    gap: 12px;
    padding-bottom: 14px;
}
.nav-group {
    display: grid;
    gap: 6px;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, .10);
    border-radius: 19px;
    background: rgba(2, 6, 23, .18);
}
.nav-section {
    margin: 3px 8px 4px;
    color: #93a4bd;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.nav-link,
.side-nav a,
.nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    color: #cbd5e1;
    padding: 10px 11px;
    border-radius: 14px;
    transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
    border: 1px solid transparent;
    min-height: 44px;
}
.nav-icon,
.side-nav a span:first-child,
.nav a span:first-child {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .075);
    color: #dbeafe;
    font-size: .90rem;
}
.nav-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 760;
    letter-spacing: -.01em;
}
.nav-link:hover,
.side-nav a:hover,
.nav a:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
    border-color: rgba(255, 255, 255, .12);
    transform: translateX(2px);
}
.nav-link.active,
.side-nav a.active,
.nav a.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .32), rgba(37, 99, 235, .18));
    color: #fff;
    border-color: rgba(165, 180, 252, .28);
    box-shadow: inset 4px 0 0 #a5b4fc, 0 10px 25px rgba(2, 6, 23, .16);
}
.nav-link.active .nav-icon,
.side-nav a.active span:first-child,
.nav a.active span:first-child {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}
.sidebar-footer {
    margin-top: auto;
    padding: 12px 9px 2px;
    border-top: 1px solid rgba(148, 163, 184, .18);
}
.logout-link { background: rgba(220, 38, 38, .08); color: #fecaca; }
.logout-link:hover { background: rgba(220, 38, 38, .16); color: #fff; }
.main { padding: 30px; overflow-x: hidden; min-width: 0; }
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, .74);
    border: 1px solid rgba(226, 232, 240, .88);
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .15); }
.topbar h1 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -.045em; color: #0f172a; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 9px 12px;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    min-width: max-content;
}
.user-pill span { display: block; font-weight: 800; }
.user-pill small { display: block; color: var(--muted); margin-top: 1px; }
.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 900;
}
/* Layout helpers */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
    position: relative;
    background: var(--panel);
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: var(--radius);
    padding: 23px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { border-color: rgba(129, 140, 248, .45); box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0 0 14px; letter-spacing: -.032em; color: #111827; }
.card p { line-height: 1.7; }
.stat {
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 116px;
}
.stat::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -28px;
    width: 105px;
    height: 105px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(79, 70, 229, .16), rgba(14, 165, 233, .12));
}
.stat strong { display: block; font-size: 2.35rem; letter-spacing: -.06em; color: #111827; }
.stat span { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group { display: grid; gap: 7px; margin-bottom: 14px; }
label { font-weight: 800; font-size: .88rem; color: #334155; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 13px;
    background: #fff;
    color: var(--text);
    outline: none;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
select { cursor: pointer; }
input:focus, select:focus, textarea:focus { border-color: #818cf8; box-shadow: var(--ring); }
textarea {
    min-height: 220px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    line-height: 1.55;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 900;
    letter-spacing: -.01em;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 24px rgba(15, 23, 42, .13); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--primary), #2563eb); color: #fff; }
.btn.primary:hover { background: linear-gradient(135deg, var(--primary-dark), #1d4ed8); }
.btn.muted { background: #f1f5f9; color: #1e293b; border: 1px solid var(--border); }
.btn.danger { background: linear-gradient(135deg, var(--danger), #b91c1c); color: #fff; }
.btn.success { background: linear-gradient(135deg, var(--success), #15803d); color: #fff; }
.btn.small { padding: 7px 10px; border-radius: 11px; font-size: .84rem; box-shadow: none; }

/* Tables */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; background: #fff; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f8fafc; }
tr:last-child td { border-bottom: 0; }

/* Components */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .03em;
}
.badge.green { background: var(--success-soft); color: #166534; }
.badge.red, .badge.danger { background: var(--danger-soft); color: #991b1b; }
.badge.orange { background: var(--warning-soft); color: #9a3412; }
.alert {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid;
    box-shadow: var(--shadow-sm);
}
.alert.success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert.danger { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.empty { color: var(--muted); text-align: center; padding: 26px; }
.search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.hidden { display: none !important; }
.logo-preview {
    min-height: 170px;
    border: 1px dashed #cbd5e1;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    display: grid;
    place-items: center;
    padding: 24px;
}
.logo-preview img { max-width: 240px; max-height: 140px; object-fit: contain; }
.template-list { display: grid; gap: 10px; }
.template-list details,
.inline-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 13px 15px;
    margin-bottom: 14px;
}
.template-list summary,
.inline-panel summary { cursor: pointer; font-weight: 900; color: var(--text); }
pre {
    white-space: pre-wrap;
    overflow: auto;
    background: #0f172a;
    color: #e5e7eb;
    padding: 15px;
    border-radius: 16px;
    line-height: 1.55;
    border: 1px solid rgba(148, 163, 184, .22);
}

@media (max-width: 1100px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(88vw, 322px);
        z-index: 60;
        transform: translateX(-105%);
        transition: transform .22s ease;
        height: 100vh;
    }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 50;
        background: rgba(15, 23, 42, .48);
        backdrop-filter: blur(2px);
    }
    .main { padding: 18px; }
    .menu-toggle { display: inline-grid; place-items: center; flex: 0 0 42px; }
    .grid.cols-2, .grid.cols-3, .grid.cols-4, .landing-hero { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .user-pill { width: 100%; min-width: 0; }
    .landing { padding: 18px; }
    .landing-nav { margin-bottom: 34px; }
}
@media (max-width: 640px) {
    .auth-card, .hero-card, .card { border-radius: 22px; padding: 20px; }
    .landing h1 { font-size: 2.45rem; }
    .landing-nav { align-items: flex-start; gap: 12px; }
    .search-row { flex-direction: column; }
    .btn { width: 100%; }
    .actions .btn.small { width: auto; }
}

/* v6 Multi-school UI additions */
.auth-card.wide{max-width:820px;}
.school-banner{display:flex;align-items:center;justify-content:space-between;gap:16px;background:linear-gradient(135deg,#ffffff,#eef6ff);border:1px solid #dbeafe;}
.school-banner h2{margin:4px 0 4px;}
@media (max-width: 760px){.school-banner{display:block}.school-banner .btn{margin-top:12px}.landing-nav .actions{flex-wrap:wrap;justify-content:flex-end}}


/* Smart multi-entry schedule builder */
.page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.badge.soft {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.20);
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    white-space: nowrap;
}
.info-panel {
    margin: 16px 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(14, 165, 233, .10), rgba(37, 99, 235, .08));
    border: 1px solid rgba(37, 99, 235, .14);
    color: #334155;
    line-height: 1.55;
}
.full-span { grid-column: 1 / -1; }
.compact-grid { margin-top: 16px; }
.day-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 10px;
}
.check-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    font-weight: 700;
    color: #334155;
    transition: .18s ease;
}
.check-pill:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    transform: translateY(-1px);
}
.check-pill input { width: 16px; height: 16px; }
.check-pill:has(input:checked) {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}
.schedule-entry-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
}
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.section-title-row h3 {
    margin: 0 0 3px;
    color: #0f172a;
    font-size: 18px;
}
.schedule-entry-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.schedule-entry-row {
    display: grid;
    grid-template-columns: 44px 1.4fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}
.entry-index {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
}
.entry-index span {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #1d4ed8;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
}
.entry-actions {
    display: flex;
    align-items: center;
    height: 42px;
}
.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
@media (max-width: 900px) {
    .page-heading-row,
    .section-title-row { flex-direction: column; align-items: stretch; }
    .schedule-entry-row { grid-template-columns: 1fr; }
    .entry-index, .entry-actions { justify-content: flex-start; height: auto; }
}

/* V10 printable schedule board */
.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.schedule-filter-panel {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 12px;
    margin: 16px 0;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
}
.schedule-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 16px;
}
.schedule-summary-strip span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 800;
}
.schedule-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.printable-section-card {
    border: 1px solid #dbe4f0;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .06);
}
.section-schedule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-bottom: 1px solid #e2e8f0;
}
.schedule-kicker {
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 10px;
    font-weight: 900;
}
.section-schedule-head h3 {
    margin: 3px 0 2px;
    font-size: 20px;
    color: #0f172a;
}
.section-schedule-head p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}
.weekly-schedule-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    border-top: 0;
}
.weekly-day-column {
    min-width: 0;
    border-right: 1px solid #e2e8f0;
    background: #ffffff;
}
.weekly-day-column:last-child { border-right: 0; }
.weekly-day-title {
    padding: 10px 8px;
    text-align: center;
    background: #1e293b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.weekly-day-body {
    padding: 10px;
    min-height: 148px;
    background: #fff;
}
.schedule-chip {
    padding: 10px;
    margin-bottom: 9px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}
.schedule-chip:last-child { margin-bottom: 0; }
.schedule-chip-time {
    font-size: 12px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 5px;
}
.schedule-chip-subject {
    color: #1d4ed8;
    font-weight: 900;
    line-height: 1.28;
}
.schedule-chip-subject span {
    display: block;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}
.schedule-chip-meta {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
    line-height: 1.35;
}
.schedule-chip-remarks {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 9px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
    font-weight: 700;
}
.schedule-chip-actions {
    display: flex;
    gap: 6px;
    margin-top: 9px;
}
.btn.xsmall {
    min-height: auto;
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 8px;
}
.no-class-note {
    padding: 28px 6px;
    color: #94a3b8;
    text-align: center;
    font-size: 12px;
    font-style: italic;
}
.schedule-empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #f8fafc;
}
@media (max-width: 1280px) {
    .weekly-schedule-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
    .weekly-day-column:nth-child(3) { border-right: 0; }
}
@media (max-width: 900px) {
    .schedule-filter-panel { grid-template-columns: 1fr; }
    .weekly-schedule-grid { grid-template-columns: 1fr; }
    .weekly-day-column { border-right: 0; border-bottom: 1px solid #e2e8f0; }
    .weekly-day-column:last-child { border-bottom: 0; }
}
@media print {
    .sidebar, .topbar, .schedule-builder-card, .page-actions, .no-print, #scheduleAlert { display: none !important; }
    .main { margin: 0 !important; padding: 0 !important; }
    .card, .printable-section-card { box-shadow: none !important; }
    .schedule-filter-panel, .schedule-summary-strip { display: none !important; }
    .weekly-schedule-grid { grid-template-columns: repeat(6, 1fr) !important; }
    .weekly-day-column { border-right: 1px solid #e2e8f0 !important; border-bottom: 0 !important; }
    .weekly-day-column:last-child { border-right: 0 !important; }
    .printable-section-card { page-break-inside: avoid; margin-bottom: 14px; }
}

/* v11 schedule filters and big-view access */
.schedule-filter-panel.wide-filters {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}
.schedule-list-card .page-actions .btn {
    white-space: nowrap;
}
@media (min-width: 1320px) {
    .schedule-filter-panel.wide-filters {
        grid-template-columns: repeat(8, minmax(130px, 1fr));
    }
}
@media (max-width: 1100px) {
    .schedule-filter-panel.wide-filters {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}
@media (max-width: 720px) {
    .schedule-filter-panel.wide-filters {
        grid-template-columns: 1fr;
    }
}

/* Advanced Conflict + Availability Suggestions */
.availability-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
}

.suggestion-grid {
    margin-top: 14px;
}

.suggestion-context {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.suggestion-context span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e293b;
    font-size: 12px;
}

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

.suggestion-column {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
}

.suggestion-column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    background: #f8fafc;
}

.suggestion-column-head h4 {
    margin: 0;
    font-size: 14px;
    color: #0f172a;
}

.suggestion-list {
    display: grid;
    gap: 8px;
    padding: 12px;
    max-height: 310px;
    overflow: auto;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 14px;
    background: #ffffff;
}

.suggestion-item strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
}

.suggestion-item small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.suggestion-empty {
    padding: 16px;
    border: 1px dashed rgba(15, 23, 42, 0.18);
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
}

.suggestion-empty.small {
    padding: 12px;
    font-size: 12px;
}

.suggestion-empty.danger,
.suggestion-warning {
    border-color: rgba(220, 38, 38, 0.22);
    background: #fff1f2;
    color: #991b1b;
}

.suggestion-warning {
    padding: 12px 14px;
    border-radius: 16px;
    margin-bottom: 14px;
}

.suggestion-warning p {
    margin: 0 0 6px;
    line-height: 1.45;
}

.suggestion-warning p:last-child {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .suggestion-columns {
        grid-template-columns: 1fr;
    }
}

/* v13 Teacher Load polished view + print preview */
.teacher-load-hero {
    overflow: hidden;
    position: relative;
}
.teacher-load-hero::after {
    content: "";
    position: absolute;
    inset: auto -80px -100px auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    pointer-events: none;
}
.teacher-load-filters {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.85);
}
.teacher-load-filters .filter-actions {
    align-self: end;
}
.tight-actions {
    gap: 8px;
}
.load-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}
.metric-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}
.metric-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.metric-card strong {
    display: block;
    margin-top: 8px;
    color: #0f172a;
    font-size: 32px;
    line-height: 1;
}
.metric-card small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}
.teacher-load-board {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}
.teacher-load-card {
    border-left: 5px solid #2563eb;
}
.teacher-load-card .section-card-header {
    margin-bottom: 10px;
}
.teacher-load-card .card-kicker {
    color: #2563eb;
}
.teacher-load-mini-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.teacher-load-mini-summary span {
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #ffffff;
    padding: 7px 10px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}
.teacher-weekly-grid .weekly-day-body {
    min-height: 168px;
}
.teacher-chip {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}
@media (max-width: 1180px) {
    .teacher-load-filters,
    .load-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 720px) {
    .teacher-load-filters,
    .load-metrics {
        grid-template-columns: 1fr;
    }
}
@media print {
    .teacher-load-hero, .load-metrics .metric-card { box-shadow: none !important; }
    .teacher-load-filters, .teacher-load-hero .page-actions { display: none !important; }
    .load-metrics { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }
    .metric-card { padding: 10px !important; border-radius: 10px !important; }
    .metric-card strong { font-size: 20px !important; }
    .teacher-load-board { margin-top: 10px !important; }
    .teacher-load-card { page-break-inside: avoid; border-left: 0 !important; }
}


/* =========================================================
   V14 MOBILE APP READY RESPONSIVE LAYER
   Adds PWA-safe spacing, touch-friendly controls, mobile card tables,
   responsive schedule boards, and app-like navigation behavior.
   ========================================================= */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}
html {
    width: 100%;
    min-height: 100%;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(79, 70, 229, .14);
}
body {
    width: 100%;
    min-height: calc(var(--app-vh, 1vh) * 100);
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}
img, svg, video { max-width: 100%; height: auto; }
button, .btn, a, select, input, textarea { touch-action: manipulation; }
input, select, textarea { font-size: 16px; min-height: 46px; }
textarea { max-width: 100%; }
.btn { min-height: 44px; }
.btn.small { min-height: 38px; }
.btn.xsmall { min-height: 32px; }
.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}
.install-app-btn[hidden] { display: none !important; }
.main {
    padding-left: max(30px, var(--safe-left));
    padding-right: max(30px, var(--safe-right));
    padding-bottom: max(30px, calc(var(--safe-bottom) + 22px));
}
.sidebar { padding-top: var(--safe-top); padding-left: var(--safe-left); }
.sidebar-footer { padding-bottom: max(10px, var(--safe-bottom)); }
.table-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; }
th, td { vertical-align: top; }
.auth-page, .landing { min-height: calc(var(--app-vh, 1vh) * 100); }

/* More compact desktop-to-tablet wrapping */
@media (max-width: 1200px) {
    .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-filter-panel.wide-filters,
    .schedule-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .app-shell { display: block; }
    .sidebar {
        width: min(86vw, 340px);
        border-radius: 0 24px 24px 0;
    }
    .sidebar-inner { padding-bottom: max(20px, var(--safe-bottom)); }
    .main {
        padding: 14px max(14px, var(--safe-right)) max(18px, calc(var(--safe-bottom) + 16px)) max(14px, var(--safe-left));
    }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        margin: -6px -2px 16px;
        border-radius: 0 0 24px 24px;
        padding: max(12px, calc(var(--safe-top) + 10px)) 14px 14px;
        box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    }
    .topbar-left { width: 100%; align-items: flex-start; }
    .topbar h1 { font-size: 1.25rem; line-height: 1.18; }
    .topbar p, .eyebrow { display: none; }
    .topbar-right { width: 100%; justify-content: space-between; }
    .user-pill { flex: 1; width: auto; }
    .install-app-btn { flex: 0 0 auto; }
    .card { padding: 18px; border-radius: 20px; }
    .page-heading-row { gap: 12px; }
    .page-actions { justify-content: stretch; }
    .page-actions .btn { flex: 1 1 160px; }
    .schedule-filter-panel,
    .schedule-filter-panel.wide-filters,
    .form-grid,
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4 { grid-template-columns: 1fr !important; }
}

@media (max-width: 760px) {
    .landing { padding: 14px; }
    .landing-nav {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 24px;
    }
    .landing-nav .brand { align-items: flex-start; }
    .landing-nav .actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .landing-hero { gap: 18px; }
    .landing h1 { font-size: clamp(2.05rem, 12vw, 3rem); line-height: 1.02; }
    .landing p { font-size: 1rem; line-height: 1.65; }
    .auth-card { max-width: 100%; padding: 20px; border-radius: 24px; }
    .auth-card.wide { max-width: 100%; }
    .brand-logo, .brand-mark { width: 42px; height: 42px; border-radius: 15px; }
    .actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .actions .btn,
    .actions form,
    .actions button { width: 100%; }
    td.actions,
    .table-card-actions { display: grid !important; grid-template-columns: 1fr; gap: 8px; }

    /* Generic mobile table-to-card view. JS supplies data-label from table headers. */
    .table-wrap { overflow: visible; border: 0; }
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr { display: block; width: 100%; }
    .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .table-wrap tbody { display: grid; gap: 12px; }
    .table-wrap tbody tr {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
        padding: 8px 0;
    }
    .table-wrap tbody tr:has(.empty) { padding: 0; }
    .table-wrap tbody td {
        border: 0 !important;
        border-bottom: 1px solid #eef2f7 !important;
        display: grid;
        grid-template-columns: minmax(110px, 38%) 1fr;
        gap: 10px;
        align-items: start;
        padding: 11px 14px !important;
        white-space: normal;
        word-break: break-word;
    }
    .table-wrap tbody td:last-child { border-bottom: 0 !important; }
    .table-wrap tbody td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .76rem;
        font-weight: 900;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .table-wrap tbody td.empty {
        display: block;
        text-align: center;
        padding: 22px !important;
    }
    .table-wrap tbody td.empty::before { display: none; }

    .schedule-entry-row { padding: 12px; border-radius: 14px; }
    .day-check-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .check-pill { min-height: 46px; padding: 10px; }
    .schedule-chip-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .weekly-schedule-grid { display: grid; grid-template-columns: 1fr !important; }
    .section-schedule-head { align-items: flex-start; flex-direction: column; padding: 14px; }
    .weekly-day-title { position: sticky; top: 74px; z-index: 3; border-radius: 0; }
    .weekly-day-body { min-height: 96px; }
    .schedule-summary-strip { display: grid; grid-template-columns: 1fr 1fr; }
    .schedule-summary-strip span { justify-content: center; text-align: center; }
}

@media (max-width: 520px) {
    .main { padding-left: 10px; padding-right: 10px; }
    .topbar { margin-left: -10px; margin-right: -10px; }
    .menu-toggle { width: 46px; height: 46px; border-radius: 16px; }
    .topbar-left > div { min-width: 0; }
    .topbar h1 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-pill div { min-width: 0; }
    .user-pill span,
    .user-pill small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
    .card, .hero-card, .auth-card { padding: 16px; }
    .card h2, .card h3 { line-height: 1.2; }
    .form-group { margin-bottom: 12px; }
    input, select, textarea { border-radius: 13px; padding: 11px 12px; }
    .btn { width: 100%; padding-left: 12px; padding-right: 12px; }
    .btn.small, .btn.xsmall { width: 100%; }
    .day-check-grid { grid-template-columns: 1fr; }
    .badge.soft { width: 100%; justify-content: center; white-space: normal; text-align: center; }
    .schedule-summary-strip { grid-template-columns: 1fr; }
    .table-wrap tbody td { grid-template-columns: 1fr; gap: 4px; }
    .table-wrap tbody td::before { font-size: .72rem; }
}

/* Large schedule matrix becomes scrollable and useful on phones/tablets. */
.board-shell,
.big-board-shell,
.big-matrix-wrap,
.matrix-wrap,
.board-scroll {
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.big-matrix {
    min-width: 880px;
}
@media (max-width: 900px) {
    .big-matrix { min-width: 760px; }
    .schedule-board-page .card,
    .board-card { overflow: hidden; }
}

@media (display-mode: standalone) {
    body { background-attachment: fixed; }
    .topbar { user-select: none; }
}

@media print {
    html, body { overflow: visible !important; min-height: auto !important; }
    .topbar { position: static !important; }
    .install-app-btn { display: none !important; }
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr { display: revert !important; }
    .table-wrap thead { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; clip: auto !important; white-space: normal !important; }
    .table-wrap tbody tr { box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; }
    .table-wrap tbody td { display: table-cell !important; border-bottom: 1px solid #e5e7eb !important; padding: 8px !important; }
    .table-wrap tbody td::before { display: none !important; }
}


/* Modern professional DepEd login page */
.modern-login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: clamp(14px, 2vw, 28px);
    background:
        radial-gradient(circle at 8% 12%, rgba(37, 99, 235, .28), transparent 30rem),
        radial-gradient(circle at 85% 82%, rgba(14, 165, 233, .22), transparent 28rem),
        linear-gradient(135deg, #06112f 0%, #0f2f68 45%, #f8fafc 45.2%, #eef4ff 100%);
    overflow-x: hidden;
}
.modern-login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(120deg, black 0%, transparent 66%);
    pointer-events: none;
}
.login-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    min-height: min(760px, calc(100vh - 44px));
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .78fr);
    border-radius: 36px;
    overflow: hidden;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 40px 100px rgba(2, 6, 23, .34);
    backdrop-filter: blur(22px);
}
.login-showcase {
    position: relative;
    isolation: isolate;
    padding: clamp(28px, 5vw, 58px);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15,23,42,.76), rgba(29,78,216,.56)),
        radial-gradient(circle at 28% 18%, rgba(255,255,255,.24), transparent 19rem),
        linear-gradient(135deg, #0f172a, #1d4ed8 58%, #0369a1);
    overflow: hidden;
}
.login-showcase::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -190px;
    bottom: -210px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.20);
    z-index: -1;
}
.login-showcase-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 620px;
}
.login-official-seal {
    width: 118px;
    height: 118px;
    display: grid;
    place-items: center;
    margin-bottom: 28px;
    border-radius: 34px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 24px 55px rgba(2, 6, 23, .32);
    border: 1px solid rgba(255,255,255,.72);
}
.login-seal-logo {
    width: 104px;
    height: 104px;
    object-fit: contain;
    border-radius: 999px;
}
.login-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.9);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.login-showcase h1 {
    margin: 20px 0 18px;
    font-size: clamp(2.25rem, 4.8vw, 4.7rem);
    line-height: .96;
    letter-spacing: -.07em;
}
.login-showcase p {
    margin: 0;
    max-width: 560px;
    color: rgba(255,255,255,.82);
    font-size: 1.08rem;
    line-height: 1.8;
}
.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}
.login-feature-grid div {
    min-height: 132px;
    padding: 17px;
    border-radius: 22px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.11);
}
.login-feature-grid strong,
.login-feature-grid span { display: block; }
.login-feature-grid strong { font-size: .92rem; margin-bottom: 8px; }
.login-feature-grid span { color: rgba(255,255,255,.73); line-height: 1.55; font-size: .86rem; }
.login-panel {
    display: grid;
    place-items: center;
    padding: clamp(24px, 4vw, 48px);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 20rem),
        rgba(255,255,255,.80);
}
.login-card-pro {
    width: 100%;
    max-width: 456px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 30px;
    padding: clamp(24px, 3.5vw, 36px);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .13);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid #e5e7eb;
}
.login-brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 4px;
    box-shadow: 0 12px 28px rgba(15,23,42,.10);
}
.login-brand strong,
.login-brand small { display: block; }
.login-brand strong { color: #0f172a; font-size: 1.05rem; letter-spacing: -.02em; }
.login-brand small { color: #64748b; margin-top: 2px; }
.login-title-block { margin-bottom: 22px; }
.auth-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.login-title-block h2 {
    margin: 14px 0 8px;
    color: #0f172a;
    font-size: clamp(1.85rem, 3vw, 2.45rem);
    letter-spacing: -.055em;
    line-height: 1;
}
.login-title-block p {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
}
.modern-login-form { display: grid; gap: 14px; }
.modern-login-form .form-group { margin-bottom: 0; }
.modern-login-form label {
    color: #334155;
    font-weight: 850;
    font-size: .82rem;
    margin-bottom: 8px;
}
.modern-login-form input {
    min-height: 54px;
    border-radius: 17px;
    border: 1px solid #dbe3ef;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 14px 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.modern-login-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.13);
    outline: none;
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 76px; }
.password-toggle {
    position: absolute;
    right: 9px;
    bottom: 9px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 900;
    cursor: pointer;
}
.login-submit {
    width: 100%;
    min-height: 55px;
    justify-content: center;
    margin-top: 4px;
    border-radius: 17px;
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #0284c7);
    box-shadow: 0 18px 35px rgba(37, 99, 235, .26);
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 22px 45px rgba(37, 99, 235, .32); }
.login-helper-row {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
    color: #64748b;
    font-size: .9rem;
}
.login-helper-row a {
    color: #1d4ed8;
    font-weight: 900;
}
.login-helper-row strong { color: #0f172a; }

@media (max-width: 1080px) {
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
    .login-showcase { padding: 32px; }
    .login-showcase-inner { justify-content: flex-start; }
    .login-feature-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 760px) {
    .modern-login-page {
        padding: 0;
        background: linear-gradient(180deg, #0f2f68 0%, #f8fafc 28%, #eef4ff 100%);
    }
    .login-shell { width: 100%; border-radius: 0; min-height: 100vh; box-shadow: none; }
    .login-showcase { padding: max(22px, calc(var(--safe-top) + 18px)) 18px 18px; }
    .login-official-seal { width: 86px; height: 86px; border-radius: 24px; margin-bottom: 18px; }
    .login-seal-logo { width: 76px; height: 76px; }
    .login-showcase h1 { font-size: clamp(2rem, 11vw, 3rem); }
    .login-showcase p { font-size: .96rem; line-height: 1.65; }
    .login-feature-grid { grid-template-columns: 1fr; margin-top: 18px; }
    .login-feature-grid div { min-height: auto; padding: 14px; }
    .login-panel { padding: 18px; align-items: start; }
    .login-card-pro { max-width: 100%; border-radius: 24px; padding: 20px; }
    .login-brand-logo { width: 50px; height: 50px; }
}
@media (max-width: 420px) {
    .login-kicker { font-size: .68rem; white-space: normal; }
    .login-title-block h2 { font-size: 1.85rem; }
    .password-wrap input { padding-right: 72px; }
}
