/* =====================================================================
   NPH IMS — Design system
   โทนสีเขียวของเทศบาล + Bootstrap 5.3 (รองรับโหมดมืด data-bs-theme="dark")
   ===================================================================== */
:root {
  --nph-primary: #1b7f4b;
  --nph-primary-rgb: 27, 127, 75;
  --nph-primary-600: #146b3e;
  --nph-primary-50: #eaf6ef;
  --nph-accent: #f2a900;
  --nph-sidebar-w: 268px;
  --nph-topbar-h: 60px;
  --nph-radius: 14px;
  --nph-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --nph-shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, .25);

  --bs-primary: var(--nph-primary);
  --bs-primary-rgb: var(--nph-primary-rgb);
  --bs-link-color: var(--nph-primary);
  --bs-link-color-rgb: var(--nph-primary-rgb);
  --bs-link-hover-color: var(--nph-primary-600);
  --bs-body-font-family: "IBM Plex Sans Thai", "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: .95rem;
  --bs-body-bg: #f4f6f5;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: var(--nph-radius);
  --bs-focus-ring-color: rgba(var(--nph-primary-rgb), .25);

  --surface: #ffffff;
  --surface-2: #f8faf9;
  --text-muted-2: #6b7a72;
  --sidebar-bg: #0f3d27;
  --sidebar-fg: #cfe6d9;
  --sidebar-muted: #7fa892;
  --sidebar-active: rgba(255, 255, 255, .1);
}

[data-bs-theme="dark"] {
  --bs-body-bg: #0f1412;
  --bs-body-color: #dfe7e2;
  --surface: #161d1a;
  --surface-2: #1b2420;
  --text-muted-2: #93a59b;
  --sidebar-bg: #0b1f15;
  --nph-primary-50: rgba(27, 127, 75, .18);
  --bs-border-color: #26322c;
  --nph-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

html { scroll-behavior: smooth; }
body { background: var(--bs-body-bg); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.text-muted-2 { color: var(--text-muted-2) !important; }
.fw-medium { font-weight: 500 !important; }
.tabular { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }

/* Buttons ----------------------------------------------------------- */
.btn { font-weight: 500; border-radius: 10px; display: inline-flex; align-items: center; gap: .4rem; justify-content: center; }
.btn-sm { border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--nph-primary); --bs-btn-border-color: var(--nph-primary); --bs-btn-hover-bg: var(--nph-primary-600); --bs-btn-hover-border-color: var(--nph-primary-600); --bs-btn-active-bg: var(--nph-primary-600); --bs-btn-disabled-bg: var(--nph-primary); --bs-btn-disabled-border-color: var(--nph-primary); }
.btn-outline-primary { --bs-btn-color: var(--nph-primary); --bs-btn-border-color: rgba(var(--nph-primary-rgb), .45); --bs-btn-hover-bg: var(--nph-primary); --bs-btn-hover-border-color: var(--nph-primary); --bs-btn-active-bg: var(--nph-primary-600); }
.btn-soft { background: var(--nph-primary-50); color: var(--nph-primary); border: 0; }
.btn-soft:hover { background: var(--nph-primary); color: #fff; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.text-bg-primary { background-color: var(--nph-primary) !important; }
.bg-primary-subtle { background: var(--nph-primary-50) !important; }
.text-primary { color: var(--nph-primary) !important; }

/* Layout -------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--nph-sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-fg);
  display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease;
}
.sidebar .brand { height: var(--nph-topbar-h); display: flex; align-items: center; gap: .65rem; padding: 0 1.1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.sidebar .brand img { width: 36px; height: 36px; border-radius: 50%; background: #fff; padding: 2px; }
.sidebar .brand .t1 { font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.sidebar .brand .t2 { font-size: .72rem; color: var(--sidebar-muted); line-height: 1.2; }
.sidebar nav { overflow-y: auto; padding: .75rem .65rem 2rem; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar .sec { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sidebar-muted); padding: 1rem .7rem .35rem; }
.sidebar .nav-link { color: var(--sidebar-fg); border-radius: 10px; padding: .5rem .7rem; display: flex; align-items: center; gap: .65rem; font-size: .92rem; }
.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--nph-accent); }
.sidebar .nav-link .chev { margin-left: auto; transition: transform .2s; font-size: .75rem; }
.sidebar .nav-link[aria-expanded="true"] .chev { transform: rotate(90deg); }
.sidebar .sub { padding-left: 2.15rem; }
.sidebar .sub .nav-link { font-size: .87rem; padding: .38rem .7rem; color: #b5d3c3; }
.sidebar .sub .nav-link.active { box-shadow: none; background: rgba(255,255,255,.08); }

.main { flex: 1; margin-left: var(--nph-sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin .25s; }
.topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--nph-topbar-h); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--bs-border-color); display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem;
}
.topbar .search { position: relative; flex: 1; max-width: 520px; }
.topbar .search input { padding-left: 2.3rem; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.topbar .search input:focus { background: var(--surface); border-color: rgba(var(--nph-primary-rgb), .4); }
.topbar .search > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted-2); }
.topbar .search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font-size: .7rem; background: var(--bs-border-color); color: var(--text-muted-2); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--bs-border-color); border-radius: 12px; box-shadow: var(--nph-shadow-lg); max-height: 70vh; overflow: auto; display: none; z-index: 1050; }
.search-results.show { display: block; }
.search-results a { display: flex; gap: .7rem; padding: .6rem .9rem; color: inherit; align-items: center; }
.search-results a:hover, .search-results a.active { background: var(--nph-primary-50); }
.search-results .type { font-size: .7rem; color: var(--text-muted-2); margin-left: auto; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--nph-primary-50); color: var(--nph-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }

.content { padding: 1.5rem; flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .6rem; }
.page-head h1 .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--nph-primary-50); color: var(--nph-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.breadcrumb { font-size: .82rem; margin-bottom: .35rem; --bs-breadcrumb-divider-color: var(--text-muted-2); }
.breadcrumb a { color: var(--text-muted-2); }
.footer { padding: 1rem 1.5rem; font-size: .8rem; color: var(--text-muted-2); border-top: 1px solid var(--bs-border-color); text-align: center; }

.backdrop { display: none; }
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--nph-shadow-lg); }
  body.sidebar-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
  .content { padding: 1rem; }
  .topbar { padding: 0 .75rem; }
  .topbar .search kbd { display: none; }
}

/* Cards --------------------------------------------------------------- */
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--bs-border-color); --bs-card-border-radius: var(--nph-radius); box-shadow: var(--nph-shadow); }
.card-header { background: transparent; font-weight: 600; padding: .9rem 1.1rem; display: flex; align-items: center; gap: .5rem; }
.card-header .actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.card-title-sm { font-size: .82rem; color: var(--text-muted-2); font-weight: 500; }

