/* ==========================================================================
   Euphoria Software – QR Access portal theme
   Change the brand in one place: the variables below.
   ========================================================================== */
:root {
  --brand: #0f766e;            /* teal-700 */
  --brand-600: #0d9488;
  --brand-100: #ccfbf1;
  --brand-50: #f0fdfa;
  --ink: #0f172a;              /* slate-900 */
  --ink-2: #334155;            /* slate-700 */
  --muted: #64748b;            /* slate-500 */
  --line: #e2e8f0;             /* slate-200 */
  --bg: #f1f5f9;               /* slate-100 */
  --card: #ffffff;
  --side-bg: #0b1220;
  --side-ink: #cbd5e1;
  --side-active: rgba(255,255,255,.08);
  --ok: #16a34a; --ok-bg: #dcfce7;
  --warn: #d97706; --warn-bg: #fef3c7;
  --bad: #dc2626; --bad-bg: #fee2e2;
  --info: #2563eb; --info-bg: #dbeafe;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --side-w: 248px;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { letter-spacing: -.01em; color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; }
code { color: var(--ink-2); background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .85em; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side .brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; color: #fff; font-weight: 600; font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; font-weight: 500; color: #7fd6cc; letter-spacing: .04em; }
.side .brand .logo {
  width: 32px; height: 32px; border-radius: 8px; background: var(--brand-600); display: grid; place-items: center; color: #fff;
}
.side .who { padding: 4px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 12.5px; line-height: 1.4; }
.side .who .name { color: #fff; font-weight: 600; font-size: 13.5px; }
.side .who .tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.12); color: #e2e8f0; font-size: 11px; }
.side .who .managing { margin-top: 6px; color: #94a3b8; }
.side .who .managing strong { color: #fff; font-weight: 600; }
.side nav { padding: 10px 12px; flex: 1; }
.side .section { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.side .nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink);
  font-size: 14px; margin-bottom: 2px;
}
.side .nav-link svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.side .nav-link:hover { background: var(--side-active); color: #fff; text-decoration: none; }
.side .nav-link.active { background: var(--brand); color: #fff; }
.side .nav-link.active svg { opacity: 1; }
.side .foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side .foot .nav-link { color: #94a3b8; }
.side .foot-links { padding: 8px 10px 2px; font-size: 12px; color: #475569; display: flex; gap: 6px; flex-wrap: wrap; }
.side .foot-links a { color: #64748b; }
.side .foot-links a:hover { color: #cbd5e1; text-decoration: none; }

.content { padding: 28px 36px 48px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.page-head .actions { flex: none; padding-top: 4px; }
.page-head .sub { max-width: 820px; }
.page-head h1 { font-size: 24px; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 12px; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: inline-block; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px 22px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--ink); }
.panel-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1200px) { .panel-grid { grid-template-columns: 1fr; } }

.stat { display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.stat .ico svg { width: 20px; height: 20px; }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 650; line-height: 1.1; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; align-items: end; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .form-actions { display: flex; align-items: flex-end; }
.form-label .req { color: var(--bad); }
@media (max-width: 1000px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-3 { grid-column: span 2; } }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.form-control, .form-select {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 11px; font-size: 14px; color: var(--ink); background: #fff;
  box-shadow: none;
}
.form-control:focus, .form-select:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(13,148,136,.18); }
.form-control::placeholder { color: #94a3b8; }
.hint { font-size: 12.5px; color: var(--muted); }

.btn { border-radius: 8px; font-weight: 550; font-size: 14px; padding: 8px 14px; border: 1px solid transparent; }
.btn-sm { font-size: 12.5px; padding: 5px 10px; border-radius: 7px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-600); border-color: var(--brand-600); }
.btn-primary:disabled { background: #99d5cf; border-color: #99d5cf; }
.btn-outline-secondary { color: var(--ink-2); border-color: #cbd5e1; background: #fff; }
.btn-outline-secondary:hover { background: #f8fafc; color: var(--ink); border-color: #94a3b8; }
.btn-outline-danger { color: var(--bad); border-color: #fecaca; background: #fff; }
.btn-outline-danger:hover { background: var(--bad-bg); color: var(--bad); border-color: #fca5a5; }
.btn-outline-success { color: var(--ok); border-color: #bbf7d0; background: #fff; }
.btn-outline-success:hover { background: var(--ok-bg); color: var(--ok); border-color: #86efac; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #f1f5f9; }

.form-switch .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Tables ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-wrap .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.table-wrap .toolbar .count { color: var(--muted); font-size: 13px; }
.table-wrap .scroll { overflow-x: auto; }
.table { margin: 0; font-size: 13.5px; }
.table td, .table th { vertical-align: middle; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }
.table td.primary { min-width: 160px; }
.table td.primary a { font-weight: 600; }
.table > :not(caption) > * > * { padding: 10px 12px; border-bottom-color: var(--line); }
.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .btn + .btn { margin-left: 4px; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; }
.btn-icon svg { width: 15px; height: 15px; }
.qr-thumb { width: 48px; height: 48px; border-radius: 6px; border: 1px solid var(--line); background: #fff; padding: 3px; image-rendering: pixelated; display: block; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; opacity: .35; margin-bottom: 8px; }

/* ---------- Badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok   { background: var(--ok-bg);   color: #15803d; }
.pill.info { background: var(--info-bg); color: #1d4ed8; }
.pill.warn { background: var(--warn-bg); color: #b45309; }
.pill.bad  { background: var(--bad-bg);  color: #b91c1c; }
.pill.mute { background: #e2e8f0; color: #475569; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }

.alert { border-radius: 10px; font-size: 13.5px; padding: 10px 14px; }
.alert-danger { background: var(--bad-bg); color: #991b1b; border-color: #fecaca; }

/* ---------- Login / landing ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, .9fr); }
.login .hero { background: var(--side-bg); color: #fff; padding: 36px 56px 28px; display: flex; flex-direction: column; gap: 28px;
  background-image: radial-gradient(1200px 600px at -10% 110%, rgba(13,148,136,.35), transparent 60%), radial-gradient(800px 500px at 110% -10%, rgba(37,99,235,.25), transparent 60%); }
.login .hero-top { display: flex; align-items: center; justify-content: space-between; }
.login .hero .brand { display: flex; align-items: center; gap: 10px; }
.login .hero .brand .logo { width: 36px; height: 36px; border-radius: 9px; background: var(--brand-600); display: grid; place-items: center; color: #fff; }
.login .hero .brand .brand-name { font-size: 17px; }
.login .hero-link { color: #cbd5e1; font-size: 13.5px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; }
.login .hero-link:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.login .hero-body { flex: 1; }
.login .hero h2 { font-size: 32px; font-weight: 650; line-height: 1.15; color: #fff; max-width: 600px; margin: 0 0 12px; }
.login .hero p { color: #94a3b8; max-width: 600px; font-size: 15px; margin: 0 0 26px; }
.login .caps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.login .cap { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.login .cap-ico { width: 32px; height: 32px; flex: none; border-radius: 8px; background: rgba(13,148,136,.25); color: #5eead4; display: grid; place-items: center; }
.login .cap-ico svg { width: 17px; height: 17px; }
.login .cap-title { font-weight: 600; font-size: 13.5px; color: #f1f5f9; margin-bottom: 3px; }
.login .cap-text { font-size: 12.5px; color: #94a3b8; line-height: 1.45; }
.login .hero-foot { color: #64748b; font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.login .hero-foot a { color: #94a3b8; }
.login .hero-foot a:hover { color: #fff; }
.login .form { display: grid; place-items: center; padding: 40px; }
.login .form .card { width: 100%; max-width: 400px; }
.login .form h1 { font-size: 22px; font-weight: 650; margin-bottom: 4px; }
@media (max-width: 1400px) { .login .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login .hero { display: none; } }

/* ---------- Sending ---------- */
.send-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.send-grid .span-2 { grid-column: span 2; }
.input-group .btn { white-space: nowrap; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; font-weight: 600; }
.btn-whatsapp:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }
.btn-whatsapp:disabled { background: #a8e9c0; border-color: #a8e9c0; color: #fff; }
.alert-success { background: var(--ok-bg); color: #166534; border-color: #bbf7d0; }
.sent-log { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; font-size: 13px; }
.sent-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) { .send-grid { grid-template-columns: 1fr; } .send-grid .span-2 { grid-column: span 1; } }

/* ---------- Public pass page ---------- */
.pass { min-height: 100vh; background: var(--side-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 14px;
  background-image: radial-gradient(900px 500px at 50% -10%, rgba(13,148,136,.35), transparent 60%); }
.pass-card { background: #fff; border-radius: 18px; padding: 26px 24px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.pass-site { font-weight: 700; font-size: 18px; color: var(--ink); }
.pass-kind { font-size: 12px; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-top: 2px; }
.pass-qr { width: 100%; max-width: 280px; aspect-ratio: 1; margin: 18px auto 12px; display: block; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; }
.pass-qr-empty { background: #f1f5f9; }
.pass-inactive .pass-qr { filter: grayscale(1); opacity: .35; }
.pass-name { font-weight: 650; font-size: 17px; }
.pass-state { margin: 10px 0 14px; }
.pass-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; font-size: 13.5px; margin: 0 auto 12px; max-width: 300px; }
.pass-meta dt { color: var(--muted); }
.pass-meta dd { margin: 0; font-weight: 500; }
.pass-help { font-size: 12.5px; color: var(--muted); margin: 0; }
.pass-foot { color: #64748b; font-size: 12px; }
.pass-foot a { color: #94a3b8; }
/* ---------- Legal pages ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 40px 24px 60px; font-size: 15px; line-height: 1.6; }
.legal-head { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 24px; }
.legal-head .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-600); display: grid; place-items: center; color: #fff; }
.legal-head .logo svg { width: 16px; height: 16px; }
.legal h1 { font-size: 30px; margin-bottom: 4px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- Detail / print badge ---------- */
.badge-card { text-align: center; }
.badge-card .qr { width: 240px; height: 240px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.badge-card .code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); margin-top: 10px; word-break: break-all; }
.kv { display: grid; grid-template-columns: 160px 1fr; row-gap: 10px; column-gap: 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--ink); }

@media print {
  .side, .page-head .actions, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

#blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem 1rem 1rem 3.7rem; color: white; }
