/* =========================================================
   WAREHOUSE KPI v5.0 — Modern UI System
   Nhất Việt Logistics
   ========================================================= */

:root {
    --nv-navy-950: #0b1f2d;
    --nv-navy-900: #123047;
    --nv-navy-800: #173d58;
    --nv-navy-700: #22506f;
    --nv-green-700: #0f7a35;
    --nv-green-600: #119447;
    --nv-green-500: #22a958;
    --nv-green-100: #e7f8ed;
    --nv-orange-600: #e77614;
    --nv-orange-500: #f08b24;
    --nv-blue-600: #176bdb;
    --nv-blue-100: #eaf3ff;
    --nv-red-600: #d43a4c;
    --nv-red-100: #fff0f2;
    --nv-amber-600: #c77700;
    --nv-amber-100: #fff7df;
    --nv-surface: #ffffff;
    --nv-surface-soft: #f7faf9;
    --nv-bg: #eef4f2;
    --nv-border: #dce7e3;
    --nv-text: #14242f;
    --nv-muted: #667985;
    --nv-shadow-sm: 0 4px 16px rgba(14, 43, 58, .07);
    --nv-shadow-md: 0 12px 32px rgba(14, 43, 58, .11);
    --nv-shadow-lg: 0 24px 70px rgba(14, 43, 58, .16);
    --nv-radius-sm: 10px;
    --nv-radius-md: 16px;
    --nv-radius-lg: 24px;
    --nv-radius-xl: 32px;
    --bs-primary: #176bdb;
    --bs-primary-rgb: 23, 107, 219;
    --bs-success: #119447;
    --bs-success-rgb: 17, 148, 71;
    --bs-danger: #d43a4c;
    --bs-danger-rgb: 212, 58, 76;
    --bs-dark: #123047;
    --bs-dark-rgb: 18, 48, 71;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--nv-text);
    background:
        radial-gradient(circle at 4% 2%, rgba(17, 148, 71, .09), transparent 30rem),
        radial-gradient(circle at 96% 8%, rgba(23, 107, 219, .08), transparent 32rem),
        linear-gradient(180deg, #f7fbf9 0%, var(--nv-bg) 52%, #f5f8f7 100%);
    font-family: "Be Vietnam Pro", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { text-underline-offset: 3px; }
::selection { background: rgba(17, 148, 71, .22); color: var(--nv-navy-950); }

.app-body > main,
.app-body > header,
.app-body > .container,
.app-body > .container-fluid {
    position: relative;
    z-index: 1;
}

/* ---------- Background ambience ---------- */
.app-ambient {
    position: fixed;
    z-index: 0;
    width: 380px;
    height: 380px;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(55px);
    opacity: .25;
}
.app-ambient-one { top: 12%; left: -230px; background: #7cddb0; }
.app-ambient-two { right: -230px; bottom: 5%; background: #8ab9ed; }

/* ---------- Initial loader ---------- */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-content: center;
    gap: 14px;
    background: linear-gradient(145deg, #f8fbfa, #eef6f2);
    transition: opacity .36s ease, visibility .36s ease;
}
.app-loader.is-hidden { opacity: 0; visibility: hidden; }
.app-loader-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    margin: 0 auto;
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--nv-shadow-lg);
}
.app-loader-mark img { position: relative; z-index: 2; }
.app-loader-ring {
    position: absolute;
    inset: -7px;
    border: 3px solid rgba(17, 148, 71, .12);
    border-top-color: var(--nv-green-600);
    border-radius: 31px;
    animation: loaderSpin 1s linear infinite;
}
.app-loader-text { color: var(--nv-muted); font-size: .86rem; font-weight: 600; letter-spacing: .02em; }
@keyframes loaderSpin { to { transform: rotate(360deg); } }

/* ---------- Navigation ---------- */
.app-navbar {
    --bs-navbar-padding-y: 0;
    min-height: 74px;
    background: linear-gradient(112deg, rgba(12, 35, 51, .97), rgba(25, 66, 89, .97));
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 10px 30px rgba(8, 28, 41, .14);
    backdrop-filter: blur(18px);
    transition: min-height .25s ease, box-shadow .25s ease, background .25s ease;
}
.app-navbar.is-scrolled {
    min-height: 64px;
    background: rgba(11, 31, 45, .96);
    box-shadow: 0 9px 28px rgba(8, 28, 41, .22);
}
.app-navbar-inner { min-height: inherit; }
.app-brand { color: #fff !important; min-width: max-content; padding: 8px 0; }
.app-brand-logo {
    display: grid;
    place-items: center;
    width: 125px;
    height: 46px;
    padding: 5px 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
    transition: transform .24s ease, box-shadow .24s ease;
}
.app-brand:hover .app-brand-logo { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(0, 0, 0, .2); }
.app-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.app-brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.app-brand-copy strong { font-size: 1.04rem; letter-spacing: .025em; }
.app-brand-copy small { margin-top: 5px; color: rgba(255,255,255,.58); font-size: .62rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.app-nav-list { gap: 3px; }
.app-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 1px;
    padding: 10px 13px !important;
    color: rgba(255, 255, 255, .7) !important;
    border-radius: 11px;
    font-size: .86rem;
    font-weight: 600;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}
.app-nav-link i { width: 16px; text-align: center; opacity: .86; }
.app-nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .09);
    transform: translateY(-1px);
}
.app-nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(17, 148, 71, .92), rgba(25, 168, 82, .92));
    box-shadow: 0 8px 18px rgba(5, 89, 39, .24);
}
.app-nav-link.active::after {
    content: "";
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: -8px;
    height: 3px;
    border-radius: 99px;
    background: var(--nv-orange-500);
}
.app-user { min-width: 0; }
.app-user-button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 175px;
    padding: 7px 10px;
    color: #fff;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px;
    text-align: left;
    transition: background .2s ease, border-color .2s ease;
}
.app-user-button:hover, .app-user-button[aria-expanded="true"] { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.app-user-button::after { margin-left: auto; opacity: .6; }
.app-user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, var(--nv-orange-500), #ffab50);
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.app-user-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.22; }
.app-user-copy strong { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .79rem; }
.app-user-copy small { color: rgba(255,255,255,.58); font-size: .66rem; }
.app-user-menu {
    min-width: 250px;
    padding: 8px;
    border: 1px solid rgba(18,48,71,.09);
    border-radius: 16px;
    box-shadow: var(--nv-shadow-lg) !important;
}
.app-user-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 10px; font-size: .86rem; }
.app-user-menu .dropdown-item i { width: 18px; color: var(--nv-muted); }
.app-user-menu .dropdown-item:hover { background: var(--nv-green-100); color: var(--nv-green-700); }
.app-navbar-toggler { border: 1px solid rgba(255,255,255,.2); border-radius: 11px; padding: 7px 9px; }
.app-navbar-toggler:focus { box-shadow: 0 0 0 4px rgba(255,255,255,.12); }

