/* ForgeCart admin — original stylesheet */
:root {
  --brand: #0f5c4d; --ink: #17201d; --ink-2: #4b5551; --muted: #6d7672; --line: #e3e1db; --bg: #f5f4f0; --card: #fff;
  --ok: #1f7a4d; --warn: #9a5b00; --err: #b42318; --radius: 12px;
  --line-strong: #b9b5ab; --input: #fff; --input-line: #d6d3cb; --focus: #9fd3c1; --subtle: #faf9f6; --chip: #ecebe6;
  --ok-bg: #e3f4ea; --ok-line: #bfe3cd; --ok-ink: #14532d; --warn-bg: #fff1d1; --warn-line: #f0d9a2; --warn-ink: #6a4300;
  --err-bg: #fde8e6; --err-line: #f0c4bf; --err-ink: #7a1a12; --info-bg: #edf4fb; --info-line: #c9dcf0; --info-ink: #173a5e;
  color-scheme: light;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Night mode — chosen with the sun/moon button in the top bar (saved per admin) */
html[data-mode="dark"] {
  --brand: #3cbf95; --ink: #e6ebe8; --ink-2: #bcc6c1; --muted: #8f9b96; --line: #2b3632; --bg: #0f1513; --card: #161e1b;
  --ok: #5fd39b; --warn: #f0b955; --err: #ff8a80;
  --line-strong: #46534e; --input: #101714; --input-line: #34413c; --focus: #2f7a63; --subtle: #1b2421; --chip: #24302c;
  --ok-bg: #133126; --ok-line: #23523f; --ok-ink: #a7e9c6; --warn-bg: #33270e; --warn-line: #5b4517; --warn-ink: #f5d48d;
  --err-bg: #3a1714; --err-line: #6a2a24; --err-ink: #ffc2bb; --info-bg: #11243a; --info-line: #23425f; --info-ink: #b8d6f5;
  color-scheme: dark;
}
html[data-mode="dark"] .btn.primary { color: #06120e; }
html[data-mode="dark"] .serp-preview { background: #fff; }
html[data-mode="dark"] img { opacity: .94; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
h3 { font-size: .95rem; margin: 14px 0 6px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .intro { max-width: 760px; margin: -6px 0 18px; }
.nowrap { white-space: nowrap; }

.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: #121a17; color: #c7cfcb; padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; text-decoration: none; padding: 6px 10px 18px; font-size: 1.02rem; }
.brand .dot { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, #2fa37f, #e8a33d); flex: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #c7cfcb; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 550; }
.sidebar nav a:hover { background: #1d2723; color: #fff; }
.sidebar nav a.active { background: #24312c; color: #fff; box-shadow: inset 3px 0 0 #2fa37f; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px 0; font-size: .88rem; }
.sidebar-foot a { color: #9fb0a9; text-decoration: none; }
.sidebar-foot small { color: #66756f; }
.main { min-width: 0; }
.topbar { display: flex; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 30px; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20; }
.menu-btn { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--ink); display: none; }
.content { padding: 26px 30px 60px; max-width: 1280px; }
.banner { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 30px; font-size: .88rem; border-bottom: 1px solid var(--warn-line); }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: -260px; width: 236px; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-btn { display: block; }
  .topbar { padding: 8px 16px; }
  .content { padding: 18px 16px 50px; }
}

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow-x: auto; }
.card.empty { text-align: center; padding: 40px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols2.wide-left { grid-template-columns: 1.5fr 1fr; }
.edit-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.edit-side { position: sticky; top: 16px; }
@media (max-width: 1000px) { .cols2, .cols2.wide-left, .edit-layout { grid-template-columns: 1fr; } .edit-side { position: static; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.9); }
.btn.danger { color: var(--err); border-color: var(--err-line); }
.btn.block { width: 100%; }
.btn.big { padding: 12px 18px; font-size: 1rem; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; }
.link.danger { color: var(--err); }
.icon { background: var(--card); border: 1px solid var(--line); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; }
.icon:disabled { opacity: .35; }

.form label, .card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.form label small, .card label small { font-weight: 400; color: var(--muted); }
small.over { color: var(--warn) !important; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--input-line); border-radius: 8px; background: var(--input); color: var(--ink); width: 100%; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); border-color: var(--brand); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.check.inline { display: inline-flex; margin-right: 14px; }
label.radio { display: flex; flex-direction: row; gap: 8px; align-items: center; font-weight: 500; margin-bottom: 8px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
fieldset.days { border: 0; padding: 0; margin: 0; }
fieldset.days legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.scroll-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 14px; }
.scroll-list label { margin-bottom: 4px; }
.preview { border-radius: 8px; margin-bottom: 10px; max-height: 180px; width: auto; max-width: 100%; }
.preview.small { max-height: 64px; }
.gallery-admin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery-admin img { border-radius: 6px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.danger-zone { margin-top: 10px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; background: var(--subtle); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .thumb img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; margin-left: 10px; }
.table tr.dim td { opacity: .55; }
.card .table th, .card .table td { padding-left: 0; }
.card.flush .table th, .card.flush .table td { padding-left: 14px; }
.reorder { width: 76px; }
.reorder form { display: flex; gap: 4px; }
.options-table input { margin: 0; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--chip); color: var(--ink-2); vertical-align: middle; }
.pill-paid, .pill-active, .pill-published, .pill-completed, .pill-processing, .pill-shipped, .pill-ready { background: var(--ok-bg); color: var(--ok); }
.pill-pending, .pill-unpaid, .pill-draft { background: var(--warn-bg); color: var(--warn); }
.pill-cancelled, .pill-refunded { background: var(--err-bg); color: var(--err); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-color: var(--brand); }
.tabs .count { background: var(--chip); border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 200px; }
.filters.inline { margin: 0; align-items: center; }
.filters.inline label { flex-direction: row; align-items: center; margin: 0; }
.pager { display: flex; gap: 8px; justify-content: center; }

.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; background: var(--subtle); border: 1px solid var(--line); }
.alert.success { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.alert.error { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }
.alert.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 1.6rem; letter-spacing: -0.02em; }
.stat small { color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 160px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.bar span { width: 100%; background: linear-gradient(180deg, #2fa37f, var(--brand)); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bar small { color: var(--muted); font-size: .7rem; }
.setup ul { margin: 0; padding-left: 18px; }
.plain { list-style: none; padding: 0; margin: 0 0 16px; } .plain li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .9rem; } .timeline time { color: var(--muted); margin-right: 8px; }
.totals { margin: 14px 0 0; } .totals div { display: flex; justify-content: space-between; padding: 3px 0; } .totals dt, .totals dd { margin: 0; } .totals .grand { font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.addon-line { font-size: .88rem; margin-top: 3px; } .addon-line span { color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0 0 16px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.day-head { margin: 22px 0 10px; }
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.plugin.on { border-color: #9fd3c1; box-shadow: inset 0 3px 0 #2fa37f; }
.plugin .row { display: flex; gap: 8px; flex-wrap: wrap; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.type-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 3px; }
.type-card:hover { border-color: var(--brand); background: var(--subtle); }
.type-card small { color: var(--muted); }
.gateway summary { cursor: pointer; display: flex; gap: 8px; align-items: center; list-style: none; }
.gateway summary::-webkit-details-marker { display: none; }
.gateway[open] summary { margin-bottom: 12px; }

/* Rich text editor */
.field { margin-bottom: 14px; } .field .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.editor { border: 1px solid var(--input-line); border-radius: 8px; overflow: hidden; background: var(--input); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.editor-bar button { border: 1px solid transparent; background: none; border-radius: 6px; padding: 4px 9px; cursor: pointer; font: inherit; font-size: .85rem; }
.editor-bar button:hover, .editor-bar button.on { background: var(--card); border-color: var(--line); }
.editor-area { min-height: 220px; padding: 14px 16px; outline: none; }
.editor-area img { max-width: 100%; }
.editor-source { width: 100%; min-height: 260px; border: 0 !important; border-radius: 0 !important; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

/* SEO preview */
.seo-box summary { cursor: pointer; margin-bottom: 12px; }
.serp-preview { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; font-family: Arial, sans-serif; background: #fff; }
.serp-url { color: #202124; font-size: .82rem; }
.serp-title { color: #1a0dab; font-size: 1.15rem; }
.serp-desc { color: #4d5156; font-size: .88rem; }

/* Installer / login */
body.install { background: radial-gradient(800px 400px at 80% -10%, #f6e2b8, transparent 60%), radial-gradient(800px 500px at 0% 110%, #cfe7de, transparent 60%), var(--bg); min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.install-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 30px; width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(20, 30, 25, .08); }
.install-card.narrow { max-width: 400px; margin-top: 8vh; }
.install-card h2 { margin-top: 24px; }
.checks { list-style: none; padding: 0; columns: 2; font-size: .9rem; } .checks .ok { color: var(--ok); } .checks .bad { color: var(--err); font-weight: 700; }

.logview { white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--subtle); border-radius: 8px; padding: 12px; max-height: 520px; overflow: auto; margin: 0; }
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.small-tabs a { font-size: .88rem; padding: 6px 10px; }

/* ---- 1.1.0: top bar, alerts, badges, site status, permissions ---- */
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-left { flex: 1; }
.who { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.owner-tag { background: var(--chip); border-radius: 999px; padding: 1px 8px; font-size: .72rem; margin-left: 4px; color: var(--muted); }
.icon-btn { position: relative; background: var(--card); border: 1px solid var(--line); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }
html[data-mode="dark"] .i-sun, html:not([data-mode="dark"]) .i-moon { display: none; }
.bell-count { position: absolute; top: -6px; right: -6px; background: var(--err); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; min-width: 19px; height: 19px; padding: 0 5px; display: flex; align-items: center; justify-content: center; }
html[data-mode="dark"] .bell-count { color: #1a0605; }
.bell-wrap { position: relative; }
.bell-menu { position: absolute; right: 0; top: 46px; width: min(380px, 92vw); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); z-index: 50; overflow: hidden; }
.bell-head { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .88rem; }
.bell-item:hover { background: var(--subtle); }
.bell-item.new { box-shadow: inset 3px 0 0 var(--brand); }
.bell-item small { display: block; color: var(--muted); }
.bell-item .lv-error { color: var(--err); } .bell-item .lv-warning { color: var(--warn); }
.nav-badge { float: right; background: #2fa37f; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; margin-top: 2px; font-weight: 700; }
.mode-pill { background: var(--err-bg); color: var(--err-ink); border: 1px solid var(--err-line); padding: 4px 11px; border-radius: 999px; font-size: .82rem; font-weight: 700; text-decoration: none; }
.banner-update { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-line); }
[class^="dot-"] { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot-error { background: var(--err); } .dot-warning { background: var(--warn); } .dot-info { background: var(--brand); }
tr.unread td { font-weight: 600; } tr.unread td small { font-weight: 400; }
tr.selected td { background: var(--subtle); }
tr.warn-row td { background: var(--warn-bg); }
.mode-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 4px; }
.mode-card { cursor: pointer; font-weight: 400 !important; }
.mode-card.on, .mode-card:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.mode-card span { display: flex; gap: 8px; align-items: center; font-size: 1rem; }
.perm-list { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 0 0 14px; }
.perm-list legend { font-weight: 700; padding: 0 6px; }
label.check.perm { align-items: flex-start; margin-bottom: 10px; }
label.check.perm span { display: flex; flex-direction: column; }
label.check.perm small { font-weight: 400; color: var(--muted); }
.message-body { white-space: normal; line-height: 1.6; font-size: 1rem; }
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.chat-msg { max-width: 78%; padding: 8px 12px; border-radius: 12px; background: var(--subtle); border: 1px solid var(--line); }
.chat-msg.staff { align-self: flex-end; background: var(--ok-bg); border-color: var(--ok-line); }
.chat-msg.system { align-self: center; background: none; border: 0; color: var(--muted); font-size: .82rem; }
.chat-msg small { display: block; color: var(--muted); font-size: .74rem; }
.qr-box { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
