: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);
}

.app-mode-watermark {
    position: fixed;
    right: 18px;
    bottom: 14px;
    z-index: 2000;
    pointer-events: none;
    color: rgba(220, 38, 38, 0.16);
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    user-select: none;
}

.app-debug-panel {
    padding: 14px 18px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-left: 4px solid #dc2626;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.app-debug-title {
    margin-bottom: 0.55rem;
    color: #991b1b;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-debug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.35rem 1rem;
    color: #475569;
    font-size: 0.93rem;
}

.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;
}

.login-dev-note {
    margin-top: 0.9rem;
    color: #dc2626;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

.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;
}

.department-map {
    width: 100%;
    min-height: 420px;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.05), rgba(37, 99, 235, 0.08));
}

.department-row[data-department-lat][data-department-lng] {
    cursor: pointer;
}

.system-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.system-meta-item {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.system-meta-key {
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.system-meta-value {
    color: #0f172a;
    word-break: break-word;
}

.system-extension-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.system-extension-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.84rem;
    font-weight: 700;
}

.system-env-value {
    white-space: pre-wrap;
    word-break: break-word;
}

.phpinfo-shell {
    max-width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #fff;
    padding: 1rem;
}

.phpinfo-shell table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.phpinfo-shell td,
.phpinfo-shell th {
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    vertical-align: top;
}

.phpinfo-shell h1,
.phpinfo-shell h2 {
    margin: 1rem 0 0.75rem;
    color: #0f172a;
}

.phpinfo-shell .center {
    text-align: left;
}

.shift-calendar-wrap {
    overflow-x: auto;
}

.shift-calendar-table {
    min-width: 960px;
}

.shift-employee-column {
    min-width: 280px;
}

.shift-day-today {
    background: rgba(37, 99, 235, 0.06);
}

.shift-row-current td:first-child {
    background: rgba(37, 99, 235, 0.05);
}

.shift-departments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.shift-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
    font-size: 0.8rem;
    font-weight: 700;
}

.shift-pill-double {
    background: rgba(14, 165, 233, 0.16);
    color: #0c4a6e;
}

.shift-editor-label {
    min-width: min(260px, 100%);
}

.shift-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shift-editor-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.85rem;
}

.shift-editor-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.85rem;
}

.shift-editor-weekday {
    padding: 0 0.35rem;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.shift-editor-weekday.is-weekend {
    color: #dc2626;
}

.shift-editor-day {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    min-height: 118px;
}

.shift-editor-primary {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.shift-editor-day:hover {
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.shift-editor-day.is-selected,
.shift-editor-day:has(.shift-editor-primary:checked) {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.08);
}

.shift-editor-day.is-double,
.shift-editor-day:has(.shift-editor-double-checkbox:checked) {
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(14, 165, 233, 0.1);
}

.shift-editor-day.is-today {
    box-shadow: inset 0 0 0 1px rgba(14, 116, 144, 0.28);
}

.shift-editor-day-placeholder {
    visibility: hidden;
    pointer-events: none;
}

.shift-editor-day-weekday {
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
}

.shift-editor-day-label {
    color: #475569;
    font-size: 0.95rem;
}

.shift-editor-day-number {
    color: #0f172a;
    font-size: 2rem;
    line-height: 1;
}

.shift-editor-day-weekday.is-weekend,
.shift-editor-day-number.is-weekend {
    color: #dc2626;
}

.shift-editor-double-toggle {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
}

.shift-editor-double-checkbox {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.shift-editor-double-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

.shift-editor-day.is-double .shift-editor-double-badge,
.shift-editor-day:has(.shift-editor-double-checkbox:checked) .shift-editor-double-badge {
    background: rgba(14, 165, 233, 0.18);
    color: #0c4a6e;
}

.shift-editor-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    color: #475569;
    font-size: 0.95rem;
}

.shift-editor-legend strong {
    color: #0f172a;
    font-size: 1rem;
}

@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;
    }

    .shift-editor-grid,
    .shift-editor-weekdays {
        gap: 0.5rem;
    }

    .shift-editor-day {
        min-height: 96px;
        padding: 0.7rem 0.75rem;
    }

    .shift-editor-day-number {
        font-size: 1.1rem;
    }

    .shift-editor-double-badge {
        min-width: 34px;
        padding: 0.15rem 0.45rem;
    }
}
