:root {
    --navy: #062f42;
    --navy-2: #0a435c;
    --blue: #2878b5;
    --blue-soft: #eaf4fb;
    --green: #08a969;
    --green-soft: #e8f8f1;
    --amber: #f4a000;
    --amber-soft: #fff5dd;
    --red: #c73737;
    --red-soft: #fff0f0;
    --teal: #0b8b8e;
    --ink: #092f43;
    --muted: #526b77;
    --line: #d5e2e9;
    --paper: #ffffff;
    --canvas: #f3f7f9;
    --shadow: 0 18px 45px rgba(6, 47, 66, .09);
    --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: auto; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Tahoma, Arial, sans-serif; line-height: 1.7; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .btn { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.text-link { color: #086ca8; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.centered { display: block; text-align: center; margin-top: 16px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 18px; background: var(--navy); color: #fff; display: flex; flex-direction: column; z-index: 20; overflow-y: auto; }
.app-brand { display: flex; gap: 12px; align-items: center; padding: 5px 8px 24px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.12); }
.app-brand img { width: 74px; height: 48px; object-fit: contain; background: #fff; border-radius: 9px; padding: 4px; }
.app-brand span { font-size: 15px; font-weight: 800; line-height: 1.45; }
.app-brand small { display: block; color: #a9c5d2; font-size: 11px; font-weight: 400; margin-top: 4px; white-space: nowrap; max-width: 125px; overflow: hidden; text-overflow: ellipsis; }
.side-nav { display: grid; gap: 5px; margin-top: 24px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; color: #d8e8ef; text-decoration: none; font-size: 14px; font-weight: 700; }
.side-nav a:hover, .side-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.side-nav a.active { box-shadow: inset -3px 0 var(--green); }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #6c96a7; flex: 0 0 auto; }
.side-nav a.active .nav-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(8,169,105,.15); }
.sidebar-foot { margin-top: auto; display: grid; gap: 9px; border-top: 1px solid rgba(255,255,255,.12); padding: 18px 8px 0; }
.sidebar-foot a { color: #bcd2dc; font-size: 12px; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }
.app-main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar { min-height: 94px; padding: 18px clamp(20px, 4vw, 52px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 12; backdrop-filter: blur(10px); }
.app-topbar h1 { margin: 2px 0 0; font-size: clamp(22px, 3vw, 31px); line-height: 1.25; }
.topbar-kicker { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.user-chip { min-width: 160px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; }
.user-chip span, .user-chip small { display: block; }
.user-chip span { font-weight: 800; font-size: 13px; }
.user-chip small { color: var(--muted); font-size: 11px; }
.app-content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 30px clamp(20px, 4vw, 52px) 48px; flex: 1; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px clamp(20px, 4vw, 52px); color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); background: #fff; }
.app-footer a { color: var(--blue); font-weight: 700; }
.mobile-nav { display: none; }
.mobile-more-links { display: none; }
.mobile-menu-toggle, .mobile-menu-close, .mobile-menu-overlay { display: none; }
.mobile-menu-overlay[hidden] { display: none !important; }

.client-command-bar { min-height: 54px; margin: 0 0 22px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.98); box-shadow: 0 10px 28px rgba(6,47,66,.08); display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow-x: auto; scrollbar-width: thin; }
.app-body .client-command-bar { position: sticky; top: 105px; z-index: 11; }
.app-body.compact-app-header .app-main > .app-topbar { display: none !important; }
.app-body.compact-app-header .client-command-bar { top: 0; }
.compact-app-header .client-command-actions .topbar-notification { flex: 0 0 auto; }
.si-app .client-command-bar { top: 0; }
.catalog-body > main > .client-command-bar { width: 100%; max-width: none; margin: 0 0 24px; position: sticky; top: 84px; z-index: 18; }
.client-history-actions { min-width: 0; display: flex; align-items: center; gap: 6px; }
.client-command-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.client-command-actions form { margin: 0; display: flex; }
.client-command-button { min-height: 40px; padding: 7px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-size: 11px; font-weight: 900; cursor: pointer; transition: background .18s,border-color .18s,transform .18s; }
.client-command-button:hover { border-color: var(--line); background: var(--blue-soft); transform: translateY(-1px); }
.client-command-button:focus-visible { outline: 3px solid rgba(40,120,181,.24); outline-offset: 2px; }
.client-command-button svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.client-install-button { border-color: #b9e3d0; background: var(--green-soft); color: #08764d; }
.client-install-button:hover { border-color: #76c7a4; background: #dcf5e9; }
.client-logout-button { border-color: #efc2c2; background: var(--red-soft); color: #a92d2d; }
.client-logout-button:hover { border-color: #e49696; background: #ffe6e6; }
body.install-help-open { overflow: hidden; }
.install-help-backdrop { position: fixed; z-index: 3000; inset: 0; padding: 20px; background: rgba(2,20,29,.66); backdrop-filter: blur(4px); display: grid; place-items: center; }
.install-help-backdrop[hidden] { display: none !important; }
.install-help-dialog { width: min(100%,460px); position: relative; padding: 28px; border: 1px solid #cbdde6; border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(2,20,29,.28); text-align: center; }
.install-help-dialog h2 { margin: 14px 0 8px; font-size: 23px; line-height: 1.4; }
.install-help-dialog p { margin: 0; color: var(--ink); line-height: 1.9; }
.install-help-dialog small { display: block; margin: 10px 0 20px; color: var(--muted); line-height: 1.8; }
.install-help-close { position: absolute; top: 12px; left: 12px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--navy); display: grid; place-items: center; font-size: 25px; cursor: pointer; }
.install-help-icon { width: 70px; height: 70px; margin: 0 auto; border-radius: 20px; background: var(--green-soft); color: #08764d; display: grid; place-items: center; }
.install-help-icon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.alert { border: 1px solid; border-radius: 12px; padding: 13px 16px; margin: 0 0 20px; font-size: 14px; font-weight: 700; }
.alert-success { color: #05623e; background: var(--green-soft); border-color: #a6e1c8; }
.alert-info { color: #0a577f; background: var(--blue-soft); border-color: #a8d5ec; }
.alert-warning { color: #745000; background: var(--amber-soft); border-color: #efd18a; }
.alert-error { color: #8f2525; background: var(--red-soft); border-color: #efb1b1; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 23px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.section-head .btn { flex: 0 0 auto; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card, .stack > * + * { margin-top: 20px; }
.card h2, .card h3 { margin-top: 0; }
.card-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.card-title-row h2, .card-title-row h3 { margin: 0; }
.card-title-row span { color: var(--muted); font-size: 12px; }
.empty { border: 1px dashed #b7cad3; background: #fbfdfe; border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 13px; padding: 17px; min-width: 0; }
.metric.green { border-top-color: var(--green); }
.metric.red { border-top-color: var(--red); }
.metric.amber { border-top-color: var(--amber); }
.metric.teal { border-top-color: var(--teal); }
.metric span { color: var(--muted); font-size: 12px; display: block; }
.metric strong { font-size: clamp(21px, 3vw, 29px); display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric small { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.quick-action { position: relative; min-height: 110px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; transition: transform .18s, box-shadow .18s; }
.quick-action:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(6,47,66,.1); }
.quick-action b { font-size: 16px; }
.quick-action small { color: var(--muted); font-size: 11px; }
.quick-action::before { content: ''; width: 32px; height: 5px; border-radius: 5px; background: var(--blue); }
.quick-action.green::before { background: var(--green); }
.quick-action.red::before { background: var(--red); }
.quick-action.teal::before { background: var(--teal); }
.quick-action.amber::before { background: var(--amber); }
.balance-list { display: grid; gap: 9px; }
.balance-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e7eef2; }
.balance-row:last-child { border: 0; }
.balance-row span { font-size: 13px; }
.balance-row strong { font-size: 14px; }
.expiry-card { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.expiry-card span, .expiry-card small { display: block; color: #c8dee7; }
.expiry-card strong { display: block; font-size: 22px; margin: 2px 0; }

.btn { min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 10px 17px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; text-decoration: none; font-weight: 800; font-size: 13px; cursor: pointer; transition: opacity .15s, transform .15s; }
.btn:hover { opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-green { background: #087a50; color: #fff; }
.btn-danger { background: #fff; border-color: #eaa4a4; color: var(--red); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-block { width: 100%; }
.btn-small { min-height: 42px; padding: 8px 12px; font-size: 11px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button-row form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button-row form label { display: flex; gap: 8px; align-items: center; }
.secure-link-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; align-items: center; margin-top: 10px; }
.overdue-alerts { border-top: 3px solid var(--red); }
.restore-result-list { border-radius: 12px; padding: 12px 18px; margin: 12px 0; }
.restore-result-list h3 { margin: 0 0 6px; font-size: 16px; }
.restore-result-list ul { margin: 0; }
.restore-result-list.error-list { background: var(--red-soft); color: #7c2020; }
.restore-result-list.warning-list { background: var(--amber-soft); color: #6d4a00; }
.network-state { margin-top: 12px; border: 1px solid #a6e1c8; background: var(--green-soft); color: #05623e; border-radius: 9px; padding: 9px 11px; font-size: 11px; font-weight: 700; }
.network-state.offline { border-color: #efd18a; background: var(--amber-soft); color: #745000; }
.hash-code { font-family: Consolas, monospace; font-size: 11px; white-space: nowrap; }
.offline-card small { display: block; margin-top: 14px; }

.form-card { max-width: 1000px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field > span { font-size: 12px; font-weight: 800; }
.field .help { color: var(--muted); font-size: 11px; font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #c5d6df; border-radius: 9px; background: #fff; min-height: 45px; padding: 9px 12px; color: var(--ink); outline: 0; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; padding: 0; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,120,181,.12); }
input[readonly] { background: #f1f5f7; color: var(--muted); }
.required::after { content: ' *'; color: var(--red); }
.form-actions { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.type-picker { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 22px; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option span { display: block; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 13px; text-align: center; font-weight: 800; cursor: pointer; }
.type-option input:checked + span { border-color: var(--blue); color: #086ca8; background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.type-option input:focus-visible + span { outline: 3px solid rgba(40,120,181,.3); outline-offset: 2px; }
.type-option[data-tone="green"] input:checked + span { border-color: var(--green); color: #05764a; background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.type-option[data-tone="red"] input:checked + span { border-color: var(--red); color: #9c2a2a; background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.effect-preview { padding: 13px 15px; border-radius: 10px; background: var(--blue-soft); color: #0a577f; font-size: 12px; margin-top: 14px; }
.inline-add { display: flex; gap: 8px; align-items: end; }
.inline-add .field { flex: 1; }
.customer-picker { position: relative; }
.customer-suggestions { position: absolute; z-index: 30; top: calc(100% - 24px); right: 0; left: 0; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); padding: 6px; }
.customer-suggestion { display: block; width: 100%; border: 0; border-bottom: 1px solid #edf2f4; background: #fff; color: var(--ink); padding: 10px; text-align: right; cursor: pointer; }
.customer-suggestion:hover, .customer-suggestion:focus { background: var(--blue-soft); }

.filters { display: grid; grid-template-columns: repeat(5, minmax(120px,1fr)); gap: 10px; margin-bottom: 17px; }
.filters .btn { align-self: end; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e6edf1; text-align: right; vertical-align: middle; font-size: 12px; }
th { color: #fff; background: var(--navy); white-space: nowrap; }
tbody tr:hover { background: #f8fbfc; }
tr.cancelled { opacity: .55; text-decoration: line-through; }
.amount-positive { color: #08764d; font-weight: 800; }
.amount-negative { color: var(--red); font-weight: 800; }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 800; background: var(--blue-soft); color: #126492; white-space: nowrap; }
.badge.green, .badge.active { background: var(--green-soft); color: #08764d; }
.badge.red, .badge.expired, .badge.suspended { background: var(--red-soft); color: #a22f2f; }
.badge.amber, .badge.pending, .badge.trial { background: var(--amber-soft); color: #7f5700; }
.badge.coming, .badge.launch_pending { background: var(--amber-soft); color: #7f5700; }
.badge.available { background: var(--green-soft); color: #08764d; }
.table-actions { display: flex; gap: 6px; white-space: nowrap; }
.pagination { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }
.pagination a, .pagination span { min-width: 42px; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; text-decoration: none; font-size: 12px; background: #fff; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }
.mobile-records { display: none; }
.mobile-record { border: 1px solid var(--line); border-right: 4px solid var(--blue); border-radius: 12px; background: #fff; padding: 13px; }
.mobile-record + .mobile-record { margin-top: 9px; }
.mobile-record-head, .mobile-record-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mobile-record-head strong { font-size: 17px; }
.mobile-record-meta { color: var(--muted); font-size: 10px; margin-top: 7px; }
.mobile-record p { margin: 8px 0; font-size: 12px; }
.mobile-record details form { display: grid; gap: 7px; margin-top: 7px; }

.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.report-card { border: 1px solid var(--line); border-radius: 13px; padding: 18px; background: #f9fbfc; }
.report-card h3 { margin: 0 0 8px; color: var(--navy); }
.report-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.8; }
.bars { display: grid; gap: 12px; }
.bar-item { display: grid; gap: 5px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.bar-track { height: 9px; border-radius: 9px; overflow: hidden; background: #e8eff3; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--blue); width: var(--bar-width, 0%); }
.bar-fill.red { background: var(--red); }
.bar-fill.green { background: var(--green); }
progress { width: 100%; height: 10px; border: 0; border-radius: 10px; overflow: hidden; background: #e8eff3; }
progress::-webkit-progress-bar { background: #e8eff3; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--red); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--red); border-radius: 10px; }
.mini-kpi { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.mini-kpi div { background: #f7fafb; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.mini-kpi span, .mini-kpi strong { display: block; }
.mini-kpi span { color: var(--muted); font-size: 10px; }
.table-note { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.business-logo-preview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfc; }
.business-logo-preview img { width: 120px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; }
.catalog-picker { position: relative; }
.catalog-picker .customer-suggestions { top: 64px; }

.catalog-body { background: #fff; }
.catalog-header { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 20; }
.catalog-nav { width: 100%; max-width: 1680px; margin: 0 auto; padding: 15px 28px; display: flex; justify-content: space-between; align-items: center; gap: 22px; }
.catalog-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.catalog-logo img { width: 94px; height: 48px; object-fit: contain; }
.catalog-links { display: flex; align-items: center; gap: 18px; font-size: 13px; font-weight: 700; }
.catalog-links a { text-decoration: none; }
.catalog-hero { color: #fff; background: linear-gradient(135deg, #052c3e 0%, #0b4c67 100%); padding: 72px 22px 88px; }
.catalog-hero-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; align-items: center; }
.catalog-kicker { color: #7fe0b6; font-size: 12px; font-weight: 800; }
.catalog-hero h1 { font-size: clamp(35px,6vw,66px); line-height: 1.18; margin: 10px 0 17px; max-width: 780px; }
.catalog-hero p { color: #d5e7ee; max-width: 690px; font-size: 17px; }
.catalog-points { display: grid; gap: 10px; }
.catalog-points div { border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); border-radius: 13px; padding: 13px 15px; }
.catalog-points strong, .catalog-points span { display: block; }
.catalog-points span { color: #b9d3df; font-size: 12px; }
.catalog-section { width: 100%; max-width: 1480px; margin: 0 auto; padding: 54px 24px; }
.catalog-section-head { display: flex; justify-content: space-between; gap: 25px; align-items: end; margin-bottom: 26px; }
.catalog-section-head h2 { font-size: 31px; margin: 0; }
.catalog-section-head p { color: var(--muted); margin: 0; max-width: 540px; }
.catalog-section .catalog-kicker { color: #087a50; }
.app-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.product-card { border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.product-card.featured { border-top: 5px solid var(--green); }
.product-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 20px; font-weight: 900; }
.product-visual { min-height: 170px; aspect-ratio: 16 / 9; margin: -10px -10px 20px; padding: 19px 22px; border-radius: 14px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; position: relative; isolation: isolate; }
.product-visual::after { content: ''; position: absolute; width: 170px; height: 170px; border: 30px solid rgba(255,255,255,.1); border-radius: 50%; inset-inline-start: -55px; bottom: -95px; z-index: -1; }
.product-visual span { max-width: 62%; font-size: 18px; font-weight: 900; line-height: 1.55; }
.app-illustration { width: 82px; height: 82px; flex: 0 0 auto; filter: drop-shadow(0 8px 16px rgba(0,0,0,.12)); }
.app-visual-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-visual > .app-visual-image { position: absolute; inset: 0; z-index: 0; }
.product-visual > .app-visual-image + span { display: none; }
.visual-ocean { background: linear-gradient(135deg,#075985,#0ea5e9); }
.visual-emerald { background: linear-gradient(135deg,#047857,#10b981); }
.visual-violet { background: linear-gradient(135deg,#5b21b6,#8b5cf6); }
.visual-indigo { background: linear-gradient(135deg,#3730a3,#6366f1); }
.visual-rose { background: linear-gradient(135deg,#be123c,#fb7185); }
.visual-amber { background: linear-gradient(135deg,#b45309,#f59e0b); }
.visual-teal { background: linear-gradient(135deg,#0f766e,#2dd4bf); }
.visual-slate { background: linear-gradient(135deg,#334155,#64748b); }
.portal-product-card h2 { margin: 0; font-size: 21px; }
.portal-product-card > p { min-height: 48px; margin: 0 0 16px; }
.product-card h3 { margin: 16px 0 5px; font-size: 21px; }
.product-card p { color: var(--muted); font-size: 13px; }
.product-features { margin: 12px 0 22px; padding: 0 18px 0 0; font-size: 12px; }
.product-scope { margin-top: 14px; }
.product-scope > strong { display: block; color: var(--navy); font-size: 13px; }
.product-pricing { margin-top: auto; border-top: 1px solid var(--line); padding-top: 17px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.price-box { background: #f7fafb; border-radius: 10px; padding: 10px; }
.price-box span, .price-box strong { display: block; }
.price-box span { color: var(--muted); font-size: 9px; }
.price-box strong { font-size: 15px; }
.price-box small { display: block; margin-top: 4px; color: var(--green); font-size: 9px; font-weight: 800; }
.price-box.self-service { background: #edf9f4; border: 1px solid #bfe7d4; }
.price-box.self-service strong { color: #08764d; }
.product-card .scope-note { margin: 10px 0 0; padding: 9px 10px; border-radius: 9px; background: #fff8e8; color: #76530d; line-height: 1.7; }
.installment-note { margin: 10px 0 0; padding: 10px 11px; border: 1px solid #bfe7d4; border-radius: 10px; background: #effaf5; color: #285a44 !important; line-height: 1.75; }
.installment-note strong { display: block; color: #087a50; }
.price-feedback-link { margin-top: 13px; color: var(--blue); text-align: center; text-decoration: underline; text-underline-offset: 4px; font-size: 11px; font-weight: 800; }
.custom-program-card { border-style: dashed; background: #f8fbfc; }
.custom-program-card .product-icon { background: #e9f8f1; color: var(--green); }
.product-actions { display: flex; gap: 8px; margin-top: 14px; }
.product-actions .btn { flex: 1; }
.product-actions form { display: flex; flex: 1; margin: 0; }
.product-secondary-links { display: grid; justify-items: center; gap: 7px; margin-top: 12px; font-size: 11px; font-weight: 800; }
.product-secondary-links > a { color: var(--blue); text-align: center; text-decoration: underline; text-underline-offset: 4px; }
.product-secondary-links .price-feedback-link { margin-top: 0; }
.catalog-how { background: var(--canvas); }
.pricing-policy-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.addon-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.addon-card { border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 14px; padding: 17px; background: #fff; }
.addon-card > span { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: #08764d; font-size: 11px; font-weight: 900; }
.addon-card h3 { margin: 11px 0 6px; font-size: 16px; }
.addon-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.policy-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 16px; padding: 16px 18px; border: 1px solid #c5deec; border-radius: 13px; background: var(--blue-soft); }
.policy-strip strong, .policy-strip span { display: block; }
.policy-strip span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.policy-strip b { flex: 0 0 auto; color: var(--blue); }
.policy-actions { justify-content: center; margin-top: 18px; }
.policy-details { padding-top: 48px; padding-bottom: 48px; }
.policy-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.policy-columns .card { margin: 0; }
.steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 15px; }
.step-card { border-top: 3px solid var(--blue); background: #fff; border-radius: 12px; padding: 18px; }
.step-card b { color: var(--blue); font-size: 12px; }
.step-card h3 { margin: 6px 0; font-size: 16px; }
.step-card p { margin: 0; color: var(--muted); font-size: 11px; }
.catalog-footer { background: var(--navy); color: #d3e5ec; padding: 30px 22px; }
.catalog-footer-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 22px; }
.catalog-footer a { color: #fff; }
.portal-page { min-height: calc(100vh - 110px); }
.portal-page > .catalog-section-head h1 { margin: 4px 0 0; font-size: 34px; }
.portal-cards { grid-template-columns: repeat(3,minmax(0,1fr)); }
.portal-product-card { padding: 18px; }
.portal-product-card .product-visual { margin: -4px -4px 17px; }
.catalog-links form { margin: 0; }
.plans-page { max-width: 1480px; }
.plan-hero { min-height: 270px; margin-bottom: 32px; padding: 20px; border-radius: 24px; color: #fff; display: grid; grid-template-columns: minmax(300px,38%) minmax(0,1fr); align-items: center; gap: clamp(26px,4vw,58px); overflow: hidden; position: relative; isolation: isolate; }
.plan-hero::after { content: ''; position: absolute; width: 430px; height: 430px; border: 75px solid rgba(255,255,255,.09); border-radius: 50%; inset-inline-start: -130px; bottom: -300px; z-index: -1; }
.plan-hero .catalog-kicker { color: #d7fff0; }
.plan-hero h1 { margin: 5px 0 10px; font-size: clamp(30px,5vw,48px); line-height: 1.25; }
.plan-hero p { max-width: 740px; margin: 0; color: rgba(255,255,255,.86); }
.plan-hero-visual { width: 100%; height: 230px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.14); overflow: hidden; box-shadow: 0 18px 44px rgba(0,0,0,.18); }
.plan-hero-visual .app-illustration { width: 96px; height: 96px; }
.plan-hero-visual .app-visual-image { width: 100%; height: 100%; object-fit: cover; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 20px; align-items: stretch; }
.plan-grid > .plan-card:only-child { width: min(100%,760px); justify-self: center; }
.plan-card { min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan-card.current { border: 2px solid var(--green); box-shadow: 0 18px 45px rgba(8,169,105,.14); }
.plan-card.recommended:not(.current) { border-top: 5px solid var(--blue); }
.plan-card h2 { margin: 5px 0 8px; font-size: 24px; }
.plan-card > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.current-plan-label { color: #08764d; font-size: 11px; }
.plan-limit { width: fit-content; padding: 5px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue) !important; font-weight: 800; }
.plan-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 8px 0 16px; }
.plan-prices > div { padding: 12px; border-radius: 11px; background: #f5f9fb; }
.plan-prices span, .plan-prices strong, .plan-prices small { display: block; }
.plan-prices span { color: var(--muted); font-size: 10px; }
.plan-prices strong { margin-top: 3px; font-size: 15px; }
.plan-prices small { margin-top: 3px; color: #08764d; font-size: 9px; font-weight: 800; }
.plan-features { margin: 0 0 18px; padding: 0 20px 0 0; display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.plan-features li::marker { color: var(--green); }
.plan-card .product-actions { margin-top: auto; }
.development-page { max-width: 980px; }
.interest-page { min-height: calc(100vh - 190px); }
.interest-page .catalog-section-head h1 { margin: 5px 0 0; font-size: clamp(27px,4vw,38px); }
.interest-card { max-width: 900px; margin: 0 auto; }
.interest-program-summary { max-width: 900px; margin: 0 auto 18px; }
.interest-program-summary .product-pricing { margin-top: 18px; }
.interest-program-summary .scope-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #fff8e8; color: #76530d; }
.price-feedback-summary .installment-explainer { margin: 15px 0 0; padding: 12px 14px; border: 1px solid #bfe7d4; border-radius: 10px; background: #effaf5; color: #285a44; font-size: 12px; line-height: 1.8; }
.price-feedback-summary .installment-explainer strong { color: #087a50; }
.price-feedback-page .interest-card { margin-bottom: 20px; }
.scope-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 25px; }
.interest-card form { display: grid; gap: 14px; margin-top: 20px; }
.consent-field label { display: flex; align-items: flex-start; gap: 9px; line-height: 1.8; }
.consent-field input { margin-top: 5px; }
.interest-success { text-align: center; padding: 18px 0; }
.interest-success h2 { margin: 0 0 8px; }
.interest-success p { color: var(--muted); }
.interest-success .button-row { justify-content: center; margin-top: 20px; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: linear-gradient(145deg, #052d3e, #0a536d); }
.auth-card { width: min(100%, 470px); background: #fff; border-top: 5px solid var(--green); border-radius: 16px; padding: clamp(24px,5vw,42px); box-shadow: 0 25px 70px rgba(0,0,0,.2); }
.auth-card.form-card { width: min(100%, 900px); }
.auth-logo { width: 130px; height: 72px; object-fit: contain; display: block; margin: 0 auto 18px; }
.auth-card h1 { text-align: center; font-size: 25px; margin: 0 0 6px; }
.auth-card > p { text-align: center; color: var(--muted); font-size: 13px; }
.auth-card form { display: grid; gap: 14px; margin-top: 24px; }
.auth-help { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; text-align: center; font-size: 11px; color: var(--muted); }
.auth-help .btn { margin-bottom: 15px; }
.trial-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(230px,.65fr); gap: 24px; align-items: start; }
.trial-layout form { margin-top: 0; }
.trial-summary { background: var(--blue-soft); border: 1px solid #c6e0ee; border-radius: 13px; padding: 18px; }
.trial-summary strong { display: block; margin-bottom: 9px; }
.trial-summary ul { margin: 0; padding: 0 19px 0 0; font-size: 13px; }
.trial-summary p { margin: 15px 0 0; color: var(--muted); font-size: 11px; }
.check-label { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; font-weight: 400; cursor: pointer; }
.check-label input { margin-top: 5px; flex: 0 0 auto; }
.form-trap { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); gap: 15px; margin-bottom: 20px; }
.admin-stat { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 16px; }
.admin-stat-link { color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.admin-stat-link:hover { border-color: var(--blue); transform: translateY(-2px); }
.subscription-card-selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.subscription-followup-filters { margin: 16px 0 20px; align-items: end; }
.subscription-followup-table td { vertical-align: top; }
.subscription-followup-table .badge { white-space: nowrap; }
.whatsapp-audience-filters { grid-template-columns: repeat(4, minmax(150px,1fr)); }
.whatsapp-message-cell { min-width: 290px; max-width: 500px; white-space: pre-line; line-height: 1.8; }
.whatsapp-row-actions { min-width: 260px; flex-wrap: wrap; align-items: flex-start; }
.whatsapp-row-actions form { margin: 0; }
.whatsapp-row-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.whatsapp-action-details { min-width: 105px; }
.whatsapp-action-details summary { list-style: none; cursor: pointer; }
.whatsapp-action-details summary::-webkit-details-marker { display: none; }
.whatsapp-action-details form { min-width: 195px; margin-top: 8px; }
.whatsapp-action-details input { width: 100%; }
.whatsapp-history { margin-top: 18px; }
.whatsapp-history > summary { cursor: pointer; font-size: 17px; font-weight: 800; }
.whatsapp-history > summary small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.whatsapp-history > .table-wrap, .whatsapp-history > .empty { margin-top: 16px; }
.admin-stat span, .admin-stat strong { display: block; }
.admin-stat span { color: var(--muted); font-size: 11px; }
.admin-stat strong { font-size: 27px; margin-top: 4px; }
.split-grid { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(0,1.5fr); gap: 20px; align-items: start; }
.business-management { display: flex; flex-direction: column; gap: 20px; }
.business-list-card { order: 0; min-width: 0; }
.business-form-card { order: 1; scroll-margin-top: 115px; }
.business-management.is-editing .business-form-card { order: -1; }
.business-management .business-form-card > form { max-width: 780px; }
.business-page-links { flex-wrap: wrap; }
.business-list-table { min-width: 1080px; }
.business-list-table th:last-child, .business-list-table td:last-child { position: sticky; left: 0; z-index: 1; box-shadow: 5px 0 12px rgba(6,47,66,.09); }
.business-list-table th:last-child { z-index: 2; background: var(--navy); }
.business-list-table td:last-child { background: #fff; }
.business-list-table tbody tr:hover td:last-child { background: #f8fbfc; }
.business-activity-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.business-activity-filters .field { min-width: 170px; flex: 1 1 170px; margin: 0; }
.business-activity-filters .btn { min-height: 40px; }
.business-activity-table { min-width: 790px; }
.business-activity-table .table-actions { flex-wrap: wrap; white-space: normal; }
.activity-app-list { display: grid; gap: 7px; }
.activity-app-list > div { padding: 6px 9px; background: #f2f8fa; border-radius: 7px; }
.activity-app-list strong, .activity-app-list small { display: block; }
.activity-message-templates { margin: 16px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; }
.activity-message-templates summary { cursor: pointer; font-weight: 800; }
.activity-message-templates .field { margin-top: 10px; }
.code-note { direction: ltr; text-align: left; font-family: Consolas, monospace; background: #eff4f6; border-radius: 8px; padding: 9px; font-size: 11px; overflow-wrap: anywhere; }

/* Billing and collections application */
.billing-body .app-content { max-width: 1540px; }
.billing-filters { grid-template-columns: repeat(6,minmax(120px,1fr)); }
.billing-list-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e7eef2; text-decoration: none; }
.billing-list-link:last-child { border: 0; }
.billing-list-link span, .billing-list-link small { display: block; }
.billing-list-link small { color: var(--muted); font-size: 10px; }
.billing-lines-head, .billing-allocation-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin: 28px 0 12px; }
.billing-lines-head h3, .billing-allocation-head h3 { margin: 0; }
.billing-lines-head p, .billing-allocation-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.billing-lines { display: grid; gap: 10px; }
.billing-line { display: grid; grid-template-columns: 42px minmax(220px,2fr) minmax(90px,.7fr) repeat(5,minmax(90px,.65fr)) minmax(110px,.75fr) auto; gap: 9px; align-items: end; padding: 13px; background: #f8fbfc; border: 1px solid var(--line); border-radius: 12px; }
.line-number { width: 34px; height: 34px; display: grid; place-items: center; align-self: center; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; }
.billing-line .field { gap: 4px; }
.billing-line .field label { font-size: 10px; }
.billing-line input { min-height: 42px; padding: 7px 9px; }
.line-total { align-self: center; }
.line-total span, .line-total strong { display: block; }
.line-total span { color: var(--muted); font-size: 10px; }
.line-total strong { font-size: 15px; }
.line-remove { align-self: center; }
.document-kind-strip, .selected-customer { display: flex; align-items: center; gap: 14px; background: var(--blue-soft); border: 1px solid #c5deec; border-radius: 11px; padding: 13px 15px; margin-bottom: 18px; }
.document-kind-strip span, .selected-customer span { color: var(--muted); font-size: 12px; }
.document-kind-strip small, .selected-customer small { color: var(--muted); }
.selected-customer a { margin-right: auto; color: var(--blue); font-weight: 800; }
.billing-document-bottom { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.7fr); gap: 24px; margin-top: 24px; align-items: start; }
.billing-totals { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: #f8fbfc; }
.billing-totals > div:not(.field) { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; border-bottom: 1px solid #e4ecef; }
.billing-totals span { color: var(--muted); font-size: 12px; }
.billing-totals .billing-grand-total { border: 0; background: var(--navy); color: #fff; border-radius: 10px; padding: 13px; margin-top: 5px; }
.billing-totals .billing-grand-total span { color: #d8e8ef; }
.billing-totals .billing-grand-total strong { font-size: 19px; }
.allocation-preview { display: flex; flex-wrap: wrap; gap: 10px 25px; margin-top: 14px; padding: 13px 16px; background: var(--green-soft); border: 1px solid #b9e6d1; border-radius: 11px; }
.allocation-preview.invalid, .effect-preview.invalid { background: var(--red-soft); border-color: #efb1b1; color: var(--red); }
.installment-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; gap: 8px; margin-bottom: 8px; }
.installment-manage { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.installment-manage > summary { list-style: none; cursor: pointer; width: fit-content; }
.installment-manage > form { margin-top: 14px; }
.installment-manage > form + form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 14px; border-top: 1px dashed var(--line); }
.installment-manage > form + form input { flex: 1 1 240px; }
.billing-customer-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(340px,.65fr); gap: 20px; align-items: start; }
.receipt-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.receipt-kpis div { padding: 13px; background: #f7fafb; border: 1px solid var(--line); border-radius: 10px; }
.receipt-kpis span, .receipt-kpis strong { display: block; }
.receipt-kpis span { color: var(--muted); font-size: 11px; }
.receipt-kpis strong { font-size: 16px; }
.receipt-links { margin: 15px 0; }
.document-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: start; }
.document-actions form { margin: 0; }
.danger-details summary { list-style: none; }
.danger-details form { display: flex; gap: 8px; margin-top: 9px; }
.invoice-sheet { max-width: 1100px; margin-inline: auto; }
.invoice-sheet-head { display: flex; justify-content: space-between; gap: 30px; align-items: start; border-bottom: 2px solid var(--navy); padding-bottom: 18px; }
.invoice-sheet-head img { width: 130px; height: 65px; object-fit: contain; }
.invoice-sheet-head h2 { margin: 4px 0; }
.invoice-sheet-head p { margin: 0; color: var(--muted); }
.invoice-title { text-align: left; display: grid; justify-items: end; gap: 5px; }
.invoice-title > span:first-child { font-size: 20px; font-weight: 800; }
.invoice-title strong { font-size: 17px; direction: ltr; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; padding: 22px 0; }
.invoice-parties span { color: var(--muted); font-size: 11px; }
.invoice-parties strong { display: block; font-size: 18px; }
.invoice-parties p { margin: 2px 0; }
.invoice-parties dl, .invoice-summary dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 20px; margin: 0; }
.invoice-parties dd, .invoice-summary dd { margin: 0; text-align: left; }
.invoice-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.6fr); gap: 30px; margin-top: 20px; }
.invoice-summary h3 { margin: 0 0 5px; font-size: 15px; }
.invoice-summary p { margin: 0 0 14px; white-space: normal; }
.invoice-summary dl { padding: 15px; background: #f7fafb; border-radius: 11px; }
.invoice-summary .grand { border-top: 2px solid var(--navy); padding-top: 9px; font-weight: 900; font-size: 16px; }
.block-muted { display: block; color: var(--muted); }
.status-timeline { display: grid; gap: 0; }
.status-timeline > div { border-right: 3px solid var(--line); padding: 2px 18px 15px 0; }
.status-timeline p { display: inline; margin: 0 10px; color: var(--muted); font-size: 12px; }
.status-timeline small { display: block; margin-top: 5px; }

/* Billing reports, settings and print surfaces — phase 5 */
.settings-stack { display: grid; gap: 20px; }
.settings-fieldset { margin: 0; min-width: 0; }
.settings-fieldset:disabled { opacity: .78; }
.settings-fieldset:disabled input, .settings-fieldset:disabled textarea { background: #f5f8fa; }
.settings-note { margin: 18px 0 0; font-weight: 400; }
.report-filter-card { margin-bottom: 18px; }
.report-filters { grid-template-columns: 1fr 1fr minmax(220px,1.5fr) auto auto; margin-bottom: 8px; }
.report-scope { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.report-progress { height: 10px; }
.report-progress.red::-webkit-progress-value { background: var(--red); }
.report-progress.red::-moz-progress-bar { background: var(--red); }
.report-progress.green::-webkit-progress-value { background: var(--green); }
.report-progress.green::-moz-progress-bar { background: var(--green); }
.report-progress.blue::-webkit-progress-value { background: var(--blue); }
.report-progress.blue::-moz-progress-bar { background: var(--blue); }
.trend-grid { display: grid; gap: 12px; }
.trend-row { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 16px; align-items: center; padding: 11px 0; border-bottom: 1px solid #e6edf1; }
.trend-row:last-child { border-bottom: 0; }
.trend-row > div { display: grid; grid-template-columns: 70px minmax(100px,1fr) 130px; gap: 9px; align-items: center; font-size: 12px; }
.trend-row small { color: var(--muted); direction: ltr; text-align: left; }
.advance-strip { margin-top: 16px; border: 1px solid #efd18a; background: var(--amber-soft); border-radius: 11px; padding: 14px; display: grid; gap: 3px; }
.advance-strip span, .advance-strip small { color: #745000; font-size: 12px; }
.advance-strip strong { font-size: 21px; }
.report-rules { margin: 0; padding: 0 20px 0 0; display: grid; gap: 13px; color: var(--muted); font-size: 13px; }
.report-rules strong { color: var(--ink); }
.customer-statement-head { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 18px; border-top: 4px solid var(--blue); }
.customer-statement-head span, .customer-statement-head p { display: block; color: var(--muted); font-size: 12px; margin: 3px 0; }
.customer-statement-head strong { display: block; font-size: 18px; }
.statement-filters { grid-template-columns: 1fr 1fr auto; margin: 0; }
.statement-opening td { background: #eef5f8; font-weight: 800; }
.statement-table tfoot th { background: #eef5f8; color: var(--ink); font-size: 13px; }
.statement-advance { margin-top: 18px; }

.print-body { background: #edf3f6; padding: 24px; }
.print-actions { width: min(100%, 980px); margin: 0 auto 15px; display: flex; justify-content: flex-end; gap: 9px; }
.print-shell { width: min(100%, 980px); min-height: 1120px; margin: 0 auto; background: #fff; border: 1px solid var(--line); padding: 42px; box-shadow: var(--shadow); }
.print-brand { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 18px; border-bottom: 3px solid var(--navy); }
.print-brand > div { display: flex; gap: 18px; align-items: start; }
.print-brand img { width: 125px; height: 68px; object-fit: contain; }
.print-brand h1 { margin: 0; font-size: 23px; }
.print-brand p { margin: 1px 0; color: var(--muted); font-size: 12px; }
.print-brand dl, .print-parties dl, .print-summary dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 5px 18px; font-size: 12px; }
.print-brand dd, .print-parties dd, .print-summary dd { margin: 0; text-align: left; }
.print-title { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 0; }
.print-title div { display: grid; gap: 2px; }
.print-title span:first-child { color: var(--muted); font-size: 13px; }
.print-title strong { font-size: 25px; }
.print-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; background: #f7fafb; border: 1px solid var(--line); border-radius: 12px; padding: 17px; margin-bottom: 20px; }
.print-parties span { color: var(--muted); font-size: 12px; }
.print-parties strong { display: block; font-size: 17px; }
.print-parties p { margin: 2px 0; font-size: 12px; }
.print-table table { min-width: 0; }
.print-summary { display: grid; grid-template-columns: 1fr minmax(300px,.7fr); gap: 30px; margin-top: 22px; }
.print-summary h3 { font-size: 14px; margin: 0 0 5px; }
.print-summary p { margin: 0 0 14px; font-size: 12px; }
.print-summary dl { padding: 15px; background: #f7fafb; border-radius: 11px; }
.print-summary .grand { border-top: 2px solid var(--navy); padding-top: 8px; font-size: 15px; font-weight: 900; }
.receipt-amount { border: 2px solid var(--green); border-radius: 12px; padding: 20px; text-align: center; margin: 22px 0; }
.receipt-amount span, .receipt-amount strong { display: block; }
.receipt-amount span { color: var(--muted); font-size: 13px; }
.receipt-amount strong { font-size: 31px; }
.print-allocations { box-shadow: none; }
.print-allocations table { min-width: 0; }
.print-allocations tfoot th { background: #eef5f8; color: var(--ink); }
.print-notes { margin-top: 18px; }
.print-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 70px; }
.print-signatures div { border-top: 1px solid var(--ink); padding-top: 8px; display: flex; justify-content: space-between; font-size: 12px; }
.print-generated { margin-top: 40px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.receipt-share-row { justify-content: flex-end; margin: -6px 0 12px; }

.permissions-layout { display:grid; grid-template-columns:minmax(240px,.75fr) minmax(0,2fr); gap:18px; align-items:start; }
.permission-users { display:grid; gap:9px; }
.permission-user { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:13px; border:1px solid var(--line); border-radius:12px; color:var(--ink); text-decoration:none; }
.permission-user > a:first-child { display:flex; justify-content:space-between; gap:12px; align-items:center; flex:1; color:inherit; text-decoration:none; }
.permission-user.active { border-color:var(--green); background:#effbf6; }
.permission-user > a:first-child > span { display:grid; gap:4px; }
.permission-user > a:first-child > span:last-child { text-align:left; justify-items:end; }
.permission-user small, .permission-choice small { color:var(--muted); }
.permission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
.permission-choice { display:flex; gap:11px; align-items:flex-start; padding:14px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.permission-choice input { margin-top:5px; accent-color:var(--green); }
.permission-choice span { display:grid; gap:3px; }
.permission-choice em { font-size:12px; color:var(--danger); font-style:normal; }
.permission-choice.disabled { background:#f5f7f8; opacity:.72; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid, .split-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: repeat(3,1fr); }
    .app-cards, .portal-cards { grid-template-columns: repeat(2,1fr); }
    .addon-grid { grid-template-columns: repeat(2,1fr); }
    .billing-line { grid-template-columns: 40px repeat(4,minmax(100px,1fr)); }
    .billing-line .line-description { grid-column: span 2; }
    .billing-customer-layout { grid-template-columns: 1fr; }
    .report-filters { grid-template-columns: repeat(3,1fr); }
    .trend-row > div { grid-template-columns: 55px 1fr 110px; }
}

@media (max-width: 900px) {
    .permissions-layout, .permission-grid { grid-template-columns: 1fr; }
    body { padding-bottom: 0; }
    body.mobile-menu-open { overflow: hidden; }
    .app-shell { display: block; }
    .app-sidebar { display: flex; position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw,330px); height: 100dvh; transform: translateX(105%); visibility: hidden; transition: transform .24s ease,visibility .24s; z-index: 90; box-shadow: -20px 0 55px rgba(3,24,34,.32); }
    .app-sidebar.is-open { transform: translateX(0); visibility: visible; }
    .app-topbar { min-height: 76px; padding: 12px 13px; position: sticky; }
    .app-body .client-command-bar { top: 76px; }
    .app-body.compact-app-header .client-command-bar { top: 0; }
    .si-app .client-command-bar { top: 0; }
    .catalog-body > main > .client-command-bar { top: 69px; }
    .client-command-bar { min-height: 50px; margin-bottom: 16px; padding: 5px; border-radius: 12px; gap: 6px; }
    .client-command-button { min-width: 42px; min-height: 42px; padding: 6px 8px; }
    .mobile-menu-toggle { min-width: 64px; min-height: 50px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--navy); display: grid; grid-template-columns: 20px auto; grid-template-rows: repeat(3,4px); align-content: center; justify-content: center; gap: 3px 7px; cursor: pointer; }
    .mobile-menu-toggle span { width: 20px; height: 2px; border-radius: 2px; background: currentColor; grid-column: 1; }
    .mobile-menu-toggle b { grid-column: 2; grid-row: 1 / 4; align-self: center; font-size: 10px; }
    .mobile-menu-close { width: 40px; height: 40px; margin: -12px -4px 8px auto; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; font-size: 27px; cursor: pointer; }
    .mobile-menu-overlay { display: block; position: fixed; inset: 0; z-index: 80; border: 0; background: rgba(2,20,29,.58); backdrop-filter: blur(2px); cursor: pointer; }
    .topbar-kicker { display: none; }
    .app-topbar h1 { font-size: 21px; }
    .user-chip { min-width: 0; max-width: 135px; padding: 6px 9px; }
    .user-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .app-content { padding: 18px 13px 35px; }
    html body.app-body .mobile-more-links.mobile-more-links,
    html body.app-body .mobile-nav.mobile-nav { display: none !important; }
    .mobile-more-links { display: none !important; }
    .mobile-more-links a, .mobile-more-links > button { flex: 0 0 auto; min-height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 11px; color: var(--navy); text-decoration: none; font-size: 11px; font-weight: 800; }
    .app-footer { display: none; }
    .mobile-nav { display: none !important; }
    .mobile-nav a, .mobile-nav form { min-width: 0; }
    .mobile-nav a, .mobile-nav button { min-width: 0; width: 100%; min-height: 52px; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; font-size: 10px; font-weight: 800; border: 0; background: transparent; padding: 2px; }
    .mobile-nav a span { width: 19px; height: 4px; border-radius: 4px; background: #b8c8d0; }
    .mobile-nav a.active { color: var(--blue); }
    .mobile-nav a.active span { background: var(--blue); }
    .section-head { align-items: start; flex-wrap: wrap; }
    .section-head h2 { font-size: 19px; }
    .card { padding: 16px; border-radius: 13px; box-shadow: none; }
    .metric-grid { gap: 9px; margin-bottom: 14px; }
    .metric { padding: 12px; }
    .metric strong { font-size: 18px; }
    .quick-grid { grid-template-columns: repeat(2,1fr); gap: 9px; }
    .quick-action { min-height: 92px; padding: 12px; }
    .form-grid, .form-grid.three, .secure-link-row { grid-template-columns: 1fr; gap: 13px; }
    .trial-layout { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .type-picker { grid-template-columns: repeat(2,1fr); gap: 7px; }
    .type-option span { padding: 11px 7px; font-size: 12px; }
    .btn-small { min-height: 42px; font-size: 11px; }
    .filters { grid-template-columns: repeat(2,1fr); }
    .mobile-records { display: grid; }
    .desktop-record-table { display: none; }
    .report-grid { grid-template-columns: 1fr; }
    .expiry-card { align-items: start; flex-direction: column; }
    .catalog-nav { padding: 10px 14px; }
    .catalog-links:not([data-catalog-menu]) a:not(.btn) { display: none; }
    .catalog-menu-toggle { display: grid; }
    .catalog-links[data-catalog-menu] { position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw,330px); padding: 72px 24px 24px; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 12px; transform: translateX(105%); visibility: hidden; transition: transform .24s ease,visibility .24s; z-index: 90; box-shadow: -20px 0 55px rgba(3,24,34,.32); }
    .catalog-links[data-catalog-menu].is-open { transform: translateX(0); visibility: visible; }
    .catalog-links[data-catalog-menu] a, .catalog-links[data-catalog-menu] > span { display: block; padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
    .catalog-links[data-catalog-menu] form, .catalog-links[data-catalog-menu] .btn { width: 100%; }
    .catalog-links[data-catalog-menu] .mobile-menu-close { position: absolute; top: 18px; right: 18px; }
    .catalog-logo img { width: 84px; }
    .catalog-hero { padding: 50px 18px; }
    .catalog-hero-inner { grid-template-columns: 1fr; gap: 25px; }
    .catalog-hero h1 { font-size: 38px; }
    .catalog-hero p { font-size: 14px; }
    .catalog-section { padding: 45px 14px; }
    .catalog-section-head { align-items: start; flex-direction: column; }
    .app-cards, .steps, .addon-grid, .policy-columns { grid-template-columns: 1fr; }
    .policy-strip { align-items: flex-start; flex-direction: column; gap: 9px; }
    .portal-cards { grid-template-columns: 1fr; }
    .product-visual { min-height: 122px; }
    .plan-hero { grid-template-columns: 1fr; gap: 18px; min-height: 190px; padding: 16px; border-radius: 18px; }
    .plan-hero-visual { width: 100%; height: clamp(165px,46vw,230px); border-radius: 14px; }
    .plan-hero-visual .app-illustration { width: 58px; height: 58px; }
    .plan-hero h1 { font-size: 27px; }
    .plan-grid { grid-template-columns: 1fr; }
    .catalog-footer-inner { flex-direction: column; }
    .admin-stats { grid-template-columns: repeat(2,1fr); }
    .billing-document-bottom, .invoice-summary { grid-template-columns: 1fr; }
    .billing-line { grid-template-columns: 34px 1fr 1fr; }
    .billing-line .line-description { grid-column: span 2; }
    .billing-line .line-remove { grid-column: -2 / -1; }
    .receipt-kpis { grid-template-columns: repeat(2,1fr); }
    .invoice-parties { grid-template-columns: 1fr; }
    .customer-statement-head, .print-brand, .print-parties, .print-summary { grid-template-columns: 1fr; flex-direction: column; }
    .trend-row { grid-template-columns: 1fr; }
    .trend-row > div { grid-template-columns: 65px 1fr 110px; }
    .print-body { padding: 0; }
    .print-shell { min-height: 0; padding: 20px; border: 0; box-shadow: none; }
    .print-actions { padding: 12px; margin: 0; }
    .billing-lines-head, .billing-allocation-head { align-items: start; flex-direction: column; }
    .installment-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
    .client-command-button span { display: none; }
    .client-install-button span { display: inline; }
    .client-install-button { padding-inline: 10px; }
    .install-help-dialog { padding: 24px 18px 20px; border-radius: 18px; }
    .install-help-dialog h2 { font-size: 20px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .metric small { display: none; }
    .metric strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: 16px; }
    .quick-grid { grid-template-columns: 1fr 1fr; }
    .filters { grid-template-columns: 1fr; }
    .section-head .btn { padding-inline: 10px; }
    .product-pricing { grid-template-columns: 1fr; }
    .scope-grid { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
}

@media print {
    .app-sidebar, .app-topbar, .mobile-nav, .app-footer, .btn, .filters, .no-print, .client-command-bar, .install-help-backdrop { display: none !important; }
    body { background: #fff; padding: 0; }
    .app-shell { display: block; }
    .app-content { padding: 0; max-width: none; }
    .card, .metric { box-shadow: none; break-inside: avoid; }
    .invoice-sheet { border: 0; padding: 0; max-width: none; }
    .invoice-items table { min-width: 0; }
    .print-body { padding: 0; background: #fff; }
    .print-shell { width: 100%; min-height: 0; border: 0; box-shadow: none; padding: 0; }
    .table-wrap { overflow: visible; }
    .report-grid { grid-template-columns: 1fr 1fr; }
    .customer-statement-head { box-shadow: none; }
}
