:root {
    color-scheme: light;
    --page: #f5f7fb;
    --surface: #fff;
    --surface-muted: #f9fafc;
    --text: #182230;
    --muted: #748093;
    --line: #e6eaf0;
    --nav: #111d31;
    --nav-muted: #a7b3c5;
    --blue: #2868d7;
    --blue-dark: #1d55b8;
    --green: #17815d;
    --red: #bd3b43;
    --amber: #a66300;
    --shadow: 0 8px 26px rgb(25 42 70 / 5%);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--text); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 252px; flex-direction: column; background: var(--nav); color: var(--nav-muted); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 18px 22px; border-bottom: 1px solid rgb(255 255 255 / 8%); color: #fff; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small, .signed-in strong, .signed-in small { display: block; }
.brand strong { font-size: 14px; }
.brand small, .signed-in small { margin-top: 2px; color: var(--nav-muted); font-size: 12px; }
.navigation { display: flex; flex: 1; flex-direction: column; gap: 5px; overflow-y: auto; padding: 20px 12px; }
.navigation a { display: flex; align-items: center; min-height: 43px; padding: 0 14px; border-radius: 8px; color: var(--nav-muted); font-weight: 600; transition: background .15s, color .15s; }
.navigation a:hover { background: rgb(255 255 255 / 7%); color: #fff; }
.navigation a.active { background: #245db6; color: #fff; }
.sidebar-bottom { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid rgb(255 255 255 / 8%); }
.signed-in { display: flex; align-items: center; gap: 10px; padding: 5px 4px 14px; color: #fff; }
.signed-in strong { max-width: 170px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: #273853; color: #fff; font-weight: 700; }
.avatar.signed-in-photo { object-fit: cover; }
.nav-logout { width: 100%; padding: 8px 10px; border: 1px solid rgb(255 255 255 / 14%); border-radius: 7px; background: transparent; color: var(--nav-muted); cursor: pointer; text-align: left; }
.nav-logout:hover { color: #fff; background: rgb(255 255 255 / 6%); }

.main { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; min-height: 76px; align-items: center; gap: 13px; padding: 13px 34px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 94%); backdrop-filter: blur(10px); }
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.topbar-date { margin-left: auto; color: var(--muted); font-size: 13px; }
.menu-button { display: none; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 21px; }
.content { display: grid; max-width: 1440px; gap: 22px; margin: auto; padding: 30px 34px 46px; }

.welcome-row, .page-toolbar, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.welcome-row h2, .page-toolbar h2, .panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.welcome-row p, .page-toolbar p, .panel-heading p, .form-intro p { margin: 4px 0 0; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats-grid.stats-three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stat-card { position: relative; display: grid; min-height: 154px; align-content: start; gap: 5px; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.stat-icon, .quick-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; font-size: 11px; font-weight: 800; }
.stat-icon { position: absolute; top: 17px; right: 17px; }
.stat-icon.blue, .quick-icon.blue { background: #ebf2ff; color: var(--blue); }
.stat-icon.violet, .quick-icon.violet { background: #f1edff; color: #6848c7; }
.stat-icon.green, .quick-icon.green { background: #e8f7f0; color: var(--green); }
.stat-icon.amber, .quick-icon.amber { background: #fff3df; color: var(--amber); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card strong { margin-top: 7px; font-size: 26px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-card small { color: var(--muted); font-size: 12px; }
.stat-card.due strong { color: var(--red); }
.stat-card.adv strong { color: var(--green); }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-heading p { font-size: 12px; }
.text-link, .back-link { color: var(--blue); font-size: 13px; font-weight: 700; }
.text-link:hover, .back-link:hover { color: var(--blue-dark); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-muted); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { color: #465266; font-size: 13px; }
td strong { color: var(--text); font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
.table-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.align-right { text-align: right; white-space: nowrap; }
.action-group { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.action-group form { display: inline-flex; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; background: #f0f2f5; color: #647084; font-size: 11px; font-weight: 750; text-transform: capitalize; white-space: nowrap; }
.badge.active, .badge.paid, .badge.online { background: #e7f6ef; color: #147550; }
.badge.suspended, .badge.overdue, .badge.offline { background: #fff0ef; color: #ad363d; }
.badge.unpaid, .badge.partial, .badge.maintenance { background: #fff5e3; color: #966000; }
.empty-state { display: grid; justify-items: center; padding: 46px 20px; text-align: center; }
.empty-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #edf3fd; color: var(--blue); font-size: 12px; font-weight: 800; }
.empty-state h3 { margin: 13px 0 3px; font-size: 15px; }
.empty-state p { margin: 0 0 17px; color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quick-card { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: transform .15s, box-shadow .15s; }
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-card > span:nth-child(2) { flex: 1; }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: 12px; }
.quick-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.quick-card > b { color: var(--muted); }

.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 750; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { border-color: var(--line); background: #fff; color: #445064; }
.button.secondary:hover { border-color: #b7c5da; background: #f8faff; }
.button.danger { border-color: #f2d4d5; background: #fff; color: var(--red); }
.button.danger:hover { background: #fff5f5; }
.button.small { min-height: 30px; padding: 0 10px; font-size: 11px; }
.button.disabled { min-height: 30px; padding: 0 10px; background: #f2f4f7; color: #a0a9b5; cursor: not-allowed; }
.button.wide { width: 100%; min-height: 44px; }
.pagination-wrap { padding: 14px 18px; border-top: 1px solid var(--line); }
.pagination-wrap nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pagination-wrap nav > div:first-child { color: var(--muted); font-size: 12px; }
.pagination-wrap nav > div:last-child > span, .pagination-wrap nav > div:last-child > a { display: inline-flex; gap: 3px; }
.pagination-wrap nav a, .pagination-wrap nav span[aria-current] span, .pagination-wrap nav span[aria-disabled] span { display: inline-flex; min-width: 30px; height: 30px; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; color: #536075; font-size: 12px; }
.pagination-wrap nav a:hover, .pagination-wrap nav span[aria-current] span { border-color: var(--blue); background: #edf4ff; color: var(--blue); }

.form-intro { margin-bottom: -8px; }
.form-intro p { margin-top: 7px; }
.form-panel { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; padding: 22px; }
.form-grid label, .stack-form label { display: grid; gap: 6px; color: #465266; font-size: 12px; font-weight: 700; }
.form-grid label.full { grid-column: 1 / -1; }
.required { color: var(--red); }
.form-grid input, .form-grid select, .form-grid textarea, .stack-form input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #dfe4eb; border-radius: 7px; outline: 0; background: #fff; color: var(--text); font-size: 13px; font-weight: 400; }
.form-grid textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .stack-form input:focus { border-color: #7aa4e9; box-shadow: 0 0 0 3px rgb(40 104 215 / 10%); }
.input-prefix { display: flex; align-items: center; border: 1px solid #dfe4eb; border-radius: 7px; background: #fff; }
.input-prefix:focus-within { border-color: #7aa4e9; box-shadow: 0 0 0 3px rgb(40 104 215 / 10%); }
.input-prefix span { padding-left: 11px; color: var(--muted); font-weight: 500; }
.input-prefix input { border: 0; box-shadow: none !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--line); background: #fcfdff; }
.form-error { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #f1cece; border-radius: 8px; background: #fff4f3; color: #a53036; font-size: 12px; }
.form-error p { margin: 0; }
.form-error p + p { margin-top: 5px; }
.alert { padding: 12px 15px; border: 1px solid; border-radius: 8px; }
.alert.success { border-color: #c9ead9; background: #effaf4; color: #176f4e; }
.alert.error { border-color: #f1cece; background: #fff4f3; color: #a53036; }
.alert ul { margin: 7px 0 0; padding-left: 19px; }

.guest-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 20% 5%, #e8f0ff 0, transparent 38%), var(--page); }
.auth-card { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 60px rgb(24 43 75 / 10%); }
.auth-brand { padding: 0 0 25px; border-bottom: 1px solid var(--line); color: var(--text); }
.auth-brand small { color: var(--muted); }
.auth-intro { margin: 24px 0 20px; }
.auth-intro h1 { margin: 5px 0; font-size: 22px; letter-spacing: -.03em; }
.auth-intro > p:last-child { margin: 0; color: var(--muted); }
.stack-form { display: grid; gap: 15px; }
.stack-form input { min-height: 43px; }
.stack-form .check-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.stack-form .check-label input { width: 15px; min-height: 15px; }
.help-inline { color: var(--muted); font-size: 11px; font-weight: 400; }
.form-errors { color: var(--red); font-size: 12px; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 400; }
.form-note { margin: -8px 0 0; color: var(--muted); font-size: 12px; }
.customer-name:hover strong { color: var(--blue); }

.customer-directory-table { min-width: 900px; }
.customer-directory-table th { padding: 16px 18px; border-right: 1px solid #dfe3e8; background: #e9ecef; color: #405064; font-size: 12px; letter-spacing: .04em; }
.customer-directory-table th:first-child, .customer-directory-table td:first-child { text-align: center; }
.customer-directory-table td { height: 84px; padding: 12px 18px; border-right: 1px solid #edf0f2; color: #3f4b5d; font-size: 14px; }
.customer-directory-table th:last-child, .customer-directory-table td:last-child { border-right: 0; }
.customer-directory-table tbody tr:nth-child(even) { background: #f0f1f2; }
.customer-directory-table tbody tr:hover { background: #f7f9fb; }
.customer-directory-table .customer-number { color: #657386; font-variant-numeric: tabular-nums; }
.directory-client { display: flex; min-width: 180px; align-items: center; gap: 14px; }
.directory-client .customer-avatar { width: 44px; height: 44px; }
.directory-client > span:last-child { min-width: 0; }
.directory-client strong, .directory-client small { display: block; }
.directory-client strong { color: #253b5a; font-size: 16px; font-weight: 700; }
.directory-client small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.directory-phone { color: #2f4057; font-size: 15px; font-variant-numeric: tabular-nums; }
.customer-directory-table .table-sub { font-size: 12px; }
.align-center { text-align: center; }
.device-count { display: inline-grid; min-width: 30px; height: 30px; place-items: center; border-radius: 6px; background: #f7f8f9; color: #172333; font-weight: 700; }
.customer-directory-table .money-cell { color: #111820; font-weight: 650; text-align: right; white-space: nowrap; }
.customer-directory-table .money-cell::first-letter { color: #00ad9c; }
.balance-pill { display: inline-flex; min-width: 69px; justify-content: center; padding: 4px 12px; border: 1px solid; border-radius: 999px; font-weight: 750; white-space: nowrap; }
.balance-due { border-color: #ffd9d9; background: #fff5f5; color: #ed252d; }
.balance-clear { border-color: #fff0a6; background: #fffbed; color: #a97a00; }
.balance-advance { border-color: #cceee4; background: #f0fbf7; color: #138363; }

.payment-history-panel { overflow: hidden; }
.payment-filters { display: flex; min-height: 92px; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.payment-search { display: flex; width: min(420px, 100%); min-height: 48px; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid #dfe4eb; border-radius: 12px; background: #fafbfc; color: #98a3b2; }
.payment-search > span { font-size: 25px; line-height: 1; }
.payment-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.payment-search input::placeholder { color: #8994a5; }
.payment-filter-controls { display: flex; align-items: center; gap: 12px; }
.payment-filter-controls select { min-width: 150px; height: 48px; padding: 0 14px; border: 1px solid #dfe4eb; border-radius: 12px; background: #fafbfc; color: #344256; font: inherit; }
.payment-filter-controls .button { height: 48px; }
.payment-directory-table { min-width: 920px; }
.payment-directory-table th { padding: 16px 18px; border-right: 1px solid #dfe3e8; background: #e9ecef; color: #405064; font-size: 12px; letter-spacing: .04em; }
.payment-directory-table th:first-child, .payment-directory-table td:first-child { text-align: center; }
.payment-directory-table td { height: 76px; padding: 11px 18px; border-right: 1px solid #edf0f2; font-size: 14px; }
.payment-directory-table th:last-child, .payment-directory-table td:last-child { border-right: 0; }
.payment-directory-table tbody tr:nth-child(even) { background: #f7f8f9; }
.payment-directory-table tbody tr:hover { background: #f0f4f8; }
.payment-row-number { color: #657386; }
.payment-client { display: flex; min-width: 190px; align-items: center; gap: 14px; }
.payment-client .customer-avatar { width: 44px; height: 44px; }
.payment-client > span:last-child { min-width: 0; }
.payment-client strong, .payment-client small { display: block; }
.payment-client strong { color: #253b5a; font-size: 16px; }
.payment-client small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.payment-amount { color: #172333 !important; font-weight: 750; text-align: right; white-space: nowrap; }
.payment-amount::first-letter { color: #00ad9c; }
.payment-method { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid #e0e4e9; border-radius: 999px; background: #f3f4f6; color: #3e4c5f; font-size: 11px; font-weight: 750; white-space: nowrap; }
.payment-note { color: #657386 !important; font-style: italic; }
.payment-status { display: inline-block; width: 40px; height: 22px; border-radius: 999px; background: #20c36a; vertical-align: middle; }
.payment-status::after { display: block; width: 16px; height: 16px; margin: 3px 3px 3px auto; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); content: ""; }
.payment-entry > summary { cursor: pointer; list-style: none; }
.payment-entry > summary::-webkit-details-marker { display: none; }
.payment-entry > summary::after { margin-left: auto; color: var(--muted); content: "+"; font-size: 20px; }
.payment-entry[open] > summary::after { content: "−"; }
.payment-entry > summary span strong, .payment-entry > summary span small { display: block; }
.payment-entry > summary span strong { font-size: 15px; }
.payment-entry > summary span small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.payment-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: stretch; justify-content: flex-end; padding: 0; background: rgb(15 23 42 / 46%); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.payment-modal.is-open { opacity: 1; pointer-events: auto; }
.payment-modal-panel { width: min(760px, 100%); height: 100vh; height: 100dvh; overflow: auto; border: 1px solid var(--line); border-radius: 18px 0 0 18px; background: var(--surface); box-shadow: -18px 0 70px rgb(15 23 42 / 22%); transform: translateX(100%); transition: transform .24s ease; }
.payment-modal.is-open .payment-modal-panel { transform: translateX(0); }
.payment-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.payment-modal-header h3 { margin: 0; font-size: 18px; }
.payment-modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.payment-modal-close { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; font-size: 20px; }
.payment-modal-close:hover { border-color: #bdd0f9; background: #f4f8ff; }
.payment-modal-body { padding: 16px 20px 0; }
.payment-modal .form-grid { padding: 0 0 16px; }
.payment-modal .form-actions { margin: 0 -20px; padding: 15px 20px; }
.modal-open { overflow: hidden; }
.directory-panel { overflow: hidden; }
.directory-filters { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.directory-search { display: flex; width: min(480px, 100%); min-height: 48px; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid #dfe4eb; border-radius: 12px; background: #fafbfc; color: #98a3b2; }
.directory-search > span { font-size: 25px; line-height: 1; }
.directory-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.directory-search input::placeholder { color: #8994a5; }
.directory-filter-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.directory-filter-controls select { min-width: 150px; height: 48px; padding: 0 13px; border: 1px solid #dfe4eb; border-radius: 12px; background: #fafbfc; color: #344256; font: inherit; }
.directory-filter-controls .button { min-height: 46px; }
.reference-directory-table { min-width: 850px; }
.reference-directory-table th { padding: 15px 18px; border-right: 1px solid #dfe3e8; background: #e9ecef; color: #405064; font-size: 12px; letter-spacing: .04em; }
.reference-directory-table td { height: 76px; padding: 11px 18px; border-right: 1px solid #edf0f2; color: #344256; font-size: 14px; }
.reference-directory-table th:last-child, .reference-directory-table td:last-child { border-right: 0; }
.reference-directory-table tbody tr:nth-child(even) { background: #f7f8f9; }
.reference-directory-table tbody tr:hover { background: #f0f4f8; }
.directory-person { display: flex; min-width: 180px; align-items: center; gap: 14px; }
.directory-person .customer-avatar { width: 44px; height: 44px; }
.directory-person > span:last-child { min-width: 0; }
.directory-person strong, .directory-person small { display: block; }
.directory-person strong { color: #253b5a; font-size: 16px; }
.directory-person small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.mono-cell { font-family: Consolas, monospace; font-size: 13px !important; }
.status-toggle { display: inline-block; width: 42px; height: 23px; border-radius: 999px; vertical-align: middle; }
.status-toggle::after { display: block; width: 17px; height: 17px; margin-top: 3px; border: 2px solid #d5d9df; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); content: ""; }
.status-toggle.is-active { background: #20c36a; }
.status-toggle.is-active::after { margin-right: 3px; margin-left: auto; border-color: #fff; }
.status-toggle.is-inactive { background: #d1d5db; }
.status-toggle.is-inactive::after { margin-left: 3px; }
.connection-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.connection-stat { position: relative; display: grid; min-height: 116px; align-content: center; gap: 5px; padding: 20px 24px; border-radius: 13px; color: #fff; }
.connection-stat.total { background: #10b982; }
.connection-stat.rate { background: #fb7414; }
.connection-stat.active { background: #a447ef; }
.connection-stat > span { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.connection-stat > strong { font-size: 27px; line-height: 1.2; }
.connection-stat > i { position: absolute; top: 50%; right: 22px; display: grid; width: 48px; height: 48px; place-items: center; transform: translateY(-50%); border-radius: 50%; background: rgb(255 255 255 / 20%); font-size: 22px; font-style: normal; font-weight: 800; }
.connection-rate { color: #182230 !important; font-weight: 750; white-space: nowrap; }
@media (max-width: 760px) {
    .connection-stats { grid-template-columns: 1fr; gap: 10px; }
    .directory-filters { align-items: stretch; flex-direction: column; }
    .directory-search { width: 100%; }
    .directory-filter-controls { flex-wrap: wrap; justify-content: stretch; }
    .directory-filter-controls select { flex: 1 1 140px; min-width: 0; }
    .payment-filters { align-items: stretch; flex-direction: column; }
    .payment-search { width: 100%; }
    .payment-filter-controls { flex-wrap: wrap; }
    .payment-filter-controls select { flex: 1 1 130px; min-width: 0; }
}
@media (max-width: 520px) {
    .payment-filter-controls { display: grid; grid-template-columns: 1fr 1fr; }
    .payment-filter-controls .button { grid-column: 1 / -1; }
}

/* Dashboard reference layout */
body.dashboard-theme { background: #10192d; color: #eef3ff; }
.dashboard-theme .sidebar { background: #1e2a43; border-right: 1px solid #34415c; }
.dashboard-theme .brand { min-height: 70px; justify-content: flex-start; padding: 12px 20px; }
.dashboard-theme .brand-logo { max-width: 156px; }
.dashboard-theme .navigation { gap: 3px; padding: 12px 8px; }
.dashboard-theme .navigation a { min-height: 44px; gap: 10px; padding: 0 13px; border-radius: 5px; color: #d4deef; }
.dashboard-theme .navigation a::before { display: inline-grid; width: 19px; place-items: center; color: #aebbd0; font-size: 14px; }
.dashboard-theme .navigation a:nth-child(1)::before { content: "◉"; }
.dashboard-theme .navigation a:nth-child(2)::before { content: "♟"; }
.dashboard-theme .navigation a:nth-child(3)::before { content: "⌘"; }
.dashboard-theme .navigation a:nth-child(4)::before { content: "▣"; }
.dashboard-theme .navigation a:nth-child(5)::before { content: "◈"; }
.dashboard-theme .navigation a:nth-child(6)::before { content: "▤"; }
.dashboard-theme .navigation a:nth-child(7)::before { content: "▦"; }
.dashboard-theme .navigation a:nth-child(8)::before { content: "▣"; }
.dashboard-theme .navigation a:nth-child(9)::before { content: "◉"; }
.dashboard-theme .navigation a:nth-child(10)::before { content: "▧"; }
.dashboard-theme .navigation a:nth-child(11)::before { content: "◷"; }
.dashboard-theme .navigation a:nth-child(12)::before { content: "♙"; }
.dashboard-theme .navigation a.active { border-right: 3px solid #5d9cff; background: #394660; color: #fff; }
.dashboard-theme .sidebar-bottom { border-color: #34415c; }
.dashboard-theme .nav-logout { border: 0; color: #c9d5e8; }
.dashboard-theme .main { background: #10192d; }
.dashboard-theme .topbar { min-height: 70px; padding: 10px 24px; border-color: #34415c; background: #1d2942; color: #edf3ff; }
.dashboard-theme .topbar > div:first-of-type { display: none; }
.dashboard-theme .topbar-date { display: none; }
.dashboard-theme .menu-button { color: #e7efff; }
.dashboard-theme .theme-toggle { order: 4; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid #3b4861; border-radius: 50%; background: #26334e; color: #ffd33d; }
.dashboard-search { display: flex; width: min(560px, 42vw); height: 46px; align-items: center; gap: 11px; margin-right: auto; padding: 0 14px; border: 1px solid #35435e; border-radius: 14px; background: #1a263d; color: #aebbd0; }
.dashboard-search > span { font-size: 24px; }
.dashboard-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #f2f6ff; font: inherit; }
.dashboard-search input::placeholder { color: #8291aa; }
.dashboard-search kbd { padding: 2px 7px; border: 1px solid #46536b; border-radius: 6px; color: #c3cde0; font-size: 10px; white-space: nowrap; }
.topbar-action { display: inline-flex; height: 42px; align-items: center; padding: 0 14px; border: 1px solid #3b4861; border-radius: 11px; color: #e1e9f8; font-weight: 650; white-space: nowrap; }
.dashboard-notifications { position: relative; display: grid; width: 36px; height: 42px; place-items: center; color: #e4ebf8; font-size: 19px; }
.dashboard-notifications span { position: absolute; top: 0; right: 0; display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 4px; border-radius: 99px; background: #ef4444; color: white; font-size: 10px; font-weight: 800; }
.dashboard-account { display: flex; max-width: 220px; height: 44px; align-items: center; gap: 9px; padding: 4px 12px 4px 5px; border: 1px solid #3b4861; border-radius: 999px; background: #2d3953; }
.dashboard-account img, .dashboard-account .avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; object-fit: cover; }
.dashboard-account strong { overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-account i { color: #bcc8db; font-style: normal; }
.dashboard-content { max-width: 1900px; gap: 24px; padding: 25px 26px 40px; }
.dashboard-hero { position: relative; display: grid; min-height: 278px; grid-template-columns: 1.05fr .9fr 1.12fr; overflow: hidden; border: 1px solid #1f65c6; border-radius: 28px; background: linear-gradient(112deg, #05234b 0%, #0b4cc0 53%, #0875d7 100%); box-shadow: 0 16px 38px rgb(0 0 0 / 24%); }
.dashboard-hero::before, .dashboard-hero::after { position: absolute; right: -5%; left: 38%; height: 1px; transform: rotate(-7deg); background: rgb(128 186 255 / 30%); content: ""; }
.dashboard-hero::before { top: 46px; }
.dashboard-hero::after { top: 150px; }
.hero-welcome, .hero-message { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 30px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-pills span { padding: 8px 13px; border: 1px solid rgb(205 226 255 / 20%); border-radius: 99px; background: rgb(255 255 255 / 9%); color: white; font-weight: 650; }
.hero-overline { margin: 18px 0 0; color: #e4efff; font-size: 23px; }
.hero-welcome h2 { margin: 0 0 18px; color: white; font-size: clamp(25px, 2.2vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.hero-welcome h2 span { color: #ffd13d; }
.attention-chip { display: inline-flex; width: fit-content; align-items: center; gap: 9px; padding: 8px 13px; border-radius: 99px; background: #f38b0b; color: white; font-weight: 750; }
.attention-chip b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #26334c; }
.hero-visual { position: relative; display: grid; min-height: 250px; place-items: center; overflow: hidden; }
.visual-orbit { position: absolute; width: 300px; height: 220px; border: 1px solid rgb(160 207 255 / 24%); border-radius: 50%; transform: rotate(-18deg); }
.orbit-two { width: 235px; height: 185px; transform: rotate(28deg); }
.network-screen { position: relative; z-index: 1; width: 255px; height: 155px; transform: perspective(540px) rotateY(-12deg) rotateX(3deg); border: 9px solid #10243e; border-bottom-width: 15px; border-radius: 12px 12px 4px 4px; background: linear-gradient(135deg, #eef6ff, #b9d8ff); box-shadow: 0 20px 28px rgb(0 0 0 / 35%); }
.network-screen::after { position: absolute; right: -18px; bottom: -24px; left: -18px; height: 12px; border-radius: 0 0 14px 14px; background: linear-gradient(#d7e0ea, #7789a0); content: ""; }
.screen-top { position: absolute; top: 0; right: 0; left: 0; height: 13px; background: #2083ed; }
.screen-sidebar { position: absolute; top: 17px; bottom: 3px; left: 0; width: 36px; background: #1b3152; }
.screen-tile { position: absolute; top: 27px; left: 47px; width: 74px; height: 37px; border-radius: 5px; background: white; box-shadow: 0 3px 8px #8db8e8; }
.tile-two { left: 132px; width: 69px; }
.screen-chart { position: absolute; right: 17px; bottom: 13px; left: 48px; height: 44px; border-bottom: 2px solid #b3c9e3; background: linear-gradient(155deg, transparent 45%, #377ff0 46%, #377ff0 49%, transparent 50%); }
.network-phone { position: absolute; z-index: 2; bottom: 38px; left: 13%; display: grid; width: 55px; height: 91px; align-content: start; gap: 8px; padding: 15px 7px; border: 5px solid #12243a; border-radius: 11px; background: #e8f2ff; box-shadow: 0 9px 15px rgb(0 0 0 / 30%); }
.network-phone span { height: 12px; margin: -10px -2px 2px; background: #2c8bff; }
.network-phone i { height: 8px; border-radius: 3px; background: #8cb8e8; }
.visual-plant { position: absolute; right: 8%; bottom: 45px; color: #8de2bd; font-size: 58px; text-shadow: 0 0 18px rgb(70 255 190 / 40%); }
.hero-message { padding-left: 18px; }
.hero-message blockquote { margin: 0; color: white; font-size: clamp(20px, 1.6vw, 29px); font-weight: 750; line-height: 1.35; }
.hero-message > p { margin: 13px 0 18px; color: #d9eaff; font-size: 12px; font-weight: 750; letter-spacing: .1em; }
.hero-mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hero-mini-stats div { display: grid; gap: 4px; min-height: 67px; align-content: center; padding: 9px 12px; border: 1px solid rgb(204 226 255 / 20%); border-radius: 13px; background: rgb(255 255 255 / 9%); }
.hero-mini-stats span { color: #d4e6ff; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.hero-mini-stats strong { color: white; font-size: 22px; }
.dashboard-attention { display: flex; min-height: 82px; align-items: center; gap: 16px; padding: 14px 20px; border: 1px solid #3a4962; border-left: 5px solid #e83590; border-radius: 17px; background: #202c42; }
.attention-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 13px; background: #40304d; color: #ed3996; font-size: 21px; }
.dashboard-attention > div { display: grid; flex: 1; gap: 2px; }
.dashboard-attention strong { color: #f1f4fb; font-size: 16px; }
.dashboard-attention small { color: #9eabc1; font-size: 13px; }
.attention-button { background: #dc2586; color: #fff; }
.dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.dashboard-section-heading h2 { margin: 0; color: #f0f4fc; font-size: 19px; }
.dashboard-section-heading p { margin: 3px 0 0; color: #94a7c1; }
.dashboard-period { padding: 9px 14px; border: 1px solid #35445d; border-radius: 9px; color: #b8c9df; font-size: 12px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { position: relative; display: flex; min-width: 0; min-height: 221px; flex-direction: column; overflow: hidden; padding: 20px 22px 15px; border: 1px solid #35435a; border-radius: 19px; background: #202c42; }
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.metric-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 13px; background: #edf3ff; color: #2563eb; font-size: 20px; font-weight: 800; }
.metric-balance .metric-icon { background: #fff0f0; color: #f04450; }
.metric-cost .metric-icon { background: #fff8e4; color: #e99000; }
.metric-clients .metric-icon { background: #eafff3; color: #10a964; }
.metric-tag { padding: 5px 9px; border-radius: 99px; background: #3d2935; color: #ff7d82; font-size: 10px; font-weight: 800; }
.metric-label { color: #9fb0c7; font-size: 13px; }
.metric-card > strong { margin: 1px 0 8px; color: #eff4fc; font-size: clamp(23px, 1.8vw, 33px); line-height: 1.15; letter-spacing: -.025em; white-space: nowrap; }
.metric-spark { display: flex; height: 56px; align-items: end; gap: 7px; margin: auto -22px 8px; padding: 0 10px; border-bottom: 1px solid #35435a; }
.metric-spark i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(0deg, #2675f0, #56a7ff); opacity: .85; }
.metric-balance .metric-spark i { background: linear-gradient(0deg, #f03946, #ff777d); }
.metric-cost .metric-spark i { background: linear-gradient(0deg, #ef9700, #ffc04c); }
.metric-clients .metric-spark i { background: linear-gradient(0deg, #04a964, #34da8b); }
.metric-card > small { color: #8fa1ba; font-size: 11px; }
.dashboard-theme .panel { border-color: #34425a; background: #202c42; box-shadow: none; }
.dashboard-theme .panel-heading { border-color: #34425a; }
.dashboard-theme .panel-heading h2 { color: #f0f4fc; }
.dashboard-theme .panel-heading p { color: #94a7c1; }
.dashboard-theme th { background: #26354e; color: #afbed3; }
.dashboard-theme td { color: #d2dced; }
.dashboard-theme td strong { color: #f2f6fd; }
.dashboard-theme tbody tr:hover { background: #293850; }
.dashboard-theme .badge { background: #35435a; color: #c5d2e5; }
.dashboard-theme .dashboard-invoices .text-link { color: #84b6ff; }
@media (max-width: 1180px) {
    .dashboard-hero { grid-template-columns: 1fr 1fr; }
    .hero-visual { display: none; }
    .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .dashboard-theme .topbar { gap: 9px; padding: 9px 13px; }
    .dashboard-search { width: auto; flex: 1; }
    .dashboard-search kbd, .topbar-action { display: none; }
    .dashboard-account { max-width: 44px; padding-right: 5px; }
    .dashboard-account strong, .dashboard-account i { display: none; }
    .dashboard-content { padding: 18px 14px 30px; }
    .dashboard-hero { grid-template-columns: 1fr; }
    .hero-welcome { padding: 24px; }
    .hero-message { padding: 8px 24px 22px; }
    .dashboard-attention { align-items: flex-start; flex-wrap: wrap; }
    .dashboard-attention > div { min-width: calc(100% - 70px); }
    .attention-button { margin-left: 63px; }
}
@media (max-width: 520px) {
    .dashboard-metrics { grid-template-columns: 1fr; }
    .hero-pills span { font-size: 11px; }
    .hero-mini-stats { gap: 6px; }
    .hero-mini-stats div { padding: 8px; }
    .hero-mini-stats strong { font-size: 19px; }
}

.customer-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.customer-identity { display: flex; min-width: 0; align-items: center; gap: 14px; }
.customer-identity h2 { overflow: hidden; margin: 0; font-size: 21px; letter-spacing: -.03em; text-overflow: ellipsis; }
.customer-identity p { margin: 4px 0 0; color: var(--muted); }
.customer-avatar { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 50%; background: #eaf1ff; color: var(--blue); font-size: 13px; font-weight: 800; object-fit: cover; }
.customer-avatar.large { width: 62px; height: 62px; font-size: 19px; }
.profile-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.profile-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.profile-tabs a { position: relative; flex: 0 0 auto; padding: 11px 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
.profile-tabs a:hover, .profile-tabs a.active { color: var(--blue); }
.profile-tabs a.active::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: var(--blue); content: ""; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.profile-panel { min-width: 0; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 8px 20px; }
.detail-list > div { min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.detail-list dd { margin: 4px 12px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.profile-panel-action { padding: 0 20px 17px; }
.summary-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.summary-counts > div { display: grid; gap: 3px; padding: 16px 20px; border-right: 1px solid var(--line); }
.summary-counts > div:last-child { border-right: 0; }
.summary-counts strong { font-size: 20px; }
.summary-counts span { color: var(--muted); font-size: 12px; }
.managed-user-cell { display: flex; align-items: center; gap: 11px; }
.managed-user-cell .customer-avatar { width: 42px; height: 42px; }
.user-photo-field { align-content: start; }
.user-photo-preview { width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; }
.website-settings-panel { width: 100%; }
.website-logo-field { align-content: start; }
.website-logo-preview { display: grid; width: min(360px, 100%); min-height: 100px; place-items: center; padding: 16px; border: 1px dashed #cbd4e1; border-radius: 10px; background: #f7f9fc; }
.website-logo-preview img { display: block; max-width: 100%; max-height: 88px; object-fit: contain; }
.site-contact-footer { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-contact-footer a { color: var(--blue); }
.site-tagline { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.guest-page .site-contact-footer { justify-content: center; margin: 17px -30px -30px; padding: 15px 20px; }
.portal-contact-footer { max-width: 1200px; margin: auto; border-color: rgb(120 140 170 / 22%); color: #99a8bd; }

.backdrop { display: none; }

@media (max-width: 1050px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .backdrop { position: fixed; inset: 0; z-index: 15; display: block; background: rgb(12 20 34 / 44%); }
    .main { margin-left: 0; }
    .menu-button { display: inline-flex; }
    .topbar { min-height: 68px; padding: 10px 16px; }
    .topbar-date { display: none; }
    .content { gap: 16px; padding: 22px 16px 34px; }
    .welcome-row, .page-toolbar { align-items: flex-start; }
    .page-toolbar { flex-wrap: wrap; }
}
@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 138px; padding: 14px; }
    .stat-icon { top: 12px; right: 12px; }
    .stat-card strong { font-size: 22px; }
    .welcome-row { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; padding: 17px; }
    .form-grid label.full { grid-column: auto; }
    .form-actions { padding: 13px 17px; }
    .auth-card { padding: 23px; }
    th, td { padding: 11px 13px; }
    .pagination-wrap nav { flex-wrap: wrap; }
    .customer-profile-head { align-items: flex-start; flex-direction: column; }
    .profile-actions { width: 100%; justify-content: space-between; }
    .profile-grid { grid-template-columns: 1fr; }
    .summary-counts { grid-template-columns: 1fr 1fr; }
    .summary-counts > div:nth-child(2) { border-right: 0; }
    .summary-counts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .detail-list { grid-template-columns: 1fr; }
    .detail-list > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}

.brand-logo { display: block; width: min(190px, 100%); height: auto; object-fit: contain; }
.sidebar .brand { min-height: 112px; justify-content: center; padding: 8px 20px; }
.sidebar .brand-logo { filter: brightness(0) invert(1); }
.auth-card { position: relative; }
.auth-brand { min-height: 0; justify-content: center; padding: 4px 0 18px; }
.auth-brand .brand-logo { width: min(200px, 80%); filter: brightness(0); }
.theme-toggle { display: inline-grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 17px; }
.theme-toggle:hover { border-color: var(--blue); color: var(--blue); }
.guest-theme-toggle { position: absolute; top: 16px; right: 16px; }
.portal-page { min-height: 100vh; }
.portal-header { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px max(24px, calc((100% - 1180px) / 2)); border-bottom: 1px solid var(--line); background: var(--surface); }
.portal-logo { display: block; width: 150px; height: auto; filter: brightness(0); }
.portal-header-actions { display: flex; align-items: center; gap: 12px; }
.portal-header-actions form { margin: 0; }
.portal-user-name { color: var(--muted); font-weight: 650; }
.portal-content { display: grid; max-width: 1180px; gap: 20px; margin: auto; padding: 34px 24px 48px; }
.portal-welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.portal-welcome h1 { margin: 4px 0; font-size: 25px; letter-spacing: -.03em; }
.portal-welcome p:last-child { margin: 0; color: var(--muted); }
.portal-stat-value { overflow-wrap: anywhere; font-size: 21px !important; }
.portal-balance-due { color: var(--red); }
.portal-balance-clear { color: var(--green); }
.portal-profile { max-width: 100%; }
.badge.hotspot { background: #eaf2ff; color: #285eae; }
.badge.pppoe { background: #f0edff; color: #6747bd; }

:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #10151d;
    --surface: #181f29;
    --surface-muted: #202936;
    --text: #e7edf5;
    --muted: #9ba9bb;
    --line: #303b4b;
    --blue: #70a5ff;
    --blue-dark: #91b8ff;
    --green: #63d4a3;
    --red: #ff898d;
    --amber: #f1bf69;
    --shadow: 0 8px 26px rgb(0 0 0 / 15%);
}
:root[data-theme="dark"] body { background: var(--page); color: var(--text); }
:root[data-theme="dark"] .topbar { background: rgb(24 31 41 / 94%); }
:root[data-theme="dark"] td,
:root[data-theme="dark"] .form-grid label,
:root[data-theme="dark"] .stack-form label,
:root[data-theme="dark"] .directory-phone,
:root[data-theme="dark"] .customer-directory-table td,
:root[data-theme="dark"] .payment-amount,
:root[data-theme="dark"] .payment-note { color: var(--text) !important; }
:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] .customer-directory-table tbody tr:nth-child(even),
:root[data-theme="dark"] .customer-directory-table tbody tr:hover,
:root[data-theme="dark"] .payment-directory-table tbody tr:nth-child(even),
:root[data-theme="dark"] .payment-directory-table tbody tr:hover { background: #222c39; }
:root[data-theme="dark"] .customer-directory-table th,
:root[data-theme="dark"] .payment-directory-table th { border-color: var(--line); background: var(--surface-muted); color: var(--muted); }
:root[data-theme="dark"] .customer-directory-table td,
:root[data-theme="dark"] .payment-directory-table td { border-color: var(--line); }
:root[data-theme="dark"] .directory-client strong,
:root[data-theme="dark"] .payment-client strong,
:root[data-theme="dark"] .payment-method { color: var(--text); }
:root[data-theme="dark"] .device-count,
:root[data-theme="dark"] .payment-method { border-color: var(--line); background: var(--surface-muted); }
:root[data-theme="dark"] .balance-due { border-color: #65373b; background: #392428; color: #ff9a9e; }
:root[data-theme="dark"] .balance-clear { border-color: #62562d; background: #322e20; color: #efcf72; }
:root[data-theme="dark"] .balance-advance { border-color: #285a4a; background: #1d362f; color: #6dd6ad; }
:root[data-theme="dark"] .form-grid input,
:root[data-theme="dark"] .form-grid select,
:root[data-theme="dark"] .form-grid textarea,
:root[data-theme="dark"] .stack-form input,
:root[data-theme="dark"] .input-prefix,
:root[data-theme="dark"] .payment-search,
:root[data-theme="dark"] .payment-filter-controls select { border-color: var(--line); background: #121923; color: var(--text); }
:root[data-theme="dark"] .form-actions { background: var(--surface-muted); }
:root[data-theme="dark"] .button.secondary { border-color: var(--line); background: var(--surface-muted); color: var(--text); }
:root[data-theme="dark"] .button.secondary:hover { border-color: #5a7396; background: #263345; }
:root[data-theme="dark"] .button.disabled { background: var(--surface-muted); color: #78879a; }
:root[data-theme="dark"] .button.danger { border-color: #63393d; background: #291d20; }
:root[data-theme="dark"] .alert.success { border-color: #285a4a; background: #1b332d; color: #7de0b6; }
:root[data-theme="dark"] .alert.error { border-color: #63393d; background: #382326; color: #ff9a9e; }
:root[data-theme="dark"] .form-error { border-color: #63393d; background: #382326; color: #ff9a9e; }
:root[data-theme="dark"] .stat-icon.blue,
:root[data-theme="dark"] .quick-icon.blue { background: #263755; }
:root[data-theme="dark"] .stat-icon.violet,
:root[data-theme="dark"] .quick-icon.violet { background: #342d4c; }
:root[data-theme="dark"] .stat-icon.green,
:root[data-theme="dark"] .quick-icon.green { background: #213c34; }
:root[data-theme="dark"] .stat-icon.amber,
:root[data-theme="dark"] .quick-icon.amber { background: #453722; }
:root[data-theme="dark"] .badge.active,
:root[data-theme="dark"] .badge.paid,
:root[data-theme="dark"] .badge.online { background: #213c34; color: #77dcb2; }
:root[data-theme="dark"] .badge.suspended,
:root[data-theme="dark"] .badge.overdue,
:root[data-theme="dark"] .badge.offline { background: #42272b; color: #ff979b; }
:root[data-theme="dark"] .badge.unpaid,
:root[data-theme="dark"] .badge.partial,
:root[data-theme="dark"] .badge.maintenance { background: #453722; color: #f0c66f; }
:root[data-theme="dark"] .badge.hotspot { background: #263755; color: #9fc2ff; }
:root[data-theme="dark"] .badge.pppoe { background: #342d4c; color: #c4b5ff; }
:root[data-theme="dark"] .auth-brand .brand-logo,
:root[data-theme="dark"] .portal-logo { filter: none; }
:root[data-theme="dark"] .guest-page { background: radial-gradient(ellipse at 20% 5%, #1a2a44 0, transparent 38%), var(--page); }
:root[data-theme="dark"] .pagination-wrap nav a,
:root[data-theme="dark"] .pagination-wrap nav span[aria-current] span,
:root[data-theme="dark"] .pagination-wrap nav span[aria-disabled] span { color: var(--muted); }

/* Restore the light palette on the dashboard when the theme switch is set to light. */
:root[data-theme="light"] body.dashboard-theme { background: var(--page); color: var(--text); }
:root[data-theme="light"] .dashboard-theme .sidebar { background: var(--nav); color: var(--nav-muted); border-color: var(--line); }
:root[data-theme="light"] .dashboard-theme .main { background: var(--page); }
:root[data-theme="light"] .dashboard-theme .topbar { border-color: var(--line); background: var(--surface); color: var(--text); }
:root[data-theme="light"] .dashboard-theme .menu-button { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .theme-toggle { border-color: var(--line); background: var(--surface-muted); color: var(--amber); }
:root[data-theme="light"] .dashboard-theme .dashboard-search { border-color: var(--line); background: var(--surface-muted); color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-search input { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-search input::placeholder { color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-search kbd,
:root[data-theme="light"] .dashboard-theme .topbar-action { border-color: var(--line); color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-notifications { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-account { border-color: var(--line); background: var(--surface-muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-account strong { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-account i { color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-section-heading h2 { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-section-heading p { color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-period { border-color: var(--line); background: var(--surface); color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-attention { border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .dashboard-theme .dashboard-attention strong { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-attention small { color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .metric-card,
:root[data-theme="light"] .dashboard-theme .panel { border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .dashboard-theme .metric-label,
:root[data-theme="light"] .dashboard-theme .metric-card > small { color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .metric-card > strong { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .metric-spark { border-color: var(--line); }
:root[data-theme="light"] .dashboard-theme .panel-heading { border-color: var(--line); background: linear-gradient(90deg, var(--surface), var(--surface-muted)); }
:root[data-theme="light"] .dashboard-theme .panel-heading h2 { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .panel-heading p { color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-invoices th { background: var(--surface-muted); color: var(--muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-invoices td { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-invoices td strong { color: var(--text); }
:root[data-theme="light"] .dashboard-theme .dashboard-invoices tbody tr:hover { background: var(--surface-muted); }
:root[data-theme="light"] .dashboard-theme .dashboard-invoices .text-link { color: var(--blue); }
:root[data-theme="light"] .dashboard-theme .dashboard-invoices .badge { color: inherit; }

@media (max-width: 520px) {
    .portal-header { min-height: 72px; padding: 8px 14px; }
    .portal-logo { width: 115px; }
    .portal-header-actions { gap: 7px; }
    .portal-user-name { display: none; }
    .portal-content { padding: 22px 14px 34px; }
    .portal-welcome { align-items: flex-start; }
    .portal-welcome h1 { font-size: 21px; }
}

.dashboard-content { gap: 25px; padding: 26px 30px 42px; }
.dashboard-welcome {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 34px;
    border: 1px solid #28556a;
    border-radius: 22px;
    background:
        radial-gradient(ellipse at 82% 10%, rgb(91 220 205 / 18%), transparent 34%),
        linear-gradient(115deg, #123f53, #176b70 58%, #1b7c78);
    box-shadow: 0 16px 36px rgb(8 25 39 / 18%);
}
.dashboard-welcome-copy { min-width: 0; }
.dashboard-welcome-date {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border: 1px solid rgb(226 255 250 / 20%);
    border-radius: 999px;
    background: rgb(255 255 255 / 8%);
    color: #d7f6f1;
    font-size: 12px;
    font-weight: 650;
}
.dashboard-welcome-label { margin: 15px 0 2px; color: #b7e5df; font-size: 14px; font-weight: 650; }
.dashboard-welcome h2 { margin: 0; color: #fff; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.2; }
.dashboard-welcome-description { margin: 8px 0 0; color: #d0eae8; font-size: 14px; }
.dashboard-welcome-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 10px; }
.dashboard-welcome-actions .button { min-height: 44px; padding: 0 16px; }
.dashboard-welcome-actions .button.dashboard-button-primary { background: #e7fbf5; color: #115c59; }
.dashboard-welcome-actions .button.dashboard-button-primary:hover { background: #fff; }
.dashboard-welcome-actions .button.dashboard-button-secondary { border-color: rgb(226 255 250 / 30%); background: rgb(255 255 255 / 8%); color: #fff; }
.dashboard-welcome-actions .button.dashboard-button-secondary:hover { border-color: rgb(226 255 250 / 60%); background: rgb(255 255 255 / 14%); }
.dashboard-quick-section { display: grid; gap: 13px; }
.dashboard-quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.dashboard-quick-action {
    display: flex;
    min-width: 0;
    min-height: 88px;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 1px solid #34425a;
    border-radius: 15px;
    background: #202c42;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.dashboard-quick-action:hover { transform: translateY(-2px); border-color: #537287; box-shadow: 0 9px 22px rgb(0 0 0 / 12%); }
.dashboard-quick-action > span:nth-child(2) { min-width: 0; flex: 1; }
.dashboard-quick-action strong, .dashboard-quick-action small { display: block; }
.dashboard-quick-action strong { color: #f0f5fc; font-size: 13px; }
.dashboard-quick-action small { margin-top: 3px; color: #9eafc5; font-size: 11px; }
.dashboard-quick-action > b { color: #9eafc5; font-size: 16px; }
.dashboard-quick-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; font-size: 17px; font-weight: 800; }
.quick-icon-payment { background: #e1f4ef; color: #148169; }
.quick-icon-bill { background: #e8efff; color: #3866c1; }
.quick-icon-customer { background: #eee8ff; color: #7553bc; }
.quick-icon-cost { background: #fff1dc; color: #a76b0a; }
.dashboard-section-heading { align-items: center; }
.dashboard-section-heading h2 { font-size: 18px; font-weight: 750; }
.dashboard-section-heading p { font-size: 12px; }
.dashboard-period { background: #202c42; }
.dashboard-data-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 17px; align-items: start; }
.dashboard-data-grid > .panel { min-width: 0; overflow: hidden; border-radius: 16px; }
.dashboard-data-grid .panel-heading { min-height: 76px; padding: 15px 18px; }
.dashboard-data-grid .panel-heading h2 { font-size: 15px; }
.dashboard-data-grid .panel-heading p { font-size: 11px; }
.dashboard-data-grid .text-link { flex: 0 0 auto; font-size: 11px; }
.dashboard-data-grid table { min-width: 0; }
.dashboard-data-grid th { padding: 12px 14px; font-size: 9px; }
.dashboard-data-grid td { padding: 12px 14px; font-size: 11px; }
.dashboard-table-link { display: block; min-width: 110px; }
.dashboard-table-link strong, .dashboard-table-link small { display: block; }
.dashboard-table-link strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-table-link small { margin-top: 3px; color: #9eafc5; font-size: 10px; }
.dashboard-data-grid .empty-state { padding: 28px 16px; }
.dashboard-data-grid .empty-state h3 { color: inherit; }
.dashboard-data-grid .empty-state p { max-width: 250px; font-size: 11px; }
.dashboard-data-grid .empty-state .button { font-size: 11px; }

:root[data-theme="light"] .dashboard-quick-action,
:root[data-theme="light"] .dashboard-period { border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .dashboard-quick-action strong { color: var(--text); }
:root[data-theme="light"] .dashboard-quick-action small,
:root[data-theme="light"] .dashboard-quick-action > b,
:root[data-theme="light"] .dashboard-table-link small { color: var(--muted); }
:root[data-theme="light"] .dashboard-data-grid .panel-heading { background: linear-gradient(90deg, var(--surface), var(--surface-muted)); }
:root[data-theme="light"] .dashboard-data-grid th { background: var(--surface-muted); color: var(--muted); }
:root[data-theme="light"] .dashboard-data-grid td { color: var(--text); }
:root[data-theme="light"] .dashboard-table-link strong { color: var(--text); }
:root[data-theme="light"] .dashboard-data-grid tbody tr:hover { background: var(--surface-muted); }
:root[data-theme="dark"] .dashboard-period { border-color: #35445d; background: #202c42; color: #b8c9df; }

@media (max-width: 1180px) {
    .dashboard-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-data-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .dashboard-content { gap: 19px; padding: 18px 14px 30px; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column; padding: 24px; }
    .dashboard-welcome-actions { width: 100%; }
    .dashboard-welcome-actions .button { flex: 1; }
    .dashboard-section-heading { align-items: flex-start; }
    .dashboard-period { max-width: 155px; text-align: center; }
}
@media (max-width: 520px) {
    .dashboard-quick-actions { grid-template-columns: 1fr; gap: 9px; }
    .dashboard-quick-action { min-height: 74px; }
    .dashboard-metrics { grid-template-columns: 1fr; }
    .dashboard-data-grid th, .dashboard-data-grid td { padding: 10px 9px; }
    .dashboard-data-grid .panel-heading { align-items: flex-start; }
    .dashboard-data-grid .text-link { white-space: nowrap; }
}

:root {
    --page: #f2f7f7;
    --surface: #fff;
    --surface-muted: #f5f9f9;
    --text: #172b33;
    --muted: #71858c;
    --line: #dce8e9;
    --nav: #102731;
    --nav-muted: #a4b8be;
    --blue: #087f87;
    --blue-dark: #05646b;
    --green: #11825f;
    --red: #bd4149;
    --amber: #a66300;
    --shadow: 0 8px 24px rgb(19 59 64 / 6%);
}
:root[data-theme="dark"] {
    --page: #0d181d;
    --surface: #142329;
    --surface-muted: #192b31;
    --text: #e7f0f1;
    --muted: #91a7ac;
    --line: #294047;
    --nav: #0b1c22;
    --nav-muted: #9ab1b7;
    --blue: #48bbb5;
    --blue-dark: #6bcfc7;
    --green: #5bd0a1;
    --red: #ff858a;
    --amber: #f0bf6a;
    --shadow: 0 10px 28px rgb(0 0 0 / 19%);
}

body {
    background:
        radial-gradient(ellipse at 88% 0, rgb(20 139 145 / 5%), transparent 32%),
        var(--page);
    font-family: "Segoe UI", Arial, sans-serif;
}
.sidebar { background: var(--nav); box-shadow: 8px 0 30px rgb(13 45 52 / 8%); }
.sidebar .brand { border-bottom-color: rgb(156 205 208 / 12%); }
.navigation { gap: 4px; padding: 18px 11px; }
.navigation a { min-height: 42px; border-left: 3px solid transparent; border-radius: 7px; }
.navigation a:hover { background: rgb(116 202 197 / 10%); }
.navigation a.active {
    border-left-color: #69d6cb;
    background: linear-gradient(90deg, rgb(10 139 139 / 36%), rgb(10 139 139 / 11%));
    color: #fff;
}
.sidebar-bottom { border-top-color: rgb(156 205 208 / 12%); }
.avatar { background: #1b424a; }
.topbar {
    border-bottom-color: var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 4px 18px rgb(22 61 67 / 3%);
}
.topbar h1 { font-size: 20px; font-weight: 720; }
.eyebrow { color: var(--blue); }
.content { gap: 20px; }
.stat-card, .panel, .summary-counts { border-radius: 14px; }
.stat-card {
    box-shadow: 0 7px 22px rgb(18 56 60 / 5%);
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgb(8 127 135 / 32%); box-shadow: var(--shadow); }
.panel { box-shadow: 0 7px 22px rgb(18 56 60 / 4%); }
.panel-heading { background: linear-gradient(90deg, var(--surface), var(--surface-muted)); }
.panel-heading h2 { font-size: 16px; font-weight: 720; }
.table-wrap th { background: var(--surface-muted); }
tbody tr:hover { background: #f0f8f7; }
.button { border-radius: 8px; }
.button.primary { box-shadow: 0 4px 10px rgb(8 127 135 / 17%); }
.button.primary:hover { box-shadow: 0 5px 13px rgb(8 127 135 / 22%); }
.button.secondary { background: var(--surface); color: var(--text); }
.button.secondary:hover { border-color: #9ac8c7; background: #f2f9f8; }
.button.danger { background: var(--surface); }
.theme-toggle { border-radius: 9px; }
.form-grid input, .form-grid select, .form-grid textarea, .stack-form input,
.payment-search, .payment-filter-controls select, .directory-search, .directory-filter-controls select {
    border-color: var(--line);
    border-radius: 8px;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus,
.stack-form input:focus, .input-prefix:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgb(8 127 135 / 12%);
}
.form-actions { background: var(--surface-muted); }
.customer-directory-table th,
.payment-directory-table th,
.reference-directory-table th {
    border-color: var(--line);
    background: #edf5f5;
    color: #526a70;
}
.customer-directory-table td,
.payment-directory-table td,
.reference-directory-table td { border-color: #e4eded; }
.customer-directory-table tbody tr:nth-child(even),
.payment-directory-table tbody tr:nth-child(even),
.reference-directory-table tbody tr:nth-child(even) { background: #f7fafa; }
.customer-directory-table tbody tr:hover,
.payment-directory-table tbody tr:hover,
.reference-directory-table tbody tr:hover { background: #edf7f6; }
.directory-client strong, .payment-client strong, .directory-person strong { color: #203b42; }
.directory-phone, .payment-amount, .payment-note { color: #344f55 !important; }
.payment-method { border-color: var(--line); background: #f2f7f7; color: #405960; }
.device-count { background: #eff5f5; color: #203b42; }
.connection-stat { border-radius: 14px; box-shadow: var(--shadow); }
.connection-stat.total { background: linear-gradient(125deg, #087e70, #10a88d); }
.connection-stat.rate { background: linear-gradient(125deg, #087f87, #20aeb1); }
.connection-stat.active { background: linear-gradient(125deg, #4658a3, #6976c8); }
.connection-rate { color: #f4ffff !important; }
.auth-card { border-radius: 17px; }
.portal-header { box-shadow: 0 4px 18px rgb(22 61 67 / 4%); }
.portal-content { gap: 20px; }
.portal-welcome h1 { font-size: 26px; }
.profile-tabs a.active::after { border-radius: 3px 3px 0 0; }
.badge { background: #edf2f3; color: #53676d; }
.badge.active, .badge.paid, .badge.online { background: #e5f5ed; color: #176f52; }
.badge.suspended, .badge.overdue, .badge.offline { background: #fff0ef; color: #a9323b; }
.badge.unpaid, .badge.partial, .badge.maintenance { background: #fff4df; color: #895b08; }
.badge.hotspot { background: #e4f4f3; color: #08777e; }
.badge.pppoe { background: #eeedff; color: #564bb0; }
*:focus-visible { outline: 3px solid rgb(8 127 135 / 32%); outline-offset: 2px; }

:root[data-theme="dark"] body {
    background:
        radial-gradient(ellipse at 88% 0, rgb(41 144 142 / 9%), transparent 34%),
        var(--page);
}
:root[data-theme="dark"] .sidebar { box-shadow: 8px 0 30px rgb(0 0 0 / 18%); }
:root[data-theme="dark"] .topbar { background: rgb(20 35 41 / 94%); }
:root[data-theme="dark"] .panel-heading { background: linear-gradient(90deg, var(--surface), var(--surface-muted)); }
:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] .customer-directory-table tbody tr:nth-child(even),
:root[data-theme="dark"] .customer-directory-table tbody tr:hover,
:root[data-theme="dark"] .payment-directory-table tbody tr:nth-child(even),
:root[data-theme="dark"] .payment-directory-table tbody tr:hover,
:root[data-theme="dark"] .reference-directory-table tbody tr:nth-child(even),
:root[data-theme="dark"] .reference-directory-table tbody tr:hover { background: #1b3036; }
:root[data-theme="dark"] .customer-directory-table th,
:root[data-theme="dark"] .payment-directory-table th,
:root[data-theme="dark"] .reference-directory-table th { border-color: var(--line); background: #1a3036; color: var(--muted); }
:root[data-theme="dark"] .customer-directory-table td,
:root[data-theme="dark"] .payment-directory-table td,
:root[data-theme="dark"] .reference-directory-table td { border-color: var(--line); }
:root[data-theme="dark"] .directory-client strong,
:root[data-theme="dark"] .payment-client strong,
:root[data-theme="dark"] .directory-person strong,
:root[data-theme="dark"] .directory-phone,
:root[data-theme="dark"] .payment-amount,
:root[data-theme="dark"] .payment-note { color: var(--text) !important; }
:root[data-theme="dark"] .payment-method,
:root[data-theme="dark"] .device-count { border-color: var(--line); background: var(--surface-muted); color: var(--text); }
:root[data-theme="dark"] .button.secondary { border-color: var(--line); background: var(--surface-muted); color: var(--text); }
:root[data-theme="dark"] .button.secondary:hover { border-color: #4a777b; background: #20383d; }
:root[data-theme="dark"] .button.danger { border-color: #633b40; background: #271e22; }
:root[data-theme="dark"] .button.disabled { background: var(--surface-muted); color: #788f94; }
:root[data-theme="dark"] .badge { background: #24353a; color: #bfd0d3; }
:root[data-theme="dark"] .badge.active,
:root[data-theme="dark"] .badge.paid,
:root[data-theme="dark"] .badge.online { background: #1c3b32; color: #7ce0b5; }
:root[data-theme="dark"] .badge.suspended,
:root[data-theme="dark"] .badge.overdue,
:root[data-theme="dark"] .badge.offline { background: #40272b; color: #ff999e; }
:root[data-theme="dark"] .badge.unpaid,
:root[data-theme="dark"] .badge.partial,
:root[data-theme="dark"] .badge.maintenance { background: #403522; color: #f1c66c; }
:root[data-theme="dark"] .badge.hotspot { background: #1c3c3f; color: #79d5d0; }
:root[data-theme="dark"] .badge.pppoe { background: #302d49; color: #c3b9ff; }
:root[data-theme="dark"] .customer-avatar { background: #1c3c3f; }
:root[data-theme="dark"] .balance-due { border-color: #65373b; background: #392428; color: #ff9a9e; }
:root[data-theme="dark"] .balance-clear { border-color: #62562d; background: #322e20; color: #efcf72; }
:root[data-theme="dark"] .balance-advance { border-color: #285a4a; background: #1d362f; color: #6dd6ad; }
:root[data-theme="dark"] .guest-page { background: radial-gradient(ellipse at 20% 5%, #143239 0, transparent 40%), var(--page); }

/* Client directory inspired by the supplied Digital Network reference. */
.client-page { background: #f2f5f9; color: #15243a; }
.client-page .main { background: #f2f5f9; }
.client-page .topbar { border-color: #e5eaf1; background: rgb(255 255 255 / 96%); color: #172942; }
.client-page .topbar h1 { color: #172942; }
.client-page .eyebrow { color: #2864eb; }
.client-page .menu-button, .client-page .theme-toggle { color: #465f7d; }
.client-page .content { max-width: 1900px; gap: 18px; padding: 20px 22px 36px; }
.client-hero { position: relative; display: flex; min-height: 132px; align-items: center; gap: 18px; overflow: hidden; padding: 24px 28px; border-radius: 19px; background: linear-gradient(110deg, #102e5e, #1c60b1); color: #fff; box-shadow: 0 10px 25px rgb(27 72 133 / 14%); }
.client-hero::after { position: absolute; top: -92px; right: 8%; width: 320px; height: 320px; border: 1px solid rgb(255 255 255 / 8%); border-radius: 50%; box-shadow: 0 0 0 42px rgb(255 255 255 / 3%), 0 0 0 86px rgb(255 255 255 / 3%); content: ""; pointer-events: none; }
.client-hero-icon { z-index: 1; display: grid; width: 58px; height: 58px; flex: 0 0 58px; place-items: center; border: 1px solid rgb(255 255 255 / 20%); border-radius: 17px; background: rgb(255 255 255 / 12%); color: white; font-size: 27px; }
.client-hero-copy { z-index: 1; }
.client-hero-copy > span { color: #b8d4ff; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.client-hero-copy h2 { margin: 3px 0; color: #fff; font-size: clamp(22px, 2.3vw, 30px); letter-spacing: -.025em; }
.client-hero-copy p { margin: 0; color: #d1e2fb; font-size: 13px; }
.client-hero-add { z-index: 1; display: inline-flex; min-height: 44px; flex-shrink: 0; align-items: center; gap: 8px; margin-left: auto; padding: 0 17px; border: 1px solid rgb(255 255 255 / 24%); border-radius: 11px; background: rgb(255 255 255 / 12%); color: #fff; cursor: pointer; font: inherit; font-weight: 700; white-space: nowrap; }
.client-hero-add:hover { background: rgb(255 255 255 / 20%); }
.client-hero-actions { z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.client-hero-actions .client-hero-add { margin-left: 0; }
.client-hero-trash { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 11px; background: transparent; color: #dbe8fb; font-weight: 650; text-decoration: none; white-space: nowrap; }
.client-hero-trash:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.client-hero-trash b { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 6px; border-radius: 999px; background: #ff6b6b; color: #fff; font-size: 11px; }
.client-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.client-metrics article { display: flex; min-width: 0; min-height: 104px; align-items: center; gap: 13px; padding: 17px; border: 1px solid #edf0f5; border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgb(24 48 78 / 4%); }
.client-metric-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 15px; font-size: 21px; font-weight: 800; }
.client-metric-icon.purple { background: #f1edff; color: #7b43e9; }
.client-metric-icon.blue { background: #edf4ff; color: #2864eb; }
.client-metric-icon.green { background: #e9fbf3; color: #05a875; }
.client-metric-icon.mint { background: #e8faf4; color: #00a982; }
.client-metrics article div { display: grid; min-width: 0; gap: 3px; }
.client-metrics small { color: #6c7e95; font-size: 12px; }
.client-metrics strong { overflow: hidden; color: #172942; font-size: clamp(18px, 1.6vw, 23px); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.client-metrics em { color: #8999ad; font-size: 11px; font-style: normal; }
.client-metrics article:nth-child(2) em { color: #009b78; }
.client-metric-spark { display: flex !important; height: 24px; align-items: flex-end; gap: 3px; margin: 3px 0; }
.client-metric-spark i { width: 7px; min-height: 4px; border-radius: 3px 3px 0 0; background: #92b3f5; }
.client-metric-spark.cost i { background: #80dbc2; }
.client-filters { display: flex; min-height: 72px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #edf0f5; border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgb(24 48 78 / 3%); }
.client-search { display: flex; min-width: 180px; height: 44px; flex: 1; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #dfe6ef; border-radius: 11px; background: #f8fafc; color: #8494aa; }
.client-search span { font-size: 22px; }
.client-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #253c59; font: inherit; }
.client-search input::placeholder { color: #98a6b8; }
.client-status-filters { display: flex; align-items: center; gap: 3px; padding: 4px; border-radius: 12px; background: #f2f5f9; }
.client-status-filters button { display: inline-flex; height: 36px; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #667993; cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; }
.client-status-filters button.selected { background: #fff; color: #1f5de0; box-shadow: 0 2px 7px rgb(29 56 91 / 10%); }
.status-dot, .client-status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #13b981; }
.status-dot.suspended { background: #97a3b3; }
.client-result-count { color: #718198; font-size: 12px; white-space: nowrap; }
.client-result-count strong { color: #203650; }
.client-table-panel { overflow: hidden; border: 1px solid #edf0f5; border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgb(24 48 78 / 3%); }
.client-page .customer-directory-table { min-width: 900px; }
.client-page .customer-directory-table th { padding: 14px 15px; border-color: #e8edf3; background: #fff; color: #526780; font-size: 12px; letter-spacing: 0; text-transform: none; }
.client-page .customer-directory-table td { height: 70px; padding: 10px 15px; border-color: #edf0f5; color: #435671; }
.client-page .customer-directory-table tbody tr:nth-child(even) { background: #fbfcfe; }
.client-page .customer-directory-table tbody tr:hover { background: #f5f8ff; }
.client-page .directory-client { gap: 11px; }
.client-page .customer-avatar { width: 42px; height: 42px; flex-basis: 42px; border-radius: 50%; background: #e4efff; color: #2864eb; }
.client-page .directory-client strong { color: #1d5de0; font-size: 13px; }
.client-page .directory-client small { color: #8999ad; }
.client-page .directory-phone { color: #516783 !important; }
.client-page .money-cell { color: #263c58; }
.client-status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #c5f2d9; border-radius: 99px; background: #f0fdf5; color: #11965d; font-size: 11px; font-weight: 700; }
.customer-status-form { margin: 0; }
.customer-status-toggle { cursor: pointer; font: inherit; transition: background .15s, box-shadow .15s, transform .15s; }
.customer-status-toggle:hover { box-shadow: 0 2px 8px rgb(22 61 99 / 12%); transform: translateY(-1px); }
.customer-status-toggle:focus-visible { outline: 3px solid rgb(40 100 235 / 28%); outline-offset: 2px; }
.customer-status-toggle-mark { opacity: .58; }
.customer-status-toggle:hover .customer-status-toggle-mark { opacity: 1; }
.client-status-pill.suspended { border-color: #e3e7ed; background: #f5f6f8; color: #778396; }
.client-status-pill.suspended i { background: #9aa5b4; }
.client-status-pill.blocked { border-color: #f5c7cb; background: #fff2f3; color: #b4232d; }
.client-status-pill.blocked i { background: #d43f4a; }
.client-status-pill.maintenance { border-color: #f6dfaa; background: #fff9eb; color: #9a6500; }
.client-status-pill.maintenance i { background: #e3a112; }
.customer-balance-pill { display: inline-flex; min-width: 90px; align-items: center; justify-content: center; padding: 6px 9px; border: 1px solid #e3e7ed; border-radius: 99px; background: #f5f6f8; color: #718198; font-size: 13px; font-weight: 700; white-space: nowrap; }
.customer-balance-pill.due { border-color: #f8d3d4; background: #fff3f2; color: #c64040; }
.customer-balance-pill.advance { border-color: #c5f2d9; background: #f0fdf5; color: #11965d; }
.client-action { display: inline-grid; width: 34px; height: 34px; place-items: center; margin-left: 5px; border: 1px solid #dfe6ef; border-radius: 9px; background: #fff; color: #58708f; cursor: pointer; font: inherit; font-size: 17px; text-decoration: none; }
.client-action:hover { border-color: #b7ccfa; background: #f3f7ff; color: #2864eb; }
.payment-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; white-space: nowrap; }
.payment-row-actions .client-action { margin-left: 0; }
.payment-delete-form { display: inline-flex; margin: 0; }
.client-drawer { background: rgb(16 27 46 / 48%); backdrop-filter: blur(5px); }
.client-drawer .payment-modal-panel { width: min(560px, 100%); border: 0; border-radius: 19px 0 0 19px; background: #fff; }
.client-drawer .client-drawer-header { position: sticky; top: 0; z-index: 2; justify-content: flex-start; min-height: 86px; padding: 16px 22px; border: 0; background: linear-gradient(110deg, #4e46df, #087ed0); color: #fff; }
.client-drawer-header > div { flex: 1; }
.client-drawer-header small { color: #d1ddff; font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.client-drawer-header h3 { margin: 3px 0 0; color: #fff; font-size: 18px; }
.client-drawer-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 15px; background: rgb(255 255 255 / 18%); color: #fff; font-size: 24px; }
.client-drawer .payment-modal-close { align-self: flex-start; order: 3; width: 32px; height: 32px; border: 0; background: rgb(255 255 255 / 14%); color: #fff; }
.client-drawer .payment-modal-close:hover { background: rgb(255 255 255 / 24%); }
.client-drawer .client-drawer-body { padding: 18px 20px 0; }
.client-drawer .form-grid { gap: 16px; }
.client-form-grid > .full { grid-column: 1 / -1; }
.client-form-grid > label { align-content: start; }
.client-form-grid .client-form-section-title { display: flex; align-items: center; gap: 8px; margin-top: 3px; padding: 11px 12px; border: 1px solid #edf0f5; border-radius: 11px; background: #f8fafc; color: #536780; font-size: 11px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.client-form-section-title span { color: #3477ed; font-size: 14px; }
.client-form-grid .form-section-help { margin: -7px 0 0; color: #718198; font-size: 11px; line-height: 1.5; }
.client-drawer .form-error { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 10px; background: #fff5f5; color: #b4232d; font-size: 12px; }
.client-drawer .form-error p { margin: 3px 0; }
.client-drawer .form-grid label { gap: 7px; color: #526176; font-size: 12px; }
.client-drawer .form-grid input, .client-drawer .form-grid select, .client-drawer .form-grid textarea { min-height: 44px; border-color: #dfe5ed; border-radius: 10px; font-size: 13px; }
.client-drawer .form-grid input:focus, .client-drawer .form-grid select:focus, .client-drawer .form-grid textarea:focus { border-color: #2864eb; box-shadow: 0 0 0 3px rgb(40 100 235 / 12%); }
.password-input { position: relative; display: flex; align-items: center; }
.client-drawer .password-input input { padding-right: 58px; }
.password-visibility-toggle { position: absolute; right: 9px; padding: 5px; border: 0; background: transparent; color: #2864eb; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }
.password-visibility-toggle:focus-visible { border-radius: 5px; outline: 2px solid #7aa4e9; }
.client-drawer .form-actions { position: sticky; bottom: 0; z-index: 1; margin: 0 -20px; padding: 14px 20px; border-top: 1px solid #edf0f5; background: #fff; }
.client-drawer .form-actions .button { min-height: 44px; border-radius: 10px; }
.client-drawer .form-actions .button.primary { background: #2864eb; }
@media (max-width: 950px) {
    .client-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-filters { flex-wrap: wrap; }
    .client-search { flex-basis: 100%; }
}
@media (max-width: 600px) {
    .client-page .content { padding: 14px 12px 28px; }
    .client-hero { align-items: flex-start; flex-wrap: wrap; padding: 19px; }
    .client-hero-icon { width: 48px; height: 48px; flex-basis: 48px; }
    .client-hero-copy { flex: 1; }
    .client-hero-add { width: 100%; justify-content: center; margin: 0; }
    .client-hero-actions { width: 100%; margin: 0; }
    .client-hero-actions > * { flex: 1; justify-content: center; }
    .client-metrics { gap: 9px; }
    .client-metrics article { min-height: 91px; gap: 9px; padding: 11px; }
    .client-metric-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; font-size: 17px; }
    .client-metrics small { font-size: 11px; }
    .client-metrics strong { font-size: 17px; }
    .client-metrics em { font-size: 10px; }
    .client-filters { gap: 8px; padding: 10px; }
    .client-status-filters { order: 2; flex: 1; justify-content: space-between; }
    .client-status-filters button { padding: 0 8px; }
    .client-result-count { order: 3; }
    .client-drawer .payment-modal-panel { width: 100%; border-radius: 0; }
    .client-drawer .client-drawer-body { padding: 14px 14px 0; }
    .client-drawer .form-grid { grid-template-columns: 1fr; padding: 0 0 16px; }
    .client-drawer .form-grid label.full { grid-column: auto; }
    .client-drawer .form-actions { margin: 0 -14px; padding: 12px 14px; }
}

/* Shared sidebar: one design across every authenticated page. */
.sidebar,
.dashboard-theme .sidebar { background: #fff; border-right: 1px solid #e1e7ef; box-shadow: 4px 0 18px rgb(25 51 84 / 4%); color: #536780; }
.sidebar .brand,
.dashboard-theme .sidebar .brand { min-height: 84px; justify-content: center; padding: 12px 18px; border-bottom: 1px solid #edf0f5; color: #172942; }
.sidebar .brand-logo,
.dashboard-theme .sidebar .brand-logo { max-width: 190px; filter: none; }
.navigation,
.dashboard-theme .navigation { gap: 4px; padding: 16px 12px; }
.navigation,
.dashboard-theme .navigation { scrollbar-width: none; -ms-overflow-style: none; }
.navigation::-webkit-scrollbar,
.dashboard-theme .navigation::-webkit-scrollbar { display: none; width: 0; height: 0; }
.navigation a,
.dashboard-theme .navigation a { min-height: 44px; gap: 10px; padding: 0 13px; border: 0; border-left: 3px solid transparent; border-radius: 8px; color: #405570; }
.navigation a::before,
.dashboard-theme .navigation a::before { display: inline-grid; width: 19px; flex: 0 0 19px; place-items: center; color: #67809d; font-size: 14px; }
.navigation a:nth-child(1)::before { content: "\25c9"; }
.navigation a:nth-child(2)::before { content: "\265f"; }
.navigation a:nth-child(3)::before { content: "\2318"; }
.navigation a:nth-child(4)::before { content: "\25a3"; }
.navigation a:nth-child(5)::before { content: "\25c8"; }
.navigation a:nth-child(6)::before { content: "\25a4"; }
.navigation a:nth-child(7)::before { content: "\25a6"; }
.navigation a:nth-child(8)::before { content: "\25a3"; }
.navigation a:nth-child(9)::before { content: "\25c9"; }
.navigation a:nth-child(10)::before { content: "\25a7"; }
.navigation a:nth-child(11)::before { content: "\25f7"; }
.navigation a:nth-child(12)::before { content: "\2659"; }
.dashboard-theme .navigation a:nth-child(1)::before { content: "\25c9"; }
.dashboard-theme .navigation a:nth-child(2)::before { content: "\265f"; }
.dashboard-theme .navigation a:nth-child(3)::before { content: "\2318"; }
.dashboard-theme .navigation a:nth-child(4)::before { content: "\25a3"; }
.dashboard-theme .navigation a:nth-child(5)::before { content: "\25c8"; }
.dashboard-theme .navigation a:nth-child(6)::before { content: "\25a4"; }
.dashboard-theme .navigation a:nth-child(7)::before { content: "\25a6"; }
.dashboard-theme .navigation a:nth-child(8)::before { content: "\25a3"; }
.dashboard-theme .navigation a:nth-child(9)::before { content: "\25c9"; }
.dashboard-theme .navigation a:nth-child(10)::before { content: "\25a7"; }
.dashboard-theme .navigation a:nth-child(11)::before { content: "\25f7"; }
.dashboard-theme .navigation a:nth-child(12)::before { content: "\2659"; }
.navigation a:hover,
.dashboard-theme .navigation a:hover { background: #f1f5fb; color: #1f5de0; }
.navigation a.active,
.dashboard-theme .navigation a.active { border-right: 0; border-left: 3px solid #2864eb; background: #edf3ff; color: #1e5be0; }
.sidebar-bottom,
.dashboard-theme .sidebar-bottom { border-color: #e7ecf2; }
.sidebar .signed-in,
.dashboard-theme .sidebar .signed-in { color: #15243a; }
.sidebar .signed-in strong,
.dashboard-theme .sidebar .signed-in strong { color: #15243a; }
.sidebar .signed-in small,
.dashboard-theme .sidebar .signed-in small { color: #73839a; }
.sidebar .avatar,
.dashboard-theme .sidebar .avatar { background: #e7efff; color: #2864eb; }
.sidebar .nav-logout,
.dashboard-theme .sidebar .nav-logout { border-color: #e1e7ef; color: #526780; }
.sidebar .nav-logout:hover,
.dashboard-theme .sidebar .nav-logout:hover { background: #f1f5fb; color: #1f5de0; }
:root[data-theme="light"] .dashboard-theme .sidebar { background: #fff; border-color: #e1e7ef; color: #536780; }
.client-page .client-hero-add { text-decoration: none; }
.client-page .client-hero .customer-avatar.large { width: 58px; height: 58px; flex: 0 0 58px; }
.client-page .panel { border: 1px solid #edf0f5; border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgb(24 48 78 / 3%); }
.client-page .panel-heading { padding: 18px 20px; border-bottom: 1px solid #edf0f5; }
.client-page .panel-heading h2, .client-page .dashboard-section-heading h2 { color: #172942; }
.client-page .panel-heading p, .client-page .dashboard-section-heading p { color: #73839a; }
.client-page .table-wrap > table { width: 100%; min-width: 720px; border-collapse: collapse; }
.client-page .table-wrap > table th { padding: 14px 15px; border-bottom: 1px solid #e8edf3; background: #fff; color: #526780; font-size: 12px; font-weight: 700; letter-spacing: 0; text-align: left; text-transform: none; }
.client-page .table-wrap > table td { height: 66px; padding: 10px 15px; border-bottom: 1px solid #edf0f5; color: #435671; }
.client-page .table-wrap > table tbody tr:nth-child(even) { background: #fbfcfe; }
.client-page .table-wrap > table tbody tr:hover { background: #f5f8ff; }
.client-page .directory-filters, .client-page .payment-filters, .client-page .client-filters { border: 1px solid #edf0f5; border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgb(24 48 78 / 3%); }
.client-page .directory-search, .client-page .payment-search { min-height: 44px; border: 1px solid #dfe6ef; border-radius: 11px; background: #f8fafc; color: #8494aa; }
.client-page .directory-search input, .client-page .payment-search input { color: #253c59; }
.client-page .directory-filter-controls select, .client-page .payment-filter-controls select, .client-page .client-filters select { min-height: 44px; padding: 0 12px; border: 1px solid #dfe6ef; border-radius: 10px; background: #fff; color: #405570; font: inherit; }
.client-page .directory-filter-controls .button, .client-page .payment-filter-controls .button { min-height: 44px; border-radius: 10px; }
.client-page .button.primary { border-color: #2864eb; background: #2864eb; color: #fff; }
.client-page .button.primary:hover { border-color: #1e53cf; background: #1e53cf; }
.client-page .button.secondary { border-color: #dfe6ef; background: #fff; color: #405570; }
.client-page .profile-tabs { gap: 5px; padding: 6px; border: 1px solid #edf0f5; border-radius: 13px; background: #fff; }
.client-page .profile-tabs a { border-radius: 9px; color: #60728a; }
.client-page .profile-tabs a.active { background: #edf3ff; color: #1f5de0; }
.client-page .dashboard-section-heading { margin: 5px 0 13px; }
.client-page .dashboard-quick-section { padding: 0; border: 0; background: transparent; box-shadow: none; }
.client-page .dashboard-quick-action { border: 1px solid #edf0f5; border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgb(24 48 78 / 3%); }
.client-page .dashboard-quick-action:hover { border-color: #cbd9f4; background: #f8faff; }
.client-page .dashboard-quick-action strong { color: #203650; }
.client-page .dashboard-quick-action small { color: #7a8aa0; }
.client-page .dashboard-data-grid { gap: 16px; }
.client-page .summary-counts { gap: 12px; }
.client-page .summary-counts > div { padding: 18px; border: 1px solid #edf0f5; border-radius: 15px; background: #fff; box-shadow: 0 5px 16px rgb(24 48 78 / 3%); }
.client-page .summary-counts strong { color: #172942; }
.client-page .summary-counts span { color: #73839a; }
.client-page .payment-modal { background: rgb(16 27 46 / 48%); backdrop-filter: blur(5px); }
.client-page .payment-modal-panel { width: min(560px, 100%); height: 100%; max-height: 100vh; margin: 0 0 0 auto; overflow-y: auto; border: 0; border-radius: 19px 0 0 19px; background: #fff; box-shadow: -16px 0 48px rgb(15 31 54 / 16%); }
.client-page .payment-modal:not(.client-drawer) .payment-modal-header { position: sticky; top: 0; z-index: 2; justify-content: flex-start; min-height: 86px; padding: 16px 22px; border: 0; background: linear-gradient(110deg, #4e46df, #087ed0); color: #fff; }
.client-page .payment-modal:not(.client-drawer) .payment-modal-header > div { flex: 1; }
.client-page .payment-modal:not(.client-drawer) .payment-modal-header h3 { color: #fff; }
.client-page .payment-modal:not(.client-drawer) .payment-modal-header p { color: #d1ddff; }
.client-page .payment-modal:not(.client-drawer) .payment-modal-close { align-self: flex-start; order: 3; width: 32px; height: 32px; border: 0; background: rgb(255 255 255 / 14%); color: #fff; }
.client-page .payment-modal:not(.client-drawer) .payment-modal-close:hover { background: rgb(255 255 255 / 24%); }
.client-page .payment-modal:not(.client-drawer) .payment-modal-body { padding: 18px 20px 0; }
.client-page .payment-modal:not(.client-drawer) .form-actions { position: sticky; bottom: 0; z-index: 1; margin: 0; padding: 14px 20px; border-top: 1px solid #edf0f5; background: #fff; }
@media (max-width: 950px) {
    .client-page .dashboard-data-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .client-page .payment-modal-panel { width: 100%; border-radius: 0; }
    .client-page .payment-modal:not(.client-drawer) .payment-modal-body { padding: 14px 14px 0; }
    .client-page .payment-modal:not(.client-drawer) .form-actions { padding: 12px 14px; }
    .client-page .summary-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sidebar width is shared by all staff pages and remembered per browser. */
.sidebar,
.dashboard-theme .sidebar { width: 220px; transition: width .2s ease; }
.sidebar .brand,
.dashboard-theme .sidebar .brand { min-height: 72px; justify-content: flex-start; padding: 10px 48px 10px 14px; }
.sidebar .brand-logo,
.dashboard-theme .sidebar .brand-logo { width: 145px; max-width: 100%; }
.main,
.dashboard-theme .main { margin-left: 220px; transition: margin-left .2s ease; }
.sidebar-size-toggle { position: absolute; top: 20px; right: 10px; display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 1px solid #dfe6ef; border-radius: 8px; background: #fff; color: #526780; cursor: pointer; font-size: 18px; line-height: 1; }
.sidebar-size-toggle:hover { border-color: #b7ccfa; background: #f3f7ff; color: #2864eb; }
.customer-delete-form { display: inline-flex; margin: 0; }
.client-action.delete { color: #bd4247; }
.client-action.delete:hover { border-color: #f4c9cb; background: #fff4f4; color: #b4232d; }
body.sidebar-compact .sidebar,
body.sidebar-compact.dashboard-theme .sidebar { width: 72px; }
body.sidebar-compact .main,
body.sidebar-compact.dashboard-theme .main { margin-left: 72px; }
body.sidebar-compact .sidebar .brand,
body.sidebar-compact.dashboard-theme .sidebar .brand { justify-content: center; padding: 10px; }
body.sidebar-compact .sidebar .brand-logo,
body.sidebar-compact.dashboard-theme .sidebar .brand-logo { visibility: hidden; }
body.sidebar-compact .sidebar-size-toggle { top: 21px; right: 22px; }
body.sidebar-compact .navigation a,
body.sidebar-compact.dashboard-theme .navigation a { justify-content: center; gap: 0; padding: 0; overflow: hidden; font-size: 0; }
body.sidebar-compact .navigation a::before,
body.sidebar-compact.dashboard-theme .navigation a::before { width: 22px; flex-basis: 22px; font-size: 17px; }
body.sidebar-compact .sidebar-bottom,
body.sidebar-compact.dashboard-theme .sidebar-bottom { padding: 12px 7px; }
body.sidebar-compact .signed-in,
body.sidebar-compact.dashboard-theme .signed-in { justify-content: center; padding: 5px 0 12px; }
body.sidebar-compact .signed-in > span,
body.sidebar-compact.dashboard-theme .signed-in > span { display: none; }
body.sidebar-compact .nav-logout,
body.sidebar-compact.dashboard-theme .nav-logout { height: 35px; overflow: hidden; padding: 0; border: 0; font-size: 0; text-align: center; }
body.sidebar-compact .nav-logout::before,
body.sidebar-compact.dashboard-theme .nav-logout::before { content: "\21aa"; font-size: 17px; }
@media (max-width: 760px) {
    .sidebar-size-toggle { display: none; }
    .sidebar,
    .dashboard-theme .sidebar,
    body.sidebar-compact .sidebar,
    body.sidebar-compact.dashboard-theme .sidebar { width: 252px; }
    body.sidebar-compact .sidebar .brand-logo,
    body.sidebar-compact.dashboard-theme .sidebar .brand-logo { visibility: visible; width: 145px; max-width: 100%; }
    body.sidebar-compact .navigation a,
    body.sidebar-compact.dashboard-theme .navigation a { justify-content: flex-start; gap: 10px; padding: 0 13px; font-size: 14px; }
    body.sidebar-compact .sidebar-bottom,
    body.sidebar-compact.dashboard-theme .sidebar-bottom { padding: 14px 16px 18px; }
    body.sidebar-compact .signed-in > span,
    body.sidebar-compact.dashboard-theme .signed-in > span { display: block; }
    body.sidebar-compact .nav-logout,
    body.sidebar-compact.dashboard-theme .nav-logout { height: auto; padding: 8px 10px; font-size: 14px; text-align: left; }
    .main,
    .dashboard-theme .main,
    body.sidebar-compact .main,
    body.sidebar-compact.dashboard-theme .main { margin-left: 0; }
}
.customer-photo-upload { display: flex; min-width: 0; align-items: center; gap: 15px; padding: 12px; border: 1px solid #e7edf5; border-radius: 13px; background: #f8fafc; }
.customer-photo-preview { display: grid; width: 82px; height: 82px; flex: 0 0 82px; place-items: center; overflow: hidden; border: 3px solid #fff; border-radius: 50%; background: #e3edff; box-shadow: 0 0 0 1px #dce6f3; color: #2864eb; font-size: 27px; font-weight: 750; }
.customer-photo-preview img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.customer-photo-preview img[hidden], .customer-photo-preview [hidden] { display: none; }
.customer-photo-preview span { display: grid; width: 100%; height: 100%; place-items: center; }
.customer-photo-control { display: grid; min-width: 0; flex: 1; gap: 6px; color: #526176; font-size: 12px; font-weight: 700; }
.customer-photo-control input[type="file"] { width: 100%; height: 44px; min-height: 44px; padding: 5px 7px; border: 1px solid #dfe5ed; border-radius: 10px; background: #fff; font-size: 12px; }
.client-form-grid input:not([type="file"]), .client-form-grid select { height: 44px; min-height: 44px; }
.client-form-grid textarea { min-height: 88px; }
@media (max-width: 600px) {
    .customer-photo-preview { width: 70px; height: 70px; flex-basis: 70px; }
    .customer-photo-upload { gap: 11px; padding: 10px; }
}

/* ---- One identical top bar on every page (light + dark) ---- */
.topbar.app-topbar { min-height: 70px; gap: 12px; padding: 10px 24px; }
.topbar.app-topbar > .app-topbar-title { display: block; min-width: 0; }
.app-topbar .app-topbar-title h1 { overflow: hidden; margin: 0; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.app-topbar .menu-button { color: var(--text); }
.app-topbar .dashboard-search { width: min(520px, 38vw); margin: 0 auto 0 14px; border-color: var(--line); background: var(--surface-muted); color: var(--muted); }
.app-topbar .dashboard-search input { color: var(--text); }
.app-topbar .dashboard-search input::placeholder { color: var(--muted); }
.app-topbar .dashboard-search kbd { border-color: var(--line); color: var(--muted); }
.app-topbar .theme-toggle { order: 0; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-muted); color: var(--amber); }
.app-topbar .dashboard-notifications { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-muted); color: var(--text); text-decoration: none; }
.app-topbar .dashboard-account { border-color: var(--line); background: var(--surface-muted); }
.app-topbar .dashboard-account strong { color: var(--text); }
@media (max-width: 760px) {
    .topbar.app-topbar { gap: 8px; padding: 9px 12px; }
    .topbar.app-topbar > .app-topbar-title { display: none; }
    .app-topbar .dashboard-search { width: auto; flex: 1; margin: 0; }
    .app-topbar .dashboard-search kbd { display: none; }
    .app-topbar .dashboard-notifications { display: none; }
    .app-topbar .dashboard-account { max-width: 44px; padding-right: 5px; }
    .app-topbar .dashboard-account strong { display: none; }
}

/* ---- Merged Customers + Connections page ---- */
.client-metrics.client-metrics-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.client-page .customer-directory-table.customer-directory-merged { min-width: 1280px; }
.client-page .customer-directory-merged th, .client-page .customer-directory-merged td { padding-right: 12px; padding-left: 12px; }
.customer-directory-merged td .table-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
@media (max-width: 1400px) { .client-metrics.client-metrics-six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .client-metrics.client-metrics-six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Monthly summary ---- */
.summary-year-form { align-items: center; }
.summary-year { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; padding: 0 8px 0 15px; border: 1px solid rgb(255 255 255 / 24%); border-radius: 11px; background: rgb(255 255 255 / 12%); color: #fff; font-weight: 700; }
.summary-year select { min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: #fff; color: #172942; font: inherit; font-weight: 700; cursor: pointer; }
.summary-month-table { min-width: 960px; }
.summary-month-table td, .summary-month-table th { white-space: nowrap; }
.summary-month-table td .table-sub { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.summary-month-table tfoot th { border-top: 2px solid var(--line); background: var(--surface-muted); color: var(--text); font-size: 14px; }
.summary-current td { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.summary-current td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.summary-future td { opacity: .45; }
.summary-now { margin-left: 8px; font-size: 10px; }
.summary-positive { color: #147550; font-weight: 700; }
.summary-negative { color: var(--red, #c0392b) !important; font-weight: 700; }
.summary-bar-col { width: 22%; min-width: 170px; }
.summary-bar { display: block; height: 7px; margin: 3px 0; border-radius: 99px; }
.summary-bar.income { background: #2f7de1; }
.summary-bar.cost { background: #f59e0b; }
.summary-legend { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; font-size: 11px; font-weight: 600; }
.summary-legend::before { width: 10px; height: 10px; border-radius: 3px; content: ""; }
.summary-legend.income::before { background: #2f7de1; }
.summary-legend.cost::before { background: #f59e0b; }

/* Payment form: searchable customer picker + method cards */
.form-grid .full { grid-column: 1 / -1; }
.customer-picker { position: relative; display: grid; gap: 6px; }
.customer-picker-label, .method-cards legend { color: #465266; font-size: 12px; font-weight: 700; }
.customer-picker-trigger { display: flex; width: 100%; min-height: 58px; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #dfe4eb; border-radius: 12px; background: #fff; color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.customer-picker-trigger:focus-visible, .customer-picker.is-open .customer-picker-trigger { border-color: #7aa4e9; outline: 0; box-shadow: 0 0 0 3px rgb(40 104 215 / 10%); }
.customer-picker.has-error .customer-picker-trigger { border-color: var(--red); }
.customer-picker-current { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; }
.customer-picker-placeholder { color: var(--muted); font-weight: 500; }
.customer-picker-caret { color: var(--muted); font-size: 12px; transition: transform .15s; }
.customer-picker.is-open .customer-picker-caret { transform: rotate(180deg); }
.customer-picker-text { display: grid; min-width: 0; line-height: 1.3; }
.customer-picker-text strong { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.customer-picker-text small { color: var(--muted); font-size: 12px; font-weight: 500; }
.customer-picker .customer-avatar { width: 40px; height: 40px; flex: 0 0 40px; }
.customer-picker-dropdown { overflow: hidden; border: 1px solid #dfe4eb; border-radius: 12px; background: var(--surface); box-shadow: 0 14px 34px rgb(15 23 42 / 12%); }
.customer-picker-search { display: flex !important; align-items: center; gap: 8px !important; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted) !important; }
.form-grid .customer-picker-search input { min-height: 34px; padding: 4px 0; border: 0; box-shadow: none; background: transparent; }
.customer-picker-list { max-height: 260px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.customer-picker-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; outline: 0; }
.customer-picker-list li[hidden] { display: none; }
.customer-picker-list li:hover, .customer-picker-list li:focus { background: #f2f6ff; }
.customer-picker-list li[aria-selected="true"] { background: #eaf1ff; box-shadow: inset 0 0 0 1px #9dbcf3; }
.customer-picker-empty { margin: 0; padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }
.customer-picker-error { color: var(--red); font-size: 12px; font-weight: 600; }
.method-cards { min-width: 0; margin: 0; padding: 0; border: 0; }
.method-cards legend { margin-bottom: 6px; padding: 0; }
.method-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.form-grid label.method-card { display: block; margin: 0; cursor: pointer; }
.method-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.method-card-face { display: grid; min-height: 72px; place-items: center; align-content: center; gap: 5px; padding: 10px 6px; border: 1.5px solid #dfe4eb; border-radius: 12px; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.method-card:hover .method-card-face { border-color: #b9cbe8; }
.method-card input:focus-visible + .method-card-face { box-shadow: 0 0 0 3px rgb(40 104 215 / 18%); }
.method-card input:checked + .method-card-face { border-color: #3b82f6; background: #eef5ff; box-shadow: 0 0 0 1px #3b82f6; }
.method-logo { display: grid; height: 24px; place-items: center; }
.method-name { font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.method-cash .method-name { color: #1f9d63; }
.method-bkash .method-name { color: #e2136e; }
.method-nagad .method-name { color: #ec1c24; }
.method-rocket .method-name { color: #8c3494; }
.payment-method.method-tag-bkash { border-color: #f7c3da; background: #fdeef5; color: #c0105c; }
.payment-method.method-tag-nagad { border-color: #fbd0c0; background: #fff1ea; color: #d2331b; }
.payment-method.method-tag-rocket { border-color: #e2c6ea; background: #f7eefa; color: #7a2d82; }
.payment-method.method-tag-cash { border-color: #c4ead7; background: #edf9f3; color: #17815d; }
@media (max-width: 560px) {
    .method-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
:root[data-theme="dark"] .customer-picker-label,
:root[data-theme="dark"] .method-cards legend { color: var(--text); }
:root[data-theme="dark"] .customer-picker-trigger,
:root[data-theme="dark"] .method-card-face { border-color: var(--line); background: #121923; color: var(--text); }
:root[data-theme="dark"] .customer-picker-dropdown { border-color: var(--line); background: var(--surface); }
:root[data-theme="dark"] .customer-picker-list li:hover,
:root[data-theme="dark"] .customer-picker-list li:focus { background: #222c39; }
:root[data-theme="dark"] .customer-picker-list li[aria-selected="true"] { background: #1c2c44; box-shadow: inset 0 0 0 1px #3c64a8; }
:root[data-theme="dark"] .method-card input:checked + .method-card-face { border-color: #5b9bff; background: #172741; }
:root[data-theme="dark"] .method-bkash .method-name { color: #ff5ca3; }
:root[data-theme="dark"] .method-nagad .method-name { color: #ff6b4f; }
:root[data-theme="dark"] .method-rocket .method-name { color: #d68ae0; }
:root[data-theme="dark"] .method-cash .method-name { color: #4fd398; }
/* Customer quick registration (Add New Client) */
.client-register-form { display: grid; gap: 14px; }
.register-card { display: grid; gap: 14px; padding: 16px; border: 1px solid #edf0f5; border-radius: 14px; background: #f8fafc; }
.register-card-title { display: flex; align-items: center; gap: 7px; margin: 0; color: #6b7c93; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.register-card-title span { color: #2864eb; }
.register-field, .location-fields label { display: grid; gap: 7px; color: #526176; font-size: 12px; font-weight: 700; }
.register-field small { color: var(--muted); font-weight: 500; }
.icon-input { position: relative; display: block; }
.icon-input-icon { position: absolute; top: 50%; left: 13px; color: #a3aebd; font-size: 14px; transform: translateY(-50%); pointer-events: none; filter: grayscale(1); opacity: .7; }
.client-register-form input, .client-register-form select, .client-register-form textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #dfe5ed; border-radius: 10px; outline: 0; background: #fff; color: var(--text); font: inherit; font-size: 14px; }
.client-register-form .icon-input input { padding-left: 40px; }
.client-register-form textarea { min-height: 70px; resize: vertical; }
.client-register-form input:focus, .client-register-form select:focus, .client-register-form textarea:focus { border-color: #2864eb; box-shadow: 0 0 0 3px rgb(40 100 235 / 12%); }
.client-register-form select:disabled, .location-fields select:disabled { cursor: not-allowed; opacity: .6; }
.location-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gender-toggle { min-width: 0; margin: 0; padding: 0; border: 0; }
.gender-toggle legend { margin-bottom: 7px; padding: 0; color: #526176; font-size: 12px; font-weight: 700; }
.gender-toggle > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-toggle label { display: block !important; margin: 0; cursor: pointer; }
.gender-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gender-toggle label > span { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; color: #263244; font-size: 14px; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.gender-toggle label > span b { font-size: 16px; }
.gender-toggle input:checked + span { border-color: #2563eb; background: #2563eb; color: #fff; box-shadow: 0 6px 16px rgb(37 99 235 / 25%); }
.gender-toggle input:focus-visible + span { box-shadow: 0 0 0 3px rgb(40 100 235 / 25%); }
.register-note { margin: 0; padding: 10px 12px; border: 1px dashed #c9d7f2; border-radius: 10px; background: #f4f8ff; color: #4a5d7a; font-size: 12px; }
@media (max-width: 520px) {
    .location-fields { grid-template-columns: 1fr; }
}

/* Profile: login details with copy */
.login-detail-list dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.login-value { min-width: 0; overflow-wrap: anywhere; }
.copy-chip { padding: 3px 9px; border: 1px solid #d6e1f5; border-radius: 999px; background: #f2f6ff; color: #2459c9; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }
.copy-chip:hover { border-color: #9dbcf3; background: #e6efff; }
.copy-chip.copied { border-color: #9fdcbf; background: #e9f8f0; color: #17815d; }
.login-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.login-actions form { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

:root[data-theme="dark"] .register-card { border-color: var(--line); background: var(--surface-muted); }
:root[data-theme="dark"] .register-field,
:root[data-theme="dark"] .location-fields label,
:root[data-theme="dark"] .gender-toggle legend { color: var(--text); }
:root[data-theme="dark"] .client-register-form input,
:root[data-theme="dark"] .client-register-form select,
:root[data-theme="dark"] .client-register-form textarea,
:root[data-theme="dark"] .gender-toggle label > span { border-color: var(--line); background: #121923; color: var(--text); }
:root[data-theme="dark"] .gender-toggle input:checked + span { border-color: #3b82f6; background: #2563eb; color: #fff; }
:root[data-theme="dark"] .register-note { border-color: #33476a; background: #172235; color: #b6c4da; }
:root[data-theme="dark"] .copy-chip { border-color: #33476a; background: #172235; color: #8fb4ff; }
:root[data-theme="dark"] .copy-chip.copied { border-color: #285a4a; background: #1d362f; color: #6dd6ad; }
/* Client Management (edit) drawer */
.client-drawer-avatar { position: relative; overflow: visible; font-size: 18px; font-weight: 800; }
.client-drawer-avatar img { width: 100%; height: 100%; border-radius: 15px; object-fit: cover; }
.client-drawer-avatar i { position: absolute; right: -5px; bottom: -5px; display: grid; width: 22px; height: 22px; place-items: center; border: 2px solid #4e6ee0; border-radius: 50%; background: #fff; color: #2864eb; font-size: 11px; font-style: normal; }
.client-drawer-header .client-drawer-meta { color: #dbe5ff; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.client-edit-form { gap: 12px; }
.edit-photo { display: grid; justify-items: center; gap: 8px; padding: 4px 0 6px; }
.edit-photo-circle { position: relative; display: grid; width: 100px; height: 100px; place-items: center; border-radius: 50%; background: #dbe8ff; color: #2864eb; cursor: pointer; font-size: 28px; font-weight: 800; }
.edit-photo-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.edit-photo-camera { position: absolute; right: 0; bottom: 2px; display: grid; width: 34px; height: 34px; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #2563eb; color: #fff; box-shadow: 0 4px 10px rgb(37 99 235 / 30%); }
.edit-photo-circle:hover .edit-photo-camera, .edit-photo-circle:focus-within .edit-photo-camera { background: #1d4ed8; }
.edit-photo small { color: #8a96a8; font-size: 13px; text-align: center; }
.edit-section-title { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; color: #8a96a8; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.switch-card { position: relative; display: flex !important; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border: 1px solid; border-radius: 14px; cursor: pointer; }
.switch-card > span { display: grid; gap: 2px; }
.switch-card strong { font-size: 16px; }
.switch-card small { font-size: 12px; font-weight: 500; }
.switch-card-red { border-color: #fcd4d4; background: #fff1f1; }
.switch-card-red strong { color: #b91c1c; }
.switch-card-red small { color: #dc2626; }
.switch-card-green { border-color: #cdeedd; background: #f1fbf6; }
.switch-card-green strong { color: #17815d; }
.switch-card-green small { color: #3f8f6e; }
.switch-card input[type="checkbox"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch { position: relative; flex: 0 0 auto; width: 54px; height: 30px; border-radius: 999px; background: #d1d5db; transition: background .2s; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); content: ""; transition: transform .2s; }
.switch-card input:checked + .switch::after { transform: translateX(24px); }
.switch-card-red input:checked + .switch { background: #dc2626; }
.switch-card-green input:checked + .switch { background: #16a34a; }
.switch-card input:focus-visible + .switch { box-shadow: 0 0 0 3px rgb(40 100 235 / 25%); }
.edit-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.location-fields-edit { grid-template-columns: 1fr 1fr; }
.location-fields-edit label:last-child { grid-column: 1 / -1; }
.location-fields label small, .register-field small { color: var(--muted); font-weight: 500; }
.register-hint { margin: 0; color: #8a96a8; font-size: 12px; font-weight: 500; }
.password-field input.mono-input { padding-right: 84px; font-family: Consolas, monospace; letter-spacing: .04em; }
.password-icon-button { position: absolute; top: 50%; display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #6b7686; cursor: pointer; transform: translateY(-50%); }
.password-icon-button:hover { background: #eef2f8; color: #2864eb; }
.password-icon-button.copied { color: #16a34a; }
[data-password-copy] { right: 42px; }
[data-password-eye] { right: 8px; }
.client-edit-form .form-actions .button.primary { background: linear-gradient(110deg, #2563eb, #5b46e5); }
.scammer-pill { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 8px; border: 1px solid #fcd4d4; border-radius: 999px; background: #fff1f1; color: #b91c1c; font-size: 11px; font-weight: 800; vertical-align: middle; white-space: nowrap; }
@media (max-width: 420px) {
    .edit-two-col, .location-fields-edit { grid-template-columns: 1fr; }
}
:root[data-theme="dark"] .switch-card-red { border-color: #65373b; background: #392428; }
:root[data-theme="dark"] .switch-card-red strong, :root[data-theme="dark"] .switch-card-red small { color: #ff9a9e; }
:root[data-theme="dark"] .switch-card-green { border-color: #285a4a; background: #1d362f; }
:root[data-theme="dark"] .switch-card-green strong, :root[data-theme="dark"] .switch-card-green small { color: #6dd6ad; }
:root[data-theme="dark"] .switch { background: #3a4656; }
:root[data-theme="dark"] .edit-photo-circle { background: #1c2c44; color: #8fb4ff; }
:root[data-theme="dark"] .edit-photo-camera { border-color: var(--surface); }
:root[data-theme="dark"] .password-icon-button:hover { background: #222c39; }
:root[data-theme="dark"] .scammer-pill { border-color: #65373b; background: #392428; color: #ff9a9e; }
/* Customer directory (design refresh) */
.dir-page { display: grid; gap: 18px; padding-bottom: 70px; }
.dir-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 28px 30px; border-radius: 18px; background: radial-gradient(circle at 85% 0, rgb(56 120 220 / 45%), transparent 45%), linear-gradient(110deg, #0c1f42, #12366e 70%, #1b4f97); color: #fff; box-shadow: 0 14px 34px rgb(12 31 66 / 22%); }
.dir-hero-icon { display: grid; width: 60px; height: 60px; flex: 0 0 60px; place-items: center; border: 1px solid rgb(255 255 255 / 14%); border-radius: 16px; background: rgb(255 255 255 / 10%); }
.dir-hero-copy { flex: 1 1 240px; min-width: 0; }
.dir-hero-copy span { color: #c9d6ee; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.dir-hero-copy h2 { margin: 4px 0; color: #fff; font-size: 30px; line-height: 1.15; }
.dir-hero-copy p { margin: 0; color: #d6e0f2; font-size: 14px; }
.dir-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dir-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid rgb(255 255 255 / 16%); border-radius: 13px; background: rgb(255 255 255 / 8%); }
.dir-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 9px; color: #dbe5f7; font-size: 14px; font-weight: 700; text-decoration: none; }
.dir-tabs a span { filter: grayscale(1) brightness(2); font-size: 13px; }
.dir-tabs a:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.dir-tabs a.active { background: #fff; color: #10274f; box-shadow: 0 4px 12px rgb(0 0 0 / 15%); }
.dir-tabs a.active span { filter: grayscale(1); }
.dir-select-toggle, .dir-trash { display: inline-flex; align-items: center; gap: 7px; min-height: 46px; padding: 0 16px; border: 1px solid rgb(255 255 255 / 22%); border-radius: 12px; background: rgb(255 255 255 / 10%); color: #fff; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; }
.dir-select-toggle:hover, .dir-trash:hover { background: rgb(255 255 255 / 18%); }
.dir-select-toggle[aria-pressed="true"] { background: #fff; color: #10274f; }
.dir-trash b { padding: 0 7px; border-radius: 999px; background: #ef4444; font-size: 11px; }
.dir-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dir-metrics article { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.dir-metrics article > div { display: grid; min-width: 0; gap: 2px; }
.dir-metrics small { color: #4b5768; font-size: 14px; font-weight: 600; }
.dir-metrics strong { color: var(--text); font-size: 22px; font-weight: 800; line-height: 1.2; }
.dir-metrics strong.teal-text { color: #0f9b77; }
.dir-metrics em { color: var(--muted); font-size: 13px; font-style: normal; }
.dir-metrics em.up { color: #17815d; font-weight: 600; }
.dir-metrics a { color: #2563eb; font-size: 13px; font-weight: 600; text-decoration: none; }
.dir-metric-icon { display: grid; width: 50px; height: 50px; flex: 0 0 50px; place-items: center; border-radius: 13px; font-size: 20px; }
.dir-metric-icon.purple { background: #f1ebff; }
.dir-metric-icon.blue { background: #e9f1ff; }
.dir-metric-icon.green { background: #e6f7ef; }
.dir-metric-icon.teal { background: #e3f7f1; color: #0f9b77; }
.dir-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.dir-search { display: flex; flex: 1 1 260px; align-items: center; gap: 9px; min-height: 46px; padding: 0 14px; border: 1px solid #dfe5ed; border-radius: 11px; background: var(--surface-muted); color: var(--muted); }
.dir-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.dir-search:focus-within { border-color: #7aa4e9; box-shadow: 0 0 0 3px rgb(40 104 215 / 10%); }
.dir-segment { display: inline-flex; gap: 3px; padding: 4px; border-radius: 11px; background: #eef1f6; }
.dir-segment a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; color: #4b5768; font-size: 14px; font-weight: 700; text-decoration: none; }
.dir-segment a.active { background: #fff; color: var(--text); box-shadow: 0 2px 6px rgb(15 23 42 / 10%); }
.dir-segment .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.green { background: #16a34a; }
.dir-filters select { min-height: 46px; padding: 0 34px 0 14px; border: 1px solid #dfe5ed; border-radius: 11px; background-color: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.dir-count { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.dir-count strong { color: var(--text); }
.dir-table-panel { border-radius: 16px; }
.dir-table th { padding: 16px 18px; background: var(--surface); color: #2b3646; font-size: 14px; font-weight: 800; letter-spacing: 0; text-transform: none; }
.dir-table th a { color: inherit; text-decoration: none; white-space: nowrap; }
.dir-table th a i { color: #a7b0bd; font-size: 11px; font-style: normal; }
.dir-table td { padding: 14px 18px; vertical-align: middle; }
.dir-table tbody tr + tr td { border-top: 1px solid var(--line); }
.dir-check { display: none; width: 34px; }
.is-selecting .dir-check { display: table-cell; }
.dir-check input { width: 17px; height: 17px; }
.dir-id { display: inline-block; padding: 5px 9px; border-radius: 7px; background: #f1f3f6; color: #4b5768; font-size: 12px; font-weight: 700; }
.dir-client { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.dir-client strong { color: #1d5bd6 !important; font-size: 15px; }
.dir-client small, .dir-employee small { display: block; color: var(--muted); font-size: 13px; }
.dir-avatar-wrap { position: relative; flex: 0 0 auto; }
.dir-avatar-wrap .customer-avatar { width: 44px; height: 44px; background: #dbe8ff; color: #2864eb; font-size: 16px; }
.presence { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border: 2px solid var(--surface); border-radius: 50%; }
.presence.on { background: #16a34a; }
.presence.off { background: #b8c0cc; }
.dir-employee { display: flex; align-items: center; gap: 10px; }
.dir-employee .customer-avatar { width: 36px; height: 36px; }
.dir-employee strong { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-size: 14px; font-weight: 650; }
.verified { color: #2563eb; }
.dir-muted { color: #a7b0bd; font-size: 13px; }
.dir-package b { display: block; color: #2563eb; font-size: 14px; }
.dir-package small { color: var(--muted); font-size: 12px; }
.balance-chip { display: inline-block; padding: 3px 10px; border-radius: 7px; font-size: 15px; font-weight: 800; white-space: nowrap; }
.balance-chip.adv { background: #e3f8ec; color: #16a34a; }
.balance-chip.due { background: #fdecec; color: #dc2626; }
.balance-chip.clear { background: #fff6dc; color: #d18a00; }
.balance-note { display: block; margin-top: 2px; font-size: 12px; }
.balance-note.adv { color: #16a34a; }
.balance-note.due { color: #dc2626; }
.dir-status { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 18px; border: 1.5px solid; border-radius: 999px; cursor: pointer; font: inherit; font-size: 15px; font-weight: 700; line-height: 1; white-space: nowrap; transition: box-shadow .15s, background .15s; }
.dir-status i { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: currentColor; }
.dir-status.active { border-color: #bdeccb; background: #edfcf2; color: #1fa652; box-shadow: 0 0 0 3px rgb(34 197 94 / 6%); }
.dir-status.active i { background: #22c55e; }
.dir-status.active:hover { background: #e2f9ea; box-shadow: 0 0 0 4px rgb(34 197 94 / 12%); }
.dir-status.inactive { border-color: #e2e6eb; background: #f5f6f8; color: #6b7686; }
.dir-status.inactive i { background: #a3acb9; }
.dir-status.inactive:hover { background: #eceff3; }
.dir-actions { display: inline-flex; align-items: center; gap: 8px; }
.dir-action { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid #e3e7ee; border-radius: 9px; background: var(--surface); color: #3e4c5f; cursor: pointer; font-size: 14px; list-style: none; text-decoration: none; }
.dir-action::-webkit-details-marker { display: none; }
.dir-action:hover { border-color: #b9cbe8; background: #f4f8ff; }
.dir-action.blue { border-color: #c9dafb; background: #eef4ff; color: #2563eb; }
.row-menu { position: relative; }
.row-menu-list { position: fixed; z-index: 60; display: grid; min-width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 40px rgb(15 23 42 / 18%); }
.row-menu-list a, .row-menu-list button { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: 13px; text-align: left; text-decoration: none; }
.row-menu-list a:hover, .row-menu-list button:hover { background: #f2f6ff; }
.row-menu-list form { margin: 0; }
.row-menu-list .danger { color: #dc2626; }
.dir-bulk-bar { position: fixed; bottom: 18px; left: 50%; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 16px 40px rgb(15 23 42 / 22%); transform: translateX(-50%); }
.dir-bulk-bar[hidden] { display: none; }
.dir-bulk-bar select { min-height: 32px; border: 1px solid #dfe5ed; border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; }
.dir-fab { position: fixed; right: 24px; bottom: 24px; z-index: 35; display: inline-flex; align-items: center; gap: 8px; padding: 15px 24px; border: 0; border-radius: 999px; background: #2563eb; color: #fff; cursor: pointer; font: inherit; font-size: 17px; font-weight: 800; box-shadow: 0 12px 28px rgb(37 99 235 / 40%); }
.dir-fab span { filter: grayscale(1) brightness(3); }
.dir-fab:hover { background: #1d4ed8; }
.is-selecting .dir-fab { display: none; }
@media (max-width: 1100px) {
    .dir-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .dir-hero { padding: 20px; }
    .dir-hero-copy h2 { font-size: 24px; }
    .dir-tabs a { padding: 8px 10px; font-size: 13px; }
    .dir-metrics { grid-template-columns: 1fr; }
    .dir-filters select, .dir-segment { flex: 1 1 140px; }
    .dir-count { margin-left: 0; }
    .dir-fab { right: 16px; bottom: 16px; padding: 13px 18px; font-size: 15px; }
}
:root[data-theme="dark"] .dir-metrics small { color: var(--muted); }
:root[data-theme="dark"] .dir-metric-icon.purple { background: #2a2342; }
:root[data-theme="dark"] .dir-metric-icon.blue { background: #1c2c44; }
:root[data-theme="dark"] .dir-metric-icon.green, :root[data-theme="dark"] .dir-metric-icon.teal { background: #1d362f; }
:root[data-theme="dark"] .dir-search, :root[data-theme="dark"] .dir-filters select, :root[data-theme="dark"] .dir-bulk-bar select { border-color: var(--line); background: #121923; }
:root[data-theme="dark"] .dir-segment { background: #121923; }
:root[data-theme="dark"] .dir-segment a { color: var(--muted); }
:root[data-theme="dark"] .dir-segment a.active { background: var(--surface-muted); color: var(--text); }
:root[data-theme="dark"] .dir-table th { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .dir-id { background: #222c39; color: var(--text); }
:root[data-theme="dark"] .dir-client strong { color: #7aa7ff !important; }
:root[data-theme="dark"] .dir-avatar-wrap .customer-avatar { background: #1c2c44; color: #8fb4ff; }
:root[data-theme="dark"] .balance-chip.adv { background: #1d362f; color: #6dd6ad; }
:root[data-theme="dark"] .balance-chip.due { background: #392428; color: #ff9a9e; }
:root[data-theme="dark"] .balance-chip.clear { background: #322e20; color: #efcf72; }
:root[data-theme="dark"] .dir-status.active { border-color: #285a4a; background: #1d362f; color: #6dd6ad; }
:root[data-theme="dark"] .dir-status.inactive { border-color: var(--line); background: #222c39; color: var(--muted); }
:root[data-theme="dark"] .dir-action { border-color: var(--line); background: var(--surface-muted); color: var(--text); }
:root[data-theme="dark"] .dir-action.blue { border-color: #33476a; background: #172235; color: #8fb4ff; }
:root[data-theme="dark"] .row-menu-list a:hover, :root[data-theme="dark"] .row-menu-list button:hover { background: #222c39; }
/* Customer dashboard: online payment */
.portal-pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 0; margin: 16px 0; border-radius: 16px; }
.portal-pay-summary { display: grid; align-content: center; gap: 4px; padding: 24px; background: linear-gradient(120deg, #4e46df, #087ed0); color: #fff; }
.portal-pay-label { color: #dbe5ff; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.portal-pay-summary strong { color: #fff; font-size: 32px; line-height: 1.15; }
.portal-pay-summary small { color: #e2e9ff; font-size: 13px; }
.portal-pay-form { display: grid; gap: 12px; padding: 22px 24px; }
.portal-pay-form label { display: grid; gap: 6px; color: #526176; font-size: 12px; font-weight: 700; }
.portal-pay-amount { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border: 1px solid #dfe5ed; border-radius: 12px; background: var(--surface); }
.portal-pay-amount:focus-within { border-color: #2864eb; box-shadow: 0 0 0 3px rgb(40 100 235 / 12%); }
.portal-pay-amount b { color: var(--muted); font-size: 18px; }
.portal-pay-amount input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 20px; font-weight: 700; }
.portal-pay-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-pay-methods span { padding: 5px 12px; border: 1px solid #e3e7ee; border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 800; }
.portal-pay-methods .method-bkash { color: #e2136e; }
.portal-pay-methods .method-nagad { color: #ec1c24; }
.portal-pay-methods .method-rocket { color: #8c3494; }
.portal-pay-methods .method-more { color: var(--muted); }
.portal-pay-button { min-height: 50px; border-radius: 12px; font-size: 16px; }
.portal-pay-note { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) {
    .portal-pay { grid-template-columns: 1fr; }
}
:root[data-theme="dark"] .portal-pay-form label { color: var(--text); }
:root[data-theme="dark"] .portal-pay-amount, :root[data-theme="dark"] .portal-pay-methods span { border-color: var(--line); background: #121923; }