/* NexusBilling 1.1 — one stylesheet for the admin and the client area.
   Colours are variables; dark = [data-theme="dark"] or the system setting. No inline styles anywhere (CSP). */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f7f9fc; --line: #e4e9f2; --line-strong: #d3dae8; --text: #141b2d; --muted: #5f6b85;
  --primary: #3d5afe; --primary-2: #6a48f5; --primary-ink: #ffffff; --primary-soft: #eaeeff;
  --green: #0e8a5f; --green-soft: #dff5ec; --red: #cf3a2e; --red-soft: #fde8e6; --orange: #a86200; --orange-soft: #fff0d4;
  --blue: #1d6ae5; --blue-soft: #e3eeff; --gray-soft: #edf0f6;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 27, 45, .04), 0 6px 20px rgba(20, 27, 45, .05);
  --shadow-lg: 0 2px 6px rgba(20, 27, 45, .06), 0 18px 44px rgba(20, 27, 45, .10);
  --side: #0f1528; --side-2: #161e36; --side-text: #aab4cf; --side-line: #1f2946;
  --hero-1: #0d1330; --hero-2: #1b2466;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --surface: #141a2e; --surface-2: #19203a; --line: #242d4a; --line-strong: #323d60; --text: #e8ecf6; --muted: #98a4c0;
    --primary: #7088ff; --primary-2: #9a7bff; --primary-ink: #0b1020; --primary-soft: #1f2850;
    --green: #4fd3a3; --green-soft: #123629; --red: #ff8f84; --red-soft: #45201d; --orange: #f5ba62; --orange-soft: #3e2f10;
    --blue: #82b4ff; --blue-soft: #172a4c; --gray-soft: #202842;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 44px rgba(0, 0, 0, .45);
    --side: #080c1a; --side-2: #121a30; --side-line: #18203a; --hero-1: #080c1a; --hero-2: #1a2260;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --surface: #141a2e; --surface-2: #19203a; --line: #242d4a; --line-strong: #323d60; --text: #e8ecf6; --muted: #98a4c0;
  --primary: #7088ff; --primary-2: #9a7bff; --primary-ink: #0b1020; --primary-soft: #1f2850;
  --green: #4fd3a3; --green-soft: #123629; --red: #ff8f84; --red-soft: #45201d; --orange: #f5ba62; --orange-soft: #3e2f10;
  --blue: #82b4ff; --blue-soft: #172a4c; --gray-soft: #202842;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 44px rgba(0, 0, 0, .45);
  --side: #080c1a; --side-2: #121a30; --side-line: #18203a; --hero-1: #080c1a; --hero-2: #1a2260;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .55em; letter-spacing: -.01em; font-weight: 700; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.03rem; } h4 { font-size: .82rem; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.ic { flex: 0 0 auto; vertical-align: -4px; }
