/* BizCardy design system: tokens and shared components for the site and the dashboard. */

:root {
  --ink: #0f172a; --text: #1e293b; --muted: #61718f; --faint: #94a3b8; --line: #e2e7f0; --bg: #f4f6fa; --surface: #ffffff; --surface2: #ebeff5;
  --brand: #0c7d9d; --brand-ink: #0b6884; --brand-soft: #e0f5fa; --on-brand: #ffffff; --accent: #f0657a;
  --cyan: #06b6d4; --violet: #8b5cf6; --coral: #f0657a; --gold: #f4c20d; --navy: #0f172a; --navy-dark: #0a1120;
  --brand-grad: linear-gradient(90deg, #0c7d9d, #6d43d9); --brand-glow: linear-gradient(90deg, #06b6d4, #8b5cf6);
  --ok: #12924f; --ok-soft: #e4f7ec; --warn: #b45309; --warn-soft: #fff4dd; --danger: #d92d20; --danger-soft: #fdecea;
  --r-sm: 10px; --r: 14px; --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 4px 10px rgba(16, 24, 40, .04), 0 14px 34px rgba(16, 24, 40, .08);
  --shadow-lg: 0 30px 70px rgba(16, 24, 40, .18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Plus Jakarta Sans", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f6fa; --text: #d3dae6; --muted: #94a3b8; --faint: #64748b; --line: #233049; --bg: #0a1120; --surface: #0f172a; --surface2: #18223a;
    --brand: #22d3ee; --brand-ink: #67e8f9; --brand-soft: #0d3140; --on-brand: #0a1120;
    --brand-grad: linear-gradient(90deg, #22d3ee, #a78bfa);
    --ok: #4ade80; --ok-soft: #10301f; --warn: #fbbf24; --warn-soft: #33270b; --danger: #f97066; --danger-soft: #3a1512;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px rgba(0, 0, 0, .4); --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); line-height: 1.15; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.right { margin-left: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; background: var(--brand-grad); color: var(--on-brand); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .1s, background .15s, box-shadow .15s, border-color .15s; -webkit-tap-highlight-color: transparent; user-select: none; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost:hover, .btn.soft:hover, .btn.plain:hover, .btn.dark:hover { filter: none; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .ic { width: 17px; height: 17px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface2); }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn.soft:hover { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.dark:hover { background: color-mix(in srgb, var(--ink) 85%, var(--brand)); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.plain { background: transparent; color: var(--muted); padding: 0 10px; }
.btn.plain:hover { background: var(--surface2); color: var(--text); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.lg { min-height: 54px; padding: 0 28px; font-size: 16.5px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn.icon.sm { width: 36px; }

/* forms */
.field { display: block; }
.field > span, .label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 400; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), .field textarea, .field select {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 16px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.field select, select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23808799' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.input:disabled, .field input:disabled, .field textarea:disabled, .field select:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 11px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 500; }
.form-ok { background: var(--ok-soft); color: var(--ok); padding: 11px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 500; }

/* position: relative keeps the hidden checkbox inside its label. Without it the checkbox escapes any scrolling panel and makes the whole page scroll into empty space. */
.switch { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: background .18s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.switch input:disabled + i { opacity: .5; }
.switch b { font-weight: 600; color: var(--ink); font-size: 14.5px; display: block; }
.switch small { color: var(--muted); font-size: 13px; display: block; }

.seg { display: flex; padding: 4px; gap: 4px; background: var(--surface2); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.panel > h3 { font-size: 17px; margin-bottom: 4px; }
.panel > h3 + p { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.notice { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: 14.5px; font-weight: 500; }
.notice.info { background: var(--brand-soft); color: var(--brand-ink); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .empty-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
.empty .empty-ic svg { width: 28px; height: 28px; }
.empty h3 { font-size: 19px; margin-bottom: 6px; }
.empty p { max-width: 380px; margin: 0 auto 18px; }

/* tables that turn into stacked cards on phones */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 12px 16px; background: var(--surface2); white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: color-mix(in srgb, var(--surface2) 50%, transparent); }
.table .strong { font-weight: 600; color: var(--ink); }
.table .actions { text-align: right; white-space: nowrap; }
@media (max-width: 760px) {
  .table.stacked thead { display: none; }
  .table.stacked, .table.stacked tbody, .table.stacked tr, .table.stacked td { display: block; width: 100%; }
  .table.stacked tr { padding: 12px 14px; border-top: 1px solid var(--line); position: relative; }
  .table.stacked tr:first-child { border-top: 0; }
  .table.stacked td { border: 0; padding: 2px 0; }
  .table.stacked td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 13px; }
  .table.stacked td:empty { display: none; }
  .table.stacked .actions { text-align: left; padding-top: 8px; }
  .table.stacked td.check { position: absolute; right: 12px; top: 12px; width: auto; }
}

/* modal + toast */
.modal-bg { position: fixed; inset: 0; z-index: 200; background: rgba(8, 10, 22, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade .16s ease; }
.modal { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up .24s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { max-width: 760px; }
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 24px; } .modal { border-radius: 24px; padding: 26px; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 21px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@media (max-width: 480px) { .modal-foot .btn { flex: 1; } }
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
@media (min-width: 900px) { .toasts { bottom: 28px; } }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 99px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: up .2s ease; display: flex; align-items: center; gap: 8px; }
.toast.bad { background: var(--danger); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .7s linear infinite; }
.loading { display: flex; justify-content: center; padding: 60px 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); font-weight: 800; font-size: 22px; letter-spacing: -.035em; color: var(--ink); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 36px; height: 36px; flex: none; background: url(../img/brand/symbol.svg) center / contain no-repeat; }

.sso-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.sso { gap: 10px; }
