/* ============================================================================
   «🚚 Доставка Нової Пошти» — premium redesign поверх Deep Navy (як «Чати»).
   Скоуп: #pageNpDelivery. Патерн .np-* дзеркалить розмітку renderNpDelivery (js/app.js).
   ========================================================================== */

#pageNpDelivery .np-wrap { display: flex; flex-direction: column; gap: 16px; font-family: 'Inter', system-ui, -apple-system, sans-serif; }

/* ── герой: рік + KPI-плитки ── */
#pageNpDelivery .np-hero {
    display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap;
    background: linear-gradient(135deg, #16233B 0%, #1E3A5F 58%, #24486F 100%);
    border-radius: var(--radius-xl); padding: 18px 20px; box-shadow: var(--shadow-lg);
}
#pageNpDelivery .np-hero__lead { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding-right: 16px; border-right: 1px solid rgba(255,255,255,.14); min-width: 128px; }
#pageNpDelivery .np-hero__title { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
#pageNpDelivery .np-year { appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.12) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius-full); font-size: 13px; font-weight: 700; padding: 7px 30px 7px 14px; cursor: pointer; transition: var(--transition); }
#pageNpDelivery .np-year:hover { background-color: rgba(255,255,255,.2); }
#pageNpDelivery .np-year option { color: #16233B; background: #fff; }

#pageNpDelivery .np-kpis { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
#pageNpDelivery .np-kpi { flex: 1 1 150px; min-width: 148px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11); border-radius: var(--radius-lg); padding: 11px 14px 12px; transition: var(--transition); }
#pageNpDelivery .np-kpi:hover { background: rgba(255,255,255,.12); }
#pageNpDelivery .np-kpi__l { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.55); display: flex; align-items: center; gap: 6px; }
#pageNpDelivery .np-kpi__v { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.15; }
#pageNpDelivery .np-kpi__v small { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.55); margin-left: 3px; }
#pageNpDelivery .np-kpi__s { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
#pageNpDelivery .np-kpi__s .bad { color: #FCA5A5; font-weight: 700; }
#pageNpDelivery .np-kpi--accent { background: linear-gradient(135deg, rgba(37,99,235,.34), rgba(59,130,246,.16)); border-color: rgba(96,165,250,.36); }

/* ── картки-секції ── */
#pageNpDelivery .np-card { background: var(--novo-surface); border: 1px solid var(--novo-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); overflow: hidden; }
#pageNpDelivery .np-card__h { display: flex; align-items: center; gap: 9px; padding: 14px 18px 12px; font-size: 14.5px; font-weight: 700; color: var(--novo-text); letter-spacing: -.01em; border-bottom: 1px solid var(--novo-border); }
#pageNpDelivery .np-card__h .hint { font-size: 11.5px; font-weight: 500; color: var(--novo-text-muted); margin-left: auto; }

/* ── місяці: рядки з подвійними барами ── */
#pageNpDelivery .np-months { padding: 8px 18px 14px; display: flex; flex-direction: column; }
#pageNpDelivery .np-mrow { display: grid; grid-template-columns: 52px 92px minmax(160px, 1fr) 108px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--novo-border-light, #EEF1F6); }
#pageNpDelivery .np-mrow:last-child { border-bottom: 0; }
#pageNpDelivery .np-mrow__m { font-weight: 800; font-size: 13.5px; color: var(--novo-text); }
#pageNpDelivery .np-mrow__n { font-size: 12px; color: var(--novo-text-muted); font-variant-numeric: tabular-nums; }
#pageNpDelivery .np-mrow__n b { color: var(--novo-text); font-size: 13px; }
#pageNpDelivery .np-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#pageNpDelivery .np-bar { display: flex; align-items: center; gap: 8px; }
#pageNpDelivery .np-bar__track { flex: 1; height: 8px; border-radius: 6px; background: var(--novo-surface-soft, #F1F5F9); overflow: hidden; }
#pageNpDelivery .np-bar__fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #1E3A5F, #3B82F6); }
#pageNpDelivery .np-bar--client .np-bar__fill { background: linear-gradient(90deg, #94A3B8, #CBD5E1); }
#pageNpDelivery .np-bar__v { width: 108px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--novo-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
#pageNpDelivery .np-bar--client .np-bar__v { color: var(--novo-text-muted); font-weight: 600; }
#pageNpDelivery .np-mrow__msgs { text-align: right; font-size: 12.5px; color: var(--novo-text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
#pageNpDelivery .np-legend { display: flex; gap: 16px; padding: 10px 18px 0 18px; font-size: 11.5px; color: var(--novo-text-muted); }
#pageNpDelivery .np-legend i { display: inline-block; width: 18px; height: 7px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; background: linear-gradient(90deg, #1E3A5F, #3B82F6); }
#pageNpDelivery .np-legend .cl i { background: linear-gradient(90deg, #94A3B8, #CBD5E1); }

/* ── клієнти: таблиця ── */
#pageNpDelivery .np-tblwrap { overflow-x: auto; }
#pageNpDelivery .np-tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
#pageNpDelivery .np-tbl thead th { position: sticky; top: 0; background: var(--novo-surface); z-index: 1; text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--novo-text-muted); padding: 10px 14px 8px; border-bottom: 2px solid var(--novo-border); white-space: nowrap; }
#pageNpDelivery .np-tbl thead th.r, #pageNpDelivery .np-tbl td.r { text-align: right; }
#pageNpDelivery .np-tbl tbody tr { cursor: pointer; transition: background .12s ease; }
#pageNpDelivery .np-tbl tbody tr:hover { background: var(--novo-blue-100, #EFF6FF); }
#pageNpDelivery .np-tbl td { padding: 9px 14px; border-bottom: 1px solid var(--novo-border-light, #EEF1F6); font-variant-numeric: tabular-nums; white-space: nowrap; }
#pageNpDelivery .np-tbl td.name { font-weight: 650; color: var(--novo-text); max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
#pageNpDelivery .np-tbl tbody tr:hover td.name { color: #2563EB; }
#pageNpDelivery .np-tbl td.muted { color: var(--novo-text-muted); }
#pageNpDelivery .np-cost { display: inline-flex; align-items: center; gap: 9px; justify-content: flex-end; }
#pageNpDelivery .np-cost__bar { width: 64px; height: 6px; border-radius: 5px; background: var(--novo-surface-soft, #F1F5F9); overflow: hidden; flex-shrink: 0; }
#pageNpDelivery .np-cost__fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #1E3A5F, #3B82F6); }

/* ── пілюля «доставка/продажі» ── */
#pageNpDelivery .np-pct { display: inline-block; min-width: 52px; text-align: center; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-full); background: var(--novo-surface-soft, #F1F5F9); color: var(--novo-text-secondary); font-variant-numeric: tabular-nums; }
#pageNpDelivery .np-pct--ok { background: #E8F7EE; color: #16803C; }
#pageNpDelivery .np-pct--warn { background: #FEF3C7; color: #92400E; }
#pageNpDelivery .np-pct--bad { background: #FEE2E2; color: #B91C1C; }
#pageNpDelivery .np-pct--none { background: transparent; color: var(--novo-text-muted); font-weight: 500; }

/* ── адаптив ── */
@media (max-width: 760px) {
    #pageNpDelivery .np-hero__lead { border-right: 0; padding-right: 0; }
    #pageNpDelivery .np-mrow { grid-template-columns: 44px 1fr; grid-auto-rows: auto; }
    #pageNpDelivery .np-mrow__msgs { grid-column: 2; text-align: left; }
}
