﻿@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@600;700&display=swap");

:root {
    --bg: #f2f7ff;
    --surface: #ffffff;
    --surface-soft: #f7fbff;
    --text: #0f172a;
    --muted: #5b6b84;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #dbeafe;
    --accent-soft-2: #c8ddff;
    --border: #ccdcff;
    --line: #d8e4fb;
    --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.11);
    --shadow-strong: 0 24px 54px rgba(16, 42, 110, 0.22);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --sidebar-width: 292px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(1000px 520px at 0% 0%, #d8e8ff 0%, rgba(216, 232, 255, 0) 55%),
        radial-gradient(920px 460px at 100% 100%, #ddeaff 0%, rgba(221, 234, 255, 0) 54%),
        linear-gradient(165deg, #f2f7ff 0%, #f7fbff 100%);
}

.portal-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
}

.portal-sidebar {
    background:
        radial-gradient(560px 280px at -20% -10%, rgba(125, 166, 255, 0.34) 0%, rgba(125, 166, 255, 0) 50%),
        linear-gradient(178deg, #0f2f73 0%, #123a86 100%);
    color: #fff;
    padding: 1.4rem 1.05rem 1.2rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
    min-height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 12px 0 34px rgba(9, 29, 79, 0.18);
}

.brand-block {
    margin-bottom: 1.25rem;
    padding: 0.25rem 0.15rem 0.65rem;
}

.brand-link {
    color: #fff;
    text-decoration: none;
    font-family: "Sora", sans-serif;
    font-size: 1.72rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: inline-block;
}

.brand-caption {
    color: #e1eeff;
    margin: 0.45rem 0 0;
    font-size: 0.96rem;
    line-height: 1.45;
}

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 0.44rem;
}

.portal-nav-link {
    color: #edf4ff;
    text-decoration: none;
    padding: 0.68rem 0.78rem;
    border-radius: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: 0.16s ease;
    position: relative;
}

.portal-nav-link::before {
    content: "";
    position: absolute;
    left: 0.44rem;
    top: 50%;
    width: 0.23rem;
    height: 0;
    border-radius: 999px;
    transform: translateY(-50%);
    background: #fff;
    opacity: 0;
    transition: 0.16s ease;
}

.portal-nav-link:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: translateX(1px);
}

