/* Card Studio — the NFC Crypto kit look: black, white, mono, hairlines. */
:root {
  --bg: #050506;
  --surface: #0e0e10;
  --surface-2: #151518;
  --surface-3: #1e1e22;
  --border: #232329;
  --border-2: #33333b;
  --text: #f5f5f7;
  --muted: #8e8e96;
  --faint: #55555d;
  --success: #30D158;
  --danger: #FF453A;
  --warning: #FFB340;
  --r-lg: 16px;
  --r-md: 14px;
  --r-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Inter, Roboto,
          Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Cascadia Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255,255,255,.22); }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0;
  font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; gap: 6px;
  padding: 26px 16px 18px;
  border-right: 1px solid var(--border);
  background: #000;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #5b5b60 0%, #1f1f22 40%, #a4a4aa 62%, #26262a 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 6px 18px rgba(0,0,0,.6);
}
.brand-mark::after {
  content: ""; position: absolute; left: 9px; top: 12px; width: 13px; height: 10px;
  border-radius: 3px; background: linear-gradient(135deg, #f2f2f5, #8e8e93);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.brand-text { min-width: 0; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { color: var(--muted); font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border: 0; border-radius: 12px; background: transparent;
  color: var(--muted); font-size: 14.5px; font-weight: 500; cursor: pointer;
  text-align: left; transition: background .15s, color .15s;
}
.nav button svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav button:hover { background: var(--surface); color: var(--text); }
.nav button.active { background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-2); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted);
  background: var(--surface-3); border-radius: 99px; padding: 1px 8px; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.reader-pill {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  font-size: 13px;
}
.reader-pill .sub { color: var(--muted); font-size: 12px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.ok { background: var(--success); box-shadow: 0 0 0 4px rgba(48,209,88,.14); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,69,58,.14); }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 4px rgba(255,179,64,.14); }
.dot.sim { background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.reader-pill.sim { border-style: dashed; border-color: var(--border-2); }

/* ---------- simulated reader ---------- */
.sim-banner { position: sticky; top: 0; z-index: 20; display: flex; gap: 14px;
  align-items: center; padding: 10px 44px; font-size: 13px; color: var(--text);
  background: repeating-linear-gradient(135deg, #0b0b0d 0 12px, #101013 12px 24px);
  border-bottom: 1px dashed var(--border-2); }
.sim-tag { font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  padding: 3px 8px; border-radius: 6px; background: #fff; color: #000; font-weight: 600;
  white-space: nowrap; }
.sim-tray { border-style: dashed; margin-bottom: 22px; }
.sim-panel { border-style: dashed; }
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px; margin-top: 16px; }
.tray-card { display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border-radius: var(--r-md); cursor: pointer; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.tray-card:hover { border-color: var(--border-2); background: var(--surface-3); }
.tray-card.on { border-color: #fff; cursor: default; }
.tray-card[disabled] { opacity: 1; }
.tc-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tc-name { font-weight: 600; font-size: 13.5px; }
.tc-sub { color: var(--muted); font-size: 11.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tc-state { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tray-card.on .tc-state { color: #fff; }
.btn.sample { border-style: dashed; }

.main { overflow-y: auto; }
#main { padding: 34px 44px 60px; }
.page { max-width: 1180px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- surfaces ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
}
.panel h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.panel .eyebrow + h2 { margin-top: 6px; }
.panel .lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: transform .08s, background .15s, opacity .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); border-color: #3a3a3c; }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: #fff; color: #000; border-color: #fff; }
.btn.primary:hover { background: #e9e9ec; }
.btn.danger { background: rgba(255,69,58,.12); color: var(--danger);
  border-color: rgba(255,69,58,.28); }
.btn.danger:hover { background: rgba(255,69,58,.2); }
.btn.solid-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.sm { height: 34px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 15.5px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .38; cursor: not-allowed; transform: none; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--faint); }
.input, select.input, textarea.input {
  height: 46px; padding: 0 15px; border-radius: 13px; width: 100%;
  background: #0B0B0C; border: 1px solid var(--border-2); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 12px 15px; resize: vertical; }
.input:focus { border-color: #5a5a5f; box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.input::placeholder { color: var(--faint); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, #8e8e93 50%),
                    linear-gradient(135deg, #8e8e93 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.input.pin { font-family: var(--mono); letter-spacing: .3em; font-size: 18px; }
.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer;
  font-size: 14px; padding: 4px 0; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px;
  flex: none; border-radius: 7px; border: 1px solid #3a3a3c; background: #0B0B0C;
  margin: 0; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: #fff; border-color: #fff; }
.check input:checked::after { content: ""; width: 6px; height: 11px; margin-top: -2px;
  border: solid #000; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }
.check .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); height: 34px;
  padding: 0 14px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
  font-weight: 500; }
.seg button.active { background: var(--surface-3); color: var(--text); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px;
  transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 40px; width: 300px; height: 42px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px;
  padding: 0 10px; border-radius: 99px; font-size: 12px; 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.blank { color: var(--muted); }
.badge.programmed { color: #fff; background: rgba(255,255,255,.1); }
.badge.backup { color: var(--success); background: rgba(48,209,88,.12); }
.badge.shipped { color: #64D2FF; background: rgba(100,210,255,.12); }
.badge.danger { color: var(--danger); background: rgba(255,69,58,.12); }
.badge.warn { color: var(--warning); background: rgba(255,179,64,.12); }

/* ---------- reader hero ---------- */
.hero { display: grid; grid-template-columns: minmax(400px, 470px) 1fr; gap: 22px;
  align-items: stretch; }
.stage {
  position: relative; border-radius: 24px; padding: 34px 30px 26px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.06), transparent 60%),
    var(--surface);
  border: 1px solid var(--border); display: flex; flex-direction: column;
  align-items: center; gap: 22px; overflow: hidden;
}
.stage-caption { text-align: center; }
.stage-caption .title { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.stage-caption .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.card-wrap { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1.586;
  perspective: 1200px; }
.card-wrap .rings { position: absolute; inset: -6%; pointer-events: none; }
.card-wrap .rings span { position: absolute; inset: 0; border-radius: 30px;
  border: 1.5px solid rgba(255,255,255,.35); opacity: 0; }
.card-wrap.present .rings span { animation: ring 2.4s cubic-bezier(.2,.6,.3,1) infinite; }
.card-wrap.present .rings span:nth-child(2) { animation-delay: .8s; }
.card-wrap.present .rings span:nth-child(3) { animation-delay: 1.6s; }
.card-wrap.ok.present .rings span { border-color: rgba(48,209,88,.45); }
.card-wrap.bad.present .rings span { border-color: rgba(255,69,58,.5); }
@keyframes ring { 0% { transform: scale(.94); opacity: .7; }
  100% { transform: scale(1.12); opacity: 0; } }

.slot { position: absolute; inset: 0; border-radius: 22px;
  border: 1.5px dashed #3a3a3c; display: grid; place-items: center;
  color: var(--muted); text-align: center; font-size: 14px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.015) 0 10px,
                                        transparent 10px 20px); }
.slot svg { width: 46px; height: 46px; margin-bottom: 10px; opacity: .55;
  animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .25; transform: translateY(-3px); } }

.metal {
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px),
    linear-gradient(128deg, #4a4a4f 0%, #1c1c1f 32%, #56565c 52%, #18181b 76%,
                    #34343a 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), inset 0 1px 0 rgba(255,255,255,.28),
              0 30px 60px -18px rgba(0,0,0,.9), 0 12px 24px -12px rgba(0,0,0,.8);
  transform: rotateX(8deg) translateY(0);
  transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .35s;
  color: #fff;
}
.card-wrap.present .metal { animation: lift .7s cubic-bezier(.2,.7,.2,1); }
@keyframes lift { from { transform: rotateX(22deg) translateY(16px); opacity: 0; }
  to { transform: rotateX(8deg) translateY(0); opacity: 1; } }
.metal::after { content: ""; position: absolute; top: -60%; left: -80%; width: 55%;
  height: 220%; transform: rotate(22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  animation: shine 6.5s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 55% { left: -80%; } 85%, 100% { left: 140%; } }
.metal.blank { background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 1px, transparent 1px 3px),
    linear-gradient(128deg, #d8d8dc 0%, #9a9aa0 35%, #e6e6ea 55%, #8c8c92 80%, #bdbdc2 100%);
  color: #111; }
.metal.bad { box-shadow: inset 0 0 0 1.5px rgba(255,69,58,.7),
  0 30px 60px -18px rgba(0,0,0,.9); }
.metal .m-top { position: absolute; left: 7%; right: 7%; top: 9%; display: flex;
  justify-content: space-between; align-items: center; }
.metal .m-brand { font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.metal .m-brand small { font-weight: 500; opacity: .6; margin-left: 6px; font-size: 12px; }
.metal .m-wave { width: 26px; height: 26px; opacity: .85; }
.metal .m-chip { position: absolute; left: 7%; top: 37%; width: 15%; aspect-ratio: 1.3;
  border-radius: 7px;
  background: linear-gradient(135deg, #f4f4f6 0%, #a9a9ae 45%, #e3e3e6 60%, #8a8a90 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); overflow: hidden; }
.metal .m-chip::before, .metal .m-chip::after { content: ""; position: absolute;
  inset: 0; background:
    linear-gradient(90deg, transparent 32%, rgba(0,0,0,.28) 32% 35%, transparent 35% 65%,
                    rgba(0,0,0,.28) 65% 68%, transparent 68%),
    linear-gradient(0deg, transparent 47%, rgba(0,0,0,.28) 47% 53%, transparent 53%); }
.metal .m-id { position: absolute; left: 7%; bottom: 25%; font-family: var(--mono);
  font-size: clamp(13px, 1.5vw, 17px); letter-spacing: .14em; opacity: .92;
  text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.metal.blank .m-id { text-shadow: none; }
.metal .m-bottom { position: absolute; left: 7%; right: 7%; bottom: 9%; display: flex;
  justify-content: space-between; align-items: flex-end; font-size: 12.5px; }
.metal .m-label { font-weight: 600; max-width: 70%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.metal .m-type { opacity: .65; font-weight: 600; letter-spacing: .06em; font-size: 11.5px; }
.metal .m-flag { position: absolute; right: 7%; top: 37%; }

/* ---------- detail list ---------- */
.dl { display: grid; grid-template-columns: 130px 1fr; row-gap: 0; }
.dl > div { padding: 12px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.dl .k { color: var(--muted); font-size: 13.5px; }
.dl .v { font-size: 14px; overflow-wrap: anywhere; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden;
  margin-top: 8px; max-width: 260px; }
.meter i { display: block; height: 100%; background: #fff; border-radius: 99px; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 22px; }
.action { text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; cursor: pointer; color: var(--text);
  transition: background .15s, border-color .15s, transform .1s; }
.action:hover { background: var(--surface-2); border-color: var(--border-2); }
.action:active { transform: scale(.99); }
.action[disabled] { opacity: .4; cursor: not-allowed; }
.action .ic { width: 40px; height: 40px; border-radius: 12px; display: grid;
  place-items: center; background: var(--surface-3); margin-bottom: 14px; }
.action .ic svg { width: 20px; height: 20px; }
.action.primary .ic { background: #fff; color: #000; }
.action.danger .ic { background: rgba(255,69,58,.14); color: var(--danger); }
.action .t { font-weight: 650; font-size: 15px; }
.action .d { color: var(--muted); font-size: 13px; margin-top: 3px; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border-radius: 14px; font-size: 13.5px; background: var(--surface-2);
  border: 1px solid var(--border-2); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.warn { background: rgba(255,179,64,.08); border-color: rgba(255,179,64,.25);
  color: #FFD28A; }
.notice.danger { background: rgba(255,69,58,.08); border-color: rgba(255,69,58,.28);
  color: #FF8A82; }
.notice.ok { background: rgba(48,209,88,.08); border-color: rgba(48,209,88,.25);
  color: #7EE29A; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px 20px; }
.stat .n { font-family: var(--mono); font-size: 26px; font-weight: 600;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 22px 18px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); }
.kpi-top svg { width: 17px; height: 17px; }
.kpi-n { font-family: var(--mono); font-size: 46px; font-weight: 500; line-height: 1.1;
  letter-spacing: -.04em; margin-top: 14px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 12px;
  align-items: center; font-size: 13.5px; }
.bar-label { color: var(--muted); }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #fff; border-radius: 99px;
  min-width: 2px; transition: width .4s; }
.bar i.ok { background: var(--success); }
.bar i.ship { background: #64D2FF; }
.bar i.faint { background: var(--faint); }
.bar-n { text-align: right; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 20px;
  border-top: 1px solid var(--border); }
.facts.three { grid-template-columns: repeat(3, 1fr); margin-top: 14px; border-top: 0; }
.fact { padding: 14px 0 0; }
.fact + .fact { border-left: 1px solid var(--border); padding-left: 16px; }
.fact-n { font-size: 24px; font-weight: 500; }
.fact-l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.mini-log { display: flex; flex-direction: column; margin-top: 10px; }
.ml-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.ml-row:last-child { border-bottom: 0; }
.ml-when { color: var(--faint); font-size: 11.5px; padding-top: 1px; }
.ml-msg { overflow-wrap: anywhere; }

/* ---------- tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); font-weight: 500; padding: 14px 18px;
  border-bottom: 1px solid var(--border); background: var(--surface); }
td { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px;
  vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.current { background: rgba(48,209,88,.06); }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.mini-card { width: 38px; height: 24px; border-radius: 5px; flex: none;
  background: linear-gradient(128deg, #5a5a5f, #1c1c1f 40%, #6a6a70 60%, #222 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); position: relative; }
.mini-card::after { content: ""; position: absolute; left: 5px; top: 8px; width: 7px;
  height: 6px; border-radius: 1.5px; background: #c7c7cc; }
.mini-card.blank { background: linear-gradient(128deg, #d8d8dc, #9a9aa0 50%, #c7c7cc); }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .big { color: var(--text); font-weight: 650; font-size: 17px; margin-bottom: 6px; }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 12px; }

/* ---------- customers ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; }
.person { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; cursor: pointer;
  transition: background .15s, border-color .15s; }
.person:hover { background: var(--surface-2); border-color: var(--border-2); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid;
  place-items: center; font-weight: 700; font-size: 16px; color: #000;
  background: linear-gradient(135deg, #f5f5f7, #9a9aa0); margin-bottom: 14px; }
.person .name { font-weight: 650; font-size: 16px; }
.person .mail { color: var(--muted); font-size: 13px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .foot { display: flex; justify-content: space-between; margin-top: 16px;
  color: var(--muted); font-size: 12.5px; }

/* ---------- clone stepper ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 22px; }
.step { display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); }
.step .num { width: 30px; height: 30px; border-radius: 50%; display: grid;
  place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-3); }
.step.active { color: var(--text); border-color: #3a3a3c; background: var(--surface-2); }
.step.active .num { background: #fff; color: #000; }
.step.done .num { background: var(--success); color: #000; }
.step .t { font-weight: 600; font-size: 14px; }
.step .d { font-size: 12.5px; color: var(--muted); }
.clone-grid { display: grid; grid-template-columns: 1fr 380px; gap: 18px; }
.mini-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mini-stage .card-wrap { max-width: 330px; }
.result { text-align: center; padding: 30px 10px 10px; }
.result .tick { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; background: rgba(48,209,88,.14);
  color: var(--success); }
.result .tick svg { width: 30px; height: 30px; }
.result h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.015em; }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px;
  align-items: center; margin: 22px 0 6px; text-align: left; }
.compare .box { background: var(--surface-2); border-radius: 14px; padding: 14px 16px;
  border: 1px solid var(--border-2); font-size: 13px; }
.compare .box .k { color: var(--muted); font-size: 12px; }

/* ---------- activity ---------- */
.timeline { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border); }
.ev:last-child { border-bottom: 0; }
.ev .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); }
.ev .ic svg { width: 16px; height: 16px; }
.ev .ic.ok { color: var(--success); background: rgba(48,209,88,.12); }
.ev .ic.bad { color: var(--danger); background: rgba(255,69,58,.12); }
.ev .ic.info { color: #fff; }
.ev .msg { font-size: 14px; overflow-wrap: anywhere; }
.ev .kind { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.ev .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- batch ---------- */
.progress { height: 10px; border-radius: 99px; background: var(--surface-3);
  overflow: hidden; margin: 14px 0; }
.progress i { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #fff, #d1d1d6); border-radius: 99px;
  transition: width .4s; }
.batch-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-pill { font-family: var(--mono); font-size: 12px; padding: 5px 10px;
  border-radius: 99px; background: var(--surface-3); }
.chip-pill.ok { color: var(--success); background: rgba(48,209,88,.1); }
.chip-pill.bad { color: var(--danger); background: rgba(255,69,58,.1); }

/* ---------- modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.66);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid;
  place-items: center; z-index: 50; animation: fadein .18s ease; padding: 20px; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 24px;
  padding: 28px; box-shadow: 0 40px 80px rgba(0,0,0,.6);
  animation: pop .22s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.015em; }
.modal .lead { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal .input { background: #111112; }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex;
  flex-direction: column; gap: 10px; z-index: 60; }
.toast { display: flex; gap: 12px; align-items: flex-start; min-width: 300px;
  max-width: 420px; padding: 14px 16px; border-radius: 16px;
  background: #1C1C1E; border: 1px solid var(--border-2);
  box-shadow: 0 20px 40px rgba(0,0,0,.5); font-size: 14px;
  animation: pop .22s cubic-bezier(.2,.8,.2,1); }
.toast .dot { margin-top: 6px; }
.toast .tt { font-weight: 650; }
.toast .td { color: var(--muted); font-size: 13px; margin-top: 2px; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .actions { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .clone-grid { grid-template-columns: 1fr; }
}

/* Keyboard focus: visible on everything that can be clicked. */
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
tr[tabindex]:focus-visible { outline-offset: -2px; }