.muted { color: var(--muted); } .center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mb0 { margin-bottom: 0; }
.hidden { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.lead { color: var(--muted); font-size: 1.05rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; line-height: 1.2; background: var(--gray-soft); color: var(--text); transition: transform .08s, box-shadow .15s, background .15s, border-color .15s; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: 0 6px 16px -6px var(--primary); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-light { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-light:hover { border-color: var(--primary); color: var(--primary); filter: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-light { background: var(--red-soft); color: var(--red); }
.btn-success { background: var(--green); color: #fff; }
.btn-white { background: #fff; color: #1b2466; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .86rem; border-radius: 8px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.inline-form { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; font-weight: 500; }
.linklike:hover { color: var(--primary); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------- cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card .card { box-shadow: none; background: var(--surface-2); }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h1, .card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 18px; }

.stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: inherit; transition: border-color .15s, transform .12s, box-shadow .15s; }
a.stat:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-tile { display: flex; align-items: center; gap: 14px; }
.stat-ic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-ic .ic { width: 22px; height: 22px; }
.stat-body { min-width: 0; }
.stat-num { display: block; font-size: 1.75rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { display: block; color: var(--muted); font-size: .88rem; margin-top: 3px; }
.stat-red .stat-num { color: var(--red); } .stat-green .stat-num { color: var(--green); } .stat-orange .stat-num { color: var(--orange); }
.stat-red .stat-ic { background: var(--red-soft); color: var(--red); } .stat-green .stat-ic { background: var(--green-soft); color: var(--green); } .stat-orange .stat-ic { background: var(--orange-soft); color: var(--orange); }
.card .stat { box-shadow: none; background: var(--surface-2); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; box-shadow: var(--shadow); }
.card .table-wrap { border-radius: var(--radius-sm); margin-bottom: 0; box-shadow: none; }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--surface-2); font-weight: 650; white-space: nowrap; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table td.right, .table th.right { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions > * { margin-left: 4px; }
.table td.check, .table th.check { width: 1%; padding-right: 0; }
.table .check input { width: 18px; height: 18px; margin: 0; display: block; }
.table tfoot td { font-weight: 650; background: var(--surface-2); }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); }
dl.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; word-break: break-word; font-weight: 500; }

/* ---------- badges, alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650; white-space: nowrap; background: var(--gray-soft); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); } .badge-red { background: var(--red-soft); color: var(--red); }
.badge-orange { background: var(--orange-soft); color: var(--orange); } .badge-blue { background: var(--blue-soft); color: var(--blue); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); border-left-width: 4px; }
.alert-ok, .alert-success { background: var(--green-soft); color: var(--green); border-color: transparent; border-left-color: var(--green); }
.alert-error { background: var(--red-soft); color: var(--red); border-color: transparent; border-left-color: var(--red); }
.alert-info { background: var(--blue-soft); color: var(--blue); border-color: transparent; border-left-color: var(--blue); }
.alert-warn { background: var(--orange-soft); color: var(--orange); border-color: transparent; border-left-color: var(--orange); }

/* ---------- forms ---------- */
.field { margin-bottom: 15px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .88rem; }
.field-check label { font-weight: 500; display: flex; gap: 9px; align-items: flex-start; font-size: .95rem; }
.field-check input { margin-top: 4px; accent-color: var(--primary); }
.req { color: var(--red); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; min-width: 0; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 260px; }
.toolbar form.inline-form { flex: 0 0 auto; display: inline; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 140px; max-width: 260px; }
.toolbar .spacer { flex: 1 1 auto; }
.input-row { display: flex; gap: 8px; } .input-row > :first-child { flex: 1 1 auto; }

/* ---------- tabs, pager ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; white-space: nowrap; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs-pill { border-bottom: 0; gap: 8px; }
.tabs-pill a { border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 16px; background: var(--surface); margin: 0; }
.tabs-pill a.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0; }
.pager a, .pager-current { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.pager-current { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.pager .muted { margin-left: 8px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--text); white-space: nowrap; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 600; color: var(--muted); font-size: .72rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #3d5afe, #6a48f5); color: #fff; box-shadow: 0 6px 14px -6px #3d5afe; }
.brand-mark .ic { width: 19px; height: 19px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.chip .ic { width: 16px; height: 16px; }
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; padding: 11px 9px; flex-direction: column; justify-content: space-between; }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- admin shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--side); color: var(--side-text); padding: 16px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--side-line); }
.sidebar .brand { color: #fff; padding: 4px 8px 16px; }
.sidebar nav { flex: 1 1 auto; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #6b779a; padding: 16px 12px 6px; font-weight: 700; }
.nav-link, .nav-group summary { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--side-text); cursor: pointer; font-weight: 500; margin-bottom: 2px; }
.nav-link .ic, .nav-group summary .ic { width: 18px; height: 18px; opacity: .85; }
.nav-link:hover, .nav-group summary:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav-link.is-active { background: linear-gradient(135deg, rgba(61, 90, 254, .32), rgba(106, 72, 245, .22)); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #7088ff; }
.nav-group summary { list-style: none; position: relative; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(-45deg); transition: transform .15s; opacity: .7; }
.nav-group[open] summary::after { transform: translateY(-80%) rotate(45deg); }
.nav-group[open] summary { color: #fff; }
.nav-sub { padding: 7px 12px 7px 41px; font-size: .9rem; position: relative; }
.nav-sub.is-active { box-shadow: none; background: var(--side-2); }
.nav-sub.is-active::before { content: ""; position: absolute; left: 20px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #7088ff; transform: translateY(-50%); }
.sidebar-foot { font-size: .76rem; color: #6b779a; padding: 14px 12px 4px; border-top: 1px solid var(--side-line); margin-top: 12px; line-height: 1.7; }
.sidebar-foot a { color: var(--side-text); }
.shell-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topsearch { flex: 1 1 auto; max-width: 460px; position: relative; }
.topsearch .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.topsearch input { padding-left: 38px; border-radius: 999px; background: var(--surface-2); border-color: var(--line); }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.main { flex: 1 1 auto; min-width: 0; padding: 26px 28px 40px; max-width: 1500px; width: 100%; }
.page-title { margin-bottom: 20px; font-size: 1.55rem; }
.auth-wrap { max-width: 430px; margin: 0 auto; padding: 48px 16px; }
.auth-wrap .card { padding: 26px; box-shadow: var(--shadow-lg); }
.auth-wide { max-width: 660px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 1.25rem; margin-bottom: 22px; letter-spacing: -.02em; }

/* ---------- client shell ---------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-head .wrap { max-width: 1400px; }
.site-head-in { display: flex; align-items: center; gap: 26px; min-height: 68px; }
.site-nav { display: flex; align-items: center; gap: 4px 18px; flex: 1 1 auto; flex-wrap: nowrap; white-space: nowrap; min-width: 0; }
.site-nav > a:not(.btn):not(.chip) { color: var(--text); padding: 6px 0; font-weight: 550; font-size: .95rem; position: relative; display: inline-flex; align-items: center; gap: 6px; }
.site-nav > a:not(.btn):not(.chip)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--primary); transform: scaleX(0); transition: transform .15s; }
.site-nav > a.is-active:not(.btn):not(.chip) { color: var(--primary); }
.site-nav > a.is-active:not(.btn):not(.chip)::after, .site-nav > a:not(.btn):not(.chip):hover::after { transform: scaleX(1); }
.site-nav > a:hover { text-decoration: none; color: var(--primary); }
.site-nav .ic { width: 18px; height: 18px; }
.site-nav-gap { flex: 1 1 auto; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: .74rem; font-weight: 700; text-align: center; line-height: 20px; }
.page { padding-top: 28px; padding-bottom: 56px; min-height: 62vh; }
.page-full { min-height: 62vh; padding-bottom: 20px; }
.flash-top { padding-top: 18px; }
.subnav { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 22px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.subnav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; color: var(--muted); white-space: nowrap; font-weight: 600; font-size: .93rem; }
.subnav a .ic { width: 17px; height: 17px; }
.subnav a.is-active { background: var(--primary-soft); color: var(--primary); }
.subnav a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.adminbar { background: var(--orange-soft); color: var(--orange); padding: 9px 0; font-size: .92rem; font-weight: 500; }
.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 44px 0 0; color: var(--muted); font-size: .93rem; margin-top: 30px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 30px; padding-bottom: 34px; }
.foot-grid h4 { text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-bottom: 12px; }
.foot-grid a:not(.brand) { display: block; color: var(--muted); padding: 4px 0; }
.foot-grid a:not(.brand):hover { color: var(--primary); text-decoration: none; }
.foot-grid p { margin-top: 12px; max-width: 300px; }
.foot-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 18px; font-size: .85rem; }

/* ---------- home ---------- */
.hero { color: #fff; background:
    radial-gradient(700px 380px at 85% 10%, rgba(122, 92, 255, .55), transparent 65%),
    radial-gradient(620px 420px at 5% 100%, rgba(47, 107, 255, .45), transparent 65%),
    linear-gradient(135deg, var(--hero-1), var(--hero-2));
  position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 44px 44px; }
.hero-in { position: relative; padding-top: 84px; padding-bottom: 130px; }
.hero-text { max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.1; letter-spacing: -.03em; margin-bottom: .4em; font-weight: 800; }
.hero p { color: rgba(255, 255, 255, .78); font-size: 1.12rem; max-width: 600px; margin: 0 auto 1.6em; }
.domain-search { display: flex; align-items: center; gap: 8px; max-width: 660px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 8px 8px 8px 16px; box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .5); }
.domain-search > .ic { color: #7a849c; width: 20px; height: 20px; }
.domain-search input[type="search"], .domain-search input[type="text"] { flex: 1 1 auto; border: 0; background: transparent; color: #141b2d; padding: 12px 4px; font-size: 1.04rem; box-shadow: none; }
.domain-search input:focus { box-shadow: none; }
.domain-search input::placeholder { color: #8791a8; }
.domain-search .btn { padding: 13px 24px; border-radius: 11px; }
.page .domain-search { box-shadow: var(--shadow); border: 1px solid var(--line-strong); margin-left: 0; }
.tld-strip { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0; margin: 26px 0 0; }
.tld-strip li { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
.tld-strip span { color: rgba(255, 255, 255, .75); margin-left: 4px; }
.section { padding-top: 56px; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-bottom: 56px; margin-top: 56px; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 30px; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.02em; margin-bottom: .3em; }
.section-head p { color: var(--muted); font-size: 1.04rem; margin: 0; }
.section.section-up { padding-top: 0; }
.feature-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: -64px; position: relative; }
.feature { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-lg); }
.feature h3 { margin-bottom: 4px; } .feature p { margin: 0; color: var(--muted); font-size: .93rem; }
.feature-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.tile { display: block; color: inherit; transition: transform .12s, border-color .15s, box-shadow .15s; }
.tile:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.tile h3 { margin-top: 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps p { margin: 0; color: var(--muted); }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #3d5afe, #6a48f5); color: #fff; font-weight: 800; margin-bottom: 12px; }
.news-item { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.news-item:first-of-type { border-top: 0; padding-top: 0; }
.cta { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; color: #fff; border-radius: 20px; padding: 34px;
  background: radial-gradient(500px 260px at 90% 0%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(135deg, #3d5afe, #6a48f5); box-shadow: 0 24px 50px -22px #3d5afe; }
.cta h2 { font-size: 1.5rem; margin-bottom: .2em; } .cta p { margin: 0; color: rgba(255, 255, 255, .85); }

/* ---------- plans ---------- */
.plans { align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 26px; transition: transform .12s, box-shadow .15s, border-color .15s; position: relative; }
.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan h3 { font-size: 1.15rem; margin-bottom: 10px; }
.plan-price { font-size: 2.1rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: .85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-desc { color: var(--muted); flex: 1 1 auto; margin: 12px 0 16px; white-space: pre-line; }
.plan-list { list-style: none; margin: 18px 0 22px; flex: 1 1 auto; border-top: 1px solid var(--line); padding: 16px 0 0; }
.plan-list li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.plan-list .ic { color: var(--green); width: 18px; height: 18px; margin-top: 2px; }
.plan-featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg); }
.plan-featured::before { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 4px; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.plan-out { opacity: .6; }

.choice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 12px; margin-bottom: 9px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.choice input { margin-top: 4px; }
.choice-main { flex: 1 1 auto; } .choice-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.totals { margin-left: auto; max-width: 380px; width: 100%; }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.totals div.grand { font-size: 1.3rem; font-weight: 800; border-bottom: 0; padding-top: 12px; }

.msg { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--surface-2); font-size: .9rem; border-bottom: 1px solid var(--line); }
.msg-body { padding: 16px; word-break: break-word; }
.msg-staff { border-left: 3px solid var(--primary); } .msg-staff .msg-head { background: var(--primary-soft); }
.msg-note { border-style: dashed; } .msg-note .msg-head { background: var(--orange-soft); }

.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--primary); } .chart .bar-2 { fill: var(--green); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .axis { stroke: var(--line-strong); }
progress { width: 100%; height: 10px; border-radius: 999px; overflow: hidden; border: 0; background: var(--gray-soft); accent-color: var(--primary); }
progress::-webkit-progress-bar { background: var(--gray-soft); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

/* ---------- invoice ---------- */
.invoice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.invoice-head address { font-style: normal; white-space: pre-line; }
.invoice-status { font-size: 1.3rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.invoice-status.is-paid { color: var(--green); } .invoice-status.is-unpaid, .invoice-status.is-overdue { color: var(--red); } .invoice-status.is-cancelled, .invoice-status.is-refunded, .invoice-status.is-draft { color: var(--muted); }
.print-page { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 28px; }

/* ---------- pieces added by the page authors ---------- */
.items-edit td.col-desc { min-width: 230px; }
.items-edit td.col-amount { min-width: 110px; }
.items-edit td.col-amount input { text-align: right; }
.items-edit td small { display: block; margin-top: 4px; }
.chart-wrap, .chart-scroll { overflow-x: auto; }
.chart-wrap .chart { min-width: 560px; }
.chart-scroll .chart { min-width: 600px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  body.client .nav-toggle { display: flex; }
  .site-head-in { flex-wrap: wrap; justify-content: space-between; gap: 12px; min-height: 60px; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 16px; }
  body.nav-open .site-nav { display: flex; }
  .site-nav > a:not(.btn):not(.chip) { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .site-nav > a:not(.btn):not(.chip)::after { display: none; }
  .site-nav .chip, .site-nav .btn, .site-nav .inline-form { align-self: flex-start; margin-top: 10px; }
  .site-nav-gap { display: none; }
}
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-side, .feature-row, .steps { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-toggle { display: flex; }
  .topsearch { display: none; }
  .topbar { padding: 0 14px; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; transform: translateX(-105%); transition: transform .2s; width: 280px; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(5, 8, 20, .55); }
  .main { padding: 18px 14px 32px; }
  .site-head-in { flex-wrap: wrap; justify-content: space-between; gap: 12px; min-height: 60px; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 16px; }
  body.nav-open .site-nav { display: flex; }
  .site-nav > a:not(.btn):not(.chip) { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .site-nav > a:not(.btn):not(.chip)::after { display: none; }
  .site-nav .chip, .site-nav .btn, .site-nav .inline-form { align-self: flex-start; margin-top: 10px; }
  .site-nav-gap { display: none; }
  .hero-in { padding-top: 54px; padding-bottom: 110px; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .grid-2, .form-grid, .form-grid-3, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-right .chip:not(.chip-btn):not([data-theme-toggle]) { display: none; }
  .domain-search { flex-wrap: wrap; padding: 10px; border-radius: 14px; }
  .domain-search > .ic { display: none; }
  .domain-search input[type="search"], .domain-search input[type="text"] { flex-basis: 100%; padding: 10px 6px; }
  .domain-search .btn { width: 100%; }
  dl.kv { grid-template-columns: 1fr; gap: 0; } dl.kv dt { margin-top: 10px; font-size: .84rem; }
  .card { padding: 16px; } .plan { padding: 20px; }
  .toolbar input, .toolbar select { max-width: none; flex-basis: 100%; }
  .cta { padding: 24px; border-radius: 16px; }
  .stat-num { font-size: 1.45rem; }
  .section { padding-top: 40px; }
  .news-item { flex-direction: column; gap: 2px; }
}
@media (max-width: 420px) { .grid-4 { grid-template-columns: minmax(0, 1fr); } }
@media print {
  .topbar, .sidebar, .site-head, .site-foot, .subnav, .no-print, .alert, .adminbar { display: none !important; }
  body { background: #fff; } .card { box-shadow: none; border: 0; padding: 0; } .main, .page { padding: 0; }
}
