/* ShoHost license admin — plain CSS, no Tailwind CDN */
:root {
  --bg: #f4f6f8;
  --panel: #fff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn-bg: #fffbeb;
  --warn: #92400e;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.sho-delivery-panel.hidden { display: none !important; }
.app { display: flex; min-height: 100%; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand { padding: 16px 18px; font-weight: 650; border-bottom: 1px solid var(--line); }
.sidebar nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
}
.sidebar a.active { background: var(--accent); color: #fff; }
.sidebar a:hover:not(.active) { background: #f3f4f6; }
.sidebar .foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar .foot a { color: var(--muted); text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  font-weight: 600;
}
.content {
  padding: 20px;
  overflow: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  max-width: 100%;
}
.sho-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.toolbar input[type="search"] { width: 240px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f9fafb; }
table.data tr:hover td { background: #fafafa; }
.slug { font-family: ui-monospace, monospace; font-size: 12px; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-muted { background: #f3f4f6; color: #4b5563; }
.btn, button.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.btn.primary, button.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn.link { border: 0; background: transparent; color: #374151; }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.backdrop { position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 40; }
.backdrop.hidden { display: none !important; }
body.sho-sheet-open { overflow: hidden; touch-action: none; }
body:not(.sho-sheet-open) { overflow-x: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 100%);
  max-height: 100dvh;
  background: #fff;
  z-index: 50;
  display: none;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(0,0,0,.08);
  transform: translateX(100%);
  transition: transform .2s ease;
}
.drawer.open {
  display: flex;
  transform: translateX(0);
}
.drawer.wide { width: min(560px, 100%); }
.drawer-head, .drawer header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}
.drawer-head h3, .drawer header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.drawer-close {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.drawer-foot, .drawer footer {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
.drawer-foot .btn.primary, .drawer footer .btn.primary { flex: 1; }
.drawer-body, .drawer .body {
  padding: 16px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer h3, .drawer h4 { margin: 0 0 8px; }
.drawer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field { display: block; margin-bottom: 12px; }
.field span, .field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 400; }
input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="url"], input[type="datetime-local"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
textarea { font-family: ui-monospace, monospace; font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 13px; }
.check input { width: auto; margin-top: 3px; }
.term-block {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: #111827;
  color: #6ee7b7;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}
#sho-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  background: #111827; color: #fff; padding: 8px 12px; border-radius: 8px;
  opacity: 0; pointer-events: none;
}
#sho-toast.show { opacity: 1; }
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.login-card h1 { margin: 0; font-size: 18px; }
.login-card p { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 14px; }
/* Other admin pages still use a few shared hooks */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
#audit-drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(480px, 100%); background: #fff; transform: translateX(100%); transition: transform .2s; z-index: 60; box-shadow: -8px 0 24px rgba(0,0,0,.08); }
#audit-drawer.open { transform: translateX(0); }
@media (min-width: 901px) { #nav-toggle { display: none; } }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 30; }
  .content { padding: 12px; }
  .topbar { padding: 12px 14px; font-size: 15px; }
}
@media (max-width: 640px) {
  .drawer-foot { flex-direction: column-reverse; align-items: stretch; }
  .drawer-foot .btn { width: 100%; text-align: center; }
  .drawer.open, .drawer.wide.open {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 16px 16px 0 0;
    transform: translateY(0);
    box-shadow: 0 -8px 32px rgba(0,0,0,.12);
  }
}
