/* =========================================================================
   Concertix Cards — design tokens
   ========================================================================= */
:root,
[data-theme="light"] {
  --bg: #f4f5fa;
  --glow-a: rgba(124, 92, 255, .12);
  --glow-b: rgba(61, 123, 255, .08);
  --surface: #ffffff;
  --surface-2: #f4f5f9;
  --surface-3: #eceef4;
  --sidebar: rgba(255, 255, 255, .78);
  --border: #e6e8f0;
  --border-strong: #d7dae4;
  --text: #0c0e16;
  --text-2: #363b4a;
  --muted: #6a7083;
  --faint: #a0a5b4;
  --input: #ffffff;
  --accent: #6552f6;
  --accent-a: #7c5cff;
  --accent-b: #3d7bff;
  --accent-soft: rgba(101, 82, 246, .10);
  --accent-ring: rgba(101, 82, 246, .25);
  --accent-glow: rgba(101, 82, 246, .45);
  --ok: #0d9467;
  --ok-soft: rgba(16, 185, 129, .12);
  --warn: #b26b00;
  --warn-soft: rgba(245, 158, 11, .14);
  --danger: #e0434a;
  --danger-soft: rgba(224, 67, 74, .10);
  --info: #0a7fd1;
  --info-soft: rgba(14, 165, 233, .12);
  --shadow-sm: 0 1px 2px rgba(16, 19, 35, .05);
  --shadow: 0 1px 2px rgba(16, 19, 35, .04), 0 12px 32px -18px rgba(16, 19, 35, .18);
  --shadow-lg: 0 30px 70px -24px rgba(16, 19, 35, .35);
  --backdrop: rgba(16, 18, 28, .40);
  --switch-off: #d4d7e1;
  --grid-line: rgba(16, 19, 35, .045);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #07080d;
  --glow-a: rgba(124, 92, 255, .20);
  --glow-b: rgba(61, 123, 255, .12);
  --surface: #0e1017;
  --surface-2: #141721;
  --surface-3: #1a1e2a;
  --sidebar: rgba(11, 12, 19, .72);
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #eef0f8;
  --text-2: #c3c8d6;
  --muted: #8990a3;
  --faint: #5a6072;
  --input: #0a0c12;
  --accent: #9483ff;
  --accent-soft: rgba(148, 131, 255, .14);
  --accent-ring: rgba(148, 131, 255, .34);
  --accent-glow: rgba(124, 92, 255, .60);
  --ok: #3fdb9b;
  --ok-soft: rgba(63, 219, 155, .12);
  --warn: #f6b955;
  --warn-soft: rgba(246, 185, 85, .12);
  --danger: #ff6d72;
  --danger-soft: rgba(255, 109, 114, .12);
  --info: #62c6ff;
  --info-soft: rgba(98, 198, 255, .12);
  --shadow-sm: none;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 16px 40px -24px rgba(0, 0, 0, .9);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .9);
  --backdrop: rgba(3, 4, 8, .66);
  --switch-off: #292e3c;
  --grid-line: rgba(255, 255, 255, .03);
  color-scheme: dark;
}

/* =========================================================================
   Base
   ========================================================================= */
