:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #22c55e;
  --err: #f87171;
  --border: #475569;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.wrap {
  max-width: 960px; margin: 0 auto; padding: 24px 16px 64px;
}
.wrap-narrow { max-width: 560px; }
h1 { margin: 0 0 4px; font-size: 24px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.muted { color: var(--muted); font-size: 13px; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password] {
  width: 100%; padding: 10px 12px;
  background: #0f172a; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
button, .btn {
  display: inline-block; cursor: pointer;
  background: var(--accent); color: #0f172a;
  border: none; border-radius: 8px;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button.ghost, .btn.ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
button.danger { background: #ef4444; color: white; }
button:disabled { opacity: .5; cursor: not-allowed; }
.msg { padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: 14px; }
.msg.err { background: rgba(248,113,113,.15); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.msg.ok  { background: rgba(34,197,94,.15);  color: #86efac; border: 1px solid rgba(34,197,94,.3); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
.actions { display: flex; gap: 6px; }
.link-box {
  display: flex; align-items: center; gap: 6px;
  background: #0f172a; border: 1px dashed var(--border);
  padding: 6px 10px; border-radius: 6px; font-family: monospace; font-size: 12px;
  word-break: break-all;
}
.copy-btn { padding: 4px 10px; font-size: 12px; }

/* Signature pad */
.sig-wrap {
  background: white; border: 2px dashed var(--border);
  border-radius: 8px; touch-action: none; position: relative;
  aspect-ratio: 16 / 9; max-width: 100%;
}
.sig-wrap canvas { width: 100%; height: 100%; display: block; border-radius: 6px; }
.sig-toolbar { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }

@media (max-width: 600px) {
  .row > * { min-width: 100%; }
}