.kpi { padding: 1rem 1.1rem; display: flex; gap: .9rem; align-items: center; height: 100%; }
.kpi .ico { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi .val { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .lbl { font-size: .82rem; color: var(--text-muted-2); }
.kpi.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.kpi.clickable:hover { transform: translateY(-2px); box-shadow: var(--nph-shadow-lg); }
.ico-green { background: #e5f4ec; color: #1b7f4b; } .ico-blue { background: #e7f0fd; color: #1d63c9; }
.ico-amber { background: #fff4dc; color: #b77a00; } .ico-red { background: #fdecec; color: #c62828; }
.ico-gray { background: #eef0f2; color: #5b6670; } .ico-teal { background: #e3f6f6; color: #0f8484; }
[data-bs-theme="dark"] .ico-green, [data-bs-theme="dark"] .ico-blue, [data-bs-theme="dark"] .ico-amber,
[data-bs-theme="dark"] .ico-red, [data-bs-theme="dark"] .ico-gray, [data-bs-theme="dark"] .ico-teal { background: rgba(255,255,255,.06); }

/* Data table ---------------------------------------------------------- */
.dt-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--bs-border-color); }
.dt-search { position: relative; min-width: 240px; flex: 1 1 260px; max-width: 460px; }
.dt-search input { padding-left: 2.2rem; }
.dt-search > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted-2); pointer-events: none; z-index: 5; }
.dt-search .input-group .btn { border-color: var(--bs-border-color); }
.dt-filters { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem 1.1rem; background: var(--surface-2); border-bottom: 1px solid var(--bs-border-color); }
.dt-filters .form-select, .dt-filters .form-control { width: auto; min-width: 150px; max-width: 260px; }
.dt-filters .ts-wrapper { min-width: 200px; max-width: 320px; }
.dt-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 1.1rem 0; }
.dt-chip { background: var(--nph-primary-50); color: var(--nph-primary); border-radius: 999px; font-size: .78rem; padding: .2rem .35rem .2rem .7rem; display: inline-flex; align-items: center; gap: .3rem; }
.dt-chip button { border: 0; background: transparent; color: inherit; padding: 0 .2rem; line-height: 1; }
.dt-table { margin: 0; --bs-table-bg: transparent; }
.dt-table thead th { font-size: .8rem; font-weight: 600; color: var(--text-muted-2); background: var(--surface-2); border-bottom-width: 1px; white-space: nowrap; padding: .65rem .75rem; position: sticky; top: 0; z-index: 2; }
.dt-table thead th.sortable { cursor: pointer; user-select: none; }
.dt-table thead th.sortable:hover { color: var(--nph-primary); }
.dt-table thead th .si { opacity: .35; font-size: .7rem; margin-left: .2rem; }
.dt-table thead th.sorted .si { opacity: 1; color: var(--nph-primary); }
.dt-table tbody td { padding: .7rem .75rem; vertical-align: middle; border-color: var(--bs-border-color); }
.dt-table tbody tr { transition: background .1s; }
.dt-table tbody tr:hover { background: color-mix(in srgb, var(--nph-primary) 4%, transparent); }
.dt-table tbody tr.selected { background: var(--nph-primary-50); }
.dt-table td.actions { white-space: nowrap; text-align: right; width: 1%; }
.dt-table .sub { font-size: .8rem; color: var(--text-muted-2); }
.dt-table .truncate { max-width: 360px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dt-table tfoot td { font-weight: 600; background: var(--surface-2); }
.dt-wrap { overflow-x: auto; max-height: calc(100vh - 290px); min-height: 200px; }
.dt-footer { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .75rem 1.1rem; border-top: 1px solid var(--bs-border-color); font-size: .85rem; }
.dt-footer .form-select { width: auto; }
.pagination { margin: 0; --bs-pagination-active-bg: var(--nph-primary); --bs-pagination-active-border-color: var(--nph-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-border-radius: 8px; }
.dt-empty { padding: 3rem 1rem; text-align: center; color: var(--text-muted-2); }
.dt-empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .5; }
.skeleton { display: block; height: .9rem; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--bs-border-color) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.dt-bulk { display: none; align-items: center; gap: .5rem; background: var(--nph-primary); color: #fff; padding: .5rem 1.1rem; font-size: .88rem; }
.dt-bulk.show { display: flex; }
.dt-bulk .btn { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255,255,255,.5); --bs-btn-hover-bg: rgba(255,255,255,.15); --bs-btn-hover-color: #fff; }
.form-check-input:checked { background-color: var(--nph-primary); border-color: var(--nph-primary); }

/* มือถือ: ตาราง -> การ์ด */
@media (max-width: 767.98px) {
  .dt-table.cardify thead { display: none; }
  .dt-table.cardify tbody tr { display: block; border: 1px solid var(--bs-border-color); border-radius: 12px; margin: .6rem; padding: .4rem .2rem; background: var(--surface); }
  .dt-table.cardify tbody td { display: flex; gap: .75rem; justify-content: space-between; border: 0; padding: .3rem .7rem; text-align: right; }
  .dt-table.cardify tbody td::before { content: attr(data-label); font-size: .78rem; color: var(--text-muted-2); text-align: left; flex-shrink: 0; max-width: 40%; }
  .dt-table.cardify tbody td.chk::before, .dt-table.cardify tbody td.actions::before { content: none; }
  .dt-table.cardify tbody td.actions { justify-content: flex-end; width: auto; border-top: 1px dashed var(--bs-border-color); margin-top: .3rem; padding-top: .5rem; }
  .dt-table.cardify .truncate { max-width: 60vw; }
  .dt-table.cardify tfoot { display: none; }
  .dt-wrap { max-height: none; }
  .dt-search { max-width: none; }
}

/* Badges -------------------------------------------------------------- */
.badge { font-weight: 500; padding: .38em .7em; border-radius: 999px; }
.badge-soft-primary { background: #e7f0fd; color: #1d63c9; } .badge-soft-success { background: #e5f4ec; color: #146b3e; }
.badge-soft-info { background: #e3f6f6; color: #0f7474; } .badge-soft-warning { background: #fff4dc; color: #8f5f00; }
.badge-soft-danger { background: #fdecec; color: #b42318; } .badge-soft-secondary { background: #eef0f2; color: #4a545d; }
.badge-soft-dark { background: #e4e6e8; color: #1f2428; }
[data-bs-theme="dark"] [class*="badge-soft-"] { background: rgba(255,255,255,.08); }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -1px; margin-right: .4rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Forms --------------------------------------------------------------- */
.form-label { font-weight: 500; font-size: .87rem; margin-bottom: .3rem; }
.form-label .req { color: #d92d20; margin-left: 2px; }
.form-control, .form-select { border-radius: 10px; padding: .5rem .8rem; }
.form-control:focus, .form-select:focus { border-color: rgba(var(--nph-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--nph-primary-rgb), .15); }
.form-text { font-size: .78rem; }
.form-section { font-weight: 600; font-size: .95rem; color: var(--nph-primary); border-bottom: 1px dashed var(--bs-border-color); padding-bottom: .4rem; margin: .5rem 0 .25rem; display: flex; align-items: center; gap: .4rem; }
.form-section:first-child { margin-top: 0; }
.invalid-feedback { font-size: .8rem; }
.date-input { position: relative; }
.date-input .form-control { padding-right: 2.4rem; }
.date-input .pick { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-muted-2); padding: .25rem .4rem; }
.date-input .pick:hover { color: var(--nph-primary); }
.date-input input[type="date"], .date-input input[type="month"] { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn-check + .btn { border-radius: 10px; }
.choice-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.choice-group .btn { --bs-btn-padding-y: .45rem; }
.btn-check:checked + .btn-outline-primary { background: var(--nph-primary); color: #fff; }

/* Tom Select */
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
.ts-control { border-radius: 10px !important; padding: .45rem .8rem !important; min-height: 38px; border-color: var(--bs-border-color) !important; background: var(--bs-body-bg) !important; color: var(--bs-body-color); }
[data-bs-theme="light"] .ts-control { background: #fff !important; }
.focus .ts-control { border-color: rgba(var(--nph-primary-rgb), .6) !important; box-shadow: 0 0 0 .2rem rgba(var(--nph-primary-rgb), .15) !important; }
.ts-dropdown { border-radius: 10px; box-shadow: var(--nph-shadow-lg); border-color: var(--bs-border-color); background: var(--surface); color: var(--bs-body-color); z-index: 2000; }
.ts-dropdown .active { background: var(--nph-primary-50); color: inherit; }
.ts-dropdown .optgroup-header { font-weight: 600; color: var(--nph-primary); background: var(--surface-2); }
.ts-wrapper.multi .ts-control > div { background: var(--nph-primary-50); color: var(--nph-primary); border-radius: 6px; border: 0; }
.ts-wrapper.is-invalid .ts-control { border-color: #dc3545 !important; }
.ts-dropdown .opt-sub { font-size: .78rem; color: var(--text-muted-2); }

/* Modal / toast ------------------------------------------------------- */
.modal-content { border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--nph-shadow-lg); }
.modal-header { border-bottom-color: var(--bs-border-color); padding: 1rem 1.3rem; }
.modal-header .modal-title { font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.modal-body { padding: 1.2rem 1.3rem; }
.modal-footer { border-top-color: var(--bs-border-color); padding: .8rem 1.3rem; }
.toast-container { z-index: 2100; }
.toast { border: 0; border-radius: 12px; box-shadow: var(--nph-shadow-lg); background: var(--surface); }
.toast .toast-body { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; }
.toast .toast-body i { font-size: 1.2rem; }

/* Tabs ---------------------------------------------------------------- */
.nav-tabs-modern { border-bottom: 1px solid var(--bs-border-color); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs-modern .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--text-muted-2); font-weight: 500; padding: .75rem 1rem; white-space: nowrap; display: flex; align-items: center; gap: .4rem; border-radius: 0; }
.nav-tabs-modern .nav-link:hover { color: var(--nph-primary); }
.nav-tabs-modern .nav-link.active { color: var(--nph-primary); border-bottom-color: var(--nph-primary); background: transparent; }
.nav-tabs-modern .count { background: var(--surface-2); color: var(--text-muted-2); font-size: .72rem; border-radius: 999px; padding: .05rem .45rem; }
.nav-tabs-modern .nav-link.active .count { background: var(--nph-primary-50); color: var(--nph-primary); }

/* Detail lists -------------------------------------------------------- */
.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .55rem 1rem; margin: 0; }
.dl dt { color: var(--text-muted-2); font-weight: 400; font-size: .87rem; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.hero { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.hero-img { width: 112px; height: 112px; border-radius: 18px; object-fit: cover; background: var(--nph-primary-50); color: var(--nph-primary); display: flex; align-items: center; justify-content: center; font-size: 2.6rem; flex-shrink: 0; }
.tag { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface-2); border: 1px solid var(--bs-border-color); border-radius: 999px; font-size: .78rem; padding: .15rem .6rem; }
.mini-map { height: 260px; border-radius: 12px; overflow: hidden; border: 1px solid var(--bs-border-color); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--bs-border-color); }
.timeline li:last-child::before { display: none; }
.timeline li .dot { position: absolute; left: 1px; top: 5px; width: 12px; height: 12px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--bs-border-color); }

/* Wizard -------------------------------------------------------------- */
.steps { display: flex; gap: .5rem; margin-bottom: 1.25rem; overflow-x: auto; }
.step { flex: 1; min-width: 150px; display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--bs-border-color); color: var(--text-muted-2); cursor: pointer; }
.step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.step.active { border-color: var(--nph-primary); color: var(--bs-body-color); box-shadow: 0 0 0 3px rgba(var(--nph-primary-rgb), .1); }
.step.active .n, .step.done .n { background: var(--nph-primary); color: #fff; }
.step .t { font-weight: 600; font-size: .88rem; line-height: 1.2; }
.step .d { font-size: .75rem; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--bs-border-color); padding: .8rem 1.1rem; display: flex; gap: .5rem; justify-content: flex-end; z-index: 10; border-radius: 0 0 var(--nph-radius) var(--nph-radius); }
.dropzone { border: 2px dashed var(--bs-border-color); border-radius: 14px; padding: 1rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.dropzone:hover, .dropzone.drag { border-color: var(--nph-primary); background: var(--nph-primary-50); }
.dropzone img { max-height: 180px; border-radius: 10px; }

/* Maps ---------------------------------------------------------------- */
.map-page { height: calc(100vh - var(--nph-topbar-h) - 3rem); min-height: 520px; display: grid; grid-template-columns: 340px 1fr; gap: 1rem; }
.map-page .panel { overflow: auto; }
.map-page #map { border-radius: var(--nph-radius); border: 1px solid var(--bs-border-color); height: 100%; }
@media (max-width: 991.98px) { .map-page { grid-template-columns: 1fr; height: auto; } .map-page #map { height: 70vh; } }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { font-family: var(--bs-body-font-family); margin: .8rem 1rem; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin-wrap { background: transparent; border: 0; }
.legend { background: var(--surface); padding: .5rem .7rem; border-radius: 10px; box-shadow: var(--nph-shadow); font-size: .8rem; }

/* Reports ------------------------------------------------------------- */
.report-list .list-group-item { border: 0; border-radius: 10px !important; margin-bottom: 2px; display: flex; gap: .7rem; align-items: flex-start; background: transparent; color: inherit; }
.report-list .list-group-item:hover { background: var(--surface-2); }
.report-list .list-group-item.active { background: var(--nph-primary-50); color: var(--nph-primary); }
.report-list .list-group-item i { font-size: 1.1rem; margin-top: .1rem; }
.report-list .desc { font-size: .78rem; color: var(--text-muted-2); }
.report-preview .rp-title { text-align: center; font-weight: 700; font-size: 1.1rem; }
.report-preview .rp-sub { text-align: center; color: var(--text-muted-2); font-size: .88rem; margin-bottom: 1rem; }
.report-preview table { font-size: .85rem; }
.report-preview .group-row td { background: var(--nph-primary-50); font-weight: 600; color: var(--nph-primary); }

/* Mail ---------------------------------------------------------------- */
.mail-item { display: flex; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--bs-border-color); cursor: pointer; color: inherit; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.unread .subj { font-weight: 700; }
.mail-item.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--nph-primary); margin-top: .5rem; flex-shrink: 0; }
.mail-item .preview { font-size: .82rem; color: var(--text-muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Auth pages ---------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 480px) 1fr; }
.auth .form-side { display: flex; flex-direction: column; justify-content: center; padding: 3rem; background: var(--surface); }
.auth .img-side { background-size: cover; background-position: center; position: relative; }
.auth .img-side::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55)); }
.auth .img-side .cap { position: absolute; left: 2.5rem; bottom: 2.5rem; color: #fff; z-index: 1; }
.auth .img-side .cap h2 { font-weight: 700; }
.auth .logo { width: 84px; height: 84px; }
@media (max-width: 767.98px) { .auth { grid-template-columns: 1fr; } .auth .img-side { display: none; } .auth .form-side { padding: 2rem 1.25rem; } }

/* Misc ---------------------------------------------------------------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted-2); }
.empty-state i { font-size: 2.6rem; opacity: .5; }
.chart-box { position: relative; height: 300px; }
.list-compact .list-group-item { padding: .6rem 1rem; background: transparent; }
.fee-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--bs-border-color); font-size: .9rem; }
.fee-row:last-child { border-bottom: 0; }
.progress-thin { height: 6px; border-radius: 999px; }
.kbd-hint { font-size: .72rem; color: var(--text-muted-2); }
.offline-bar { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 2200; }
@media print { .sidebar, .topbar, .footer, .no-print { display: none !important; } .main { margin: 0 !important; } }
