:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #16181d;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #cfd3da; background: #fff; border-radius: 8px; padding: 8px 12px; }
button:hover { background: #f3f4f6; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: #17191e; color: #fff; border-color: #17191e; }
button.primary:hover { background: #2b2f37; }
.shell { max-width: 1320px; margin: 0 auto; padding: 36px 24px 56px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #6b7280; margin: 0 0 6px; }
h1 { font-size: clamp(28px, 4vw, 42px); margin: 0; letter-spacing: -.03em; }
h2 { margin: 0 0 10px; }
.sub { margin: 8px 0 0; color: #626975; }
.card, .table-card { background: #fff; border: 1px solid #e1e4e8; border-radius: 14px; box-shadow: 0 8px 25px rgba(20,24,30,.05); }
.login-card { max-width: 650px; padding: 24px; }
.login-card p { color: #626975; }
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 7px; }
input, textarea { width: 100%; border: 1px solid #cfd3da; border-radius: 8px; padding: 10px 12px; background: #fff; color: #16181d; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { outline: 3px solid rgba(56, 92, 170, .15); border-color: #6679a6; }
.inline { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.toolbar { padding: 14px; display: flex; align-items: end; gap: 18px; justify-content: space-between; margin-bottom: 14px; }
.toolbar > div:first-child { width: min(460px, 100%); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.table-card { overflow: hidden; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #737b87; background: #fafbfc; }
th, td { padding: 13px 14px; border-bottom: 1px solid #eceef1; vertical-align: top; }
td.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; white-space: nowrap; }
.destination { max-width: 590px; word-break: break-all; }
.destination a { color: #2457a6; text-decoration: none; }
.destination a:hover { text-decoration: underline; }
.date { white-space: nowrap; color: #626975; font-size: 13px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 750; }
.badge.active { background: #e9f8ef; color: #176536; }
.badge.disabled { background: #fbeaea; color: #8b2424; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 275px; }
.actions button { padding: 6px 8px; font-size: 12px; }
.actions button.danger { color: #a12626; border-color: #efc4c4; }
.actions-col { min-width: 275px; }
.empty { padding: 42px; text-align: center; color: #737b87; }
.pager { padding: 12px 14px; display: flex; justify-content: center; align-items: center; gap: 12px; background: #fafbfc; }
.muted { color: #737b87; font-size: 13px; }
.error { color: #a12626 !important; min-height: 1.2em; }
dialog { width: min(760px, calc(100vw - 30px)); border: none; border-radius: 16px; padding: 0; box-shadow: 0 22px 70px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(20,24,30,.45); }
.dialog-form { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.icon-btn { width: 36px; height: 36px; padding: 0; font-size: 24px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #17191e; color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: 0 8px 30px rgba(0,0,0,.2); z-index: 100; }
@media (max-width: 760px) {
  .topbar, .toolbar { flex-direction: column; align-items: stretch; }
  .header-actions { justify-content: flex-start; }
  .toolbar > div:first-child { width: 100%; }
  .toolbar-right { justify-content: space-between; }
}


/* QR modal */
.qr-dialog { width: min(540px, calc(100vw - 30px)); }
.qr-dialog .dialog-form { text-align: center; }
.qr-dialog .dialog-head { text-align: left; }
.qr-canvas-button { display: block; margin: 0 auto; padding: 0; border: 0; background: transparent; border-radius: 14px; }
.qr-canvas-button:hover { background: transparent; box-shadow: 0 0 0 4px rgba(56,92,170,.10); }
.qr-canvas-wrap { display: block; padding: 14px; background: #fff; border: 1px solid #e1e4e8; border-radius: 14px; }
.qr-canvas { display: block; width: min(320px, 70vw); height: auto; image-rendering: pixelated; }
.qr-short-url { margin: 16px auto 0; max-width: 460px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 750; font-size: 14px; overflow-wrap: anywhere; }
.qr-help { max-width: 450px; margin: 10px auto 0; line-height: 1.45; }
.qr-actions { justify-content: center; flex-wrap: wrap; }