*,
*::before,
*::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--glow-a), transparent 65%),
    radial-gradient(700px 420px at -10% 110%, var(--glow-b), transparent 60%);
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 28px; font-weight: 650; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 620; }
p { margin: 0; }
b { font-weight: 600; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center-text { text-align: center; }
.center-self { margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grad-text {
  background: linear-gradient(100deg, var(--accent-a), var(--accent-b) 60%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ico { width: 18px; height: 18px; flex: none; display: block; }

::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =========================================================================
   Brand
   ========================================================================= */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 680; font-size: 15.5px; letter-spacing: -.01em; }
.brand-mark {
  position: relative;
  width: 28px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 6px 16px -6px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  width: 8px;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .85);
}
.brand-lg { font-size: 18px; }
.brand-name { display: inline-flex; align-items: baseline; gap: 5px; }
.brand-sub { font-weight: 500; color: var(--muted); }

/* =========================================================================
   Buttons & inputs
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font: 600 14px/1 var(--font);
  letter-spacing: -.005em;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
  background: transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .15s ease, border-color .15s ease, filter .15s ease;
}
.btn .ico { width: 17px; height: 17px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.lg { height: 46px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 10px 24px -12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 14px 30px -12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.secondary { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { color: #fff; background: linear-gradient(135deg, #ff5f6d, #e0343f); box-shadow: 0 10px 24px -12px rgba(224, 52, 63, .6); }
.btn.danger:hover:not(:disabled) { filter: brightness(1.06); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn.outline { border-color: var(--border-strong); background: var(--surface); height: 40px; width: 40px; }
.icon-btn.danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: .5; cursor: default; }
.icon-btn.spin .ico { animation: spin .8s linear infinite; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }

input,
select {
  width: 100%;
  height: 42px;
  font: 400 14px var(--font);
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 0 13px;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); }

.input-wrap { position: relative; display: block; }
.input-wrap .pw-toggle { position: absolute; right: 4px; top: 3px; }
.input-wrap input { padding-right: 44px; }
.input-wrap.prefix input { padding-left: 28px; padding-right: 13px; }
.input-prefix { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.form-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

/* switches */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.switch { position: relative; flex: none; width: 40px; height: 23px; border-radius: 999px; background: var(--switch-off); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.3, .7, .4, 1); }
input:checked + .switch { background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); }
input:checked + .switch::after { transform: translateX(17px); }
input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* icon bubbles */
.icon-bubble { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); color: var(--text-2); }
.icon-bubble .ico { width: 19px; height: 19px; }
.icon-bubble.lg { width: 54px; height: 54px; border-radius: 16px; }
.icon-bubble.lg .ico { width: 24px; height: 24px; }
.icon-bubble.accent { background: var(--accent-soft); color: var(--accent); }
.icon-bubble.ok { background: var(--ok-soft); color: var(--ok); }
.icon-bubble.info { background: var(--info-soft); color: var(--info); }
.icon-bubble.warn { background: var(--warn-soft); color: var(--warn); }
.icon-bubble.danger { background: var(--danger-soft); color: var(--danger); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* avatars */
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-weight: 650; font-size: 13px; letter-spacing: .02em; background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
.av-0 { background: linear-gradient(135deg, #7c5cff, #3d7bff); }
.av-1 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.av-2 { background: linear-gradient(135deg, #f43f5e, #f59e0b); }
.av-3 { background: linear-gradient(135deg, #a855f7, #ec4899); }
.av-4 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.av-5 { background: linear-gradient(135deg, #475569, #1e293b); }

/* =========================================================================
   Banner + toast
   ========================================================================= */
.demo-banner {
  position: relative;
  z-index: 30;
  text-align: center;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 11px 16px 11px 12px;
  border-radius: 14px;
  font-weight: 560;
  font-size: 13.5px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: toast-in .28s cubic-bezier(.2, .8, .3, 1);
}
.toast .ico { width: 20px; height: 20px; color: var(--ok); }
.toast.error .ico { color: var(--danger); }

/* =========================================================================
   Auth
   ========================================================================= */
.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  overflow: hidden;
}
.auth-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(620px 460px at 22% 30%, rgba(124, 92, 255, .30), transparent 62%),
    radial-gradient(520px 420px at 42% 85%, rgba(34, 211, 238, .14), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: radial-gradient(1100px 800px at 30% 45%, #000 45%, transparent 85%);
}
.auth-showcase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding-block: 64px;
  padding-inline: clamp(24px, 7vw, 110px);
}
.auth-title { font-size: clamp(38px, 4.6vw, 60px); font-weight: 700; letter-spacing: -.035em; line-height: 1.04; margin-top: 18px; }
.auth-sub { max-width: 440px; font-size: 16px; color: var(--muted); }

.card-stack { position: relative; height: 290px; max-width: 520px; margin-top: 18px; }
.card-stack .vcard { position: absolute; width: min(340px, 72%); box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .22); }
.stack-1 { left: 0; top: 70px; transform: rotate(-7deg); animation: float-a 7s ease-in-out infinite; }
.stack-2 { left: 21%; top: 34px; transform: rotate(3deg); opacity: .92; animation: float-b 8s ease-in-out infinite; }
.stack-3 { left: 40%; top: 0; transform: rotate(12deg); opacity: .8; animation: float-c 9s ease-in-out infinite; }

.auth-panel { display: grid; place-items: center; padding-block: 40px; padding-inline: 24px; }
.auth-card {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 18px;
  padding: 34px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card-brand { display: none; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; color: var(--muted); }
.auth-foot .ico { width: 14px; height: 14px; }

/* =========================================================================
   Shell
   ========================================================================= */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px 16px;
  background: var(--sidebar);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
}
.sidebar > .brand { padding: 4px 10px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: 560 14px var(--font);
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.nav-item.active .ico { color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--accent-a), var(--accent-b)); }

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip-text { min-width: 0; }
.user-chip-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-role { font-size: 12px; color: var(--muted); }
.foot-actions { display: flex; gap: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
.foot-actions .icon-btn { flex: 1; }

.main { min-width: 0; padding-block: 36px 64px; padding-inline: clamp(16px, 4vw, 48px); }
.page { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; animation: page-in .35s ease; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.eyebrow { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.page-sub { color: var(--muted); margin-top: 6px; max-width: 620px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px 22px; }
.panel.flush { padding: 0; overflow: hidden; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat-tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0; }
.stat-tile > div:last-child { min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: 21px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value small { font-size: 14px; color: var(--muted); font-weight: 500; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); max-width: 100%; }
.segmented.scroll { overflow-x: auto; }
.seg { height: 32px; padding: 0 14px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font: 580 13px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg:hover { color: var(--text); }
.seg.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), inset 0 0 0 1px var(--border); }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; pointer-events: none; }
.search input { padding-left: 36px; height: 40px; }

/* =========================================================================
   Virtual cards
   ========================================================================= */
.vcard {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.586;
  max-width: 100%;
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  box-shadow: 0 18px 40px -24px rgba(8, 10, 30, .8), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .35s cubic-bezier(.2, .8, .3, 1), box-shadow .35s, filter .3s;
}
.vcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .28), transparent 45%),
    radial-gradient(80% 80% at 0% 100%, rgba(0, 0, 0, .25), transparent 60%);
}
.vcard::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 260px;
  height: 260px;
  right: -90px;
  bottom: -120px;
  border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 36px rgba(255, 255, 255, .03);
}
.skin-0 { background: linear-gradient(135deg, #6a4dff 0%, #4169ff 55%, #2b8cff 100%); }
.skin-1 { background: linear-gradient(135deg, #1b2034 0%, #2b3350 60%, #394568 100%); }
.skin-2 { background: linear-gradient(135deg, #059669 0%, #0d9488 45%, #0284c7 100%); }
.skin-3 { background: linear-gradient(135deg, #f43f5e 0%, #f97316 60%, #f59e0b 100%); }
.skin-4 { background: linear-gradient(135deg, #7e22ce 0%, #c026d3 55%, #db2777 100%); }
.skin-5 { background: linear-gradient(135deg, #172554 0%, #1e40af 55%, #0891b2 100%); }

.vcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.vcard-name { font-weight: 620; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.vcard-chip {
  position: relative;
  width: 40px;
  height: 29px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f8e3a3, #d4a94e 55%, #f3d78b);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.vcard-chip::before,
.vcard-chip::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.vcard-chip::before { background: linear-gradient(90deg, transparent 32%, rgba(0, 0, 0, .18) 32% 36%, transparent 36% 64%, rgba(0, 0, 0, .18) 64% 68%, transparent 68%); }
.vcard-chip::after { background: linear-gradient(transparent 45%, rgba(0, 0, 0, .18) 45% 55%, transparent 55%); }
.vcard-mid { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vcard-brand { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .82; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); white-space: nowrap; }
.vcard-top .vcard-brand { font-size: 11px; margin-top: 3px; }
.vcard-contactless { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); border-left-color: transparent; border-bottom-color: transparent; transform: rotate(45deg); flex: none; margin-top: 2px; }
.vcard-number { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: clamp(15px, 1.6vw, 18px); font-weight: 600; letter-spacing: .08em; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); white-space: nowrap; }
.vcard-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.vcard-fields { display: flex; gap: 20px; min-width: 0; }
.vcard-field { display: flex; flex-direction: column; gap: 1px; font-family: var(--mono); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.vcard-label { font-family: var(--font); font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.vcard-value { display: inline-flex; align-items: center; gap: 4px; }
.vcard-network { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 21px; letter-spacing: -.02em; line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }

.skeleton-line { height: 12px; width: 55%; border-radius: 6px; background: var(--surface-3); }

/* cards list */
.cards-table th { padding-inline: 12px; }
.cards-table td { padding: 11px 12px; }
.cards-table td:first-child, .cards-table th:first-child { padding-left: 16px; }
.cards-table td:last-child, .cards-table th:last-child { padding-right: 10px; }
.cards-table .person { gap: 10px; }
.cards-table .icon-btn { width: 32px; height: 32px; }
.cards-table .badge.plain { height: 18px; padding: 0 6px; font-size: 10.5px; }
.cards-table .mini-card { width: 44px; height: 28px; font-size: 9px; }
.cards-table .person-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mono { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.cell-inline { display: inline-flex; align-items: center; gap: 6px; }
.num-cell { position: relative; }
.copy-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.copy-btn:hover { color: var(--text); background: var(--surface-3); }
.copy-btn .ico { width: 13px; height: 13px; }
tr.row-revealed td { background: var(--accent-soft); }
tr.row-revealed .mono { color: var(--text); font-weight: 600; }
.reveal-timer-bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--accent); transform-origin: left; animation: drain 60s linear forwards; }
tr.row-closed { opacity: .6; }
tr.is-new td { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
tr.skeleton td { padding: 18px 16px; }

/* transactions */
.tx-stats { gap: 10px; }
.tx-stats .stat-tile { padding: 10px 14px; gap: 12px; }
.tx-stats .icon-bubble { width: 32px; height: 32px; border-radius: 10px; }
.tx-stats .icon-bubble .ico { width: 16px; height: 16px; }
.tx-stats .stat-value { font-size: 17px; }
.tx-table td { padding: 11px 12px; vertical-align: top; }
.tx-table td:first-child, .tx-table th:first-child { padding-left: 16px; }
.tx-merchant { font-weight: 600; }
.tx-desc-sub { font-size: 12px; color: var(--muted); }
.tx-reason { font-size: 12px; color: var(--danger); margin-top: 2px; }
.amt { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.amt.credit { color: var(--ok); }
.amt.void { color: var(--muted); font-weight: 500; text-decoration: line-through; }
.tx-id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.pw-mask { color: var(--faint); letter-spacing: .1em; }
.pw-shown { font-weight: 600; user-select: all; }
.tx-empty { padding: 40px 16px; text-align: center; color: var(--muted); }
tr.skeleton .skeleton-line { animation: shimmer 1.4s linear infinite; background: linear-gradient(100deg, var(--surface-3) 30%, var(--surface-2) 50%, var(--surface-3) 70%) 0 0 / 300% 100%; }

.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px 20px; border-radius: var(--radius-lg); border: 1.5px dashed var(--border-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty h3 { font-size: 17px; margin-top: 6px; }
.empty p { color: var(--muted); max-width: 360px; }
.empty .btn { margin-top: 8px; }

/* =========================================================================
   Tables / lists
   ========================================================================= */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 2px; justify-content: flex-end; }
.person { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.person-name { font-weight: 600; }
.person-sub { font-size: 12.5px; color: var(--muted); }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-3); font-size: 12.5px; font-weight: 560; white-space: nowrap; }
.chip .ico { width: 14px; height: 14px; color: var(--muted); }
.table-empty { padding: 40px; text-align: center; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 6px 0; }
.tl-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-item .icon-bubble { width: 36px; height: 36px; border-radius: 11px; }
.tl-item .icon-bubble .ico { width: 17px; height: 17px; }
.tl-main { min-width: 0; }
.tl-title { font-size: 13.5px; }
.tl-title b { font-weight: 620; }
.tl-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.mini-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.mini-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.mini-card { width: 52px; height: 33px; border-radius: 7px; display: grid; place-items: end start; padding: 3px 6px; font: 700 10px var(--mono); color: #fff; }
.mini-card.closed { filter: grayscale(1) brightness(.8); }

/* connection */
.connection { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.conn-hero { display: grid; gap: 18px; align-content: start; }
.conn-status { display: flex; align-items: center; gap: 16px; }
.conn-status h2 { font-size: 22px; }
.pulse { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: pulse 2s ease-out infinite; }
.pulse.bad { background: var(--danger); }
.pulse.bad::after { border-color: var(--danger); }
.kv { display: grid; gap: 0; border-top: 1px solid var(--border); }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: none; }
.kv-row dt { color: var(--muted); }
.kv-row dd { margin: 0; font-weight: 560; text-align: right; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.check-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.check-list .icon-bubble { width: 30px; height: 30px; border-radius: 9px; }
.check-list .icon-bubble .ico { width: 15px; height: 15px; }
.panel-title { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

/* =========================================================================
   Dialogs
   ========================================================================= */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}
.dialog[open] { animation: dialog-in .28s cubic-bezier(.2, .8, .3, 1); }
.dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); }
.dialog.narrow { width: min(420px, calc(100vw - 32px)); }
.dialog.wide { width: min(820px, calc(100vw - 32px)); }
.dialog.xwide { width: min(1000px, calc(100vw - 32px)); }
.stack { display: grid; gap: 18px; }
.dialog-head { display: flex; align-items: center; gap: 14px; }
.dialog-head h2 { margin-bottom: 2px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.dialog-actions.split > .btn { flex: 1; }
.form-section { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.section-label { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.new-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.new-card-preview {
  display: grid;
  gap: 14px;
  padding: 28px 22px;
  border-radius: 20px;
  background:
    radial-gradient(260px 180px at 50% 40%, var(--glow-a), transparent 70%),
    var(--surface-2);
  border: 1px solid var(--border);
}
.new-card-preview .vcard { transform: rotate(-3deg); }
.new-card-form { display: grid; gap: 16px; }

/* =========================================================================
   Motion
   ========================================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes pulse { 0% { opacity: .7; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes float-a { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(-6deg) translateY(-10px); } }
@keyframes float-b { 0%, 100% { transform: rotate(3deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-14px); } }
@keyframes float-c { 0%, 100% { transform: rotate(12deg) translateY(0); } 50% { transform: rotate(11deg) translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal-timer-bar { animation: none; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1080px) {
  .auth { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
  .auth-card-brand { display: flex; }
  .connection { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    z-index: 20;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand foot" "nav nav";
    gap: 12px;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar > .brand { grid-area: brand; padding: 0; }
  .nav { grid-area: nav; flex-direction: row; overflow-x: auto; gap: 6px; }
  .nav-item { height: 36px; flex: none; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { grid-area: foot; margin: 0; padding: 0; border: none; background: none; display: flex; align-items: center; gap: 8px; }
  .user-chip-text { display: none; }
  .user-chip .avatar { width: 30px; height: 30px; font-size: 12px; }
  .foot-actions { border: none; padding: 0; }
  .main { padding-block: 24px 48px; }
  h1 { font-size: 24px; }
}

@media (max-width: 1200px) {
  .hide-md { display: none; }
}

@media (max-width: 700px) {
  .hide-sm { display: none; }
}

@media (max-width: 600px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .new-card { grid-template-columns: 1fr; gap: 18px; }
  .new-card-preview { padding: 20px 18px; }
  .page-head > .btn { width: 100%; }
  .search { max-width: none; }
  .dialog { padding: 20px; border-radius: 20px; }
  .tl-item { grid-template-columns: auto minmax(0, 1fr); }
  .tl-time { grid-column: 2; }
  .auth-card { padding: 26px 22px; }
  .stats { gap: 8px; }
  .stat-tile { padding: 10px 14px; gap: 12px; }
  .stat-tile .icon-bubble { width: 32px; height: 32px; border-radius: 10px; }
  .stat-tile .icon-bubble .ico { width: 16px; height: 16px; }
  .stat-value { font-size: 17px; }
}
