/* ZapoHost Panel — base styles (no inline styles: CSP forbids them) */
:root {
  /* ZapoHost logo palette: lime #c5fa57 + ink #142018 */
  --brand: #3f6212;        /* readable green for links/accents on white */
  --brand-dark: #142018;   /* logo ink */
  --brand-soft: #f1fbe0;
  --accent: #c5fa57;       /* logo lime — buttons, highlights */
  --accent-hover: #b4ef3d;
  --accent-ink: #000000;   /* black text on lime buttons */
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bg); padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.wrap { word-break: break-all; display: block; margin-top: .4rem; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-lg { font-size: 1.4rem; margin-bottom: 1.5rem; }
.brand-mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
}

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }

/* Guest / auth pages */
.guest { background: radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), var(--bg)); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 520px; padding: 2rem; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; font-size: .9rem; flex-wrap: wrap; }
.err-code { font-size: 3rem; font-weight: 800; color: var(--brand); line-height: 1; margin-bottom: .5rem; }

/* Forms */
.form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.form label { display: grid; gap: .35rem; font-weight: 500; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: .65rem .8rem; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.has-error input { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 400; }
.code-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.1rem; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* Alerts & badges */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; font-size: .92rem; }
.alert-success { background: var(--ok-soft); border-color: #a7f3d0; color: #065f46; }
.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.alert-info { background: var(--brand-soft); border-color: #d9f99d; color: #365314; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* Client layout */
.topbar {
  display: flex; align-items: center; gap: 2rem; padding: .8rem 1.5rem;
  background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.mainnav { display: flex; gap: 1.25rem; flex: 1; }
.mainnav a { color: var(--muted); font-weight: 500; }
.mainnav a:hover { color: var(--text); text-decoration: none; }
.usermenu { display: flex; align-items: center; gap: .75rem; }
.usermenu form, .sidebar-foot form { margin: 0; }
.container { max-width: 1320px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-head { margin-bottom: 1.5rem; }
.soon { opacity: .45; pointer-events: none; }
@media (max-width: 760px) { .mainnav { display: none; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); display: grid; gap: .2rem; }
.stat-num { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-warn { border-color: #fcd34d; background: var(--warn-soft); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.table td { padding: .65rem .6rem; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }

/* Admin layout */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #ffffff; border-right: 1px solid var(--border); color: var(--text); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: var(--text); }
.sidebar nav { display: grid; gap: .15rem; flex: 1; align-content: start; }
.sidebar nav a { color: #334155; padding: .5rem .7rem; border-radius: 6px; font-weight: 500; }
.sidebar nav a:hover { background: #f1f5f9; color: var(--text); text-decoration: none; }
.nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 1rem .7rem .3rem; }
.sidebar-foot { display: grid; gap: .5rem; }
.sidebar-foot .btn-ghost { color: var(--text); border-color: var(--border); }
.sidebar-foot .btn-ghost:hover { background: #f1f5f9; }
.admin-main { padding: 2rem; max-width: none; min-width: 0; }
.admin-main.wide { max-width: none; }
@media (max-width: 860px) { .admin { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }

.steps { padding-left: 1.2rem; display: grid; gap: .5rem; }
.secret { font-size: 1rem; letter-spacing: .05em; background: var(--brand-soft); color: var(--brand-dark); }
details summary { cursor: pointer; }

/* ---------- Stage 1 components ---------- */
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }
.btn-col { display: grid; gap: .5rem; }
.btn-col form { margin: 0; }
.right { text-align: right; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.big { font-size: 1.6rem; font-weight: 700; margin: .2rem 0 1rem; }
.help { color: var(--muted); font-size: .8rem; font-weight: 400; }
.note { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; margin: .75rem 0; }
.narrow { max-width: 640px; }
.dim td { opacity: .5; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 1.25rem; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 1.25rem; }
.pad { padding: 1.1rem 1.25rem; }
.card.flush h2.pad { margin: 0; padding-bottom: .5rem; }
.form.compact { gap: .65rem; margin-top: .5rem; }
.form.inline { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.form.inline label { flex: 1 1 140px; }
.actions { display: flex; gap: .5rem; }
label.check { display: flex !important; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: auto; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .grid-2-1 { grid-template-columns: 1fr; } }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: .4rem 1rem; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.searchbar { display: flex; gap: .5rem; margin-bottom: 1rem; max-width: 520px; }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.pager { display: flex; gap: .3rem; margin: 1rem 0; }
.pager a, .pager span { padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: .88rem; }
.pager .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.table.small td, .table.small th { padding: .45rem .4rem; font-size: .86rem; }
.table tfoot td { border-bottom: 0; padding-top: .4rem; padding-bottom: .4rem; }
.table tfoot tr.total td { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
.table.pricing input { width: 92px; padding: .4rem .5rem; }
.table.lines input { padding: .45rem .6rem; }
.w-amount { width: 160px; }
fieldset.module-fields { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin: 1rem 0 0; }
fieldset.module-fields legend { padding: 0 .4rem; font-weight: 600; }
.mainnav a.active, .sidebar nav a.active { color: var(--brand); }
.sidebar nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cart-link { font-weight: 500; color: var(--text); }
.cart-link .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; }
a.stat { color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--brand); }

/* Store */
.store-group { margin-bottom: 2rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.plan { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.plan h3 { margin: 0; font-size: 1.15rem; }
.plan-price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.plan-price .muted { font-size: 1rem; font-weight: 500; }
.plan .btn { margin-top: auto; }
.features { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .4rem; font-size: .93rem; }
.features li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: .5rem; }
.cycle-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.cycle-option { display: grid !important; gap: .15rem !important; border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; cursor: pointer; position: relative; }
.cycle-option input { position: absolute; opacity: 0; }
.cycle-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cycle-name { font-weight: 600; }
.cycle-price { font-size: 1.15rem; font-weight: 700; }
.currency-switch { display: flex; gap: .3rem; }
.promo-form { display: flex; gap: .5rem; border-top: 1px solid var(--border); }
.promo-form input { max-width: 220px; }
.summary { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin: 0 0 1rem; }
.summary dd { margin: 0; text-align: right; }
.summary .total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.btn-paypal { background: #ffc439; color: #111; margin-top: .5rem; }
.btn-paypal:hover { background: #f2b52e; }
.table th.right, .table td.right { text-align: right; }
.card.form { margin-top: 0; }
.grid-2 > label, .grid-3 > label { align-content: start; }

/* ---------- Stage 2: domains ---------- */
.domain-search { display: flex; gap: .6rem; padding: 1rem; }
.domain-search input { font-size: 1.1rem; }
.domain-results td { vertical-align: middle; }
.transfer-box summary { list-style: none; display: inline-flex; }
.transfer-box summary::-webkit-details-marker { display: none; }
.transfer-box[open] form { margin-top: .5rem; min-width: 220px; }
.domain-options { display: grid; gap: .4rem; margin-bottom: .5rem; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row form { margin: 0; }
.inline-action { margin: -0.5rem 0 1.25rem; }
.w-small { width: 80px !important; }
.warn-row td { background: var(--warn-soft); }
.promo-tag { display: inline-block; background: #fee2e2; color: #b91c1c; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
details.sub { border: 1px solid var(--border); border-radius: 8px; padding: .7rem .9rem; margin: .5rem 0 1rem; }
details.sub[open] summary { margin-bottom: .5rem; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 0 0 1rem; }
.filters input[type=search] { max-width: 260px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* TLD pricing: full-width table, sync box on top */
.tld-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
@media (max-width: 1000px) { .tld-top { grid-template-columns: 1fr; } }
.table.pricing input[type=number] { width: 92px; padding: .4rem .5rem; }
.table.pricing select { padding: .35rem .4rem; }
.table.pricing td, .table.pricing th { padding: .55rem .6rem; }
.filters { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem; }
.sync-card { padding: 1rem 1.25rem; }
.sync-card h2 { margin: 0; font-size: 1.05rem; }
.sync-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.sync-card .dl { margin: 0; }
.filters input[type=search] { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .7rem; font: inherit; min-width: 220px; }
.table.pricing select { min-width: 130px; }
.bulk-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* Logo */
.logo { display: block; height: 32px; width: auto; }
.brand-lg .logo { height: 40px; }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: .35rem; }
.sidebar .logo { height: 28px; }
.brand-sub { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; justify-content: flex-end; }
.inline-form input[type=text] { width: 11rem; padding: .35rem .55rem; }
.form-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.form-inline input[type=email] { width: 18rem; padding: .35rem .55rem; }
/* tickets */
.thread { display: grid; gap: .9rem; margin-bottom: 1.25rem; }
.msg { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; }
.msg header { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .5rem; }
.msg header .small { margin-left: auto; }
.msg-staff { border-left: 4px solid var(--accent); }
.msg-client { border-left: 4px solid #cbd5e1; }
.msg-note { background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b; }
.msg-body { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.attachments { margin: .75rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.narrow-form { max-width: 900px; }
.nav-count { display: inline-block; min-width: 1.3rem; padding: 0 .4rem; margin-left: .35rem; border-radius: 999px; background: var(--danger, #dc2626); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.3rem; }
.ticket-side .dl { grid-template-columns: 100px 1fr; }
.preview-box { border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; background: #fff; }
.code-area { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
ul.plain { list-style: none; padding: 0; margin: .25rem 0 1rem; display: grid; gap: .35rem; }
.qr { display: block; margin: .25rem 0 1rem; border: 1px solid var(--border); border-radius: 10px; image-rendering: pixelated; width: 228px; height: 228px; }
