:root {
    --pvz-bg: #eef3f7;
    --pvz-bg-accent: radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 32%), linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
    --pvz-surface: rgba(255, 255, 255, 0.92);
    --pvz-border: rgba(148, 163, 184, 0.22);
    --pvz-sidebar-bg: linear-gradient(180deg, #082f49 0%, #0f766e 100%);
    --pvz-sidebar-border: rgba(255, 255, 255, 0.08);
    --pvz-text-strong: #0f172a;
    --pvz-text-muted: #5b6474;
    --pvz-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

body {
    background: var(--pvz-bg-accent);
    background-attachment: fixed;
    background-size: cover;
    color: var(--pvz-text-strong);
}

.chart-container {
    position: relative;
    min-height: 360px;
}

#uploadAlert .alert,
#layoutAlert .alert,
#globalAlert .alert {
    margin-bottom: 0;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pvz-layout {
    min-height: 100vh;
    display: flex;
}

.pvz-sidebar {
    width: 290px;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--pvz-sidebar-bg);
    color: #f8fafc;
    border-right: 1px solid var(--pvz-sidebar-border);
    box-shadow: var(--pvz-shadow);
}

.pvz-sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    gap: 24px;
}

.pvz-sidebar-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px;
}

.pvz-brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.pvz-sidebar .text-secondary,
.pvz-sidebar .small {
    color: rgba(241, 245, 249, 0.72) !important;
}

.pvz-sidebar .nav-link {
    border-radius: 14px;
    color: rgba(248, 250, 252, 0.88);
    padding: 0.95rem 1rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.pvz-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.pvz-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
}

.pvz-sidebar-footer {
    margin-top: auto;
}

.user-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card-name {
    font-weight: 700;
}

.user-card-meta {
    color: rgba(241, 245, 249, 0.72);
    font-size: 0.875rem;
    word-break: break-word;
}

.pvz-main {
    flex: 1;
    min-width: 0;
}

.pvz-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--pvz-border);
}

.pvz-offcanvas {
    width: 290px;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 30px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.95) 0%, rgba(15, 118, 110, 0.9) 100%);
    color: #f8fafc;
    box-shadow: var(--pvz-shadow);
}

.dashboard-hero .text-secondary {
    color: rgba(241, 245, 249, 0.78) !important;
}

.dashboard-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-card,
.dashboard-stat-card {
    background: var(--pvz-surface);
    border: 1px solid var(--pvz-border);
    border-radius: 24px;
    box-shadow: var(--pvz-shadow);
    backdrop-filter: blur(12px);
    overflow: visible;
}

.dashboard-stat-card .card-body {
    padding: 22px;
}

.dashboard-stat-label {
    color: var(--pvz-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-stat-value {
    margin-top: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
}

.dashboard-stat-meta {
    margin-top: 8px;
    color: var(--pvz-text-muted);
    font-size: 0.92rem;
}

.card.dashboard-card .card-header,
.card.dashboard-stat-card .card-header {
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

.table.card-table th {
    color: var(--pvz-text-muted);
    font-weight: 700;
}

.login-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(8, 47, 73, 0.55), transparent 28%), linear-gradient(135deg, #082f49 0%, #0f766e 45%, #dbeafe 120%);
    background-attachment: fixed;
    background-size: cover;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(420px, 100%);
    padding: 38px 34px 34px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 30px 90px rgba(8, 47, 73, 0.24);
    backdrop-filter: blur(16px);
}

.login-title {
    font-size: 2.1rem;
    margin-bottom: 28px;
    text-align: center;
}

.login-form .form-control {
    min-height: 54px;
    border-radius: 16px;
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-form .form-label {
    margin-bottom: 0.55rem;
    font-weight: 600;
}

.login-panel .alert {
    margin-bottom: 1rem;
    border-radius: 14px;
}

.login-form .btn {
    min-height: 50px;
    border-radius: 14px;
    font-weight: 700;
}

.directory-lookup {
    position: relative;
    z-index: 40;
}

.directory-lookup-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    max-height: 280px;
    overflow-y: auto;
}

.directory-lookup-item {
    width: 100%;
    display: block;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.directory-lookup-item:hover,
.directory-lookup-item.is-active {
    background: rgba(15, 23, 42, 0.06);
}

.directory-lookup-title {
    font-weight: 700;
    line-height: 1.2;
}

.directory-lookup-meta {
    margin-top: 4px;
    color: #5b6474;
    font-size: 0.86rem;
    line-height: 1.3;
}

.document-frame {
    width: 100%;
    min-height: 78vh;
    border: 0;
    border-radius: 0 0 24px 24px;
    background: #f8fafc;
}

@media (max-width: 991.98px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .login-panel {
        padding: 26px;
        border-radius: 24px;
    }

    .dashboard-hero {
        padding: 24px;
        border-radius: 24px;
    }

    .dashboard-card,
    .dashboard-stat-card {
        border-radius: 20px;
    }
}
