/* GoTickets dashboard, ticket page and docs. */
:root {
  --ink: #15201E; --ink-2: #4A5A57; --ink-3: #7D8B88; --line: #DCE3E1; --line-2: #EEF2F1; --bg: #F5F7F6; --card: #FFFFFF;
  --teal: #0E6B5C; --teal-2: #0A5246; --teal-bg: #E3F1EE; --saffron: #F2B33D; --saffron-bg: #FDF3DC;
  --red: #B42318; --red-bg: #FDECEA; --blue: #1D4ED8; --blue-bg: #E8EEFD; --amber: #8A5A00; --amber-bg: #FFF4D6;
  --r: 10px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
h1 { font-size: 24px; line-height: 1.25; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.muted { color: var(--ink-3); } .small { font-size: 13px; }
.sp { flex: 1; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #DCE7E4; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #fff; text-decoration: none; padding: 4px 8px 18px; letter-spacing: .01em; }
.side a.nav { color: #C4D3CF; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 600; }
.side a.nav:hover { background: rgb(255 255 255 / .06); color: #fff; }
.side a.nav[aria-current="page"] { background: rgb(242 179 61 / .16); color: #fff; box-shadow: inset 3px 0 0 var(--saffron); }
.side .who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgb(255 255 255 / .1); font-size: 13px; color: #9FB3AE; }
.side .who b { display: block; color: #fff; font-size: 14px; }
.side .who button { display: block; margin-top: 8px; background: none; border: 1px solid rgb(255 255 255 / .25); color: #DCE7E4; border-radius: 6px; padding: 5px 10px; font: inherit; cursor: pointer; }
main.page { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1180px; width: 100%; }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font-size: 24px; line-height: 1.2; }
.stat span { color: var(--ink-3); font-size: 13px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 12px; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #C9D3D0; border-radius: 8px; padding: 9px 11px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; color: var(--ink); }
.check input { width: auto; margin-top: 3px; }
.hint { font-weight: 400; color: var(--ink-3); font-size: 12.5px; display: block; margin-top: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px/1.2 var(--font); padding: 9px 14px; border-radius: 8px; border: 1px solid #C9D3D0;
  background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-2); }
.btn.danger { color: var(--red); border-color: #F1B8B2; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.err { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.note { background: var(--blue-bg); color: var(--blue); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.note.warn { background: var(--amber-bg); color: var(--amber); }
.note.ok { background: var(--teal-bg); color: var(--teal-2); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 10px 12px; background: #FAFBFB; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #FAFCFB; }
.r { text-align: right; }
.empty { background: var(--card); border: 1px dashed #C9D3D0; border-radius: var(--r); padding: 28px; text-align: center; color: var(--ink-2); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.paid, .pill.published, .pill.active { background: var(--teal-bg); color: var(--teal-2); }
.pill.pending, .pill.draft { background: var(--amber-bg); color: var(--amber); }
.pill.failed, .pill.cancelled, .pill.expired, .pill.suspended, .pill.void { background: var(--red-bg); color: var(--red); }
.keybox { display: flex; gap: 8px; align-items: center; }
.keybox input { font-family: var(--mono); font-size: 13px; background: #FAFBFB; }
pre.code { background: var(--ink); color: #E3EEEB; border-radius: 8px; padding: 14px; overflow-x: auto; font: 12.5px/1.55 var(--mono); margin: 0 0 12px; white-space: pre; }

/* ---------- dialogs and toasts ---------- */
dialog { border: 0; border-radius: 14px; padding: 22px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
dialog::backdrop { background: rgb(15 25 23 / .45); }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  opacity: 0; transition: .2s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--red); }

/* ---------- sign-in screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); }
.auth .card { width: min(400px, 100%); padding: 26px; }
.auth .logo { color: var(--ink); padding: 0 0 16px; }

/* ---------- phones ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 2px; }
  .logo { padding: 4px 8px; width: 100%; }
  .side .who { margin: 0; border: 0; padding: 4px 8px; width: 100%; display: flex; gap: 10px; align-items: center; }
  .side .who b { display: inline; }
  .side .who button { display: inline-block; margin: 0 0 0 auto; }
  .side a.nav { padding: 6px 9px; font-size: 14px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.stack td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 12px; text-align: right; }
  table.stack td::before { content: attr(data-l); color: var(--ink-3); font-size: 12.5px; text-align: left; }
}
