/* CreemHost billing — hand-written stylesheet (no framework, no CDN) */
:root {
  --ink: #14211b;
  --ink-2: #3d4b44;
  --ink-3: #6b7a72;
  --paper: #f6f4ef;
  --card: #ffffff;
  --line: #e3dfd6;
  --brand: #0f6b45;
  --brand-ink: #0a4a30;
  --brand-tint: #e6f2ec;
  --accent: #d98a1f;
  --danger: #b4332b;
  --danger-tint: #fbeceb;
  --ok: #1f7a4d;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }

/* ---------- Auth / installer shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 38%) 1fr; }
.shell-side { background: var(--brand-ink); color: #e9f1ec; padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.shell-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; border: 56px solid rgba(255,255,255,.05); }
.shell-side .mark { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.shell-side .mark span { color: var(--accent); }
.shell-side h2 { font-size: 1.9rem; font-weight: 600; max-width: 14ch; color: #fff; }
.shell-side p { color: #b9cdc2; max-width: 36ch; }
.shell-side .version { opacity: .6; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mb-0 { margin-bottom: 0; }
.actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 8px; }
.shell-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.panel { width: 100%; max-width: 440px; }
.panel.wide { max-width: 620px; }
.steps { display: flex; gap: 6px; margin-bottom: 28px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--brand); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; 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-tint); }
input.code-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .4em; text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-ink); text-decoration: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; font-size: .92rem; }
.alert.error { background: var(--danger-tint); color: var(--danger); border: 1px solid #f1c9c6; }
.alert.ok { background: var(--brand-tint); color: var(--brand-ink); border: 1px solid #c4e0d1; }
.alert ul { margin: 0; padding-left: 18px; }

.checklist { list-style: none; padding: 0; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.checklist li { display: flex; justify-content: space-between; padding: 9px 14px; border-top: 1px solid var(--line); font-size: .9rem; }
.checklist li:first-child { border-top: 0; }
.pill { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.pill.ok { background: var(--brand-tint); color: var(--ok); }
.pill.no { background: var(--danger-tint); color: var(--danger); }
.pill.warn { background: #fdf1df; color: #94600f; }
.pill.muted { background: #eeece6; color: var(--ink-3); }

/* ---------- Admin layout ---------- */
.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #12201a; color: #c9d6cf; padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .mark { color: #fff; font-weight: 700; padding: 0 10px 22px; display: block; }
.side .mark span { color: var(--accent); }
.side h6 { margin: 18px 10px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #6f8479; }
.side a, .side .soon { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 7px; color: #c9d6cf; font-size: .92rem; }
.side a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side a.active { background: rgba(217,138,31,.14); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.side .soon { color: #5d7167; cursor: default; }
.side .soon em { font-style: normal; font-size: .68rem; border: 1px solid #34463d; padding: 0 6px; border-radius: 99px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 2; }
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: .9rem; color: var(--ink-2); }
.topbar form { margin: 0; }
.content { padding: 28px; max-width: 1200px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: .85rem; color: var(--ink-3); font-weight: 500; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-body { padding: 18px; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.list th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: 10px 18px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 18px; border-bottom: 1px solid #f0ede6; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }

.qr-wrap { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; line-height: 0; }
.qr svg { width: 180px; height: 180px; }
.secret { font-family: var(--mono); background: #fff; border: 1px dashed var(--line); padding: 8px 10px; border-radius: 6px; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: var(--mono); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

details.alt { margin-top: 18px; font-size: .9rem; }
details.alt summary { cursor: pointer; color: var(--ink-3); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .shell-side { padding: 28px 24px; }
  .shell-side h2, .shell-side p { display: none; }
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
}

/* ---------- Phase 2 step 2: lists, forms, badges ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-3); font-size: .9rem; margin-top: 4px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { width: auto; min-width: 160px; padding: 7px 10px; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8f2620; }
.btn.light { background: var(--brand-tint); color: var(--brand-ink); }
.btn.light:hover { background: #d3e8dd; }
.inline { display: inline; margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 4px; margin: 0 0 18px; background: #fff; }
legend { font-weight: 700; font-size: .85rem; padding: 0 6px; color: var(--ink-2); }
.check { display: flex; gap: 8px; align-items: center; font-size: .92rem; margin-bottom: 14px; }
.check input { width: auto; }
.field .error { color: var(--danger); font-size: .8rem; margin-top: 4px; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
table.list tr.click:hover td { background: #faf9f5; }
table.list input, table.list select { padding: 6px 8px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; text-transform: capitalize; background: #eeece6; color: var(--ink-2); }
.badge.active, .badge.paid, .badge.approved, .badge.online { background: var(--brand-tint); color: var(--ok); }
.badge.pending, .badge.unpaid, .badge.draft, .badge.on_hold { background: #fdf1df; color: #94600f; }
.badge.suspended, .badge.overdue, .badge.rejected, .badge.fraud, .badge.offline { background: var(--danger-tint); color: var(--danger); }
.badge.cancelled, .badge.terminated, .badge.closed, .badge.refunded, .badge.hidden, .badge.retired { background: #eeece6; color: var(--ink-3); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.empty { padding: 28px 18px; text-align: center; color: var(--ink-3); }
.total-line { font-size: 1.3rem; font-weight: 700; }
.danger-zone { border-color: #f1c9c6; }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4, .split { grid-template-columns: 1fr; } }
details.inline-details { display: inline-block; position: relative; }
details.inline-details > summary { list-style: none; }
details.inline-details > summary::-webkit-details-marker { display: none; }
details.inline-details .pop { position: absolute; right: 0; top: 40px; z-index: 5; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 10px 30px rgba(20,33,27,.12); }
table.list td.error { color: var(--danger); font-weight: 600; }
/* sidebar ka rang poore page ki lambai tak */
.admin { background: linear-gradient(to right, #12201a 236px, transparent 236px); }
@media (max-width: 860px) { .admin { background: none; } }
/* ---------- Phase 2 step 3 ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--ink-3); font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.row-form { display: flex; gap: 6px; margin: 0; }
.row-form input { width: 130px; padding: 6px 8px; }
.row-form input[type=text] { width: 170px; }
.actions-cell { white-space: nowrap; }
.audit-json { max-width: 380px; word-break: break-all; color: var(--ink-3); }
.stat.attention { border-color: #ecc58a; background: #fffaf1; }
.side .count { font-size: .7rem; background: var(--accent); color: #12201a; font-weight: 700; padding: 0 7px; border-radius: 99px; }
a.stat { color: inherit; } a.stat:hover { text-decoration: none; border-color: var(--brand); }
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--brand); letter-spacing: -.04em; line-height: 1; margin-bottom: 12px; }