/* ---------- Page typography & general layout ---------- */
main.container,
main.container-fluid,
main.container-xxl { animation: pageEnter .44s ease both; }
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

h1, h2, h3, h4, h5, h6 { color: var(--nv-navy-950); letter-spacing: -.02em; }
main h1.h3,
main .h3.fw-bold,
main > .d-flex h1 {
    position: relative;
    padding-left: 17px;
}
main h1.h3::before,
main .h3.fw-bold::before,
main > .d-flex h1::before {
    content: "";
    position: absolute;
    left: 0;
    top: .16em;
    bottom: .14em;
    width: 5px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--nv-green-500), var(--nv-orange-500));
}
.text-muted { color: var(--nv-muted) !important; }

/* ---------- Cards ---------- */
.card,
.card-custom,
.login-card,
.accordion-item {
    border-color: rgba(23, 61, 88, .08) !important;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--nv-shadow-sm);
}
.card {
    border-radius: var(--nv-radius-md) !important;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { border-color: rgba(17,148,71,.14) !important; }
.card.shadow-sm { box-shadow: var(--nv-shadow-sm) !important; }
.card.shadow-lg { box-shadow: var(--nv-shadow-lg) !important; }

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .46s ease, transform .46s cubic-bezier(.2,.8,.2,1);
}
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    border: 1px solid rgba(23,61,88,.07) !important;
    border-radius: 20px !important;
    box-shadow: var(--nv-shadow-sm);
}
.stat-card::before {
    content: "";
    position: absolute;
    top: -35px;
    right: -28px;
    width: 115px;
    height: 115px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(17,148,71,.12), rgba(23,107,219,.08));
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--nv-shadow-md); }
.stat-card .display-5, .stat-card .display-6, .stat-card h2, .stat-card strong { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
    --bs-btn-border-radius: 11px;
    position: relative;
    overflow: hidden;
    min-height: 40px;
    padding: .56rem .94rem;
    font-weight: 650;
    letter-spacing: -.01em;
    box-shadow: none;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:focus-visible { box-shadow: 0 0 0 4px rgba(23,107,219,.17) !important; }
.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #1673e7, #105cc3);
    box-shadow: 0 8px 18px rgba(23, 107, 219, .21);
}
.btn-primary:hover { border-color: transparent; background: linear-gradient(135deg, #2480ef, #1467d3); box-shadow: 0 11px 25px rgba(23,107,219,.26); }
.btn-success {
    border-color: transparent;
    background: linear-gradient(135deg, #15a14d, #0f803b);
    box-shadow: 0 8px 18px rgba(17, 148, 71, .2);
}
.btn-success:hover { border-color: transparent; background: linear-gradient(135deg, #1caf57, #118943); box-shadow: 0 11px 25px rgba(17,148,71,.26); }
.btn-danger { background: linear-gradient(135deg, #e14b5d, #be2f41); border-color: transparent; box-shadow: 0 8px 18px rgba(212,58,76,.18); }
.btn-dark { background: linear-gradient(135deg, var(--nv-navy-800), var(--nv-navy-950)); border-color: transparent; }
.btn-outline-dark { border-color: #8c9da8; color: var(--nv-navy-800); }
.btn-outline-dark:hover { background: var(--nv-navy-800); border-color: var(--nv-navy-800); }
.btn-outline-secondary { border-color: #bdc9cf; color: #526672; }
.btn-lg { min-height: 50px; border-radius: 13px; }
.btn-sm { min-height: 34px; border-radius: 9px; }
.btn .button-spinner { margin-right: 7px; }
.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
    transform: scale(0);
    animation: ripple .58s linear;
    pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- Form controls ---------- */
.form-label { margin-bottom: .48rem; color: #344b5b; font-size: .87rem; font-weight: 650; }
.form-control,
.form-select {
    min-height: 46px;
    color: var(--nv-text);
    background-color: #fff;
    border: 1px solid #d7e1e5;
    border-radius: 11px;
    box-shadow: 0 1px 1px rgba(0,0,0,.01);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.form-control:hover,
.form-select:hover { border-color: #b4c5cc; }
.form-control:focus,
.form-select:focus {
    border-color: rgba(23,107,219,.68);
    box-shadow: 0 0 0 4px rgba(23,107,219,.11), 0 7px 18px rgba(23,107,219,.06);
    background-color: #fff;
}
.form-control:disabled,
.form-select:disabled { color: #687985; background-color: #eef3f2; border-color: #e0e7e5; opacity: 1; }
.form-control-lg,
.form-select-lg { min-height: 52px; font-size: .97rem; }
.form-text { color: #788b96; font-size: .76rem; }
textarea.form-control { min-height: 100px; }
.form-check-input { width: 1.12em; height: 1.12em; border-color: #a8b7bf; }
.form-check-input:checked { background-color: var(--nv-green-600); border-color: var(--nv-green-600); }
.input-group-text { border-color: #d7e1e5; background: #f3f7f6; color: var(--nv-muted); }
.password-field-wrap { position: relative; }
.password-field-wrap .form-control { padding-right: 48px; }
.password-toggle {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 7px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #657983;
    background: transparent;
    border: 0;
    border-radius: 9px;
    transform: translateY(-50%);
}
.password-toggle:hover { background: #edf4f1; color: var(--nv-green-700); }

/* ---------- Alerts and toasts ---------- */
.app-alert,
.alert {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--nv-shadow-sm);
}
.app-alert { display: flex; align-items: center; gap: 11px; padding: 14px 17px; }
.app-alert-icon { font-size: 1.15rem; }
.alert-success { color: #0c6930; background: #e9f8ee; }
.alert-danger { color: #a72636; background: #fff0f2; }
.alert-warning { color: #8f5900; background: #fff6dc; }
.alert-info, .alert-secondary { color: #315a74; background: #edf5fa; }
.app-toast {
    overflow: hidden;
    width: min(380px, calc(100vw - 30px));
    color: var(--nv-text);
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(18,48,71,.09);
    border-radius: 16px;
    box-shadow: var(--nv-shadow-lg);
    backdrop-filter: blur(16px);
}
.app-toast .toast-header { background: transparent; border-bottom-color: #edf1ef; }

/* ---------- Badges ---------- */
.badge { padding: .43em .72em; border-radius: 999px; font-weight: 650; letter-spacing: .005em; }
.text-bg-primary, .bg-primary { background-color: var(--nv-blue-600) !important; }
.text-bg-success, .bg-success { background-color: var(--nv-green-600) !important; }
.bg-dark, .text-bg-dark { background-color: var(--nv-navy-900) !important; }

/* ---------- Tables ---------- */
.table-responsive {
    position: relative;
    border: 1px solid rgba(23,61,88,.08);
    border-radius: 15px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.table-responsive.is-scrollable-right::after {
    content: "";
    position: sticky;
    right: 0;
    display: block;
    float: right;
    width: 24px;
    height: 1px;
    margin-top: -1px;
    box-shadow: -12px 0 20px rgba(13,42,57,.22);
}
.table { --bs-table-bg: transparent; --bs-table-hover-bg: rgba(17,148,71,.045); margin-bottom: 0; color: var(--nv-text); }
.table > :not(caption) > * > * { padding: .84rem .78rem; border-bottom-color: #e3ebe8; }
.table thead th {
    color: #3b5362;
    background: #eff5f3;
    border-bottom-width: 1px;
    font-size: .82rem;
    font-weight: 750;
    letter-spacing: .01em;
    white-space: nowrap;
}
.table tbody tr { transition: background .16s ease; }
.table tbody tr:hover { background: rgba(17,148,71,.04); }
.table tbody td { vertical-align: middle; }
.table tfoot th { border: 0; }

.kpi-score-table { min-width: 1100px; }
.kpi-score-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    color: #fff;
    background: linear-gradient(180deg, #6c87a8, #5f7898);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}
.kpi-score-table tbody tr:not(.table-total-row):hover td { background: #f4faf7; }
.kpi-score-table td:nth-child(n+4) { text-align: right; }
.kpi-score-table .table-total-row td { background: #dfe9f4; font-weight: 750; }
.kpi-score-table tfoot th { color: #fff; background: linear-gradient(110deg, var(--nv-navy-900), var(--nv-navy-800)); }
.kpi-score-table td:last-child { min-width: 128px; }
.kpi-score-table td form { margin: 0; }
.monthly-summary-table { min-width: 850px; }
.monthly-summary-table thead th { color: #fff; background: linear-gradient(110deg, var(--nv-navy-900), var(--nv-navy-800)); text-align: center; vertical-align: middle; }
.monthly-summary-table tbody th { background: #eef4f2; white-space: nowrap; }
.kpi-reference-table { min-width: 980px; }
.kpi-reference-table thead th,
.daily-detail-table thead th { color: #fff; background: linear-gradient(110deg, var(--nv-navy-900), var(--nv-navy-800)); vertical-align: middle; }
.kpi-reference-table td,
.daily-detail-table td { vertical-align: top; }
.daily-detail-table { min-width: 1450px; font-size: .9rem; }
.daily-detail-table th:nth-child(1) { width: 65px; }
.daily-detail-table th:nth-child(2) { width: 120px; }
.daily-detail-table th:nth-child(6) { width: 110px; }
.daily-detail-table th:nth-child(8) { width: 150px; }

/* ---------- Login ---------- */
.login-page {
    position: relative;
    min-height: calc(100vh - 74px);
    display: grid;
    place-items: center;
    padding: 50px 18px 70px;
    overflow: hidden;
}
.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,.78), rgba(255,255,255,.78)),
        radial-gradient(circle at 25% 20%, rgba(17,148,71,.25), transparent 24rem),
        radial-gradient(circle at 78% 74%, rgba(23,107,219,.19), transparent 29rem);
}
.login-card {
    position: relative;
    z-index: 2;
    width: min(100%, 470px);
    overflow: hidden;
    padding: 38px;
    border: 1px solid rgba(255,255,255,.75) !important;
    border-radius: 28px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 30px 90px rgba(15,48,61,.18) !important;
    backdrop-filter: blur(20px);
}
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--nv-green-600), var(--nv-orange-500), var(--nv-blue-600));
}
.login-logo-wrap {
    display: inline-grid;
    place-items: center;
    width: 150px;
    height: 70px;
    padding: 9px 14px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 9px 27px rgba(12,45,56,.1);
}
.login-kicker { color: var(--nv-green-700); font-size: .75rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.login-security-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 19px; color: var(--nv-muted); font-size: .73rem; }

/* ---------- Checklist ---------- */
.app-hero {
    position: relative;
    overflow: hidden;
    padding: 32px 16px 40px;
    color: #fff;
    background:
        linear-gradient(125deg, rgba(10,31,45,.97), rgba(27,74,97,.95)),
        var(--nv-navy-900);
    border-radius: 0 0 34px 34px;
    box-shadow: 0 15px 38px rgba(10,31,45,.17);
}
.app-hero::before,
.app-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.055);
}
.app-hero::before { width: 230px; height: 230px; top: -155px; left: 7%; }
.app-hero::after { width: 330px; height: 330px; right: -150px; bottom: -245px; }
.app-hero h1 { position: relative; color: #fff; margin: 11px 0 4px; font-size: clamp(1.65rem, 4vw, 2.25rem); font-weight: 800; letter-spacing: -.025em; }
.app-hero p { position: relative; margin: 0; color: rgba(255,255,255,.7); }
.hero-logo {
    position: relative;
    width: auto;
    height: 58px;
    padding: 7px 13px;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,.2);
}
.checklist-shell { padding-top: 30px; padding-bottom: 80px; }
.card-custom {
    width: 100%;
    margin-bottom: 13px;
    padding: 19px;
    color: var(--nv-text);
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(23,61,88,.07) !important;
    border-left: 5px solid transparent !important;
    border-radius: 17px;
    box-shadow: var(--nv-shadow-sm);
    text-align: left;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
button.card-custom:hover { transform: translateY(-3px); border-color: rgba(23,107,219,.17) !important; box-shadow: var(--nv-shadow-md); }
.category-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.category-card > span:first-child { display: flex; align-items: flex-start; gap: 4px; }
.card-done { background: linear-gradient(135deg, #f1fff6, #f8fffa); border-left-color: var(--nv-green-600) !important; }
.status-badge { flex: 0 0 auto; min-width: 48px; padding: 6px 10px; border-radius: 999px; font-size: .78rem; text-align: center; white-space: nowrap; }
.question-card { cursor: default; padding: 24px; box-shadow: var(--nv-shadow-md); }
.question-card h2 { font-size: 1.1rem; }
.progress-container {
    position: relative;
    overflow: hidden;
    height: 10px;
    margin: 12px 0;
    background: #dce6e3;
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(12,42,52,.08);
}
.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--nv-green-600), #42c66f, var(--nv-orange-500));
    background-size: 180% 100%;
    border-radius: inherit;
    box-shadow: 0 0 12px rgba(17,148,71,.35);
    transition: width .45s cubic-bezier(.2,.8,.2,1);
    animation: progressShimmer 3s linear infinite;
}
@keyframes progressShimmer { to { background-position: -180% 0; } }
.btn-kpi {
    flex: 1;
    min-height: 58px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.active-result { outline: 4px solid rgba(16,51,70,.12); transform: translateY(-2px); }
.saved-result { padding: 11px 13px; color: #3c5968; background: #edf5f2; border: 1px solid #dceae5; border-radius: 11px; font-size: .88rem; }
#main-app > .d-flex:first-child {
    position: sticky;
    top: 83px;
    z-index: 9;
    padding: 10px;
    margin-inline: -10px;
    background: rgba(238,244,242,.88);
    border-radius: 12px;
    backdrop-filter: blur(12px);
}
#total-progress { min-width: 52px; padding: 7px 10px; }
.checklist-success-pulse { animation: successPulse .55s ease; }
@keyframes successPulse { 50% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(17,148,71,.08); } }

/* ---------- Score weights and reporting ---------- */
.score-weight-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 12px; }
.score-weight-item {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
    background: linear-gradient(145deg, #f6faf8, #eef5f2);
    border: 1px solid #dfe9e5;
    border-radius: 14px;
}
.score-weight-item::after { content: ""; position: absolute; top: -24px; right: -24px; width: 68px; height: 68px; border-radius: 50%; background: rgba(17,148,71,.08); }
.score-weight-item span { color: #5b7180; font-size: .78rem; font-weight: 750; }
.score-weight-item strong { position: relative; z-index: 1; font-size: 1.15rem; }
.report-table-card { overflow: hidden; }
.summary-score-link { display: flex; flex-direction: column; min-width: 80px; padding: 7px; color: inherit; border-radius: 9px; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.summary-score-link:hover { background: #e8f3ff; transform: translateY(-1px); }
.summary-score-link strong { font-size: 1.08rem; }
.summary-score-link small { color: var(--nv-muted); }
.text-bg-danger-subtle { background: #f8d7da !important; }

/* ---------- Accordion ---------- */
.accordion-item { overflow: hidden; border-radius: 14px !important; }
.accordion-button { padding: 16px 18px; color: var(--nv-text); background: #fff; font-size: .91rem; box-shadow: none !important; }
.accordion-button:not(.collapsed) { color: var(--nv-green-700); background: #edf8f1; }
.accordion-button::after { width: 18px; height: 18px; background-size: 18px; }
.accordion-body { background: #fbfdfc; }

/* ---------- Admin ---------- */
.admin-grid .card { overflow: hidden; min-height: 180px; border: 0; border-radius: 18px !important; transition: transform .2s ease, box-shadow .2s ease; }
.admin-grid .card:hover { transform: translateY(-5px); box-shadow: var(--nv-shadow-md); }
.admin-grid .card i.fa-solid { filter: drop-shadow(0 5px 10px rgba(0,0,0,.08)); }

/* ---------- Footer and utilities ---------- */
.app-footer {
    position: relative;
    z-index: 1;
    margin-top: 35px;
    padding: 18px 0;
    color: #6c7f89;
    background: rgba(255,255,255,.6);
    border-top: 1px solid rgba(23,61,88,.07);
    font-size: .75rem;
    backdrop-filter: blur(12px);
}
.app-footer-brand { display: flex; align-items: center; gap: 7px; color: var(--nv-navy-800); font-weight: 750; }
.app-footer-brand span { color: var(--nv-green-700); }
.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1020;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: #fff;
    background: linear-gradient(145deg, var(--nv-navy-800), var(--nv-navy-950));
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(12,36,52,.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- PDF export ---------- */
.pdf-export-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    overflow: auto;
    padding: 12px;
    background: #fff;
}
.pdf-export-wrapper {
    width: 1500px;
    min-height: 100px;
    margin: 0 auto;
    color: #17212b;
    background: #fff;
    font-family: Arial, sans-serif;
}
.pdf-export-wrapper table { border-collapse: collapse; }
.pdf-export-wrapper th,
.pdf-export-wrapper td { padding: 8px !important; border: 1px solid #cfd8df !important; }
.pdf-export-wrapper thead th { color: #fff !important; background: #6f86a6 !important; }
.pdf-export-wrapper .table-total-row td { background: #d9e2ef !important; }
.pdf-export-wrapper tfoot th { color: #fff !important; background: #20364a !important; }
.pdf-export-wrapper tr { break-inside: avoid; page-break-inside: avoid; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .app-navbar { min-height: 68px; }
    .app-navbar .navbar-collapse {
        margin: 10px 0 14px;
        padding: 12px;
        background: rgba(255,255,255,.07);
        border: 1px solid rgba(255,255,255,.09);
        border-radius: 16px;
    }
    .app-nav-list { gap: 3px; }
    .app-nav-link { width: 100%; padding: 11px 12px !important; }
    .app-nav-link.active::after { display: none; }
    .app-user { margin-top: 9px; }
    .app-user-button { width: 100%; }
    .app-user-copy strong { max-width: none; }
}

@media (max-width: 991.98px) {
    .score-weight-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    main.container, main.container-fluid, main.container-xxl { padding-top: 1.5rem !important; padding-bottom: 2rem !important; }
}

@media (max-width: 767.98px) {
    .app-brand-logo { width: 112px; height: 43px; }
    .app-brand-copy strong { font-size: .91rem; }
    .app-brand-copy small { display: none; }
    main h1.h3, main .h3.fw-bold, main > .d-flex h1 { font-size: 1.4rem; }
    .card { border-radius: 15px !important; }
    .card.p-4 { padding: 1.15rem !important; }
    .table > :not(caption) > * > * { padding: .7rem .65rem; }
    .app-footer .container-fluid { justify-content: center !important; text-align: center; }
    #main-app > .d-flex:first-child { top: 73px; }
}

@media (max-width: 575.98px) {
    .app-navbar-inner { padding-inline: 12px; }
    .app-brand { gap: 7px !important; }
    .app-brand-logo { width: 98px; height: 40px; border-radius: 10px; }
    .app-brand-copy strong { font-size: .78rem; }
    .app-hero { padding: 26px 14px 34px; border-radius: 0 0 25px 25px; }
    .hero-logo { height: 52px; }
    .checklist-shell { padding-inline: 13px; padding-top: 20px; }
    .card-custom { padding: 16px; border-radius: 14px; }
    .category-card { align-items: flex-start; }
    .question-card { padding: 18px; }
    .btn-kpi { min-height: 54px; font-size: .91rem; }
    .login-page { min-height: calc(100vh - 64px); padding: 25px 13px 45px; }
    .login-card { padding: 27px 20px; border-radius: 22px; }
    .login-logo-wrap { width: 138px; height: 65px; }
    .score-weight-grid { grid-template-columns: 1fr; }
    .back-to-top { right: 12px; bottom: 12px; width: 42px; height: 42px; }
    .app-footer-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal-on-scroll { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
    .app-navbar,
    .app-footer,
    .back-to-top,
    .app-loader,
    .app-ambient,
    form,
    .btn,
    .accordion,
    .nav,
    .navbar,
    .no-export,
    .no-print { display: none !important; }
    body { color: #000; background: #fff; font-size: 10px; }
    .container, .container-fluid, .container-xxl { width: 100% !important; max-width: none !important; padding: 0 !important; }
    .card { border: 0 !important; box-shadow: none !important; }
    .kpi-score-table { min-width: 0; }
    .daily-detail-table { min-width: 0 !important; font-size: 8px; }
    .daily-detail-table th, .daily-detail-table td { padding: 4px !important; }
}

/* Small helper used by the global confirmation dialog */
.place-items-center { place-items: center; }
.login-card h1 { padding-left: 0 !important; }
.login-card h1::before { display: none !important; }
