/* Owner: the simplified Customers screen (js/owner-users.js) and the tabbed customer profile (js/owner-profile.js + the money card in js/owner-finance.js).
 * Warm cream ground, white cards, dark readable text, green for good, orange for the one primary action per area, red only for overdue / danger. Small buttons. */

:root {
  --rd-ink: #1d1916; --rd-muted: #746b64; --rd-line: #eadfce; --rd-card: #ffffff; --rd-cream: #fbf6ee; --rd-orange: #e8720c; --rd-orange-dk: #c25a02;
  --rd-green: #1d6b32; --rd-green-bg: #e6f4e9; --rd-amber: #8a5a00; --rd-amber-bg: #fff1d6; --rd-red: #9a2a1b; --rd-red-bg: #fbe7e3; --rd-blue: #25508a; --rd-blue-bg: #e8f0fb; --rd-grey-bg: #f0ebe3;
}

/* calm buttons inside the redesigned screens: one orange primary, outlines for the rest */
.uv .btn, #profileBody.pf-on .btn { min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 700; box-shadow: none; text-transform: none; letter-spacing: 0; }
.uv .btn-primary, #profileBody.pf-on .btn-primary { background: var(--rd-orange); background-image: none; color: #fff; border: 1px solid var(--rd-orange); }
.uv .btn-primary:hover, #profileBody.pf-on .btn-primary:hover { background: var(--rd-orange-dk); }
.uv .btn-outline, #profileBody.pf-on .btn-outline { background: #fff; color: var(--rd-ink); border: 1px solid #d9cbb6; }
.uv .btn-outline:hover, #profileBody.pf-on .btn-outline:hover { background: var(--rd-cream); }

