/* Admin mockups — shared design tokens + component styles.
   Extracted from catalog.html and aligned with team/_shared.css so every
   Admin/Settings mockup (catalog, markup-rules, regions, users, etc.)
   stays visually consistent.
   Applied via <link rel="stylesheet" href="../admin/_shared.css">. */

/* ── Design tokens ── */
:root {
  --ns-bg: #0c1222;
  --ns-surface: rgba(255,255,255,0.04);
  --ns-surface-h: rgba(255,255,255,0.07);
  --ns-border: rgba(255,255,255,0.08);
  --ns-border-h: rgba(255,255,255,0.12);
  --ns-inset-glow: inset 0 1px 0 rgba(255,255,255,0.04);
  --ns-text-100: rgba(255,255,255,0.95);
  --ns-text-70: rgba(255,255,255,0.70);
  --ns-text-45: rgba(255,255,255,0.45);
  --ns-text-25: rgba(255,255,255,0.25);

  --ns-accent: #818cf8;
  --ns-accent-glow: rgba(129,140,248,0.10);
  --ns-info: #60a5fa;
  --ns-positive: #34d399;
  --ns-warning: #fbbf24;
  --ns-critical: #f97316;
  --ns-danger: #f87171;

  --card-shadow: 0 0 0 1px var(--ns-border), var(--ns-inset-glow);
  --glass-bg: rgba(255,255,255,0.06);
  --glass-shadow: 0 0 0 1px rgba(255,255,255,0.06), inset 0 1px 0 rgba(255,255,255,0.04);

  --ease: cubic-bezier(0.22,1,0.36,1);
  --transition: 150ms var(--ease);
}

/* ── Light mode overrides ── */
.light {
  --ns-bg: #f0f1f5;
  --ns-surface: rgba(255,255,255,0.85);
  --ns-surface-h: rgba(255,255,255,0.95);
  --ns-border: rgba(0,0,0,0.10);
  --ns-border-h: rgba(0,0,0,0.15);
  --ns-inset-glow: inset 0 1px 0 rgba(255,255,255,0.6);
  --ns-text-100: #1a1d26;
  --ns-text-70: #44495a;
  --ns-text-45: #6b7188;
  --ns-text-25: #9ba0b3;

  --ns-accent: #818cf8;
  --ns-accent-glow: rgba(129,140,248,0.08);
  --ns-info: #60a5fa;
  --ns-positive: #34d399;
  --ns-warning: #d97706;
  --ns-critical: #dc2626;
  --ns-danger: #dc2626;

  --card-shadow: 0 0 0 1px var(--ns-border), 0 1px 3px rgba(0,0,0,0.06);
  --glass-bg: rgba(255,255,255,0.70);
  --glass-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}

/* ── Base reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', sans-serif;
  background: var(--ns-bg);
  color: var(--ns-text-100);
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ns-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.10); }

/* ── Monospace utility ── */
.mono {
  font-family: 'Geist Mono', 'SF Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* ── Top nav ── */
.top-nav {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(12,18,34,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  z-index: 50;
}
.light .top-nav {
  background: rgba(240,241,245,0.92);
  border-bottom-color: rgba(0,0,0,0.06);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 28px;
  text-decoration: none;
  color: var(--ns-text-100);
}
.nav-brand:hover { text-decoration: none; }
.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: white;
}
.nav-brand-text { font-size: 18px; font-weight: 700; letter-spacing: 0.18em; }
.nav-items { display: flex; align-items: center; gap: 2px; flex: 1; }
.ni {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  color: var(--ns-text-45);
}
.ni:hover { color: var(--ns-text-70); background: rgba(255,255,255,0.04); text-decoration: none; }
.ni.active {
  color: var(--ns-text-100);
  background: rgba(255,255,255,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 0 1px rgba(255,255,255,0.08);
}
.light .ni.active { background: rgba(0,0,0,0.06); box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 0 0 1px rgba(0,0,0,0.08); }
.light .ni:not(.active):hover { background: rgba(0,0,0,0.03); }
.nav-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nib {
  padding: 7px;
  border-radius: 8px;
  color: var(--ns-text-45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}
.nib:hover { color: var(--ns-text-70); background: rgba(255,255,255,0.04); }
.light .nib:hover { background: rgba(0,0,0,0.03); }
.nco {
  font-size: 12px;
  font-weight: 500;
  color: var(--ns-text-70);
  background: none;
  border: none;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.ndiv { width: 1px; height: 20px; background: rgba(255,255,255,0.06); margin: 0 6px; }
.light .ndiv { background: rgba(0,0,0,0.10); }
.hled {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}
.ns {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Admin shell layout ── */
.admin-shell {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── Admin sidebar ── */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 16px 12px;
  border-right: 1px solid var(--ns-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.light .admin-sidebar {
  scrollbar-color: rgba(0,0,0,0.10) transparent;
}
.admin-sidebar .group-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ns-text-45);
  padding: 12px 12px 6px;
}
.admin-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ns-text-45);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.admin-sidebar .nav-link:hover {
  color: var(--ns-text-70);
  background: var(--ns-surface-h);
  text-decoration: none;
}
.admin-sidebar .nav-link.active {
  color: var(--ns-text-100);
  background: rgba(129,140,248,0.08);
  box-shadow: 0 0 0 1px rgba(129,140,248,0.12);
}
.admin-sidebar .nav-link svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  flex-shrink: 0;
}
.admin-sidebar .nav-link.active svg {
  opacity: 1;
  color: var(--ns-accent);
}

/* ── Admin main content ── */
.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.light .admin-main {
  scrollbar-color: rgba(0,0,0,0.10) transparent;
}

/* ── Page header ── */
.page-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-hdr h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.page-hdr .sub {
  font-size: 12px;
  color: var(--ns-text-45);
  margin-top: 2px;
}

/* ── Cards ── */
.card {
  background: var(--ns-surface);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Data tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ns-text-45);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ns-border);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
.data-table th.right,
.data-table td.right { text-align: right; }
.data-table td {
  font-size: 12px;
  color: var(--ns-text-70);
  padding: 10px 12px;
  border-bottom: 1px solid var(--ns-border);
  vertical-align: middle;
}
.data-table tr { cursor: pointer; transition: all var(--transition); }
.data-table tr:hover td { background: var(--ns-surface-h); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--ns-accent);
  color: #000;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  background: var(--ns-surface);
  color: var(--ns-text-70);
  box-shadow: 0 0 0 1px var(--ns-border);
}
.btn-secondary:hover { background: var(--ns-surface-h); }
.btn-ghost {
  background: none;
  color: var(--ns-text-45);
}
.btn-ghost:hover { color: var(--ns-text-70); background: var(--ns-surface); }
.btn-danger {
  background: rgba(248,113,113,0.12);
  color: var(--ns-danger);
  box-shadow: 0 0 0 1px rgba(248,113,113,0.25);
}
.btn-danger:hover { background: rgba(248,113,113,0.18); }
.btn-sm { padding: 5px 10px; font-size: 10px; }
.btn-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--ns-border);
  margin-top: 14px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}