.portal-nav-link.is-active {
    background: rgba(255, 255, 255, 0.26);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.portal-nav-link:hover::before,
.portal-nav-link.is-active::before {
    height: 62%;
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 0.88rem;
    border-top: 1px solid rgba(210, 227, 255, 0.42);
    background: linear-gradient(180deg, rgba(12, 44, 112, 0) 0%, rgba(12, 44, 112, 0.88) 46%, rgba(9, 33, 88, 1) 100%);
    position: sticky;
    bottom: 0;
    padding-bottom: 1rem;
}

.user-line {
    margin-bottom: 0.62rem;
    color: #deecff;
    font-size: 0.92rem;
    font-weight: 600;
}

.sidebar-footer .btn-outline-light {
    --bs-btn-border-color: rgba(233, 241, 255, 0.82);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #e9f2ff;
    --bs-btn-hover-color: #1e40af;
    --bs-btn-hover-border-color: #e9f2ff;
    font-weight: 700;
}

.portal-main {
    padding: 1.9rem 2rem;
    min-width: 0;
    animation: fade-up 0.32s ease;
}

.portal-main > .alert {
    border-radius: var(--radius-sm);
    border-width: 1px;
}

.page-head {
    padding: 0.2rem 0.1rem;
}

.page-head h1 {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: clamp(1.5rem, 2.12vw, 2.2rem);
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.page-head p {
    margin: 0.62rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.report-grid {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.report-card {
    display: block;
    text-decoration: none;
    background:
        linear-gradient(145deg, rgba(245, 250, 255, 0.95) 0%, rgba(255, 255, 255, 0.97) 100%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1rem 1.08rem;
    color: inherit;
    box-shadow: var(--shadow-soft);
    transition: transform 0.17s ease, box-shadow 0.17s ease, border-color 0.17s ease;
}

.report-card:hover {
    transform: translateY(-3px);
    border-color: #93b8ff;
    box-shadow: 0 18px 34px rgba(27, 66, 148, 0.18);
}

.report-card h2 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.report-card p {
    margin: 0.52rem 0 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.report-toolbar {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.report-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(226, 238, 255, 0.78);
    border: 1px solid #cbdeff;
}

.report-pages-toggle {
    --bs-btn-color: #1e3a8a;
    --bs-btn-border-color: #b4d0ff;
    --bs-btn-bg: #eff5ff;
    --bs-btn-hover-bg: #e8f1ff;
    --bs-btn-hover-border-color: #a7c8ff;
    --bs-btn-hover-color: #1d4ed8;
    white-space: nowrap;
    font-weight: 700;
}

.report-pages-toggle.is-disabled {
    opacity: 0.55;
}

.report-pages-toggle.is-hover-open {
    --bs-btn-bg: #dbeafe;
    --bs-btn-border-color: #93c5fd;
}

.report-pages-meta {
    color: #4f6585;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0 0.2rem;
}

.report-view-controls {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-left: auto;
}

.report-view-controls .btn {
    --bs-btn-color: #1f3f8f;
    --bs-btn-border-color: #bfd5ff;
    --bs-btn-hover-bg: #eff5ff;
    --bs-btn-hover-border-color: #aac7ff;
    --bs-btn-hover-color: #1e3a8a;
    font-weight: 700;
}

.report-view-controls .btn.is-active {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--accent-strong);
    --bs-btn-hover-border-color: var(--accent-strong);
    --bs-btn-hover-color: #fff;
}

.report-workspace {
    margin-top: 1rem;
    display: flex;
    align-items: stretch;
    gap: 1rem;
    position: relative;
}

.report-pages-panel {
    width: min(350px, 30vw);
    min-width: 258px;
    background: linear-gradient(180deg, #f7fbff 0%, #f4f9ff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 0.86rem;
    max-height: clamp(560px, calc(100dvh - 190px), 1100px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
}

.report-workspace.is-pages-collapsed .report-pages-panel {
    width: 0;
    min-width: 0;
    max-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.report-workspace.is-pages-collapsed.is-pages-hover-open .report-pages-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(380px, 35vw);
    min-width: 290px;
    max-height: clamp(560px, calc(100dvh - 190px), 1100px);
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #f7fbff 0%, #f4f9ff 100%);
    box-shadow: var(--shadow-strong);
    opacity: 1;
    pointer-events: auto;
    z-index: 20;
}

.report-pages-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.report-pages-title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 1.03rem;
    letter-spacing: -0.01em;
}

.report-pages-subtitle {
    margin: 0.2rem 0 0;
    color: #607899;
    font-size: 0.86rem;
    font-weight: 600;
}

.report-pages-collapse {
    width: 2rem;
    height: 2rem;
    border-radius: 0.52rem;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    border-color: #b7d0ff;
    color: #1e3a8a;
    background: #fff;
}

.report-pages-search {
    margin-bottom: 0.82rem;
}

.report-pages-list {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-right: 0.3rem;
}

.report-pages-list::-webkit-scrollbar {
    width: 9px;
}

.report-pages-list::-webkit-scrollbar-thumb {
    background: #9fc3ff;
    border-radius: 999px;
}

.report-page-item {
    width: 100%;
    border: 0;
    border-radius: 0.62rem;
    background: transparent;
    color: #111827;
    text-align: left;
    padding: 0.62rem 0.72rem;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.report-page-item:hover {
    background: #eaf3ff;
    transform: translateX(1px);
}

.report-page-item.is-active {
    background: #ffffff;
    color: #1e40af;
    box-shadow: inset 3px 0 0 var(--accent);
    font-weight: 800;
}

.report-pages-empty {
    color: #64748b;
    font-size: 0.93rem;
    padding: 0.65rem 0.4rem;
}

.report-frame-wrap {
    margin-top: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    height: clamp(560px, calc(100dvh - 190px), 1100px);
}

.report-workspace .report-frame-wrap {
    margin-top: 0;
    flex: 1 1 auto;
}

.report-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
}

.report-frame iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
}

.login-body::before,
.login-body::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.login-body::before {
    width: min(56vw, 700px);
    height: min(56vw, 700px);
    top: -18vw;
    right: -16vw;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, rgba(37, 99, 235, 0) 65%);
}

.login-body::after {
    width: min(46vw, 580px);
    height: min(46vw, 580px);
    bottom: -14vw;
    left: -14vw;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.17) 0%, rgba(29, 78, 216, 0) 68%);
}

.login-card {
    width: min(470px, 100%);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 1;
}

.login-title {
    margin: 0;
    font-family: "Sora", sans-serif;
    letter-spacing: -0.02em;
}

.login-subtitle {
    margin: 0.42rem 0 1.35rem;
    color: var(--muted);
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-strong);
    --bs-btn-hover-border-color: var(--accent-strong);
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    font-weight: 700;
}

.form-control:focus {
    border-color: #9fc0ff;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.18);
}

.alert-warning {
    --bs-alert-bg: #fff4d6;
    --bs-alert-border-color: #f1db9f;
    --bs-alert-color: #7b5a00;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1220px) {
    :root {
        --sidebar-width: 272px;
    }

    .portal-main {
        padding: 1.6rem 1.45rem;
    }

    .report-pages-meta {
        display: none;
    }
}

@media (max-width: 991px) {
    .portal-layout {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        position: static;
        height: auto;
        min-height: 0;
        overflow: visible;
        border-right: 0;
        box-shadow: none;
    }

    .portal-main {
        padding: 1.1rem;
    }

    .report-toolbar-left {
        width: 100%;
        border-radius: 12px;
        justify-content: flex-start;
    }

    .report-view-controls {
        margin-left: 0;
    }

    .report-view-controls .btn {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .report-workspace {
        flex-direction: column;
    }

    .report-pages-panel {
        width: 100%;
        min-width: 0;
        max-height: min(42vh, 420px);
    }

    .report-workspace.is-pages-collapsed.is-pages-hover-open .report-pages-panel {
        position: static;
        width: 100%;
        min-width: 0;
        max-height: min(42vh, 420px);
        box-shadow: var(--shadow-soft);
        z-index: auto;
    }

    .report-workspace.is-pages-collapsed .report-pages-panel {
        max-height: 0;
    }

    .report-frame-wrap {
        height: min(72vh, 760px);
    }

    .report-frame {
        min-height: 460px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

