:root {
    --bg: #f3f9fd;
    --surface: #ffffff;
    --ink: #163a52;
    --muted: #5b7a90;
    --accent: #1e9ad6;
    --accent-2: #3bb4ea;
    --accent-3: #6ecaf3;
    --accent-dark: #1480b8;
    --coral: #c45c4a;
    --amber: #c4922a;
    --violet: #4a6270;
    --border: #d2eaf6;
    --excellent: #1f7a5c;
    --good: #1e9ad6;
    --satisfactory: #b8860b;
    --needs: #b86a3d;
    --unsatisfactory: #a33b3b;
    --sidebar: #0f6f9e;
    --sidebar-2: #1890c4;
    --shadow: 0 14px 40px rgba(30, 154, 214, 0.12);
    --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(59, 180, 234, 0.14), transparent 40%),
        radial-gradient(circle at 90% 0%, rgba(110, 202, 243, 0.16), transparent 35%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
}

h1, h2, h3, .brand, .page-title, .home-brand strong {
    font-family: "Sora", "Manrope", sans-serif;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }

/* ===== App shell ===== */
.app-shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(165deg, var(--sidebar) 0%, var(--sidebar-2) 55%, #3bb4ea 100%);
    color: #e8fbff;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.08);
}

.brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.brand-lockup__mark {
    width: 140px;
    height: 140px;
    object-fit: contain;
    background: transparent;
    flex-shrink: 0;
    filter: drop-shadow(0 14px 28px rgba(30, 154, 214, 0.3));
}

.brand-lockup__text {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    line-height: 1.1;
}

.brand-lockup__text strong {
    margin: 0;
    font-family: "Sora", "Manrope", sans-serif;
    font-size: clamp(1.55rem, 3.2vw, 2.15rem);
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    color: #163a52;
}