.badge-positive  { background: rgba(52,211,153,0.12);  color: var(--ns-positive); }
.badge-warning   { background: rgba(251,191,36,0.12);  color: var(--ns-warning); }
.badge-danger    { background: rgba(248,113,113,0.12); color: var(--ns-danger); }
.badge-info      { background: rgba(96,165,250,0.12);  color: var(--ns-info); }
.badge-accent    { background: rgba(129,140,248,0.12); color: var(--ns-accent); }
.badge-neutral   { background: var(--ns-surface-h);    color: var(--ns-text-45); }

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.form-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ns-text-45);
}
.form-input,
.form-select {
  background: var(--ns-surface);
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--ns-text-100);
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus,
.form-select:focus {
  border-color: var(--ns-accent);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.12);
}
.form-select { appearance: none; cursor: pointer; }

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  gap: 1px;
  padding: 3px;
  border-radius: 10px;
  background: var(--ns-surface);
  box-shadow: 0 0 0 1px var(--ns-border);
  margin-bottom: 20px;
  width: fit-content;
}
.tab-item {
  font-size: 12px;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  background: none;
  color: var(--ns-text-45);
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-item:hover:not(.active) {
  color: var(--ns-text-70);
  background: rgba(255,255,255,0.02);
}
.tab-item.active {
  color: var(--ns-text-100);
  background: var(--ns-surface-h);
  box-shadow: 0 1px 8px rgba(0,0,0,0.15), 0 0 0 1px var(--ns-border);
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--ns-bg);
  border: 1px solid var(--ns-border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px var(--ns-border);
  width: 520px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
}
.light .modal {
  background: #f8f9fb;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 0 0 1px var(--ns-border);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ns-border);
}
.modal-header h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ns-text-45);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover {
  color: var(--ns-text-100);
  background: var(--ns-surface-h);
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--ns-border);
}

/* ── Info tooltips ── */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: var(--ns-text-45);
  font-size: 9px;
  font-weight: 700;
  cursor: default;
  flex-shrink: 0;
}
.info-tip::before {
  content: 'i';
}
.info-tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e2438;
  color: var(--ns-text-70);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--ns-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  white-space: nowrap;
  max-width: 240px;
  white-space: normal;
  text-align: center;
  z-index: 200;
  pointer-events: none;
}
.light .info-tip:hover::after {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ── Toggle switches ── */
.toggle {
  position: relative;
  width: 32px;
  height: 18px;
  background: rgba(255,255,255,0.12);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ns-text-100);
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on { background: var(--ns-accent); }
.toggle.on::after { transform: translateX(14px); }

/* ── Utility classes ── */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

.text-right  { text-align: right; }
.text-center { text-align: center; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Divider ── */
.divider { height: 1px; background: var(--ns-border); margin: 12px 0; }
