/* Capy admin: a work tool, not a toy. Cocoa sidebar, cream workspace, caramel accent, solid colors only.
   Numbers read as one strip of figures, statuses as dots with text, tight 8px corners. */
:root {
  --brand: #D9762A; --brand-dark: #A9561B; --brand-soft: #FBEADB; --brand-text: #9C4F17;
  --success: #3F9A1F; --success-soft: #E4F3D8; --success-text: #2F7614;
  --red: #D8402F; --red-soft: #FBE1DC; --red-text: #B3311F;
  --gold: #E5A11A; --gold-soft: #FCF0D2;
  --text: #2E1E14; --muted: #7D6556; --faint: #A8917F;
  --bg: #F7F2EC; --surface: #FFFFFF; --border: #E8DCCF; --border-strong: #D2BFAC; --locked: #EEE5DA;
  --side: #2B1D14; --side-text: #E9DCCF; --side-muted: #9C8573; --side-hover: #3A281C; --side-active: #4A3324;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #E8893A; --brand-dark: #B5601F; --brand-soft: #3A2618; --brand-text: #F2A464;
    --success-soft: #1F3313; --success-text: #8BD65A; --red-soft: #3F1C18; --red-text: #FF8A7D; --gold-soft: #3A2E12;
    --text: #F6EBDF; --muted: #B59C88; --faint: #8A7363; --bg: #1A130F; --surface: #241A14; --border: #3B2C22; --border-strong: #54402F; --locked: #33271F;
    --side: #120D0A; --side-hover: #22180F; --side-active: #2E2117;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 800; }
h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 800; letter-spacing: -0.01em; }
a { color: var(--brand-text); }
.muted { color: var(--muted); margin: 4px 0 0; }
.small { font-size: 13px; }
pre { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border); padding: 14px; border-radius: var(--radius); font: 13px/1.55 ui-monospace, Menlo, monospace; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
aside { background: var(--side); color: var(--side-text); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand img { border-radius: 8px; background: var(--side-active); }
.brand strong { display: block; font-size: 17px; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 12px; color: var(--side-muted); }
nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-group { margin: 14px 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); }
.nav-group:first-child { margin-top: 0; }
nav a { text-decoration: none; color: var(--side-text); padding: 8px 10px; border-radius: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; border-left: 3px solid transparent; }
nav a:hover { background: var(--side-hover); }
nav a.active { background: var(--side-active); color: #fff; border-left-color: var(--brand); }
.logout { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--side-active); }
.logout p { margin: 0 0 8px; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 30px 40px 64px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.page-head .date { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Panels */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 20px; }

/* KPI strip: one panel, figures separated by hairlines. */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.tile { padding: 16px 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; }
.tile > p:first-child { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.tile .big { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .big + .muted { margin: 0; }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }
tr.dim td strong { color: var(--muted); }
td.actions { white-space: nowrap; text-align: right; }
table.features td:nth-child(2) { width: 120px; }
table.features td:nth-child(3) { width: 240px; }

/* Status: a dot and plain text instead of colored pills. */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; flex: none; }
.badge.live { color: var(--success-text); }
.badge.stub { color: var(--brand-text); }
.badge.off { color: var(--muted); }
.notice { background: var(--success-soft); color: var(--success-text); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 600; border-left: 3px solid var(--success); }
.notice.error { background: var(--red-soft); color: var(--red-text); border-left-color: var(--red); }
.notice.warn { background: var(--gold-soft); color: var(--brand-text); font-weight: 500; border-left-color: var(--gold); }

/* Buttons: rectangles with a solid lip, never capsules. */
.btn { display: inline-block; font: inherit; font-weight: 700; text-decoration: none; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 7px; padding: 8px 15px; box-shadow: 0 2px 0 var(--border-strong); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--brand); border-color: var(--brand-dark); color: #fff; box-shadow: 0 2px 0 var(--brand-dark); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--red-text); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--side-text); border-color: var(--side-active); box-shadow: none; }
.btn.ghost:hover { background: var(--side-hover); }
.inline { display: inline-block; margin: 0 4px 0 0; }

/* Switch: square-cornered track, solid colors. */
.switch { width: 46px; height: 26px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--locked); position: relative; cursor: pointer; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 4px; background: #fff; box-shadow: 0 1px 0 var(--border-strong); transition: left .15s; }
.switch.on { background: var(--brand); border-color: var(--brand-dark); }
.switch.on span { left: 23px; box-shadow: 0 1px 0 var(--brand-dark); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; }
.segmented button { font: inherit; font-weight: 700; font-size: 13px; padding: 6px 13px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; white-space: nowrap; }
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button.selected { background: var(--text); color: var(--surface); }
.segmented button:disabled { cursor: not-allowed; opacity: .5; }

/* Forms */
.form { display: grid; gap: 14px; max-width: 640px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 13px; }
input, select, textarea { font: inherit; font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 9px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
legend { font-weight: 800; padding: 0 6px; font-size: 13px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

/* Login and payment pages. */
body.pay { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side); }
.pay-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 30px; width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: center; }
.pay-card img { margin: 0 auto; }
.pay-card h1 { font-size: 22px; }
.pay-card label { text-align: left; }
.pay-card .btn { width: 100%; padding: 12px; }
.pay-card form { margin: 0; }
.eyebrow { text-transform: uppercase; font-size: 11px; font-weight: 800; color: var(--brand-text); margin: 0; letter-spacing: .08em; }
.amount { font-size: 34px; font-weight: 800; margin: 0; letter-spacing: -0.02em; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: static; height: auto; gap: 12px; }
  nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
  .nav-group { display: none; }
  nav a { border-left: none; }
  .logout { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .logout p { margin: 0; }
  main { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; gap: 4px; }
  .row-between { flex-direction: column; align-items: flex-start; }
  table.features td:nth-child(3) { width: auto; }
}

/* Launch checklist: switch or status on the left, text in the middle. */
table.launch td { vertical-align: top; }
table.launch td.check { width: 120px; padding-top: 14px; }
table.launch td p { margin: 4px 0 0; }
/* Native progress bar: the CSP forbids inline styles, so width comes from value/max. */
progress.meter { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--locked); overflow: hidden; margin: 4px 0 10px; display: block; }
progress.meter::-webkit-progress-bar { background: var(--locked); border-radius: 4px; }
progress.meter::-webkit-progress-value { background: var(--brand); border-radius: 4px; }
progress.meter::-moz-progress-bar { background: var(--brand); border-radius: 4px; }
.card .row-between h2 { margin: 0; }


/* Checkbox and radio rows (Уведомления): the box sits before its text instead of filling the line. */
.form label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0 16px 0 0; }
.form label.check input { width: auto; margin: 0; }
.form input[type="time"] { width: auto; }
