
:root {
  --pora-blue: #0b3d91;
  --pora-blue-dark: #082b66;
  --ink: #1a1f29;
  --muted: #6b7280;
  --border: #e2e5ea;
  --bg: #f6f7f9;
  --danger: #b3261e;
  --ok: #1e7a34;
  --warn: #a15c00;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; width: 100%; }
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label input, label select { margin-top: 4px; color: var(--ink); }

.topbar {
  background: var(--pora-blue);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar__title { font-weight: 600; }
.topbar__session { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar__session[hidden] { display: none; }

.btn { border: none; border-radius: 6px; padding: 9px 14px; font-weight: 600; }
.btn--primary { background: var(--pora-blue); color: #fff; }
.btn--primary:hover { background: var(--pora-blue-dark); }
.btn--small { padding: 6px 10px; font-size: 13px; }
.btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--secondary { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.panel { background: #fff; border-radius: 10px; padding: 24px; margin: 40px auto; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.panel--narrow { max-width: 380px; }
.hint { color: var(--muted); font-size: 13px; margin-top: -8px; margin-bottom: 16px; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; }

.layout { display: flex; height: calc(100vh - 56px - 45px); }
.list-pane {
  width: 320px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}
.list-pane__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.list-pane__header h2 { font-size: 16px; margin: 0; }
.filter { margin-bottom: 8px; }
.merchant-list { list-style: none; margin: 0; padding: 0; }
.merchant-list li {
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
}
.merchant-list li:hover { background: var(--bg); }
.merchant-list li.selected { background: #e8edf9; }
.merchant-list li .name { font-weight: 600; font-size: 14px; }
.merchant-list li .meta { font-size: 12px; color: var(--muted); }

.detail-pane { flex: 1; overflow-y: auto; padding: 24px 32px; }
.empty-state { color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge--draft { background: #eee; color: #555; }
.badge--submitted, .badge--under_review { background: #fff3cd; color: var(--warn); }
.badge--pending_issue { background: #fde2c8; color: var(--warn); }
.badge--approved { background: #d9ecff; color: var(--pora-blue); }
.badge--active { background: #d9f2df; color: var(--ok); }
.badge--suspended { background: #ffe3d6; color: #a1470c; }
.badge--rejected, .badge--inactive { background: #f6d6d3; color: var(--danger); }

.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h3 { margin-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.field { margin-bottom: 4px; }
.field .k { font-size: 12px; color: var(--muted); }
.field .v { font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table th { color: var(--muted); font-weight: 600; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal { background: #fff; border-radius: 10px; padding: 24px; width: 420px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal h2 { margin-top: 0; font-size: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 8px; font-size: 14px; z-index: 200;
  max-width: 360px;
}
.toast--error { background: var(--danger); }
.toast--ok { background: var(--ok); }

.tabs { display: flex; gap: 4px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--border); height: 45px; align-items: flex-end; }
.tab { background: transparent; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; font-weight: 600; color: var(--muted); }
.tab:hover { color: var(--ink); }
.tab--active { color: var(--pora-blue); border-bottom-color: var(--pora-blue); }
.tab[hidden] { display: none; }

.page { max-width: 960px; margin: 0 auto; padding: 24px 20px; }
.page .card { overflow-x: auto; }
.page__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page__header h2 { margin: 0; font-size: 18px; }
.filter--inline { margin: 0; display: flex; align-items: center; gap: 8px; }
.filter--inline select { width: auto; margin-top: 0; }

.link { background: none; border: none; padding: 0; color: var(--pora-blue); text-decoration: underline; font-size: 13px; cursor: pointer; }
.links { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.links__sep { margin: 0 6px; }
.notice { background: #e6f4ea; color: var(--ok); border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.muted { color: var(--muted); }

.setup { margin-top: 16px; }
.sr-copy { position: fixed; left: -9999px; top: 0; opacity: 0; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.link:disabled { color: var(--muted); text-decoration: none; cursor: not-allowed; }
.warn-box { background: #fff3cd; border: 1px solid #f0d58a; color: #5c4400; border-radius: 6px; padding: 12px; font-size: 13px; margin-bottom: 12px; }
.code-block { display: block; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; user-select: all; margin: 4px 0 12px; }
.codes { columns: 2; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; padding-left: 18px; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; color: var(--ink); font-size: 14px; }
.check input { width: auto; margin: 0; }
.setup ol { padding-left: 18px; font-size: 13px; color: var(--ink); }