/* =========================================================== Customers screen */
#adminPanelPlans.uv-on .owner-mobile-only, #adminPanelPlans.uv-on .owner-desktop-only { display: none !important; }
#adminPanelPlans.uv-on.uv-legacy .owner-desktop-only { display: block !important; }
#adminPanelPlans.uv-on.uv-legacy #usersV2 { display: none; }
.uv { color: var(--rd-ink); }
.uv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.uv-back { display: none; }
.uv-title { flex: 1 1 220px; min-width: 0; }
.uv-title h2 { margin: 0; font: 800 1.45rem var(--font-head, "Plus Jakarta Sans"); }
.uv-title p { margin: 2px 0 0; color: var(--rd-muted); font-size: 13px; }
.uv-head-acts { display: flex; gap: 8px; align-items: center; }
.uv-more { position: relative; }
.uv-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 230px; background: #fff; border: 1px solid var(--rd-line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 28px rgba(60, 40, 10, .14); display: flex; flex-direction: column; }
.uv-menu[hidden] { display: none; }
.uv-menu button, .uv-pop button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; font: 600 13px var(--font-body, Inter); color: var(--rd-ink); cursor: pointer; }
.uv-menu button:hover, .uv-pop button:hover { background: var(--rd-cream); }
.uv-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.uv-metric { background: #fff; border: 1px solid var(--rd-line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.uv-metric span { font-size: 11.5px; color: var(--rd-muted); font-weight: 600; }
.uv-metric b { font: 800 1.35rem var(--font-head, "Plus Jakarta Sans"); }
.uv-metric.ok b { color: var(--rd-green); } .uv-metric.warn b { color: var(--rd-amber); } .uv-metric.bad b { color: var(--rd-red); }
.uv-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rd-line); margin-bottom: 12px; }
.uv-tabs::-webkit-scrollbar { display: none; }
.uv-tab { flex: none; background: none; border: 0; border-bottom: 2.5px solid transparent; padding: 9px 12px; font: 700 13px var(--font-head, "Plus Jakarta Sans"); color: var(--rd-muted); cursor: pointer; white-space: nowrap; }
.uv-tab span { font-weight: 700; font-size: 11.5px; background: var(--rd-grey-bg); border-radius: 999px; padding: 1px 7px; margin-left: 3px; color: var(--rd-muted); }
.uv-tab.on { color: var(--rd-ink); border-bottom-color: var(--rd-orange); }
.uv-tab.on span { background: #ffe7cf; color: var(--rd-orange-dk); }
.uv-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.uv-tools input { flex: 1 1 auto; min-width: 0; min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid #d9cbb6; background: #fff; font-size: 14px; }
.uv-filter-btn.on { border-color: var(--rd-orange); color: var(--rd-orange-dk); }
.uv-filters { background: #fff; border: 1px solid var(--rd-line); border-radius: 12px; padding: 12px; margin-bottom: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.uv-filters[hidden] { display: none; }
.uv-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--rd-muted); font-weight: 600; }
.uv-f select { min-height: 36px; border-radius: 8px; border: 1px solid #d9cbb6; background: #fff; padding: 0 8px; font-size: 13px; color: var(--rd-ink); }
.uv-f-acts { display: flex; gap: 8px; justify-content: flex-end; grid-column: 1 / -1; }
.uv-empty { background: #fff; border: 1px dashed var(--rd-line); border-radius: 12px; padding: 22px; text-align: center; color: var(--rd-muted); }
.uv-table-wrap { background: #fff; border: 1px solid var(--rd-line); border-radius: 14px; overflow: hidden; }
.uv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.uv-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--rd-muted); background: var(--rd-cream); padding: 9px 12px; font-weight: 700; white-space: nowrap; }
.uv-table td { padding: 9px 8px; border-top: 1px solid #f3ece0; vertical-align: middle; white-space: nowrap; }
.uv-table th { padding: 9px 8px; }
.uv-table td:first-child { white-space: normal; min-width: 130px; }
.uv-table td.uv-st { white-space: normal; }
.uv-table td.uv-st .uv-chip { display: table; margin: 2px 0; }
.uv-table tr:hover td { background: #fffcf7; }
.uv-table td small, .uv-card small { display: block; color: var(--rd-muted); font-size: 11.5px; margin-top: 1px; }
.uv-name { font-weight: 800; color: var(--rd-ink); text-decoration: none; }
.uv-name:hover { color: var(--rd-orange-dk); }
.uv-due { font-weight: 800; color: var(--rd-red); } .uv-nodue { color: var(--rd-muted); }
.uv-table td.uv-acts { display: flex; gap: 4px; align-items: center; justify-content: flex-end; min-width: 96px; }
.uv-view { font-weight: 700; font-size: 13px; color: var(--rd-orange-dk); text-decoration: none; }
.uv-dots { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; font-size: 18px; line-height: 1; color: var(--rd-muted); cursor: pointer; }
.uv-dots:hover { background: var(--rd-cream); border-color: var(--rd-line); }
.uv-chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin: 1px 4px 1px 0; white-space: nowrap; }
.uv-chip-ok { background: var(--rd-green-bg); color: var(--rd-green); } .uv-chip-warn { background: var(--rd-amber-bg); color: var(--rd-amber); }
.uv-chip-bad { background: var(--rd-red-bg); color: var(--rd-red); } .uv-chip-info { background: var(--rd-blue-bg); color: var(--rd-blue); } .uv-chip-mute { background: var(--rd-grey-bg); color: var(--rd-muted); }
.uv-cards { display: flex; flex-direction: column; gap: 8px; }
.uv-card { background: #fff; border: 1px solid var(--rd-line); border-radius: 14px; padding: 11px 12px; display: flex; flex-direction: column; gap: 5px; }
.uv-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.uv-card-top .uv-name { font-size: 15px; overflow-wrap: anywhere; }
.uv-card-plan { font-size: 12.5px; color: var(--rd-muted); }
.uv-card-pay { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.uv-card-pay b { color: var(--rd-red); }
.uv-card-acts { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.uv-more-row { text-align: center; margin: 12px 0; }
.uv-pop { position: absolute; z-index: 1250; width: 190px; background: #fff; border: 1px solid var(--rd-line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 28px rgba(60, 40, 10, .18); display: flex; flex-direction: column; }
.uv-overlay { position: fixed; inset: 0; z-index: 1300; background: rgba(30, 20, 10, .5); display: flex; align-items: flex-end; justify-content: center; }
.uv-review { position: relative; width: min(480px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 18px; box-sizing: border-box; }
@media (min-width: 640px) { .uv-overlay { align-items: center; } .uv-review { border-radius: 20px; } }
.uv-review h3 { margin: 0 34px 8px 0; font: 800 1.1rem var(--font-head, "Plus Jakarta Sans"); }
.uv-x { position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border: 0; background: none; font-size: 24px; color: var(--rd-muted); cursor: pointer; }
.uv-review-sum { background: var(--rd-cream); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.uv-review-sum small { color: var(--rd-muted); }
.uv-req { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--rd-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.uv-req small { display: block; color: var(--rd-muted); font-size: 12px; margin-top: 2px; }
.uv-req.is-done { background: var(--rd-green-bg); border-color: #cfe6d4; }
.uv-note { font-size: 12px; color: var(--rd-muted); margin: 8px 0; }
.uv-review-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 900px) {
  .uv-back { display: inline-flex; }
  .uv-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uv-head-acts { width: 100%; justify-content: flex-end; }
  .uv-title { flex-basis: 150px; }
}
/* selection ticks from the bulk-action mode */
.uv-card.bd-selectable, tr.bd-selectable { cursor: pointer; }
.uv-card.is-selected { border-color: var(--rd-red); background: #fff6ea; }
.bd-check-uv { display: inline-block; vertical-align: middle; margin-right: 8px; }

/* =========================================================== Customer profile */
#profileBody.pf-on > .profile-header-card:not(.pf-facts) { display: none; }
.pf-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 14px 18px; align-items: center; background: #fff; border: 1px solid var(--rd-line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.pf-back { font-size: 12px; font-weight: 700; color: var(--rd-muted); text-decoration: none; }
.pf-id h1 { margin: 2px 0 2px; font: 800 1.4rem var(--font-head, "Plus Jakarta Sans"); overflow-wrap: anywhere; }
.pf-id p { margin: 0 0 6px; color: var(--rd-muted); font-size: 13px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pf-chip { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pf-chip-ok { background: var(--rd-green-bg); color: var(--rd-green); } .pf-chip-warn { background: var(--rd-amber-bg); color: var(--rd-amber); } .pf-chip-bad { background: var(--rd-red-bg); color: var(--rd-red); } .pf-chip-mute { background: var(--rd-grey-bg); color: var(--rd-muted); }
.pf-glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pf-g { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-g > span { font-size: 11px; color: var(--rd-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pf-g > b { font-size: 13.5px; overflow-wrap: anywhere; }
.pf-g small { color: var(--rd-muted); font-size: 11.5px; }
.pf-g-due > b { font-size: 1.15rem; } .pf-g-due.is-due > b { color: var(--rd-red); }
.pf-bar, .fin-period-bar { height: 6px; background: var(--rd-grey-bg); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.pf-bar i, .fin-period-bar i { display: block; height: 100%; background: var(--rd-green); border-radius: 999px; }
.pf-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pf-more { position: relative; }
.pf-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 70; min-width: 220px; background: #fff; border: 1px solid var(--rd-line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 28px rgba(60, 40, 10, .16); display: flex; flex-direction: column; }
.pf-menu[hidden] { display: none; }
.pf-menu button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; font: 600 13px var(--font-body, Inter); color: var(--rd-ink); cursor: pointer; }
.pf-menu button:hover { background: var(--rd-cream); } .pf-menu .is-danger { color: var(--rd-red); }
.pf-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rd-line); margin-bottom: 14px; position: sticky; top: 0; background: var(--bg, #fffaf3); z-index: 20; }
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tab { flex: none; background: none; border: 0; border-bottom: 2.5px solid transparent; padding: 11px 14px; font: 700 13.5px var(--font-head, "Plus Jakarta Sans"); color: var(--rd-muted); cursor: pointer; white-space: nowrap; }
.pf-tab.on { color: var(--rd-ink); border-bottom-color: var(--rd-orange); }
.pf-panel { display: flex; flex-direction: column; gap: 12px; }
.pf-panel[hidden] { display: none; }
.pf-panel > .account-card { margin: 0; }
.pf-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pf-card { background: #fff; border: 1px solid var(--rd-line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pf-card h4 { margin: 0 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--rd-muted); }
.pf-plan-name { font: 800 1.05rem var(--font-head, "Plus Jakarta Sans"); margin-bottom: 2px; }
.pf-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; border-top: 1px dashed #f0e6d8; }
.pf-kv span { color: var(--rd-muted); } .pf-kv b { text-align: right; overflow-wrap: anywhere; }
.pf-pay3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-pay3 > div { background: var(--rd-cream); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.pf-pay3 span { font-size: 11px; color: var(--rd-muted); font-weight: 600; } .pf-pay3 b { font-size: 1.05rem; } .pf-pay3 .is-due b { color: var(--rd-red); }
.pf-card-act { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.pf-empty { color: var(--rd-muted); font-size: 13px; margin: 4px 0; }
.pf-account { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--rd-cream); border: 1px solid var(--rd-line); border-radius: 14px; padding: 12px 16px; }
.pf-account > div { display: flex; flex-direction: column; } .pf-account span { font-size: 11.5px; color: var(--rd-muted); font-weight: 600; } .pf-account b { font-size: 1.15rem; } .pf-account b.is-due { color: var(--rd-red); } .pf-account small { color: var(--rd-muted); font-size: 11.5px; }
.pf-facts { background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; margin: 0 !important; }
.pf-facts > div:first-child { display: none; }
#profileBody .pf-facts .profile-header-stats { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important; gap: 8px; width: 100%; }
#pfOverview { display: flex; flex-direction: column; gap: 12px; }
.pf-facts .profile-stat { min-width: 0; padding: 8px 10px; }
.pf-facts .profile-stat-value { font-size: 14px !important; }
.pf-facts .profile-stat { background: #fff; border: 1px solid var(--rd-line); border-radius: 10px; padding: 8px 10px; }
.pf-fold > h3 { cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin: 0; }
.pf-fold > h3::after { content: "▾"; font-size: 14px; color: var(--rd-muted); transition: transform .15s; }
.pf-fold.is-open > h3::after { transform: rotate(180deg); }
.pf-fold > .pf-fold-body { display: none; margin-top: 10px; }
.pf-fold.is-open > .pf-fold-body { display: block; }
.pf-advanced { border: 1px solid #f0c9c3; border-radius: 14px; background: #fff; padding: 4px 4px 10px; }
.pf-advanced > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; color: var(--rd-red); font-size: 14px; }
.pf-advanced > .account-card { margin: 6px 10px 0; }
@media (max-width: 900px) {
  .pf-head { grid-template-columns: 1fr; }
  .pf-acts { justify-content: flex-start; }
  .pf-glance { grid-template-columns: 1fr 1fr; }
  .pf-glance .pf-g:first-child { grid-column: 1 / -1; }
  .pf-cards { grid-template-columns: 1fr; }
  .pf-account { grid-template-columns: 1fr; }
}

/* the money card (Payments & Bills tab) */
.fin-figs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .fin-figs-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fin-period { background: #fff; border: 1px solid var(--rd-line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.fin-period.is-void { opacity: .6; }
.fin-period-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fin-period-top small { color: var(--rd-muted); }
.fin-period-figs { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 2px; font-size: 13px; color: var(--rd-muted); }
.fin-period-figs b { color: var(--rd-ink); }
.fin-period-figs .fin-due-text b { color: var(--rd-red); } .fin-period-figs .fin-ok-text b { color: var(--rd-green); }
.fin-period-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.fin-sched { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--rd-muted); margin: 4px 0; }
.fin-sched span { background: var(--rd-cream); border-radius: 999px; padding: 2px 9px; }
.fin-period-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.fin-period-other { background: var(--rd-cream); }
.fin-fold { border: 1px solid var(--rd-line); border-radius: 12px; background: #fff; margin-top: 10px; padding: 0 12px; }
.fin-fold > summary { cursor: pointer; list-style: none; padding: 11px 0; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.fin-fold > summary::-webkit-details-marker { display: none; }
.fin-fold > summary::after { content: "▾"; color: var(--rd-muted); margin-left: 8px; }
.fin-fold[open] > summary::after { transform: rotate(180deg); }
.fin-fold > summary span { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--rd-muted); background: var(--rd-grey-bg); border-radius: 999px; padding: 1px 9px; }
.fin-fold-sub { margin: 8px 0 12px; }
.fin-tx-wrap { overflow-x: auto; margin-bottom: 10px; }
.fin-tx { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fin-tx th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--rd-muted); padding: 6px 8px; white-space: nowrap; }
.fin-tx td { padding: 8px; border-top: 1px solid #f3ece0; vertical-align: top; }
.fin-tx .r { text-align: right; font-weight: 700; white-space: nowrap; }
.fin-tx tr.is-void td { color: #a39c92; text-decoration: line-through; }
.fin-tx-note { color: var(--rd-muted); font-size: 11px; }
.fin-tx-acts { white-space: nowrap; text-align: right; }
.fin-preview { background: var(--rd-cream); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 0 0 8px; min-height: 0; }
.fin-preview:empty { display: none; }
.fin-inst-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 6px; align-items: center; }
.fin-inst-row input { min-height: 38px; border-radius: 8px; border: 1px solid #d9cbb6; padding: 0 8px; }

/* the screens never grow wider than the phone: every block may shrink, the tabs and the table scroll inside themselves */
.uv, .uv > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.uv-table-wrap { overflow-x: auto; }
.pf-panels, .pf-panel, .pf-head, #profileBody.pf-on { min-width: 0; max-width: 100%; }
.pf-tabs { max-width: 100%; }

/* the same calm buttons inside the pop-ups (modals are added to the page body, outside the screens above) */
.uv-review .btn, .fin-modal .btn, .fin-modal .btn-block { min-height: 40px; border-radius: 10px; font-size: 13.5px; font-weight: 700; box-shadow: none; }
.uv-review .btn-primary, .fin-modal .btn-primary { background: var(--rd-orange); background-image: none; color: #fff; border: 1px solid var(--rd-orange); }
.uv-review .btn-primary:hover, .fin-modal .btn-primary:hover { background: var(--rd-orange-dk); }
.uv-review .btn-sm { min-height: 34px; padding: 0 12px; }
.fin-inst-row input { min-width: 0; width: 100%; box-sizing: border-box; }
.fin-inst-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; }
.fin-tx-acts { display: flex; gap: 10px; justify-content: flex-end; border-top: 0 !important; }
.fin-tx-note { display: block; }