.brand-lockup__text em {
    font-style: normal;
    background: linear-gradient(90deg, #1e9ad6, #3bb4ea);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-lockup__text small {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #5b7a90;
}

.brand-lockup--sidebar {
    gap: 0.9rem;
    color: #e8fbff;
}

.brand-lockup--sidebar .brand-lockup__mark {
    width: 96px;
    height: 96px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
}

.brand-lockup--sidebar .brand-lockup__text strong {
    color: #fff;
    font-size: 1.08rem;
    letter-spacing: 0.045em;
}

.brand-lockup--sidebar .brand-lockup__text em {
    background: linear-gradient(90deg, #b9e5f9, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-lockup--sidebar .brand-lockup__text small {
    color: rgba(232, 251, 255, 0.78);
    font-size: 0.72rem;
}

.brand-lockup--auth {
    justify-content: center;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
}

.brand-lockup--auth .brand-lockup__mark {
    width: 128px;
    height: 128px;
}

.brand-logo-full {
    display: block;
    height: 72px;
    width: auto;
    max-width: min(280px, 70vw);
    object-fit: contain;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.brand-logo-full--sidebar {
    height: 58px;
    max-width: 200px;
    background: transparent;
}

.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    flex-shrink: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3bb4ea, #1e9ad6);
    color: #04343f;
    font-weight: 800;
}

.brand-sub {
    font-size: 0.78rem;
    opacity: 0.8;
    margin: 0.35rem 0 1.4rem;
}

.nav-link {
    display: block;
    color: #e8fbff;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    margin-bottom: 0.3rem;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.main {
    padding: 1.5rem 2rem 3rem;
    animation: fade-up 0.55s ease both;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.sidebar-head {
    display: block;
}

.sidebar-close,
.sidebar-toggle,
.sidebar-backdrop {
    display: none;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #163a52, #1e9ad6 55%, #3bb4ea);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.user-chip {
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0,168,168,0.12);
    animation: fade-down 0.5s ease both;
}

.card-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f7fdff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
    animation: fade-up 0.55s ease both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(6, 56, 70, 0.14);
}

.card-panel h2,
.card-panel h3 { margin-top: 0; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: linear-gradient(145deg, #fff, #eefcff);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: scale-in 0.45s ease both;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 30px rgba(30, 200, 255, 0.18);
}

.stat-card .label {
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Dashboard visuals */
.dash-visuals {
    margin-bottom: 1.25rem;
}

.dash-visuals__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dash-panel {
    position: relative;
    background: linear-gradient(165deg, #ffffff 0%, #f3faff 55%, #eaf6fc 100%);
    border: 1px solid rgba(30, 154, 214, 0.18);
    border-radius: 1.25rem;
    padding: 1.15rem 1.2rem 1rem;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(30, 154, 214, 0.1);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease, box-shadow 0.3s ease;
}

.dash-panel.is-in {
    opacity: 1;
    transform: translateY(0);
}

.dash-panel:hover {
    box-shadow: 0 22px 44px rgba(30, 154, 214, 0.16);
}

.dash-panel--wide {
    margin-bottom: 1rem;
}

.dash-panel--gauge {
    grid-row: span 1;
}

.dash-panel__aura {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    right: -60px;
    top: -70px;
    background: radial-gradient(circle, rgba(59, 180, 234, 0.28), transparent 68%);
    animation: mon-aura 6s ease-in-out infinite;
    pointer-events: none;
}

.dash-panel__head {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.dash-panel__head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #163a52;
}

.dash-panel__tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1480b8;
    background: rgba(30, 154, 214, 0.1);
    border: 1px solid rgba(30, 154, 214, 0.16);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.dash-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1480b8;
    background: rgba(30, 154, 214, 0.1);
    border: 1px solid rgba(30, 154, 214, 0.18);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
}

.dash-live i {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: mon-live 1.5s ease-out infinite;
}

.dash-gauge-wrap {
    position: relative;
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 1rem;
    align-items: center;
}

.dash-gauge .mon-gauge__prog {
    stroke: url(#dashGrad);
}

.dash-panel.is-in .dash-gauge .mon-gauge__prog {
    stroke-dashoffset: calc(364.4 - (364.4 * var(--p) / 100));
}

.dash-panel.is-in .dash-gauge {
    animation: mon-gauge-breathe 3.4s ease-in-out infinite;
}

.dash-gauge-stats {
    opacity: 1;
}

.dash-gauge-stats li {
    opacity: 0;
    transform: translateX(10px);
}

.dash-panel.is-in .dash-gauge-stats li {
    opacity: 1;
    transform: translateX(0);
}

.dash-panel.is-in .dash-gauge-stats li:nth-child(1) { transition-delay: 0.15s; }
.dash-panel.is-in .dash-gauge-stats li:nth-child(2) { transition-delay: 0.25s; }
.dash-panel.is-in .dash-gauge-stats li:nth-child(3) { transition-delay: 0.35s; }

.dash-panel__foot {
    position: relative;
    margin: 0.85rem 0 0;
    font-size: 0.8rem;
    color: #7a98ad;
}

.dash-chart-wrap {
    position: relative;
    height: 220px;
}

.dash-chart-wrap--sm { height: 200px; }
.dash-chart-wrap--bars { height: 280px; }

.dash-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.dash-progress-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.dash-progress-meta > div {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(30, 154, 214, 0.12);
    border-radius: 0.85rem;
    padding: 0.55rem 0.75rem;
}

.dash-progress-meta span {
    display: block;
    font-size: 0.75rem;
    color: #7a98ad;
    font-weight: 600;
}

.dash-progress-meta strong {
    font-size: 1.25rem;
    color: #163a52;
    font-weight: 800;
}

.dash-meter {
    --p: 0;
    position: relative;
    margin-top: 0.85rem;
    height: 2.35rem;
    border-radius: 999px;
    background: rgba(30, 154, 214, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
}

.dash-meter__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, #7ad0f5, #1e9ad6 55%, #1480b8);
    border-radius: inherit;
    transition: width 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash-panel.is-in .dash-meter__fill {
    width: calc(var(--p) * 1%);
}

.dash-meter span {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 800;
    color: #163a52;
    mix-blend-mode: multiply;
}

@media (max-width: 980px) {
    .dash-visuals__grid { grid-template-columns: 1fr; }
    .dash-gauge-wrap { grid-template-columns: 1fr; justify-items: center; }
    .dash-gauge-stats { width: 100%; }
}

@media (max-width: 560px) {
    .dash-chart-wrap,
    .dash-chart-wrap--sm { height: 190px; }
    .dash-chart-wrap--bars { height: 240px; }
}

.kpi-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    animation: pop-in 0.4s ease both;
}

.kpi-excellent { background: linear-gradient(135deg, #1f7a5c, #2d9a74); }
.kpi-good { background: linear-gradient(135deg, #2a6f8f, #3a85a8); }
.kpi-satisfactory { background: linear-gradient(135deg, #b8860b, #c9a03a); color: #fff; }
.kpi-needs { background: linear-gradient(135deg, #b86a3d, #c97e55); }
.kpi-unsatisfactory { background: linear-gradient(135deg, #a33b3b, #b85050); }

.table th {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 168, 168, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 168, 168, 0.35);
    filter: brightness(1.05);
}

.score-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) 140px minmax(240px, 1.6fr);
    gap: 1rem;
    align-items: start;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--border);
}

.score-row:last-child { border-bottom: none; }
.score-row .kpi-name { font-weight: 700; line-height: 1.35; }
.score-input { width: 100%; }
.score-evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.evidence-current a { font-size: 0.85rem; }
.evidence-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.pub-scientific-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #e8f7f4;
    color: #0b6b5c;
    font-size: 0.9rem;
}
.pub-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.pub-badge--intl { background: #e7f0ff; color: #1a4f9c; }
.pub-badge--local { background: #fff3df; color: #8a5a00; }

.evidence-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.evidence-thumb-btn {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}
.evidence-modal[hidden] { display: none !important; }
.evidence-modal {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.evidence-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}
.evidence-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(960px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.28);
    overflow: hidden;
}
.evidence-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.evidence-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}
.evidence-modal__tools {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.evidence-modal__body {
    position: relative;
    flex: 1;
    min-height: 320px;
    max-height: calc(92vh - 64px);
    overflow: auto;
    background: #f6f8fb;
    padding: 0.75rem;
}
.evidence-modal__body img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 100px);
    margin: 0 auto;
    border-radius: 8px;
}
.evidence-modal__body iframe {
    width: 100%;
    height: calc(92vh - 100px);
    border: 0;
    background: #fff;
    border-radius: 8px;
}
.evidence-modal__docx {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    line-height: 1.55;
}
.evidence-modal__docx h1,
.evidence-modal__docx h2,
.evidence-modal__docx h3 { margin-top: 0.75rem; }
.evidence-modal__loading,
.evidence-modal__fallback {
    padding: 2rem 1rem;
    text-align: center;
    color: #445;
}

.status-badge {
    display: inline-block;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-evaluated { background: #d8f8ea; color: #0b7a4d; }
.status-pending,
.status-not_started { background: #fff3cd; color: #856404; }
.status-in_progress { background: #d6f0ff; color: #0b5f8a; }

.table-warning-soft { background: rgba(255, 243, 205, 0.45) !important; }

.role-group-title {
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--accent), var(--accent-2), transparent) 1;
    color: var(--accent-dark);
}

.dept-group-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
    color: var(--ink);
}

.alert { border-radius: 14px; border: none; animation: fade-down 0.4s ease both; }

.form-control, .form-select {
    border-radius: 12px;
    border-color: var(--border);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 0.25rem rgba(59, 180, 234, 0.2);
}

/* ===== Home page ===== */
.home-body {
    overflow-x: hidden;
    background:
        linear-gradient(165deg, #f8fcff 0%, #eaf6fc 28%, #d7effa 62%, #c4e7f7 100%);
    color: #163a52;
    min-height: 100vh;
}

.home-bg-orbs { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.35;
    animation: drift 16s ease-in-out infinite;
}
.orb-a { width: 360px; height: 360px; background: #7ec8ef; top: -80px; left: -60px; }
.orb-b { width: 280px; height: 280px; background: #a6daf5; bottom: 10%; right: -40px; animation-delay: -4s; }
.orb-c { width: 220px; height: 220px; background: #5eb8e8; top: 40%; left: 40%; animation-delay: -7s; }

.home-nav,
.home-hero,
.home-leaders,
.top-league,
.home-login-section,
.home-footer {
    position: relative;
    z-index: 1;
}

.home-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 4vw;
    gap: 1rem;
}

.home-brand {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e9ad6, #3bb4ea);
    color: #fff;
    animation: pulse-glow 2.8s ease-in-out infinite;
}

.home-brand strong { display: block; font-size: 1.15rem; color: #163a52; }
.home-brand small { opacity: 0.85; color: #5b7a90; }

.btn-home-login {
    background: #1e9ad6;
    border: 1px solid #1e9ad6;
    color: #fff;
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    font-weight: 700;
    transition: transform 0.25s ease, background 0.25s ease;
}

.btn-home-login:hover {
    background: #1480b8;
    color: #fff;
    transform: translateY(-2px);
}

.home-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    padding: 2rem 6vw 3rem;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(30, 154, 214, 0.12);
    color: #1e9ad6;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.home-hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.15;
    margin: 1rem 0;
    font-weight: 800;
    color: #163a52;
}

.home-hero h1 span {
    background: linear-gradient(90deg, #1e9ad6, #3bb4ea, #6ecaf3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 4s linear infinite;
    background-size: 200% auto;
}

.home-hero .lead {
    font-size: 1.08rem;
    color: #5b7a90;
    max-width: 34rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.btn-outline-light {
    border: 2px solid #1e9ad6;
    color: #1e9ad6;
    border-radius: 12px;
    font-weight: 700;
}
.btn-outline-light:hover { background: #1e9ad6; color: #fff; }

.home-hero-card,
.mon-card {
    position: relative;
    background: linear-gradient(165deg, #ffffff 0%, #f3faff 55%, #eaf6fc 100%);
    border: 1px solid rgba(30, 154, 214, 0.2);
    border-radius: 1.75rem;
    padding: 1.5rem 1.45rem 1.35rem;
    color: #163a52;
    box-shadow: 0 28px 60px rgba(30, 154, 214, 0.14);
    overflow: hidden;
    animation: float-y 5.5s ease-in-out infinite;
}

.mon-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(145deg, rgba(30, 154, 214, 0.55), transparent 42%, rgba(122, 208, 245, 0.5));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.mon-card__aura {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    right: -70px;
    top: -80px;
    background: radial-gradient(circle, rgba(59, 180, 234, 0.35), transparent 68%);
    animation: mon-aura 6s ease-in-out infinite;
    pointer-events: none;
}

.mon-card__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(30, 154, 214, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 154, 214, 0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.35), transparent 75%);
    pointer-events: none;
}

.mon-card__top {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.mon-card__live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1480b8;
    background: rgba(30, 154, 214, 0.1);
    border: 1px solid rgba(30, 154, 214, 0.18);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
}

.mon-card__live i {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: mon-live 1.5s ease-out infinite;
}

.mon-card__kpi {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #1e9ad6, #3bb4ea);
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(30, 154, 214, 0.28);
}

.mon-card h2 {
    position: relative;
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: #163a52;
    letter-spacing: -0.02em;
}

.mon-card__lead {
    position: relative;
    margin: 0.4rem 0 1.1rem;
    color: #5b7a90;
    font-size: 0.92rem;
    line-height: 1.45;
}

.mon-card__body {
    position: relative;
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.15rem;
}

.mon-gauge {
    position: relative;
    width: 132px;
    height: 132px;
}

.mon-gauge svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.mon-gauge__track,
.mon-gauge__prog {
    fill: none;
    stroke-width: 10;
}

.mon-gauge__track { stroke: #d7eef8; }

.mon-gauge__prog {
    stroke: url(#monGrad);
    stroke-linecap: round;
    stroke-dasharray: 364.4;
    stroke-dashoffset: 364.4;
    filter: drop-shadow(0 0 8px rgba(59, 180, 234, 0.45));
    transition: stroke-dashoffset 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mon-card.is-in .mon-gauge__prog {
    stroke-dashoffset: calc(364.4 - (364.4 * var(--p) / 100));
}

.mon-card.is-in .mon-gauge {
    animation: mon-gauge-breathe 3.4s ease-in-out infinite;
}

.mon-gauge__core {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    line-height: 1;
}

.mon-gauge__core strong {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1480b8;
}

.mon-gauge__core small {
    font-size: 0.85rem;
    font-weight: 700;
    color: #5b7a90;
    margin-top: 0.15rem;
}

.mon-gauge__core em {
    display: block;
    margin-top: 0.4rem;
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a98ad;
}

.mon-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.mon-stats li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(30, 154, 214, 0.12);
    box-shadow: 0 6px 14px rgba(20, 120, 170, 0.05);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.mon-card.is-in .mon-stats li {
    opacity: 1;
    transform: translateX(0);
}

.mon-card.is-in .mon-stats li:nth-child(1) { transition-delay: 0.15s; }
.mon-card.is-in .mon-stats li:nth-child(2) { transition-delay: 0.25s; }
.mon-card.is-in .mon-stats li:nth-child(3) { transition-delay: 0.35s; }

.mon-stats span {
    font-size: 0.78rem;
    color: #5b7a90;
    font-weight: 600;
}

.mon-stats strong {
    font-size: 0.88rem;
    color: #163a52;
}

.mon-stats__live {
    color: #1e9ad6 !important;
}

.mon-chart {
    position: relative;
    padding: 0.85rem 0.75rem 0.55rem;
    border-radius: 1.1rem;
    background:
        radial-gradient(120px 60px at 90% 20%, rgba(59, 180, 234, 0.12), transparent),
        linear-gradient(180deg, rgba(255,255,255,0.95), rgba(232, 246, 252, 0.88));
    border: 1px solid rgba(30, 154, 214, 0.14);
    overflow: hidden;
}

.mon-chart__head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7a98ad;
}

.mon-chart__canvas-wrap {
    position: relative;
    height: 176px;
}

.mon-chart__canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

@keyframes mon-live {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

@keyframes mon-aura {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes mon-gauge-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@media (max-width: 520px) {
    .mon-card__body { grid-template-columns: 1fr; justify-items: center; }
    .mon-stats { width: 100%; }
}

/* legacy */
.pulse-ring { display: none; }
.stat-pill { display: none; }
.mini-bars { display: none; }

/* ===== Top-3 League (maximal) ===== */
.top-league {
    position: relative;
    z-index: 1;
    padding: 2.5rem 6vw 3.5rem;
    overflow: hidden;
}

.top-league__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.top-league__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.45;
    animation: drift 12s ease-in-out infinite;
}

.top-league__blob--1 {
    width: 280px;
    height: 280px;
    background: #8fd4f5;
    top: -40px;
    left: 8%;
}

.top-league__blob--2 {
    width: 320px;
    height: 320px;
    background: #b9e5f9;
    right: 5%;
    bottom: -60px;
    animation-delay: -5s;
}

.top-league__shine {
    position: absolute;
    inset: 10% 15%;
    background: radial-gradient(circle, rgba(255,255,255,0.7), transparent 65%);
    animation: tl-pulse 5s ease-in-out infinite;
}

.top-league__head {
    position: relative;
    margin-bottom: 1.75rem;
}

.top-league__kicker {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #1e9ad6;
    margin-bottom: 0.45rem;
}

.top-league__head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3.2vw, 2.35rem);
    color: #163a52;
    letter-spacing: -0.02em;
}

.top-league__head p {
    margin: 0.45rem 0 0;
    color: #5b7a90;
}

.top-league__grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem;
}

.tl-card {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
    border: 1px solid rgba(30, 154, 214, 0.18);
    border-radius: 1.5rem;
    padding: 1.35rem;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(20, 120, 170, 0.1);
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
    transition-delay: calc(var(--d, 1) * 0.08s);
}

.tl-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(30, 154, 214, 0.55), transparent 40%, rgba(110, 202, 243, 0.45));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.85;
}

.tl-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
    opacity: 0;
}

.tl-card.is-in::after {
    animation: tl-shine 2.8s ease-in-out 0.4s 1;
}

.tl-card.is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tl-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 55px rgba(30, 154, 214, 0.18);
}

.tl-card:hover::after {
    animation: tl-shine 1.4s ease-in-out;
}

.tl-card__glow {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    right: -50px;
    top: -60px;
    background: radial-gradient(circle, rgba(59, 180, 234, 0.28), transparent 70%);
    animation: tl-spin-slow 10s linear infinite;
}

.tl-card__head {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.tl-card__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.tl-card__icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #1e9ad6, #3bb4ea);
    box-shadow: 0 8px 18px rgba(30, 154, 214, 0.3);
}

.tl-card__head h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #163a52;
}

.tl-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #1480b8;
    background: #e6f6fd;
    border: 1px solid #c5e8f7;
}

.tl-card__badge i {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #3bb4ea;
    box-shadow: 0 0 0 0 rgba(59, 180, 234, 0.5);
    animation: tl-dot 1.6s ease-out infinite;
}

.tl-card__podium {
    position: relative;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    border-radius: 1.15rem;
    background: linear-gradient(135deg, rgba(30, 154, 214, 0.08), rgba(110, 202, 243, 0.12));
    margin-bottom: 0.85rem;
}

.tl-ring {
    position: relative;
    width: 110px;
    height: 110px;
}

.tl-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.tl-ring__track,
.tl-ring__prog {
    fill: none;
    stroke-width: 8;
}

.tl-ring__track { stroke: #d9eef8; }

.tl-ring__prog {
    stroke: #1e9ad6;
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    filter: drop-shadow(0 0 6px rgba(59, 180, 234, 0.55));
    transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-card.is-in .tl-ring__prog {
    stroke-dashoffset: calc(327 - (327 * var(--p) / 100));
}

.tl-card.is-in .tl-ring {
    animation: tl-ring-breathe 3.2s ease-in-out infinite;
}

.tl-ring__core {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    line-height: 1;
}

.tl-ring__core strong {
    font-size: 1.45rem;
    color: #1480b8;
    font-weight: 800;
}

.tl-ring__core small {
    font-size: 0.8rem;
    color: #5b7a90;
    font-weight: 700;
}

.tl-card__champ span:first-child,
.tl-card__place {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1e9ad6;
    margin-bottom: 0.25rem;
}

.tl-card__champ strong {
    display: block;
    font-size: 1.05rem;
    color: #163a52;
}

.tl-card__champ span {
    display: block;
    color: #5b7a90;
    font-size: 0.88rem;
    margin-top: 0.15rem;
}

.tl-tag {
    display: inline-block;
    margin-top: 0.45rem;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e9ad6, #3bb4ea);
}

.tl-tag.kpi-excellent { background: linear-gradient(135deg, #1f7a5c, #2d9a74); }
.tl-tag.kpi-good { background: linear-gradient(135deg, #1e7eb8, #2a9ad0); }
.tl-tag.kpi-satisfactory { background: linear-gradient(135deg, #b8860b, #d4a017); }
.tl-tag.kpi-needs { background: linear-gradient(135deg, #c45c26, #e07a3a); }
.tl-tag.kpi-unsatisfactory { background: linear-gradient(135deg, #a33b3b, #c94d4d); }

.tl-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tl-row {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.7rem 0.35rem;
    border-top: 1px solid #e5f3fa;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    transition-delay: calc(0.25s + var(--i, 0) * 0.08s);
}

.tl-card.is-in .tl-row {
    opacity: 1;
    transform: translateX(0);
}

.tl-row__n {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.55rem;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 800;
    background: #e8f6fc;
    color: #1e9ad6;
}

.tl-row--1 .tl-row__n {
    background: linear-gradient(135deg, #e8c96a, #c9a33a);
    color: #3a2d08;
    animation: tl-medal 2s ease-in-out infinite;
}

.tl-row--2 .tl-row__n { background: linear-gradient(135deg, #d5dee3, #9aa7ae); color: #2d3436; }
.tl-row--3 .tl-row__n { background: linear-gradient(135deg, #d4a08f, #b87a66); color: #fff; }

.tl-row__who strong {
    display: block;
    color: #163a52;
    font-size: 0.95rem;
}

.tl-row__who small {
    color: #5b7a90;
    font-size: 0.8rem;
}

.tl-row__meta {
    min-width: 88px;
    text-align: right;
}

.tl-row__pct {
    display: block;
    font-weight: 800;
    color: #1480b8;
    font-size: 0.95rem;
}

.tl-row__bar {
    height: 4px;
    border-radius: 999px;
    background: #dceef7;
    overflow: hidden;
    margin-top: 0.3rem;
}

.tl-row__bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #1e9ad6, #6ecaf3);
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(0.35s + var(--i, 0) * 0.1s);
}

.tl-card.is-in .tl-row__bar i { width: var(--w); }

.tl-card__empty {
    display: grid;
    place-items: center;
    gap: 0.75rem;
    min-height: 180px;
    color: #5b7a90;
    text-align: center;
}

.tl-card__empty-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px dashed #b7d9eb;
    animation: tl-spin-slow 8s linear infinite;
}

@keyframes tl-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.04); }
}

@keyframes tl-spin-slow {
    to { transform: rotate(360deg); }
}

@keyframes tl-dot {
    0% { box-shadow: 0 0 0 0 rgba(59, 180, 234, 0.55); }
    100% { box-shadow: 0 0 0 10px rgba(59, 180, 234, 0); }
}

@keyframes tl-medal {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes tl-shine {
    0% { left: -60%; opacity: 0; }
    20% { opacity: 1; }
    100% { left: 120%; opacity: 0; }
}

@keyframes tl-ring-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
    .tl-card,
    .tl-row,
    .tl-ring__prog,
    .tl-row__bar i,
    .top-league__blob,
    .top-league__shine,
    .tl-card__glow,
    .tl-card__empty-ring,
    .tl-card__badge i,
    .mon-card,
    .mon-card__aura,
    .mon-card__live i,
    .mon-gauge__prog,
    .dash-panel,
    .dash-panel__aura,
    .dash-live i,
    .dash-meter__fill {
        animation: none !important;
        transition: none !important;
    }
    .tl-card,
    .mon-card,
    .dash-panel {
        opacity: 1;
        transform: none;
    }
    .tl-row { opacity: 1; transform: none; }
    .tl-card.is-in .tl-ring__prog {
        stroke-dashoffset: calc(327 - (327 * var(--p) / 100));
    }
    .tl-card.is-in .tl-row__bar i { width: var(--w); }
    .mon-card.is-in .mon-gauge__prog {
        stroke-dashoffset: calc(364.4 - (364.4 * var(--p) / 100));
    }
    .mon-stats li { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
    .top-league__grid { grid-template-columns: 1fr; }
    .tl-card__podium { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

/* legacy aliases kept for safety */
.home-leaders { padding: 1rem 6vw 3rem; }
.leader-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }

.home-login-section { padding: 1rem 6vw 4rem; }

.login-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 980px;
    margin: 0 auto;
    border-radius: 28px;
    overflow: hidden;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 28px 60px rgba(30, 154, 214, 0.14);
}

.login-panel-side {
    background: linear-gradient(165deg, #1480b8, #1e9ad6 55%, #3bb4ea);
    color: #fff;
    padding: 2.2rem;
}

.login-panel-side ul { padding-left: 1.1rem; margin: 1rem 0 0; }
.login-panel-side li { margin-bottom: 0.45rem; }

.login-panel-form { padding: 2.2rem; }

.home-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 6vw 2rem;
    color: #5b7a90;
    font-size: 0.9rem;
}

.pulse-soft { animation: pulse-soft 2s ease-in-out infinite; }

/* Animations */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-down {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pop-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 180, 234, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(59, 180, 234, 0); }
}
@keyframes pulse-soft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.08); }
}
@keyframes ring-pulse {
    0% { transform: scale(0.7); opacity: 0.7; }
    100% { transform: scale(1.35); opacity: 0; }
}
@keyframes bar-grow {
    from { height: 0; opacity: 0.3; }
    to { height: var(--h); opacity: 1; }
}
@keyframes bounce-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes shimmer {
    to { background-position: 200% center; }
}
@keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.animate-fade-up { animation: fade-up 0.7s ease both; }
.animate-fade-down { animation: fade-down 0.6s ease both; }
.animate-scale-in { animation: scale-in 0.55s ease both; }
.animate-float { animation: float-y 4.5s ease-in-out infinite; }

@media (max-width: 980px) {
    .home-hero,
    .leader-grid,
    .top-league__grid,
    .login-panel { grid-template-columns: 1fr; }
    .app-shell { grid-template-columns: 1fr; }
    .score-row { grid-template-columns: 1fr; }
    .score-evidence-grid { grid-template-columns: 1fr; }
    .main {
        padding: 1rem;
        padding-top: 0.85rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        min-width: 0;
        overflow-x: clip;
    }

    .home-nav,
    .home-hero,
    .top-league,
    .home-login-section {
        padding-left: max(1.25rem, env(safe-area-inset-left));
        padding-right: max(1.25rem, env(safe-area-inset-right));
    }

    .home-hero { padding-top: 1.25rem; }
    .home-hero-copy h1 { font-size: clamp(1.55rem, 7vw, 2.1rem); }
    .hero-actions { display: grid; gap: 0.65rem; }
    .hero-actions .btn { width: 100%; text-align: center; }
    .btn-outline-light { background: #fff; }

    .brand-lockup { gap: 0.7rem; }
    .brand-lockup__mark { width: 72px; height: 72px; }
    .brand-lockup__text strong { font-size: 1.05rem; letter-spacing: 0.04em; }
    .brand-lockup__text small { display: none; }
    .brand-lockup--sidebar .brand-lockup__mark { width: 64px; height: 64px; }
    .home-nav { padding-top: 0.55rem; padding-bottom: 0.55rem; }

    .login-panel-side,
    .login-panel-form { padding: 1.35rem 1.2rem; }
    .login-panel { border-radius: 18px; }

    .sidebar-toggle {
        display: inline-grid;
        gap: 4px;
        width: 2.55rem;
        height: 2.55rem;
        place-content: center;
        border: 1px solid #c5e8f7;
        border-radius: 0.85rem;
        background: #fff;
        box-shadow: 0 8px 18px rgba(30, 154, 214, 0.12);
        flex-shrink: 0;
        padding: 0;
        cursor: pointer;
    }

    .sidebar-toggle span {
        display: block;
        width: 1.1rem;
        height: 2px;
        border-radius: 999px;
        background: #1e9ad6;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .app-shell.sidebar-open .sidebar-toggle span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    .app-shell.sidebar-open .sidebar-toggle span:nth-child(2) { opacity: 0; }
    .app-shell.sidebar-open .sidebar-toggle span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .sidebar-close {
        display: grid;
        place-items: center;
        width: 2.2rem;
        height: 2.2rem;
        border: 0;
        border-radius: 0.7rem;
        background: rgba(255, 255, 255, 0.16);
        color: #fff;
        font-size: 1.4rem;
        line-height: 1;
        cursor: pointer;
        flex-shrink: 0;
    }

    .sidebar-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.4rem;
    }

    .sidebar-head .brand-sub { margin-bottom: 0.75rem; }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(10, 40, 60, 0.45);
        backdrop-filter: blur(2px);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .app-shell.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 300px);
        height: 100vh;
        height: 100dvh;
        z-index: 50;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: 18px 0 40px rgba(0, 0, 0, 0.18);
        padding-top: max(1.15rem, env(safe-area-inset-top));
        padding-bottom: max(1.15rem, env(safe-area-inset-bottom));
    }

    .app-shell.sidebar-open .sidebar { transform: translateX(0); }

    .nav-link {
        padding: 0.85rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }

    .page-title {
        font-size: 1.1rem;
        line-height: 1.25;
        max-width: 58vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-chip {
        max-width: 46vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.78rem;
        padding: 0.4rem 0.7rem;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        background: rgba(247, 252, 255, 0.92);
        backdrop-filter: blur(10px);
        padding: 0.65rem 0 0.75rem;
        margin-bottom: 1rem;
        align-items: flex-start;
    }

    .stat-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .btn { white-space: normal; }
    body { overflow-x: hidden; }
    .card-panel {
        max-width: 100%;
        min-width: 0;
        padding: 1rem;
        border-radius: 14px;
    }
    .card-panel:has(> .table),
    .card-panel:has(> table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .main .table { min-width: 520px; }
    .form-control-lg { font-size: 1rem; }
    .score-row { gap: 0.75rem; padding: 0.85rem 0; }
    .score-row input[type="range"] { width: 100%; }
    .evidence-actions { width: 100%; }
    .evidence-actions .btn { min-height: 40px; }
    .evidence-modal__dialog {
        width: min(100%, 96vw);
        max-height: 94vh;
        border-radius: 12px;
    }
    .evidence-modal__body img { max-height: calc(94vh - 88px); }
    .evidence-modal__body iframe { height: calc(94vh - 88px); }
    .pub-scientific-badge {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr; }
    .user-chip { display: none; }
    .brand-lockup__mark { width: 56px; height: 56px; }
    .brand-lockup__text strong { font-size: 0.95rem; }
    .home-footer { font-size: 0.8rem; }
    .status-badge { font-size: 0.72rem; }
    .page-title { max-width: 70vw; font-size: 1rem; }
    .main .table { min-width: 420px; }
    form.row.g-3 > [class*="col-"] .btn,
    form .d-flex.gap-2 .btn { width: 100%; }
    .mt-3.d-flex.gap-2 .btn { flex: 1 1 100%; }
}
