:root { --ink: #0F1B2D; --ink2: #4A5568; --ink3: #718096; --bg: #F3F7F6; --card: #fff; --line: #E2E8E6; --brand: #16A34A; --brand-d: #0F7F40; --brand-l: #DCF3E4;
  --bad: #DC2626; --bad-l: #FDE8E8; --warn: #B45309; --warn-l: #FEF3C7; --blue: #2563EB; --blue-l: #E0ECFF; --r: 10px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-d); }
.boot { padding: 40px; text-align: center; color: var(--ink3); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, #F1F8F3, #DCEFE2); }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: 0 10px 30px rgba(15,60,30,.08); display: flex; flex-direction: column; gap: 12px; }
.login-card img { width: 190px; margin: 0 auto 4px; display: block; }
.kicker { font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--brand-d); text-transform: uppercase; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 16px; margin: 0; } h3 { font-size: 14px; margin: 0; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #C9D6D1; background: #FAFCFB; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-d); }
.btn.danger { color: var(--bad); border-color: #F5C2C2; } .btn.sm { padding: 4px 9px; font-size: 12.5px; } .btn.block { width: 100%; padding: 10px; }
.err { background: var(--bad-l); color: var(--bad); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.muted { color: var(--ink3); } .small { font-size: 12px; }
.top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.top .brand { display: flex; align-items: center; gap: 9px; font-weight: 800; } .top .brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.top .brand small { display: block; font-weight: 600; font-size: 10.5px; color: var(--ink3); letter-spacing: .08em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--ink2); display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { background: var(--brand-l); color: var(--brand-d); }
.badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.top .me { margin-left: auto; display: flex; gap: 8px; align-items: center; }
main { padding: 16px 18px; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .l { font-size: 11.5px; color: var(--ink3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; } .stat .v { font-size: 22px; font-weight: 800; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; } th { text-align: left; font-size: 11.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; background: #F6FAF8; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid #EEF2F1; vertical-align: middle; } tr:hover td { background: #FBFDFC; }
td.num, th.num { text-align: right; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.ok { background: var(--brand-l); color: var(--brand-d); } .pill.trial { background: var(--blue-l); color: var(--blue); } .pill.warn { background: var(--warn-l); color: var(--warn); } .pill.bad { background: var(--bad-l); color: var(--bad); } .pill.muted { background: #EEF1F0; color: var(--ink2); }
.modal-bg { position: fixed; inset: 0; background: rgba(15,27,45,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 860px; max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; }
.modal.narrow { max-width: 440px; }
.modal .mh { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal .mb { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.toast { position: fixed; bottom: 18px; right: 18px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 99; max-width: 420px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; background: #F6FAF8; border: 1px dashed var(--brand); border-radius: 8px; padding: 8px 10px; user-select: all; }
/* Messages */
.chat-layout { display: grid; grid-template-columns: 330px 1fr; gap: 12px; height: calc(100vh - 110px); min-height: 420px; }
.chat-list { overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.chat-item { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.chat-item:hover { background: #F6FAF8; } .chat-item.on { background: var(--brand-l); border-color: #BFE6CB; }
.chat-item .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; } .chat-item .p { color: var(--ink3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.closed { opacity: .62; }
.thread { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.thread .th { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #FAFCFB; }
.msg { max-width: 72%; padding: 8px 11px; border-radius: 12px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--brand-l); border-color: #BFE6CB; }
.msg .meta { font-size: 11px; color: var(--ink3); margin-top: 3px; } .msg img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; margin-top: 4px; cursor: zoom-in; }
.compose { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.compose textarea { resize: none; min-height: 40px; max-height: 140px; }
.preview { display: flex; align-items: center; gap: 8px; padding: 0 10px 8px; } .preview img { max-height: 60px; border-radius: 6px; }
.empty { padding: 40px; text-align: center; color: var(--ink3); }
@media (max-width: 860px) { .chat-layout { grid-template-columns: 1fr; height: auto; } .chat-list { max-height: 260px; } .thread { height: 70vh; } .grid2, .grid3 { grid-template-columns: 1fr; } main { padding: 12px; } .msg { max-width: 88%; } }
.stack { display: flex; flex-direction: column; gap: 10px; }
.shop-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; }
.info { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13px; }
.note { background: #FFF7E6; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
@media (max-width: 860px) { .shop-grid { grid-template-columns: 1fr; } }

/* Manage shop: wide three-column panel that fits a landscape screen without scrolling */
.modal.wide { max-width: 1320px; height: min(calc(100vh - 32px), 780px); overflow: hidden; }
.mwrap { height: 100%; min-height: 0; }
.modal.wide .mb { flex: 1; min-height: 0; padding: 12px 14px; }
.mg { display: grid; grid-template-columns: 1fr 1.05fr 1fr; gap: 12px; height: 100%; min-height: 0; }
.mcol { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.mcol .box { padding: 10px 12px; gap: 6px; }
.mcol .box h3 { margin: 0; font-size: 14px; }
.mcol .box.grow { flex: 1 1 0; min-height: 90px; }
.mcol .scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: none; }
.mcol .scroll::-webkit-scrollbar { display: none; }
.mcol table td, .mcol table th { padding: 5px 6px; font-size: 13px; }
.mcol .info { grid-template-columns: 96px 1fr; gap: 3px 8px; font-size: 13px; }
.mcol .grid3 { gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips span { background: #F1F5F3; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.f-row { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 8px; }
.f-row label { font-size: 12px; color: var(--muted, #64748b); }
.f-in { display: flex; gap: 6px; align-items: center; min-width: 0; }
.f-in input { flex: 1; min-width: 0; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-grid .btn { width: 100%; justify-content: center; }
.nowrap { white-space: nowrap; }
table.act td { vertical-align: top; }
@media (max-width: 1000px), (max-height: 560px) {
  .modal.wide { height: auto; overflow: auto; }
  .mg { grid-template-columns: 1fr; height: auto; } .mwrap { height: auto; }
  .mcol .box.grow { flex: none; }
  .mcol .scroll { max-height: 240px; }
}

.card.backups { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.card.backups h3 { margin: 0 0 2px; font-size: 15px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
