:root {
  --slate-blue: #2C3E50; --slate-blue-light: #3e5871; --slate-blue-dark: #1a252f;
  --wheat: #E8C877; --bg: #f4f6f8; --card: #fff; --text: #1f2933; --muted: #6b7785;
  --line: #e1e6eb; --danger: #c0392b; --ok: #1e8449;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--slate-blue-light); }
code { background: #eef1f4; padding: 1px 6px; border-radius: 4px; font-size: .9em; word-break: break-all; }
.muted { color: var(--muted); } .center { text-align: center; } .big { font-size: 1.35rem; font-weight: 600; margin: .2rem 0; }
.grow { flex: 1; }

.brand { font-weight: 700; letter-spacing: -.5px; }
.brand .star { color: var(--wheat); text-decoration: none; font-weight: 700; margin-left: 1px; }
.auth-logo .brand .star { color: #c9a24a; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--slate-blue); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { color: #fff; font-size: 1.6rem; padding: 0 10px 18px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { color: #cfd8e0; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.sidebar nav a:hover { background: var(--slate-blue-light); color: #fff; }
.sidebar nav a.active { background: var(--slate-blue-dark); color: #fff; box-shadow: inset 3px 0 0 var(--wheat); }
.logout { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 0; border-top: 1px solid var(--slate-blue-light); }
.who { font-size: .85rem; color: #cfd8e0; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 0; }
.topbar h1 { font-size: 1.4rem; margin: 0; color: var(--slate-blue); word-break: break-all; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--slate-blue); }
main { padding: 16px 28px 28px; flex: 1; }
.footer { padding: 16px 28px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.footer .brand { color: var(--slate-blue); }
.footnote { font-size: .8rem; color: var(--muted); margin-top: 2px; } .footnote.center { margin-top: 18px; text-align: center; }

/* cards & grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; } .card.wide { grid-column: 1 / -1; } .card.narrow { max-width: 460px; } .card.flush { padding: 0; overflow-x: auto; }
.card h2 { margin: 0 0 8px; font-size: 1rem; color: var(--slate-blue); text-transform: uppercase; letter-spacing: .04em; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar span { display: block; height: 100%; background: var(--slate-blue-light); }
table.plain { width: 100%; border-collapse: collapse; } table.plain td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
pre.log { background: var(--slate-blue-dark); color: #d6e0e8; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: .78rem; max-height: 320px; margin: 0; white-space: pre-wrap; word-break: break-all; }

/* forms & buttons */
label { display: block; font-weight: 500; margin-bottom: 14px; }
input[type=text], input[type=password], input:not([type]) { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #c9d2da; border-radius: 8px; font: inherit; background: #fff; }
input:focus, textarea:focus { outline: 2px solid var(--slate-blue-light); outline-offset: 1px; }
.btn { display: inline-block; padding: 8px 16px; border: 1px solid #c9d2da; background: #fff; color: var(--slate-blue); border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f0f3f6; }
.btn.primary { background: var(--slate-blue); border-color: var(--slate-blue); color: #fff; } .btn.primary:hover { background: var(--slate-blue-light); }
.btn.ghost { background: transparent; } .btn.small { padding: 5px 12px; font-size: .85rem; } .btn.block { width: 100%; padding: 11px; }
.sidebar .btn.ghost { color: #fff; border-color: var(--slate-blue-light); } .sidebar .btn.ghost:hover { background: var(--slate-blue-light); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.success { background: #e8f6ee; border-color: #b7e0c8; color: var(--ok); } .flash.error { background: #fdecea; border-color: #f2c1bb; color: var(--danger); }

/* auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, var(--slate-blue-dark), var(--slate-blue-light)); }
.auth-card { background: #fff; border-radius: 14px; padding: 32px 30px; width: 100%; max-width: 380px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.auth-logo { text-align: center; font-size: 2.3rem; color: var(--slate-blue); margin-bottom: 6px; }
.auth-logo .star { color: #c9a24a; }
.about { max-width: 560px; margin: 0 auto; text-align: center; padding-top: 24px; }

/* file manager */
.crumbs { margin-bottom: 12px; color: var(--muted); } .crumbs span { margin: 0 6px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.dropzone { border: 2px dashed #c9d2da; border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); margin-bottom: 14px; transition: .15s; }
.dropzone.over { border-color: var(--slate-blue-light); background: #eaf0f6; color: var(--slate-blue); }
table.files { width: 100%; border-collapse: collapse; }
table.files th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.files td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.files tr:last-child td { border-bottom: 0; }
.r { text-align: right; } .actions { text-align: right; white-space: nowrap; } .actions a { margin-left: 12px; font-size: .88rem; } a.danger { color: var(--danger); }

/* code editor */
#code { width: 100%; min-height: 62vh; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.5; padding: 14px; border: 1px solid #c9d2da; border-radius: 10px; background: #fff; tab-size: 2; resize: vertical; }

/* visual editor */
.visual-body { background: #fff; overflow: hidden; }
.visual-bar { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--slate-blue); color: #fff; }
.visual-bar .brand-link { color: #fff; text-decoration: none; font-size: 1.15rem; }
.visual-bar .brand .star { color: var(--wheat); }
.visual-name { opacity: .85; } .visual-bar .muted { color: #cfd8e0; }
.visual-bar .btn { border-color: var(--slate-blue-light); } .visual-bar .btn.primary { background: var(--wheat); color: var(--slate-blue-dark); border-color: var(--wheat); }

@media (max-width: 800px) {
  .sidebar { position: fixed; left: -250px; z-index: 20; transition: left .2s; height: 100vh; } .sidebar.open { left: 0; }
  .menu-btn { display: block; } .topbar { padding: 14px 16px 0; } main { padding: 12px 16px 24px; } .footer { padding: 14px 16px; }
  .hide-sm { display: none; } .actions a { display: inline-block; margin: 2px 0 2px 10px; }
}

/* ---- wizards, pills and admin additions ---- */
.auth-card.wide { max-width: 580px; }
.auth-card h2 { margin: 6px 0 8px; font-size: 1.35rem; color: var(--slate-blue); }
.small { font-size: .85rem; }
.stepper { list-style: none; display: flex; justify-content: space-between; gap: 4px; padding: 0; margin: 4px 0 22px; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; color: var(--muted); font-size: .75rem; text-align: center; }
.stepper li:not(:last-child)::after { content: ''; position: absolute; top: 13px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--line); }
.stepper li.done:not(:last-child)::after { background: var(--slate-blue-light); }
.stepper .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; font-weight: 600; font-size: .8rem; z-index: 1; }
.stepper li.done .dot { background: var(--slate-blue-light); border-color: var(--slate-blue-light); color: #fff; }
.stepper li.current .dot { border-color: var(--slate-blue); color: var(--slate-blue); box-shadow: 0 0 0 3px #dfe7ee; }
.stepper li.current { color: var(--slate-blue); font-weight: 600; }
.progress { display: flex; align-items: center; gap: 16px; padding: 18px; background: #f4f6f8; border-radius: 10px; margin: 10px 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--slate-blue); border-radius: 50%; animation: spin 0.9s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .15em; font-size: 1.15rem; text-transform: uppercase; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 5px; }
input[type=email] { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #c9d2da; border-radius: 8px; font: inherit; background: #fff; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.ok { background: #e8f6ee; color: var(--ok); } .pill.warn { background: #fdf3dc; color: #946200; } .pill.err { background: #fdecea; color: var(--danger); }
.dns-result.ok { color: var(--ok); } .dns-result.warn { color: #946200; } .dns-result.err { color: var(--danger); }
.linkbox { display: flex; gap: 8px; margin: 14px 0; } .linkbox input { margin-top: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--slate-blue-light); text-decoration: underline; cursor: pointer; }
.linklike.danger { color: var(--danger); }
form.inline, .inline-logout { display: inline; margin: 0; } .inline-logout { margin-left: 8px; }
details.pw summary { cursor: pointer; color: var(--slate-blue-light); font-size: .88rem; }
details.pw form { display: flex; gap: 6px; margin-top: 6px; } details.pw input { margin: 0; padding: 6px 8px; }
.tpl-grid { display: grid; gap: 10px; margin: 14px 0 18px; }
.tpl input { position: absolute; opacity: 0; }
.tpl-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.tpl input:checked + .tpl-card { border-color: var(--slate-blue); background: #f0f4f8; }
.tpl input:focus-visible + .tpl-card { outline: 2px solid var(--slate-blue-light); }
.swatch { display: flex; height: 14px; border-radius: 4px; overflow: hidden; margin-bottom: 6px; border: 1px solid var(--line); } .swatch i { flex: 1; }
table.dns { margin: 10px 0; } table.dns th { text-align: left; font-size: .75rem; color: var(--muted); text-transform: uppercase; padding: 4px 8px 4px 0; }
ul.tour { padding-left: 20px; } ul.tour li { margin-bottom: 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
pre.log.small { font-size: .72rem; max-height: 140px; margin-top: 8px; }
.who em { font-style: normal; font-size: .7rem; background: var(--wheat); color: var(--slate-blue-dark); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.logout .btn { white-space: nowrap; } .logout .who { min-width: 0; }
