/* Admin panel — same theme variables as the site. */
:root {
  --serif: "Fraunces", Georgia, serif; --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --text: var(--ink); --muted: rgb(var(--ink-rgb) / .62); --line: rgb(var(--ink-rgb) / .12);
  --glass-bg: rgb(var(--tint-rgb) / .62); --glass-line: rgb(255 255 255 / .6); --field: rgb(var(--tint-rgb) / .8);
  --r: 16px;
}
@media (prefers-color-scheme: dark) { :root:not([data-mode=light]) { --glass-line: rgb(255 255 255 / .08); --field: rgb(255 255 255 / .05); } }
:root[data-mode=dark] { --glass-line: rgb(255 255 255 / .08); --field: rgb(255 255 255 / .05); }
* { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.55 var(--sans); color: var(--text); background: var(--bg);
  background-image: radial-gradient(1000px 500px at 100% 0, rgb(var(--accent-rgb) / .12), transparent 60%), radial-gradient(800px 500px at 0 100%, rgb(var(--accent2-rgb) / .08), transparent 60%); background-attachment: fixed; }
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; margin: 0 0 .8rem; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.lead { font-size: 1.02rem; max-width: 70ch; }
.glass { background: var(--glass-bg); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); border: 1px solid var(--glass-line); box-shadow: 0 16px 40px -26px rgb(var(--ink-rgb) / .45); }
.logo-dark { display: none; }
:root[data-mode=dark] .logo-light { display: none; } :root[data-mode=dark] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-mode=light]) .logo-light { display: none; } :root:not([data-mode=light]) .logo-dark { display: block; } }

