/* MakanPay — shared shell. One stylesheet across CMS, storefront and POS. */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e3e8ee;
  --text: #1a1f36;
  --muted: #697386;
  --accent: #635bff;
  --accent-soft: #f0efff;
  --ok: #0e7c5a;
  --ok-soft: #e3f5ee;
  --warn: #9a6700;
  --warn-soft: #fff6e0;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(26, 31, 54, .08), 0 1px 2px rgba(26, 31, 54, .04);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- top bar ---- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a {
  padding: 6px 12px; border-radius: 6px; text-decoration: none;
  color: var(--muted); font-weight: 500;
}
.topnav a:hover { background: var(--bg); color: var(--text); }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }

/* ---- layout ---- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs button {
  background: none; border: none; padding: 10px 16px; cursor: pointer;
  font: inherit; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- table ---- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); font-weight: 600;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
}
td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* ---- pills ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.off { background: var(--bg); color: var(--muted); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* ---- buttons ---- */
button.btn, a.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; font-size: 13px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
button.btn:hover, a.btn:hover { background: var(--bg); }
button.btn.primary, a.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.btn.primary:hover, a.btn.primary:hover { filter: brightness(1.08); }
button.btn.danger { color: var(--danger); border-color: #f3c6c2; }
button.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- forms ---- */
label.field { display: block; margin-bottom: 12px; }
label.field span {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--muted); margin-bottom: 4px;
}
input, select, textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font: inherit; font-size: 13px; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

/* ---- misc ---- */
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.outlet { display: flex; align-items: center; gap: 10px; }
.outlet .emoji {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; font-size: 17px; background: var(--bg);
}
.outlet strong { display: block; font-weight: 600; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 18px;
  border-radius: 8px; z-index: 100; box-shadow: var(--shadow);
  max-width: 640px;
}
.toast.err { background: var(--danger); }

/* ---- activity feed ---- */
.feed { max-height: 460px; overflow-y: auto; font-family: var(--mono); font-size: 12px; }
.feed-row { padding: 8px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; }
.feed-row:last-child { border-bottom: none; }
.feed-row time { color: var(--muted); flex-shrink: 0; }
.feed-row .k { color: var(--accent); flex-shrink: 0; }

/* ---------------------------------------------------------------------------
   Responsive
   The console, storefront and POS are all used on a phone in a real venue —
   a manager checking an outlet, a cashier at a counter. Nothing here may
   overflow the viewport horizontally.
   --------------------------------------------------------------------------- */

/* Wide content scrolls inside its own card, never the page.
   The table keeps a readable minimum width and scrolls horizontally — squeezing
   columns to fit 375px renders one letter per line, which is worse than a swipe. */
table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
thead, tbody, tr { display: table; width: 100%; min-width: 640px; }
th, td { white-space: nowrap; }
/* the outlet name column may wrap — it is the widest and least scannable nowrap */
td .outlet strong, td .outlet span { white-space: normal; }

@media (max-width: 1024px) {
  .wrap { padding: 18px; }
}

@media (max-width: 820px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .wrap { padding: 14px; }

  /* Topbar: the brand keeps its mark but drops the descriptor, and the nav
     scrolls rather than pushing the page wider. */
  .topbar { padding: 0 14px; gap: 10px; }
  .brand small { display: none; }
  .brand .app { font-size: 13px; }
  .topnav { gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 6px 9px; font-size: 13px; white-space: nowrap; }

  /* Five tabs never fit at 375 — scroll them. */
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 10px 12px; white-space: nowrap; }

  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .card-head .spacer { margin-left: 0; width: 100%; height: 0; }
  .card-head select, .card-head input { width: 100% !important; }

  th, td { padding: 10px 12px; }
  .btn-row { width: 100%; }
  button.btn, a.btn { flex: 1; justify-content: center; }
}

@media (max-width: 560px) {
  /* Keep the Monstarlab mark, drop the product name — the page title says it. */
  .brand .sep, .brand .app { display: none; }
}

@media (max-width: 420px) {
  .wrap { padding: 12px; }
  .page-head h1 { font-size: 19px; }
  .outlet .emoji { width: 30px; height: 30px; font-size: 15px; }
  .mono { font-size: 11px; }
  label.field { margin-bottom: 10px; }
}

/* Touch targets on coarse pointers. */
@media (pointer: coarse) {
  button.btn, a.btn { min-height: 40px; }
  input, select { min-height: 40px; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
}

/* ---- brand marks ---- */
:root{ --ml:#F2E900; }
.brand .ml-mark{font-weight:700;font-size:15px;letter-spacing:-.035em;
  font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:var(--text)}
.brand .ml-dots{display:grid;grid-template-columns:repeat(2,4px);grid-template-rows:repeat(2,4px);
  gap:2px;margin:0 2px 0 1px}
.brand .ml-dots i{background:var(--ml);width:4px;height:4px;display:block}
.brand .sep{color:var(--border);margin:0 2px}
.brand .app{font-weight:600;font-size:14px;letter-spacing:-.01em}

/* ---- inline icons ---- */
.i{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;
   stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px}
