/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --ink: #1f2330;
  --muted: #6b7280;
  --paper: #f6f7fb;
  --card: #ffffff;
  --border: #e7e9f2;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(31, 35, 48, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 35, 48, 0.10);
  --shadow-lg: 0 18px 46px rgba(31, 35, 48, 0.14);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-main { flex: 1 0 auto; }

/* Touch-friendly baseline: every interactive element gets >= 44px hit area */
.btn, .form-control, .form-select, .nav-link, .page-link, .dropdown-item {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.form-control, .form-select { display: block; }
.btn { border-radius: var(--radius-pill); font-weight: 600; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover, .btn-primary:focus { background: #4338ca; border-color: #4338ca; }

/* ============================================================
   Navbar
   ============================================================ */
.app-navbar {
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.role-badge { font-size: 0.65rem; border-radius: var(--radius-pill); padding: 0.25em 0.6em; }
.role-admin { background: #fee2e2; color: #b91c1c; }
.role-moderator { background: #fef3c7; color: #92400e; }
.role-editor { background: #dbeafe; color: #1e40af; }
.role-user { background: #e5e7eb; color: #374151; }

/* ============================================================
   Cards / surfaces
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.shorten-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.hero { padding: 3rem 0 1.5rem; text-align: center; }
.hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.hero p { color: var(--muted); }

.result-box {
  background: #eef2ff;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  word-break: break-all;
}

/* Honeypot trap — visually hidden, still in normal DOM flow, off canvas */
.hp-trap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ============================================================
   Tables — mobile friendly (stacked on small screens)
   ============================================================ */
.table-responsive-cards th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table-responsive-cards td { vertical-align: middle; }

@media (max-width: 767.98px) {
  .table-responsive-cards thead { display: none; }
  .table-responsive-cards tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .table-responsive-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 0.4rem 0;
  }
  .table-responsive-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    margin-right: 1rem;
  }
}

.app-footer { color: var(--muted); }

.status-pill { border-radius: var(--radius-pill); padding: 0.25em 0.7em; font-size: 0.75rem; font-weight: 600; }
.status-active { background: #dcfce7; color: #166534; }
.status-blocked { background: #fee2e2; color: #b91c1c; }
.status-deleted { background: #e5e7eb; color: #374151; }

.stat-card { border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-card .num { font-size: 1.8rem; font-weight: 800; }

#qrModalImage { background: #fff; padding: 12px; border-radius: var(--radius-md); }
