:root {
  --bg: #0b0f14;
  --bg-soft: #111720;
  --card: #161d27;
  --card-2: #1c2530;
  --border: #232e3b;
  --text: #e8eef5;
  --muted: #8a97a6;
  --accent: #5b8cff;
  --accent-2: #7c5bff;
  --ok: #3fb96b;
  --warn: #e0a526;
  --err: #e0525f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #142033 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }

/* Header */
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 0 28px;
}
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
}
.brand h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -0.3px; }
.brand .sub { color: var(--muted); font-size: 13px; margin: 0; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; color: var(--muted);
  margin-bottom: 6px; font-weight: 500;
}
input, select {
  width: 100%; padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text); font-size: 15px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}
select { appearance: none; cursor: pointer; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .1s, opacity .15s; width: 100%;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 8px; }

/* Status pills */
.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; text-transform: capitalize;
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted);
}
.pill.created, .pill.awaiting_payment { color: var(--warn); border-color: rgba(224,165,38,.4); }
.pill.partially_paid { color: var(--warn); }
.pill.paid_pending_confirmations, .pill.awaiting { color: var(--accent); border-color: rgba(91,140,255,.4); }
.pill.confirmed { color: var(--accent); }
.pill.fulfilled { color: var(--ok); border-color: rgba(63,185,107,.4); }
.pill.expired, .pill.cancelled { color: var(--err); border-color: rgba(224,82,95,.4); }

/* Status page */
.status-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .status-grid { grid-template-columns: 1.2fr .8fr; } }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; word-break: break-all; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

.qr { background: #fff; border-radius: 12px; padding: 12px; display: inline-flex; }
.qr img, .qr svg { width: 180px; height: 180px; }

/* Confirmations bar */
.confirm { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.confirm .dot.done { background: var(--ok); }

/* Tables (admin) */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: rgba(255,255,255,.012); }

/* Utilities */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.flex { display: flex; gap: 8px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; }
.section-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 24px 0 10px; }

/* Lang switch */
.lang {
  position: absolute; top: 20px; right: 24px;
  display: flex; gap: 6px;
}
.lang button {
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer;
}
.lang button.active { color: var(--text); border-color: var(--accent); }

/* Toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
  box-shadow: var(--shadow); max-width: 90vw;
}
#toast.show { opacity: 1; }

.hidden { display: none !important; }

/* Centered single-column layout for client pages */
.brand.center { justify-content: center; }
.card.center { margin-left: auto; margin-right: auto; }
