/* =====================================================================
   HubPro Admin — design system (2026 redesign)
   Loaded by resources/views/layouts/app.blade.php after Bootstrap 5.
   Brand colours can be overridden at runtime from General Settings
   (layout prints --hp-primary / --hp-sidebar / --hp-bg on :root).
   ===================================================================== */
:root {
  --hp-primary: #FF720D;
  --hp-primary-600: #EA640A;
  --hp-primary-50: #FFF2E8;
  --hp-primary-100: #FFE1CC;
  --hp-sidebar: #132C49;
  --hp-sidebar-2: #0F2540;
  --hp-bg: #F6F8FC;
  --hp-card: #FFFFFF;
  --hp-ink: #0D1B34;
  --hp-text: #22314A;
  --hp-muted: #5E6E86;
  --hp-subtle: #8996AA;
  --hp-border: #E3E9F2;
  --hp-border-2: #EDF1F7;
  --hp-head: #F4F7FB;
  --hp-blue: #1E6FE6;
  --hp-blue-50: #EAF2FE;
  --hp-blue-100: #D6E6FD;
  --hp-green: #16A34A;
  --hp-green-50: #E7F7EE;
  --hp-amber: #D97706;
  --hp-amber-50: #FFF4E0;
  --hp-red: #E03E45;
  --hp-red-50: #FDECEC;
  --hp-purple: #7C3AED;
  --hp-purple-50: #F1EAFE;
  --hp-gray-50: #F1F4F8;
  --hp-radius: 12px;
  --hp-radius-sm: 8px;
  --hp-shadow: 0 1px 2px rgba(16, 37, 66, .04), 0 1px 3px rgba(16, 37, 66, .06);
  --hp-shadow-lg: 0 12px 32px rgba(16, 37, 66, .14);
  --hp-side-w: 248px;
  --hp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- base ---------- */
body.hp-admin {
  margin: 0;
  background: var(--hp-bg);
  color: var(--hp-text);
  font-family: var(--hp-font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.hp-admin a { color: var(--hp-blue); text-decoration: none; }
body.hp-admin a:hover { text-decoration: none; filter: brightness(.92); }
body.hp-admin h1, body.hp-admin h2, body.hp-admin h3, body.hp-admin h4, body.hp-admin h5, body.hp-admin h6 { color: var(--hp-ink); font-family: var(--hp-font); }
.hp-i { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.hp-i-sm { width: 15px; height: 15px; }
.hp-i-lg { width: 22px; height: 22px; }
.hp-i-xl { width: 26px; height: 26px; }
.hp-muted { color: var(--hp-muted) !important; }
.hp-subtle { color: var(--hp-subtle) !important; }
.hp-ink { color: var(--hp-ink) !important; }
.hp-strong { font-weight: 600; color: var(--hp-ink); }
.hp-link-orange, a.hp-link-orange { color: var(--hp-primary) !important; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.hp-link-blue, a.hp-link-blue { color: var(--hp-blue) !important; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.hp-text-green { color: var(--hp-green) !important; }
.hp-text-red { color: var(--hp-red) !important; }
.hp-text-amber { color: var(--hp-amber) !important; }
.hp-nowrap { white-space: nowrap; }
.hp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.hp-shell { min-height: 100vh; }
.hp-side {
  position: fixed; inset: 0 auto 0 0; width: var(--hp-side-w); z-index: 1040;
  background: var(--hp-sidebar); color: #DCE5F1;
  display: flex; flex-direction: column;
}
.hp-side-scroll { flex: 1; overflow-y: auto; padding: 0 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.hp-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; text-decoration: none !important; }
.hp-brand-mark { width: 36px; height: 36px; border-radius: 7px; background: var(--hp-primary); color: #fff; font-weight: 800; font-size: 20px; display: grid; place-items: center; }
.hp-brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; }
.hp-brand-text { color: #fff; font-weight: 800; font-size: 22px; letter-spacing: .3px; }
.hp-side-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9FB0C8; padding: 16px 10px 6px; }
.hp-side-label.hp-first { padding-top: 10px; border-bottom: 1px solid rgba(255,255,255,.1); margin: 0 0 8px; padding-bottom: 8px; }
.hp-nav { list-style: none; margin: 0; padding: 0; }
.hp-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0;
  color: #E6EDF6 !important; border-radius: 9px; font-size: 14.5px; font-weight: 500;
  transition: background .15s;
}
.hp-nav a .hp-i { width: 20px; height: 20px; color: #E6EDF6; }
.hp-nav a:hover { background: rgba(255,255,255,.07); filter: none; }
.hp-nav a.active { background: var(--hp-primary); color: #fff !important; box-shadow: 0 6px 14px rgba(255, 114, 13, .28); }
.hp-nav a.active .hp-i { color: #fff; }
.hp-nav .hp-nav-text { flex: 1; min-width: 0; line-height: 1.2; }
.hp-nav .hp-nav-sub { display: block; font-size: 12px; font-weight: 400; color: #A9B8CC; margin-top: 2px; }
.hp-nav a.active .hp-nav-sub { color: rgba(255,255,255,.85); }
.hp-nav-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--hp-primary); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.hp-nav a.active .hp-nav-badge { background: rgba(255,255,255,.25); }
.hp-side-user { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.1); color: #fff !important; }
.hp-side-user:hover { background: rgba(255,255,255,.05); filter: none; }
.hp-side-user .hp-av { width: 40px; height: 40px; }
.hp-side-user b { display: block; font-weight: 600; font-size: 14.5px; }
.hp-side-user small { color: #A9B8CC; font-size: 12.5px; }

.hp-main { margin-left: var(--hp-side-w); min-height: 100vh; display: flex; flex-direction: column; }
.hp-top {
  position: sticky; top: 0; z-index: 1030; background: rgba(246, 248, 252, .92); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 14px; padding: 12px 28px; min-height: 64px;
}
.hp-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--hp-muted); flex: 1; min-width: 0; flex-wrap: wrap; }
.hp-crumbs a { color: var(--hp-muted) !important; }
.hp-crumbs .sep { color: #B5C0D0; }
.hp-crumbs .cur { color: var(--hp-ink); font-weight: 600; }
.hp-top-search { position: relative; width: min(360px, 32vw); }
.hp-top-search input { width: 100%; height: 40px; border: 1px solid var(--hp-border); border-radius: 9px; padding: 0 12px 0 40px; background: #fff; font-size: 13.5px; color: var(--hp-text); outline: none; }
.hp-top-search input:focus { border-color: var(--hp-blue); box-shadow: 0 0 0 3px var(--hp-blue-50); }
.hp-top-search .hp-i { position: absolute; left: 13px; top: 11px; color: var(--hp-muted); }
.hp-top-btn { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--hp-border); background: #fff; color: var(--hp-ink) !important; font-weight: 600; font-size: 13px; }
.hp-icon-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--hp-ink); background: transparent; border: 0; position: relative; }
.hp-icon-btn:hover { background: #fff; }
.hp-icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--hp-primary); border: 2px solid var(--hp-bg); }
.hp-menu-toggle { display: none; }
.hp-content { padding: 4px 28px 32px; flex: 1; }
.hp-content-narrow { max-width: 1440px; }

/* ---------- page header ---------- */
.hp-head { background: #fff; border: 1px solid var(--hp-border); border-radius: var(--hp-radius); box-shadow: var(--hp-shadow); padding: 18px 22px 0; margin-bottom: 18px; }
.hp-head.no-tabs { padding-bottom: 18px; }
.hp-head-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hp-head-icon { width: 64px; height: 64px; border-radius: 12px; background: var(--hp-blue-50); color: var(--hp-blue); display: grid; place-items: center; flex: 0 0 auto; }
.hp-head-icon .hp-i { width: 30px; height: 30px; }
.hp-head-icon.letter { font-size: 30px; font-weight: 700; }
.hp-head-title { flex: 1; min-width: 220px; }
.hp-head-title h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.hp-head-title p { margin: 4px 0 0; color: var(--hp-muted); font-size: 15px; }
.hp-head-title .meta { display: flex; align-items: center; gap: 8px; color: var(--hp-muted); font-size: 14px; margin-top: 6px; flex-wrap: wrap; }
.hp-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hp-head .hp-tabs { margin-top: 16px; border-top: 1px solid var(--hp-border-2); }
.hp-plain-head { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.hp-plain-head h1 { font-size: 32px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.hp-plain-head p { margin: 2px 0 0; color: var(--hp-muted); font-size: 15.5px; }
.hp-back { display: inline-flex; align-items: center; gap: 8px; color: var(--hp-blue) !important; font-weight: 500; margin: 2px 0 12px; }

/* ---------- cards ---------- */
.hp-card { background: var(--hp-card); border: 1px solid var(--hp-border); border-radius: var(--hp-radius); box-shadow: var(--hp-shadow); }
.hp-card + .hp-card { margin-top: 18px; }
.hp-card-pad { padding: 20px 22px; }
.hp-card-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 22px; }
.hp-card-head.bordered { border-bottom: 1px solid var(--hp-border-2); }
.hp-card-head .hp-ci { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--hp-ink); flex: 0 0 auto; }
.hp-card-head .hp-ci.tile { background: var(--hp-gray-50); }
.hp-card-head h2, .hp-card-head h3 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.hp-card-head p { margin: 3px 0 0; color: var(--hp-muted); font-size: 13.5px; }
.hp-card-head .grow { flex: 1; min-width: 0; }
.hp-card-head .tools { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.hp-card-body { padding: 0 22px 20px; }
.hp-card-foot { padding: 14px 22px; border-top: 1px solid var(--hp-border-2); }
.hp-divider { border-top: 1px solid var(--hp-border-2); margin: 16px 0; }
.hp-grid { display: grid; gap: 18px; }
.hp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hp-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.hp-split-wide { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.hp-split-60 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.hp-stack > * + * { margin-top: 18px; }

/* ---------- stat cards ---------- */
.hp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 18px; }
.hp-stat { background: #fff; border: 1px solid var(--hp-border); border-radius: var(--hp-radius); box-shadow: var(--hp-shadow); padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; position: relative; overflow: hidden; }
.hp-stat .tile { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.hp-stat .tile .hp-i { width: 28px; height: 28px; }
.hp-stat .lbl { color: var(--hp-muted); font-size: 14px; font-weight: 500; }
.hp-stat .num { font-size: 30px; font-weight: 800; color: var(--hp-ink); letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; display: flex; align-items: baseline; gap: 10px; }
.hp-stat .sub { color: var(--hp-muted); font-size: 13.5px; margin-top: 2px; }
.hp-stat .spark { position: absolute; right: 14px; bottom: 10px; width: 46%; height: 34px; }
.hp-stat.tinted { padding: 10px; }
.hp-stat.tinted .inner { border-radius: 9px; padding: 14px; display: flex; gap: 14px; width: 100%; }
.hp-delta { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.hp-delta.up { color: var(--hp-green); }
.hp-delta.down { color: var(--hp-red); }
.t-orange { background: var(--hp-primary-50); color: var(--hp-primary); }
.t-blue { background: var(--hp-blue-50); color: var(--hp-blue); }
.t-green { background: var(--hp-green-50); color: var(--hp-green); }
.t-amber { background: var(--hp-amber-50); color: var(--hp-amber); }
.t-red { background: var(--hp-red-50); color: var(--hp-red); }
.t-purple { background: var(--hp-purple-50); color: var(--hp-purple); }
.t-gray { background: var(--hp-gray-50); color: var(--hp-muted); }
.t-navy { background: var(--hp-sidebar); color: #fff; }

/* ---------- buttons ---------- */
.hp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 9px; border: 1px solid var(--hp-border); background: #fff; color: var(--hp-ink) !important;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: all .15s; text-decoration: none !important; line-height: 1;
}
.hp-btn:hover { border-color: #CCD6E4; background: #FAFBFD; filter: none; }
.hp-btn:disabled, .hp-btn.disabled { opacity: .5; pointer-events: none; }
.hp-btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.hp-btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.hp-btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.hp-btn-primary { background: var(--hp-primary); border-color: var(--hp-primary); color: #fff !important; box-shadow: 0 4px 10px rgba(255, 114, 13, .22); }
.hp-btn-primary:hover { background: var(--hp-primary-600); border-color: var(--hp-primary-600); }
.hp-btn-soft { background: var(--hp-blue-50); border-color: var(--hp-blue-50); color: var(--hp-blue) !important; }
.hp-btn-soft:hover { background: var(--hp-blue-100); border-color: var(--hp-blue-100); }
.hp-btn-blue { background: var(--hp-blue); border-color: var(--hp-blue); color: #fff !important; }
.hp-btn-outline-blue { color: var(--hp-blue) !important; border-color: #BFD5F7; }
.hp-btn-outline-orange { color: var(--hp-primary) !important; border-color: var(--hp-primary); }
.hp-btn-outline-red { color: var(--hp-red) !important; border-color: #F3B4B6; }
.hp-btn-outline-red:hover { background: var(--hp-red-50); border-color: var(--hp-red); }
.hp-btn-ghost { border-color: transparent; background: transparent; }
.hp-btn-ghost:hover { background: var(--hp-gray-50); border-color: transparent; }
.hp-btn-icon { width: 40px; padding: 0; }
.hp-btn-icon.hp-btn-sm { width: 34px; }
.hp-btn-block { width: 100%; }
.hp-btn-group { display: inline-flex; }
.hp-btn-group .hp-btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.hp-btn-group .hp-btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,.35); padding: 0 12px; }

/* ---------- forms ---------- */
.hp-field { margin-bottom: 14px; }
.hp-field > label, .hp-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--hp-ink); margin-bottom: 6px; }
.hp-req { color: var(--hp-red); margin-left: 2px; }
.hp-input, .hp-select, .hp-textarea {
  width: 100%; height: 40px; border: 1px solid #D5DDE8; border-radius: 8px; background: #fff; color: var(--hp-ink);
  padding: 0 12px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
.hp-textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.hp-input:focus, .hp-select:focus, .hp-textarea:focus { border-color: var(--hp-primary); box-shadow: 0 0 0 3px var(--hp-primary-50); }
.hp-input[readonly], .hp-input:disabled, .hp-select:disabled { background: #F3F6FA; color: var(--hp-muted); }
.hp-input.is-invalid, .hp-select.is-invalid, .hp-textarea.is-invalid { border-color: var(--hp-red); }
.hp-select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322314A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.hp-help { font-size: 12.5px; color: var(--hp-muted); margin-top: 5px; }
.hp-error { font-size: 12.5px; color: var(--hp-red); margin-top: 5px; }
.hp-counter { font-size: 12px; color: var(--hp-subtle); text-align: right; margin-top: 4px; }
.hp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.hp-form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.hp-form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
.hp-span-2 { grid-column: span 2; }
.hp-input-icon { position: relative; }
.hp-input-icon .hp-i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--hp-muted); pointer-events: none; }
.hp-input-icon .hp-input { padding-left: 40px; }
.hp-input-group { display: flex; }
.hp-input-group .hp-input { border-radius: 8px 0 0 8px; }
.hp-input-group .hp-addon { border: 1px solid #D5DDE8; border-left: 0; border-radius: 0 8px 8px 0; background: #fff; width: 42px; display: grid; place-items: center; color: var(--hp-muted); cursor: pointer; }
.hp-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--hp-ink); }
.hp-check input[type=checkbox], .hp-check input[type=radio], input.hp-cb { width: 18px; height: 18px; accent-color: var(--hp-blue); margin: 0; flex: 0 0 auto; }
.hp-check-card { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--hp-border); border-radius: 8px; padding: 10px 14px; min-width: 120px; cursor: pointer; }
.hp-radio-list { display: grid; gap: 10px; }
.hp-radio-list .hp-check { align-items: flex-start; }
.hp-radio-list small { display: block; color: var(--hp-muted); font-size: 12.5px; }
/* toggle switch */
.hp-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.hp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hp-switch .track { width: 44px; height: 24px; border-radius: 99px; background: #D5DDE8; position: relative; transition: background .15s; flex: 0 0 auto; }
.hp-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.hp-switch input:checked + .track { background: var(--hp-green); }
.hp-switch.blue input:checked + .track { background: var(--hp-blue); }
.hp-switch input:checked + .track::after { transform: translateX(20px); }
.hp-switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--hp-blue-50); }
/* segmented */
.hp-seg { display: inline-flex; background: var(--hp-gray-50); border-radius: 10px; padding: 4px; gap: 2px; }
.hp-seg.full { display: flex; }
.hp-seg.full > * { flex: 1; }
.hp-seg button, .hp-seg a, .hp-seg label { border: 1px solid transparent; background: transparent; padding: 7px 16px; border-radius: 8px; font-weight: 500; color: var(--hp-text) !important; font-size: 13.5px; cursor: pointer; text-align: center; }
.hp-seg .active, .hp-seg input:checked + span { background: #fff; color: var(--hp-blue) !important; border-color: var(--hp-blue-100); box-shadow: var(--hp-shadow); }
.hp-seg.blue .active { background: var(--hp-blue-50); }
/* chips */
.hp-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; background: var(--hp-blue-50); color: #1F3A68; font-size: 13px; font-weight: 500; }
.hp-chip button { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; display: inline-flex; opacity: .7; }
.hp-chip button:hover { opacity: 1; }
.hp-chip.gray { background: var(--hp-gray-50); color: var(--hp-text); }
/* search */
.hp-search { position: relative; }
.hp-search .hp-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--hp-muted); }
.hp-search input { width: 100%; height: 42px; border: 1px solid #D5DDE8; border-radius: 9px; padding: 0 14px 0 42px; outline: none; font-size: 14px; }
.hp-search input:focus { border-color: var(--hp-primary); box-shadow: 0 0 0 3px var(--hp-primary-50); }
.hp-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.hp-filters > .hp-search { flex: 1 1 280px; }
.hp-filters .hp-select { width: auto; min-width: 150px; }
.hp-filters .hp-field { margin: 0; min-width: 160px; flex: 1 1 160px; }

/* ---------- tabs ---------- */
.hp-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.hp-tabs a, .hp-tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 13px 14px; color: var(--hp-text) !important; font-weight: 500; font-size: 14.5px; white-space: nowrap; background: none; border: 0; cursor: pointer; }
.hp-tabs a.active, .hp-tabs button.active { color: var(--hp-primary) !important; font-weight: 600; }
.hp-tabs a.active::after, .hp-tabs button.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--hp-primary); }
.hp-tabs .cnt { background: var(--hp-gray-50); color: var(--hp-text); border-radius: 6px; padding: 1px 8px; font-size: 12.5px; font-weight: 600; }
.hp-tabs .active .cnt { background: var(--hp-primary-50); color: var(--hp-primary); }
.hp-tabs.boxed { border-bottom: 1px solid var(--hp-border-2); padding: 0 12px; }
.hp-tab-pane { display: none; }
.hp-tab-pane.active { display: block; }

/* ---------- tables ---------- */
.hp-table-wrap { overflow-x: auto; }
.hp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.hp-table thead th { background: var(--hp-head); color: var(--hp-ink); font-weight: 600; font-size: 13px; text-align: left; padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--hp-border-2); }
.hp-table thead th:first-child { border-top-left-radius: 8px; }
.hp-table thead th:last-child { border-top-right-radius: 8px; }
.hp-table.caps thead th { text-transform: uppercase; font-size: 12px; letter-spacing: .04em; color: var(--hp-muted); }
.hp-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--hp-border-2); vertical-align: middle; color: var(--hp-text); }
.hp-table tbody tr:last-child td { border-bottom: 0; }
.hp-table tbody tr:hover td { background: #FBFCFE; }
.hp-table tbody tr.selected td { background: #F2F7FF; }
.hp-table .cell-main { font-weight: 600; color: var(--hp-ink); }
.hp-table .cell-sub { color: var(--hp-muted); font-size: 13px; }
.hp-table.compact tbody td { padding: 9px 14px; }
.hp-table td.num, .hp-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.hp-table tfoot td { padding: 12px 14px; font-weight: 700; color: var(--hp-ink); background: var(--hp-head); }
.hp-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit !important; }
.hp-company { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hp-company .txt { min-width: 0; }
.hp-company .txt b, .hp-company .txt a.name { display: block; font-weight: 600; color: var(--hp-ink) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-company .txt small { color: var(--hp-muted); font-size: 13px; }
.hp-table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 2px; flex-wrap: wrap; color: var(--hp-muted); }
.hp-thumb { width: 60px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--hp-gray-50); }

/* ---------- badges ---------- */
.hp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1.25; }
.hp-badge .hp-i { width: 15px; height: 15px; }
.hp-badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-green { background: var(--hp-green-50); color: #13803D; }
.b-amber { background: var(--hp-amber-50); color: #B76100; }
.b-red { background: var(--hp-red-50); color: #C9252C; }
.b-blue { background: var(--hp-blue-50); color: #1B5FC7; }
.b-purple { background: var(--hp-purple-50); color: #6A2FD6; }
.b-gray { background: var(--hp-gray-50); color: #4A5A72; }
.b-orange { background: var(--hp-primary-50); color: #D35A04; }
.b-navy { background: #E6ECF5; color: #1B3253; }
.hp-badge.solid-dot .d { background: currentColor; }
.hp-badge.sm { font-size: 12px; padding: 2px 8px; }
.hp-tag { display: inline-block; padding: 4px 10px; border-radius: 6px; background: #EEF2F7; color: #2A3B55; font-size: 13px; font-weight: 500; white-space: nowrap; }
.hp-tag.orange { background: var(--hp-primary-50); color: #C65207; }
.hp-tag.blue { background: var(--hp-blue-50); color: #1B5FC7; }
.hp-tag.purple { background: var(--hp-purple-50); color: #6A2FD6; }
.hp-tag.green { background: var(--hp-green-50); color: #13803D; }
.hp-tag.red { background: var(--hp-red-50); color: #B4232A; }
.hp-tag.gray { background: #EEF2F7; color: #4A5A72; }
.hp-tag .hp-i { vertical-align: -2px; }
.hp-count-pill { background: var(--hp-amber-50); color: #B76100; border-radius: 8px; padding: 4px 10px; font-weight: 600; font-size: 13px; }

/* ---------- avatars ---------- */
.hp-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; overflow: hidden; background: var(--hp-blue-50); color: var(--hp-blue); }
.hp-av img { width: 100%; height: 100%; object-fit: cover; }
.hp-av.sq { border-radius: 8px; }
.hp-av.lg { width: 48px; height: 48px; font-size: 18px; }
.hp-av.xl { width: 72px; height: 72px; font-size: 30px; }
.hp-av.sm { width: 28px; height: 28px; font-size: 12px; }
.av-0 { background: var(--hp-blue-50); color: var(--hp-blue); }
.av-1 { background: var(--hp-green-50); color: var(--hp-green); }
.av-2 { background: var(--hp-purple-50); color: var(--hp-purple); }
.av-3 { background: var(--hp-primary-50); color: var(--hp-primary); }
.av-4 { background: #E6F6F8; color: #0E8A9A; }
.av-5 { background: var(--hp-red-50); color: var(--hp-red); }

/* ---------- pagination ---------- */
.hp-pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hp-pager a, .hp-pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--hp-border); background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--hp-ink) !important; font-weight: 500; font-size: 13.5px; }
.hp-pager .active { background: var(--hp-primary); border-color: var(--hp-primary); color: #fff !important; }
.hp-pager.blue .active { background: var(--hp-blue-50); border-color: var(--hp-blue); color: var(--hp-blue) !important; }
.hp-pager .disabled { color: var(--hp-subtle) !important; pointer-events: none; }
.hp-pager .gap { border: 0; background: none; }

/* ---------- lists / misc ---------- */
.hp-list { list-style: none; margin: 0; padding: 0; }
.hp-list > li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--hp-border-2); }
.hp-list > li:last-child { border-bottom: 0; }
.hp-list .grow { flex: 1; min-width: 0; }
.hp-list b { font-weight: 600; color: var(--hp-ink); display: block; }
.hp-list small { color: var(--hp-muted); font-size: 12.5px; }
.hp-kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 18px; font-size: 14px; }
.hp-kv dt { color: var(--hp-muted); font-weight: 400; }
.hp-kv dd { margin: 0; color: var(--hp-ink); }
.hp-kv-2 { display: grid; grid-template-columns: 130px 1fr 130px 1fr; gap: 12px 18px; }
.hp-kv-icon { display: grid; grid-template-columns: 22px 130px 1fr; gap: 14px 12px; align-items: center; }
.hp-kv-icon .hp-i { color: var(--hp-muted); }
.hp-kv-icon dt { color: var(--hp-muted); }
.hp-kv-icon dd { margin: 0; color: var(--hp-ink); display: flex; align-items: center; gap: 8px; }
.hp-check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hp-check-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--hp-text); }
.hp-check-list .ok { width: 20px; height: 20px; border-radius: 50%; background: var(--hp-green); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.hp-check-list .ok .hp-i { width: 12px; height: 12px; stroke-width: 3; }
.hp-ok { width: 20px; height: 20px; border-radius: 50%; background: var(--hp-green); color: #fff; display: inline-grid; place-items: center; }
.hp-ok .hp-i { width: 12px; height: 12px; stroke-width: 3; }
.hp-no { width: 20px; height: 20px; border-radius: 50%; background: #64748B; color: #fff; display: inline-grid; place-items: center; }
.hp-no .hp-i { width: 12px; height: 12px; stroke-width: 3; }
.hp-note { display: flex; gap: 10px; align-items: flex-start; background: var(--hp-blue-50); color: #24406B; border-radius: 9px; padding: 11px 14px; font-size: 13.5px; }
.hp-note .hp-i { color: var(--hp-blue); margin-top: 1px; }
.hp-note.amber { background: var(--hp-amber-50); color: #7A4A00; }
.hp-note.amber .hp-i { color: var(--hp-amber); }
.hp-note.red { background: var(--hp-red-50); color: #8C1D22; }
.hp-note.green { background: var(--hp-green-50); color: #0F5F2D; }
.hp-callout { border-radius: 12px; padding: 16px; background: #FFF6EE; border: 1px solid #FFE3CC; }
.hp-progress { height: 10px; border-radius: 99px; background: #E9EEF5; overflow: hidden; }
.hp-progress > span { display: block; height: 100%; background: var(--hp-blue); border-radius: 99px; }
.hp-stars { display: inline-flex; gap: 2px; color: #F59E0B; }
.hp-stars .off { color: #D5DCE6; }
.hp-stars .hp-i { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.hp-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.hp-timeline li { display: grid; grid-template-columns: 14px 180px 1fr auto; gap: 12px; align-items: baseline; padding: 8px 0; position: relative; }
.hp-timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #94A3B8; position: relative; top: 1px; }
.hp-timeline li:first-child::before { background: var(--hp-blue); }
.hp-timeline b { font-weight: 600; color: var(--hp-ink); }
.hp-timeline span { color: var(--hp-muted); font-size: 13.5px; }
.hp-timeline time { color: var(--hp-muted); font-size: 13.5px; white-space: nowrap; }
.hp-empty { text-align: center; padding: 40px 20px; color: var(--hp-muted); }
.hp-empty .hp-i { width: 40px; height: 40px; color: #B5C0D0; margin-bottom: 8px; }
.hp-empty h4 { font-size: 16px; margin: 0 0 4px; }
.hp-mini-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hp-mini-tile { border: 1px solid var(--hp-border); border-radius: 10px; padding: 14px; }
.hp-mini-tile .ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 8px; }
.hp-mini-tile .l { color: var(--hp-muted); font-size: 13px; }
.hp-mini-tile .v { font-size: 24px; font-weight: 800; color: var(--hp-ink); }
.hp-quick { display: flex; align-items: stretch; }
.hp-quick > div { flex: 1; display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-left: 1px solid var(--hp-border-2); }
.hp-quick > div:first-child { border-left: 0; flex: 0 0 200px; display: block; }
.hp-quick a.q { display: flex; align-items: center; gap: 12px; color: inherit !important; }
.hp-quick .q b { display: block; color: var(--hp-ink); font-weight: 600; font-size: 13.5px; }
.hp-quick .q small { color: var(--hp-muted); font-size: 12.5px; }
.hp-drag { color: #A6B2C4; cursor: grab; display: inline-flex; }
.hp-dropzone { border: 2px dashed #C8D6EA; border-radius: 12px; background: #FAFCFF; padding: 32px 20px; text-align: center; color: var(--hp-muted); transition: all .15s; cursor: pointer; }
.hp-dropzone.drag { border-color: var(--hp-blue); background: var(--hp-blue-50); }
.hp-dropzone h4 { font-size: 17px; margin: 10px 0 4px; }
.hp-file-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--hp-red-50); color: var(--hp-red); display: grid; place-items: center; flex: 0 0 auto; }
.hp-date-tile { width: 56px; height: 60px; border-radius: 10px; display: grid; place-content: center; text-align: center; flex: 0 0 auto; }
.hp-date-tile small { font-size: 11.5px; font-weight: 700; text-transform: uppercase; line-height: 1; }
.hp-date-tile b { font-size: 22px; font-weight: 800; line-height: 1.1; }
.hp-legend { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; color: var(--hp-text); }
.hp-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.hp-color-swatch { width: 44px; height: 40px; border-radius: 8px; border: 1px solid var(--hp-border); flex: 0 0 auto; padding: 0; cursor: pointer; }
.hp-msg { background: var(--hp-gray-50); border-radius: 10px; padding: 14px 16px; white-space: pre-line; color: var(--hp-ink); line-height: 1.6; }

/* ---------- stepper ---------- */
.hp-steps { display: flex; align-items: center; gap: 14px; padding: 18px 0 20px; }
.hp-step { display: flex; align-items: center; gap: 12px; }
.hp-step .n { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--hp-gray-50); color: var(--hp-muted); font-weight: 600; flex: 0 0 auto; }
.hp-step b { display: block; font-weight: 600; color: var(--hp-ink); }
.hp-step small { color: var(--hp-muted); font-size: 12.5px; }
.hp-step.active .n { background: var(--hp-blue); color: #fff; }
.hp-step.active b { color: var(--hp-blue); }
.hp-step.done .n { background: var(--hp-blue); color: #fff; }
.hp-step-line { flex: 1; height: 2px; background: var(--hp-border); min-width: 30px; }
.hp-step-line.done { background: var(--hp-blue); }

/* ---------- side panel (detail drawer) ---------- */
.hp-panel { position: sticky; top: 80px; }
.hp-panel-close { margin-left: auto; }

/* ---------- sticky save bar ---------- */
.hp-savebar { position: sticky; bottom: 0; z-index: 1020; margin: 18px -28px -32px; padding: 12px 28px; background: #fff; border-top: 1px solid var(--hp-border); display: flex; align-items: center; gap: 12px; }
.hp-savebar .state { display: flex; align-items: center; gap: 8px; color: var(--hp-muted); flex: 1; }
.hp-savebar .state i { width: 10px; height: 10px; border-radius: 50%; background: #F5B300; box-shadow: 0 0 0 4px #FFF3CC; }
.hp-savebar.clean .state { visibility: hidden; }

/* ---------- dropdown (bootstrap) ---------- */
body.hp-admin .dropdown-menu { border: 1px solid var(--hp-border); border-radius: 10px; box-shadow: var(--hp-shadow-lg); padding: 6px; font-size: 14px; }
body.hp-admin .dropdown-item { border-radius: 7px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; color: var(--hp-text); }
body.hp-admin .dropdown-item:hover { background: var(--hp-gray-50); }
body.hp-admin .dropdown-item.text-danger { color: var(--hp-red) !important; }

/* ---------- charts ---------- */
.hp-chart { position: relative; width: 100%; }
.hp-bar-row { display: grid; grid-template-columns: 70px 1fr 40px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--hp-text); }
.hp-rank { display: grid; grid-template-columns: 36px 1fr 40px; gap: 12px; align-items: center; }
.hp-rank .n { width: 32px; height: 32px; border-radius: 50%; background: var(--hp-blue-50); color: var(--hp-blue); display: grid; place-items: center; font-weight: 700; }

/* ---------- alerts (flash) ---------- */
.hp-flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.hp-flash.ok { background: var(--hp-green-50); color: #0F5F2D; border: 1px solid #BFE8CF; }
.hp-flash.err { background: var(--hp-red-50); color: #8C1D22; border: 1px solid #F6C4C6; }
.hp-flash button { margin-left: auto; border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; }

/* =====================================================================
   Legacy compatibility: Bootstrap pages not yet rebuilt still render
   inside the new shell. These rules restyle Bootstrap/Vuexy markup.
   ===================================================================== */
body.hp-admin .card { border: 1px solid var(--hp-border); border-radius: var(--hp-radius); box-shadow: var(--hp-shadow); background: #fff; }
body.hp-admin .card-header { background: transparent; border-bottom: 1px solid var(--hp-border-2); padding: 16px 20px; }
body.hp-admin .card-title, body.hp-admin .card-header h5 { font-weight: 700; color: var(--hp-ink); margin: 0; }
body.hp-admin .card-body { padding: 20px; }
body.hp-admin .btn { border-radius: 9px; font-weight: 600; font-size: 14px; padding: 8px 16px; }
body.hp-admin .btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
body.hp-admin .btn-primary { background: var(--hp-primary); border-color: var(--hp-primary); color: #fff; }
body.hp-admin .btn-primary:hover, body.hp-admin .btn-primary:focus { background: var(--hp-primary-600); border-color: var(--hp-primary-600); }
body.hp-admin .btn-outline-primary { color: var(--hp-primary); border-color: var(--hp-primary); }
body.hp-admin .btn-outline-primary:hover { background: var(--hp-primary); color: #fff; }
body.hp-admin .btn-label-primary { background: var(--hp-primary-50); color: var(--hp-primary); border: 0; }
body.hp-admin .btn-label-secondary, body.hp-admin .btn-outline-secondary { background: #fff; color: var(--hp-ink); border: 1px solid var(--hp-border); }
body.hp-admin .form-control, body.hp-admin .form-select { border: 1px solid #D5DDE8; border-radius: 8px; min-height: 40px; font-size: 14px; color: var(--hp-ink); }
body.hp-admin .form-control:focus, body.hp-admin .form-select:focus { border-color: var(--hp-primary); box-shadow: 0 0 0 3px var(--hp-primary-50); }
body.hp-admin .form-label { font-weight: 500; font-size: 13.5px; color: var(--hp-ink); }
body.hp-admin .form-check-input:checked { background-color: var(--hp-blue); border-color: var(--hp-blue); }
body.hp-admin .table { --bs-table-bg: transparent; font-size: 14px; }
body.hp-admin .table > thead th { background: var(--hp-head); color: var(--hp-ink); font-weight: 600; font-size: 13px; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--hp-border-2); padding: 11px 14px; }
body.hp-admin .table > tbody td { padding: 12px 14px; border-color: var(--hp-border-2); vertical-align: middle; }
body.hp-admin .badge { font-weight: 500; border-radius: 7px; padding: 5px 9px; }
body.hp-admin .bg-label-success { background: var(--hp-green-50) !important; color: #13803D !important; }
body.hp-admin .bg-label-warning { background: var(--hp-amber-50) !important; color: #B76100 !important; }
body.hp-admin .bg-label-danger { background: var(--hp-red-50) !important; color: #C9252C !important; }
body.hp-admin .bg-label-info, body.hp-admin .bg-label-primary { background: var(--hp-blue-50) !important; color: #1B5FC7 !important; }
body.hp-admin .bg-label-secondary { background: var(--hp-gray-50) !important; color: #4A5A72 !important; }
body.hp-admin .modal-content { border: 0; border-radius: 14px; box-shadow: var(--hp-shadow-lg); }
body.hp-admin .modal-header { border-bottom: 1px solid var(--hp-border-2); padding: 18px 22px; }
body.hp-admin .modal-title { font-weight: 700; color: var(--hp-ink); }
body.hp-admin .modal-footer { border-top: 1px solid var(--hp-border-2); }
body.hp-admin .pagination .page-link { border-radius: 8px !important; margin: 0 3px; border: 1px solid var(--hp-border); color: var(--hp-ink); min-width: 36px; text-align: center; }
body.hp-admin .pagination .page-item.active .page-link { background: var(--hp-primary); border-color: var(--hp-primary); color: #fff; }
body.hp-admin .nav-tabs .nav-link.active, body.hp-admin .nav-pills .nav-link.active { color: var(--hp-primary); border-color: transparent transparent var(--hp-primary); background: transparent; }
body.hp-admin .nav-pills .nav-link.active { background: var(--hp-primary); color: #fff; }
body.hp-admin .alert { border-radius: 10px; }
body.hp-admin .container-xxl { max-width: none; padding: 0; }
body.hp-admin .swal2-popup { font-family: var(--hp-font); border-radius: 14px; }
body.hp-admin .swal2-confirm { background: var(--hp-primary) !important; border-radius: 9px !important; }

/* ---------- responsive ---------- */
@media (max-width: 1399px) {
  .hp-split { grid-template-columns: minmax(0, 1fr) 360px; }
  .hp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  .hp-side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--hp-shadow-lg); }
  body.hp-side-open .hp-side { transform: none; }
  body.hp-side-open .hp-scrim { display: block; }
  .hp-main { margin-left: 0; }
  .hp-menu-toggle { display: grid; }
  .hp-split, .hp-split-wide, .hp-split-60 { grid-template-columns: 1fr; }
  .hp-panel { position: static; }
  .hp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-quick { flex-wrap: wrap; }
  .hp-quick > div { flex: 1 1 45%; border-left: 0; border-top: 1px solid var(--hp-border-2); }
}
@media (max-width: 767px) {
  .hp-top { padding: 10px 16px; }
  .hp-content { padding: 4px 16px 24px; }
  .hp-top-search, .hp-top-btn span { display: none; }
  .hp-grid-2, .hp-grid-3, .hp-grid-4, .hp-form-grid, .hp-form-grid-3, .hp-form-grid-4 { grid-template-columns: 1fr; }
  .hp-span-2 { grid-column: auto; }
  .hp-head-title h1, .hp-plain-head h1 { font-size: 24px; }
  .hp-head-icon { width: 52px; height: 52px; }
  .hp-kv, .hp-kv-2 { grid-template-columns: 1fr 1.4fr; }
  .hp-savebar { margin: 18px -16px -24px; padding: 12px 16px; }
  .hp-mini-tiles { grid-template-columns: 1fr; }
  .hp-steps { flex-wrap: wrap; }
  .hp-step-line { display: none; }
  .hp-timeline li { grid-template-columns: 14px 1fr; }
  .hp-timeline li span, .hp-timeline li time { grid-column: 2; }
}
.hp-scrim { display: none; position: fixed; inset: 0; background: rgba(9, 20, 38, .45); z-index: 1035; }
.hp-stat:has(.spark) { padding-bottom: 48px; }
.hp-stat:has(.spark) .spark { bottom: 12px; right: 18px; width: 52%; }
.hp-split > .hp-card, .hp-split-wide > .hp-card, .hp-split-60 > .hp-card, .hp-grid > .hp-card, .hp-stack > .hp-card + .hp-card { margin-top: 0; }
.hp-stack > * + * { margin-top: 18px !important; }
/* tile colour helpers win over avatar defaults */
.hp-av.t-orange, .hp-ci.t-orange { background: var(--hp-primary-50); color: var(--hp-primary); }
.hp-av.t-blue, .hp-ci.t-blue { background: var(--hp-blue-50); color: var(--hp-blue); }
.hp-av.t-green, .hp-ci.t-green { background: var(--hp-green-50); color: var(--hp-green); }
.hp-av.t-amber, .hp-ci.t-amber { background: var(--hp-amber-50); color: var(--hp-amber); }
.hp-av.t-red, .hp-ci.t-red { background: var(--hp-red-50); color: var(--hp-red); }
.hp-av.t-purple, .hp-ci.t-purple { background: var(--hp-purple-50); color: var(--hp-purple); }
.hp-av.t-gray, .hp-ci.t-gray { background: var(--hp-gray-50); color: var(--hp-muted); }
.hp-filters .hp-select { min-width: 130px; flex: 0 1 165px; }
.hp-filters > .dropdown > .hp-btn { height: 42px; }
.hp-locked .hp-when-unlocked { display: none !important; }
#visRows:not(.hp-locked) .hp-when-locked { display: none !important; }
.hp-check-card:has(input:checked) { border-color: var(--hp-blue-100); background: #F7FAFF; }
.hp-seg label span.active { background: #fff; color: var(--hp-blue) !important; border: 1px solid var(--hp-blue-100); box-shadow: var(--hp-shadow); }
#serviceList > * + * { margin-top: 10px !important; }
[hidden] { display: none !important; }
.hp-btn.hp-link-blue { color: var(--hp-blue) !important; }
.hp-btn.hp-text-red { color: var(--hp-red) !important; }
.hp-btn.hp-text-green { color: var(--hp-green) !important; }
.hp-btn.hp-link-orange { color: var(--hp-primary) !important; }

/* Legacy pages with their dark theme switched off (see layouts/app) */
.hp-legacy .text-white, .hp-legacy .text-light { color: var(--hp-ink) !important; }
.hp-legacy .text-muted { color: var(--hp-muted) !important; }
.hp-legacy .bg-dark, .hp-legacy .bg-primary:not(.badge), .hp-legacy .bg-secondary:not(.badge) { background: #fff !important; color: var(--hp-ink) !important; }
.hp-legacy h1, .hp-legacy h2, .hp-legacy h3, .hp-legacy h4, .hp-legacy h5, .hp-legacy h6 { color: var(--hp-ink); }
.hp-legacy .card + .card, .hp-legacy .card { margin-bottom: 18px; }
.hp-legacy .table { color: var(--hp-text); }
.hp-legacy .table-dark { --bs-table-bg: #fff; --bs-table-color: var(--hp-ink); }
.hp-legacy .required-field::after, .hp-legacy .required::after { content: " *"; color: var(--hp-red); }
.hp-legacy .form-section, .hp-legacy .detail-section { background: #fff; border: 1px solid var(--hp-border); border-radius: var(--hp-radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--hp-shadow); }
.hp-legacy .form-section h6, .hp-legacy .detail-section h6, .hp-legacy .detail-section h5 { font-size: 15px; font-weight: 700; color: var(--hp-ink); margin-bottom: 14px; }
.hp-legacy .page-header h1, .hp-legacy #table-header-module h2 { font-size: 26px; font-weight: 800; color: var(--hp-ink); }
.hp-legacy #table-header-module, .hp-legacy .page-header { background: #fff; border: 1px solid var(--hp-border); border-radius: var(--hp-radius); padding: 18px 22px; margin-bottom: 18px; box-shadow: var(--hp-shadow); }
.hp-legacy .page-header p { color: var(--hp-muted); margin: 0; }

/* Text colour for older pages: the old theme made body text light for a dark background */
body.hp-admin .hp-content { color: var(--hp-text); }
.hp-legacy, .hp-legacy p, .hp-legacy td, .hp-legacy li, .hp-legacy label, .hp-legacy small, .hp-legacy span:not(.badge):not(.hp-badge), .hp-legacy div { color: inherit; }
.hp-legacy strong, .hp-legacy b, .hp-legacy .card-header h4, .hp-legacy .card-title { color: var(--hp-ink); }
.hp-legacy .detail-label { font-size: 12px; font-weight: 600; color: var(--hp-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.hp-legacy .detail-value { color: var(--hp-ink); margin-bottom: 12px; }
.hp-legacy .detail-value a, .hp-legacy a:not(.btn):not(.hp-btn):not(.dropdown-item) { color: var(--hp-blue); }
.hp-legacy .form-control, .hp-legacy .form-select { background-color: #fff; color: var(--hp-ink); }
.hp-legacy .form-control::placeholder { color: var(--hp-subtle, #8A97AB); }
.hp-legacy .btn-secondary { background: #fff; color: var(--hp-ink); border: 1px solid var(--hp-border); }
.hp-legacy .bg-success:not(.hp-badge) { background: var(--hp-green-50) !important; color: #13803D !important; }
.hp-legacy .bg-warning:not(.hp-badge) { background: var(--hp-amber-50) !important; color: #B76100 !important; }
.hp-legacy .bg-secondary.badge { background: var(--hp-gray-50) !important; color: #4A5A72 !important; }
.hp-tag.amber { background: var(--hp-amber-50); color: #B76100; }
.hp-tag.gray { background: var(--hp-gray-50); color: #4A5A72; }
.hp-tag .hp-i { vertical-align: -2px; }
.hp-btn.hp-btn-danger { background: var(--hp-red); border-color: var(--hp-red); color: #fff; }
.hp-btn.hp-btn-danger:hover { filter: brightness(.94); color: #fff; }
/* bulk action bar */
.hp-bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: #FFF6EE; border: 1px solid #FFD9BC; }
.hp-bulkbar[hidden] { display: none !important; }
.hp-bulkbar .count { font-weight: 600; color: var(--hp-ink); margin-right: auto; }
.hp-bulkbar .hp-select { height: 36px; width: auto; min-width: 190px; }

/* Card headers: keep title and subtitle tight regardless of theme typography */
.hp-card-head .grow h2, .hp-card-head .grow h3 { margin: 0 !important; line-height: 1.3; }
.hp-card-head .grow p { margin: 3px 0 0 !important; line-height: 1.45; }
.hp-card-head .hp-step-num { margin-top: 1px; }
/* Segmented radio control (label > input + span) */
.hp-seg label { padding: 0 !important; border: 0 !important; margin: 0; }
.hp-seg label input { position: absolute; opacity: 0; pointer-events: none; }
.hp-seg label span { display: block; padding: 7px 18px; border-radius: 8px; border: 1px solid transparent; color: var(--hp-text); font-weight: 500; }
.hp-seg label input:checked + span, .hp-seg label span.active { background: #fff; color: var(--hp-ink) !important; border-color: var(--hp-border); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); font-weight: 600; }
.hp-seg label input:focus-visible + span { outline: 2px solid var(--hp-blue); outline-offset: 1px; }
.hp-card > .hp-card-body:first-child { padding-top: 20px; }
@media (max-width: 1100px) { .hp-main .hp-split { grid-template-columns: minmax(0, 1fr) !important; } }

/* plan form: post types */
.hp-pt-box { grid-column: 1 / -1; border: 1px solid var(--hp-border-2); border-radius: 12px; padding: 16px; background: #FAFBFD; }
.hp-pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.hp-pt { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 38px 11px 12px; background: #fff; border: 1.5px solid var(--hp-border); border-radius: 10px; cursor: pointer; margin: 0; }
.hp-pt input { position: absolute; opacity: 0; pointer-events: none; }
.hp-pt .tile { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.hp-pt .t { display: flex; flex-direction: column; min-width: 0; }
.hp-pt b { color: var(--hp-ink); font-size: 14px; }
.hp-pt small { color: var(--hp-muted); font-size: 12px; line-height: 1.35; }
.hp-pt .chk { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #C4CDD9; background: #fff; display: grid; place-items: center; }
.hp-pt input:checked ~ .chk { background: var(--hp-primary); border-color: var(--hp-primary); }
.hp-pt input:checked ~ .chk::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.hp-pt:has(input:checked) { border-color: var(--hp-primary); }
.hp-pt input:focus-visible ~ .chk { box-shadow: 0 0 0 3px rgba(255, 114, 13, .25); }
.hp-pt.off { opacity: .55; cursor: not-allowed; }
.tile.t-blue { background: var(--hp-blue-50, #EAF2FE); color: var(--hp-blue, #1E6FE6); }
.tile.t-purple { background: #F1ECFD; color: #7448D8; }
.tile.t-orange { background: #FFF1E6; color: #E5650A; }
.tile.t-green { background: #E7F7EE; color: #13803D; }
.hp-pt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.hp-ptc { padding: 18px; display: flex; flex-direction: column; gap: 14px; margin: 0 !important; }
.hp-ptc.off { opacity: .7; }
.hp-ptc .top { display: flex; gap: 12px; align-items: flex-start; }
.hp-ptc .tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.hp-ptc .grow { flex: 1; min-width: 0; }
.hp-ptc h2 { font-size: 17px; font-weight: 700; margin: 0 0 2px; }
.hp-ptc p { margin: 0; color: var(--hp-muted); font-size: 13px; }
.hp-ptc .nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; background: #F7F9FC; border-radius: 10px; padding: 10px; }
.hp-ptc .nums b { display: block; font-size: 18px; font-weight: 800; color: var(--hp-ink); }
.hp-ptc .nums small { color: var(--hp-muted); font-size: 11.5px; line-height: 1.2; display: block; }
.hp-ptc .kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.hp-ptc .kv dt { color: var(--hp-muted); font-weight: 500; }
.hp-ptc .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hp-ptc .kv code { color: var(--hp-text); background: #F1F4F8; padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.hp-ptc .acts { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