/* layout */
.side { position: fixed; inset: 12px auto 12px 12px; width: 230px; border-radius: 22px; padding: 18px 12px; display: flex; flex-direction: column; z-index: 20; }
.side-brand { display: flex; flex-direction: column; gap: 4px; padding: 4px 10px 16px; text-decoration: none; color: var(--muted); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.side-brand img { height: 44px; width: auto; align-self: flex-start; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 500; }
.side nav a:hover { background: rgb(var(--accent-rgb) / .1); }
.side nav a.on { background: var(--accent); color: #fff; }
.badge { background: var(--accent2); color: #fff; font-size: .72rem; border-radius: 99px; padding: 1px 8px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.side-foot a, .link { color: var(--text); text-decoration: none; font-size: .9rem; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-family: inherit; }
.side-open { display: none; }
.main { margin-left: 254px; padding: 28px clamp(16px, 3vw, 40px) 80px; max-width: 1400px; }
.main-head h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }

/* panels & grids */
.panel { border-radius: 20px; padding: 20px 22px; margin-bottom: 18px; }
.narrow-panel { max-width: 760px; }
.cards4, .cards3 { display: grid; gap: 14px; margin-bottom: 18px; }
.cards4 { grid-template-columns: repeat(4, 1fr); } .cards3 { grid-template-columns: repeat(3, 1fr); }
.kpi { display: flex; flex-direction: column; gap: 2px; border-radius: 18px; padding: 16px 18px; text-decoration: none; color: var(--text); }
.kpi strong { font: 400 2.3rem/1.1 var(--serif); color: var(--accent); }
.kpi .kpi-text { font-size: 1.5rem; }
.kpi-alert strong { color: var(--accent2); }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sticky { position: sticky; top: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row2 .grow { grid-column: span 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { padding: .45rem .85rem; border-radius: 99px; text-decoration: none; color: var(--text); border: 1px solid var(--line); font-size: .9rem; }
.tabs a.on { background: var(--accent); color: #fff; border-color: transparent; }

/* forms */
.field { margin-bottom: 14px; display: flex; flex-direction: column; }
label { font-weight: 600; font-size: .86rem; margin-bottom: 5px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: .62rem .8rem; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=color] { width: 44px; height: 34px; padding: 2px; }
input[type=file] { padding: .45rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgb(var(--accent-rgb) / .5); border-color: transparent; }
textarea { resize: vertical; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; margin: 6px 0; }
.small-field { max-width: 140px; }
form.inline { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.inline input[type=search] { width: 220px; }
form.inline select { width: auto; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: .5rem; cursor: pointer; font-weight: 500; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; max-height: 300px; overflow: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }

/* buttons */
.btn, .btn-sm { display: inline-flex; align-items: center; justify-content: center; gap: .4em; font: 600 .95rem var(--sans); background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: 99px; padding: .65rem 1.2rem; cursor: pointer; text-decoration: none; }
.btn-sm { font-size: .82rem; padding: .38rem .8rem; }
.btn.ghost, .btn-sm.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-sm.danger { background: transparent; color: #c0392b; border-color: rgb(192 57 43 / .35); }
.btn.wide { width: 100%; margin-bottom: 8px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* flash & status */
.flash { border-radius: 14px; padding: .8rem 1rem; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: rgb(46 160 90 / .12); border-color: rgb(46 160 90 / .35); }
.flash-error { background: rgb(200 50 50 / .12); border-color: rgb(200 50 50 / .4); }
.flash-info { background: rgb(var(--accent-rgb) / .1); border-color: rgb(var(--accent-rgb) / .35); }
.status { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--line); }
.status-published, .status-approved { background: rgb(46 160 90 / .16); color: #1e8a4a; }
.status-pending { background: rgb(var(--accent2-rgb) / .18); color: var(--accent2); }
.status-rejected, .status-hidden { background: rgb(200 50 50 / .12); color: #c0392b; }

/* tables & lists */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .num { text-align: right; }
.table tr.is-off td { opacity: .55; }
.item-table { border-radius: 20px; overflow: hidden; }
.item-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-title { font-weight: 600; text-decoration: none; color: var(--text); display: block; }
.thumb { width: 150px; height: 100px; border-radius: 12px; overflow: hidden; background: var(--line); display: grid; place-items: center; color: var(--muted); font-size: .8rem; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.sm { width: 64px; height: 48px; font-family: var(--serif); font-size: 1.1rem; }

/* images */
.image-row { display: flex; gap: 14px; align-items: flex-start; }
.image-controls { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.gallery-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; min-height: 20px; }
.g-item { border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--field); cursor: grab; display: flex; flex-direction: column; gap: 5px; }
.g-item img { height: 100px; width: 100%; object-fit: cover; border-radius: 8px; pointer-events: none; }
.g-item input { padding: .35rem .5rem; font-size: .82rem; }
.dragging { opacity: .4; }
.picker { width: min(960px, 94vw); max-height: 86vh; border-radius: 20px; padding: 0; color: var(--text); }
.picker::backdrop { background: rgb(0 0 0 / .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.picker-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
.picker-head input { flex: 1; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; padding: 14px; overflow: auto; max-height: 70vh; }
.picker-grid button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; background: var(--line); }
.picker-grid button:hover { border-color: var(--accent); }
.picker-grid img { width: 100%; height: 100%; object-fit: cover; }
.map-picker { height: 240px; border-radius: 12px; overflow: hidden; margin-bottom: 10px; background: var(--line); }

/* builder */
.block-list { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 8px; }
.block-row { display: grid; grid-template-columns: 28px 140px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; cursor: grab; }
.block-row.is-off { opacity: .55; }
.grip { color: var(--muted); cursor: grab; letter-spacing: -2px; user-select: none; }
.block-type { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--accent); }
.block-name { display: flex; flex-direction: column; min-width: 0; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.type-card { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; border: 1px dashed var(--line); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.type-card:hover { border-color: var(--accent); background: rgb(var(--accent-rgb) / .06); }
.pick-list { border: 1px solid var(--line); border-radius: 12px; max-height: 420px; overflow: auto; }
.pick-row { display: grid; grid-template-columns: 24px 1fr 130px; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.pick-row.on { background: rgb(var(--accent-rgb) / .07); }
.pick-row .check { margin: 0; }
.pick-row select { padding: .3rem .5rem; }

/* themes */
.mode-panel { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.mode-panel > div { flex: 1; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.theme-card { border-radius: 20px; overflow: hidden; }
.theme-card.is-off { opacity: .6; }
.theme-preview { position: relative; height: 130px; }
.theme-preview img { width: 100%; height: 100%; object-fit: cover; }
.swatches { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; padding: 5px; border-radius: 99px; background: rgb(255 255 255 / .7); }
.swatches span { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgb(0 0 0 / .1); }
.live-badge { position: absolute; top: 10px; right: 10px; background: var(--accent2); color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.theme-body { padding: 14px 16px 16px; }
.color-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.color-row { display: flex; align-items: center; gap: 10px; font-weight: 500; margin-bottom: 6px; }
.mini-preview { margin-top: 10px; border-radius: 14px; padding: 16px; background: var(--p-bg); color: var(--p-ink); display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.mp-kicker { color: var(--p-a); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.mp-title { font: 500 1.25rem var(--serif); }
.mp-btn { align-self: flex-start; background: var(--p-a); color: #fff; padding: .3rem .9rem; border-radius: 99px; font-size: .82rem; font-weight: 600; }

/* dashboard */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bars span { flex: 1; height: max(var(--h), 2px); background: linear-gradient(var(--accent), rgb(var(--accent-rgb) / .5)); border-radius: 4px 4px 0 0; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; }

/* approvals */
.approve-row { display: flex; gap: 14px; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.diff td.old { background: rgb(200 50 50 / .06); } .diff td.new { background: rgb(46 160 90 / .08); }
.diff-img { width: 160px; border-radius: 8px; }
.diff-imgs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.diff-imgs img { width: 90px; height: 64px; object-fit: cover; border-radius: 8px; }
.approve-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.approve-form input { flex: 1; min-width: 220px; }

/* login & install */
body.login, body.install { min-height: 100svh; display: grid; place-items: center; background-size: cover; background-position: center; padding: 20px; }
.login-card { width: min(420px, 100%); border-radius: 26px; padding: 30px; display: flex; flex-direction: column; }
.login-card img { height: 56px; width: auto; align-self: flex-start; margin-bottom: 14px; }
.login-card h1 { font-size: 1.8rem; margin-bottom: .2rem; }
.login-card .btn { margin: 6px 0 14px; }
.wizard { width: min(720px, 100%); border-radius: 26px; padding: 30px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.steps span { flex: 1; min-width: 110px; font-size: .78rem; font-weight: 600; color: var(--muted); border-top: 3px solid var(--line); padding-top: 6px; }
.steps span.on { color: var(--accent); border-color: var(--accent); }
.steps span.done { color: var(--text); border-color: rgb(var(--accent-rgb) / .5); }
.checks { list-style: none; padding: 0; margin: 0 0 16px; }
.checks li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.ok { color: #1e8a4a; font-weight: 600; } .bad { color: #c0392b; font-weight: 600; }

@media (max-width: 1000px) {
  .side { transform: translateX(-110%); transition: transform .3s; }
  body.nav-open .side { transform: none; }
  .side-open { display: grid; place-items: center; position: fixed; top: 12px; right: 12px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass-bg); color: var(--text); font-size: 1.2rem; }
  .main { margin-left: 0; padding-top: 60px; }
  .edit-grid { grid-template-columns: 1fr; }
  .cards4 { grid-template-columns: repeat(2, 1fr); } .cards3 { grid-template-columns: 1fr; }
  .block-row { grid-template-columns: 24px 1fr; } .block-row .block-type { display: none; } .block-row .row-btns { grid-column: 1 / -1; }
  .item-row { grid-template-columns: 56px 1fr; } .item-status, .item-actions { grid-column: 2; }
}
@media (max-width: 600px) { .row2, .color-cols { grid-template-columns: 1fr; } .image-row { flex-direction: column; } }

/* hosts portal */
.bill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--line); white-space: nowrap; }
.bill-active { background: rgb(46 160 90 / .16); color: #1e8a4a; }
.bill-due { background: rgb(230 160 30 / .2); color: #b07400; }
.bill-grace { background: rgb(var(--accent2-rgb) / .2); color: var(--accent2); }
.bill-expired, .bill-unpaid { background: rgb(200 50 50 / .13); color: #c0392b; }
.bill-exempt { background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.status-expired { background: rgb(200 50 50 / .12); color: #c0392b; }
.hosts-table td { vertical-align: middle; }
.num-input { max-width: 120px; text-align: right; }
.small-num { max-width: 70px; }
.rates-table td { vertical-align: middle; }
.rates-table tr.is-off td { opacity: .55; }
.check.enforce { align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.owner-seg { margin-bottom: 10px; }
.sub-card { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; }
.sub-card .pay-note { white-space: pre-line; }
