/* Konduyt Phone Number Simulator — visual language mirrors konduyt.dev:
   white ground with a dot grid, black accent, thin borders, Inter. */

:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --body: #3d3d3d;
  --muted: #6b6b6b;
  --border: #e7e7e7;
  --border-strong: #d4d4d4;
  --panel: #fafafa;
  --dot: rgba(0, 0, 0, 0.13);
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --amber-ink: #92600a;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-border: #fecdca;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--ink); }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; letter-spacing: -0.03em;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-divider { width: 1px; height: 22px; background: var(--border); }
.brand-product { font-size: 14px; font-weight: 600; color: var(--body); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px;
  color: var(--muted); background: #fff; white-space: nowrap;
}
.pill-test { border-color: var(--amber-border); background: var(--amber-soft); color: var(--amber-ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-email { font-size: 13px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layout {
  max-width: 1360px; margin: 0 auto; padding: 24px 28px 64px;
  display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 28px;
  align-items: start;
}
.sidebar { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-group + .sidebar-group { margin-top: 18px; }
.sidebar-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 0 12px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; text-decoration: none;
  font-size: 14px; font-weight: 500; color: var(--body); border: 1px solid transparent;
}
.nav-item:hover { background: #fff; border-color: var(--border); color: var(--ink); }
.nav-item.active { background: #fff; border-color: var(--border); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-count {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--muted); background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 7px;
}

/* ---------- content ---------- */
.content { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
h1 { font-size: 27px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: 17px; letter-spacing: -0.01em; font-weight: 650; }
.sub { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.page-head .btn { margin-left: auto; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--amber-border); background: var(--amber-soft);
  color: var(--amber-ink); border-radius: var(--radius); padding: 12px 14px;
  font-size: 12.5px; line-height: 1.55;
}
.notice strong { font-weight: 700; }
.notice svg { flex: none; margin-top: 1px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.card-head .sub { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- buttons + forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: #fff; color: var(--ink); border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.06); text-decoration: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--panel); border-color: var(--border-strong); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--panel); border-color: var(--border); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.btn-danger:hover { background: #fde8e6; border-color: #f9b9b3; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--body); }
input, select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px; outline: none; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: #a9a9a9; box-shadow: 0 0 0 3px rgba(10,10,10,0.07); }
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.input-mono { font-family: var(--mono); font-size: 13px; }
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 18px; border-bottom: 1px solid var(--border); background: #fff;
}
.check-field {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px;
  font-weight: 500; color: var(--body); padding-bottom: 9px; white-space: nowrap;
}
.check-field input { width: auto; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > label.field { flex: 1 1 150px; min-width: 0; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------- table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--panel);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--body); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcfcfc; }
td.num, .mono { font-family: var(--mono); font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .btn + .btn { margin-left: 6px; }
.row-link { cursor: pointer; }

/* ---------- status chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 9px; border: 1px solid var(--border); color: var(--muted); background: #fff;
  white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip-available { color: #0a0a0a; border-color: var(--border-strong); background: var(--panel); }
.chip-assigned { color: #fff; background: var(--ink); border-color: var(--ink); }
.chip-retired { color: var(--muted); background: var(--panel); }
.chip-active { color: var(--amber-ink); border-color: var(--amber-border); background: var(--amber-soft); }
.chip-verified { color: #05603a; border-color: #abefc6; background: #ecfdf3; }
.chip-expired { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-title { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.msg-body { font-size: 12.5px; color: var(--body); line-height: 1.55; margin-top: 3px; word-break: break-word; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ---------- detail ---------- */
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-number { font-family: var(--mono); font-size: 25px; letter-spacing: -0.02em; }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.meta-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.meta-value { font-size: 13px; color: var(--ink); margin-top: 4px; word-break: break-word; }
.otp-code {
  font-family: var(--mono); font-size: 30px; letter-spacing: 0.28em;
  font-weight: 700; padding: 10px 0 4px;
}
.otp-box {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 16px 18px; background: var(--panel);
}
.countdown { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- auth ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); }
.auth-card .brand { margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin: 18px 0; }
.auth-tab { flex: 1; border: none; background: transparent; padding: 8px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-note { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 16px; }

/* ---------- toast + misc ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast {
  background: var(--ink); color: #fff; font-size: 13px; line-height: 1.5;
  padding: 11px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: slide .18s ease;
}
.toast.error { background: var(--danger); }
.toast.ok { background: #05603a; }
@keyframes slide { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.pagination { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pagination .sub { font-size: 12px; }
.pagination .spacer { margin-left: auto; }

.skeleton { color: var(--muted); font-size: 13px; padding: 28px; text-align: center; }
.error-box { border: 1px solid var(--danger-border); background: var(--danger-soft); color: var(--danger); border-radius: var(--radius); padding: 14px 16px; font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label.field { min-width: 120px; flex: 1 1 120px; }
.verify-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
.verify-row label.field { flex: 1 1 140px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px 18px 56px; }
  .sidebar {
    position: static; flex-direction: row; overflow-x: auto; gap: 6px;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .sidebar-label { display: none; }
  .sidebar-group { display: flex; flex-direction: row; gap: 6px; }
  .sidebar-group + .sidebar-group { margin-top: 0; }
  .nav-item { white-space: nowrap; border: 1px solid var(--border); background: #fff; }
  .nav-count { display: none; }
  .topbar-inner { padding: 12px 18px; }
  h1 { font-size: 23px; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-number { font-size: 21px; }
}
@media (max-width: 560px) {
  .brand-product, .brand-divider, .user-email { display: none; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 24px; }
  .card-head { padding: 14px; }
  .card-body { padding: 14px; }
  .meta-grid { grid-template-columns: minmax(0, 1fr); }
  .otp-code { font-size: 24px; }
  .btn { font-size: 13px; }
}
