/* NTP V2 Secure Docs — v2 light/clean UI (minimal clutter, modern, airy) */
:root {
  --bg: #f8faff;
  --bg2: #eef3ff;
  --card: #ffffffe6;
  --stroke: #e8ecf6;
  --text: #05070f;
  --muted: #667089;
  --muted2: #8a93a8;
  --primary-contrast: #0b1220;

  --primary: #2563eb;
  --primary2: #06b6d4;
  --ok: #16a34a;
  --bad: #e11d48;
  --warn: #f59e0b;

  --shadow: 0 18px 42px rgba(14, 19, 37, 0.08);
  --shadow2: 0 8px 18px rgba(14, 19, 37, 0.07);

  --r: 14px;
  --r2: 18px;

  --mono:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --sans:
    ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica,
    "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}

[data-theme="dark"] .btn.primary {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
}

[data-theme="dark"] .nav-item {
  color: #9ca3af;
}

[data-theme="dark"] .nav-item.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #f9fafb;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --bg2: #0a0f1e;
  --card: #0f172acc;
  --stroke: #1f2a44;
  --text: #eaf0ff;
  --muted: #a8b3cc;
  --muted2: #8e9ab5;
  --primary-contrast: #f5f7ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --shadow2: 0 10px 26px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}
a,
button,
a:hover,
a:focus,
button:hover,
button:focus {
  text-decoration: none;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--sans);
  background-color: #f5f7fb;
  color: var(--text);
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}

/* Concept banner */
.concept-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--primary) 20%, var(--card)),
    color-mix(in oklab, var(--primary2) 15%, var(--card))
  );
  border-bottom: 1px solid var(--stroke);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
}

.hidden {
  display: none !important;
}
.mono {
  font-family: var(--mono);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.right {
  text-align: right;
}

/* AUTH */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(520px, 96vw);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  padding: 18px;
}
.auth-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 14px;
}
.mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.12),
    rgba(6, 182, 212, 0.1)
  );
  border: 1px solid var(--stroke);
}
.mark.small {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}
.mk-hex {
  fill: transparent;
  stroke: color-mix(in oklab, var(--primary) 45%, transparent);
  stroke-width: 1.2;
}
.mk-hex2 {
  fill: transparent;
  stroke: color-mix(in oklab, var(--primary2) 40%, transparent);
  stroke-width: 1.2;
}
.mk-line {
  stroke: color-mix(in oklab, var(--text) 70%, transparent);
  stroke-width: 1.3;
  stroke-linecap: round;
}

.auth-title {
  letter-spacing: 0.2px;
  font-size: 18px;
}
.auth-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.auth-form {
  padding: 6px 10px 10px;
}
.row {
  margin-bottom: 12px;
}
.row.inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.input,
.select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--card) 85%, transparent);
  color: var(--text);
  outline: none;
}
.input::placeholder {
  color: var(--muted2);
}
.search input::placeholder {
  color: var(--muted2);
}
.input:focus,
.select:focus {
  border-color: color-mix(in oklab, var(--primary) 55%, var(--stroke));
}

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
}
.chk input {
  accent-color: var(--primary);
}

/* Buttons */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  font-weight: 750;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0px) scale(0.99);
}
.btn.primary {
  border-color: #1d4ed8;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
}
.btn.danger {
  border-color: color-mix(in oklab, var(--bad) 35%, var(--stroke));
  background: color-mix(in oklab, var(--bad) 10%, var(--card));
}
.w100 {
  width: 100%;
}

.pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--muted);
  white-space: nowrap;
}

/* APP Layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  background: color-mix(in oklab, var(--card) 85%, transparent);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}
.shell.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
}
.sidebar {
  width: 200px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.side-head {
  padding: 14px;
}
.account {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.12),
    rgba(6, 182, 212, 0.1)
  );
  border: 1px solid var(--stroke);
}
.account-id {
  font-size: 12px;
  color: var(--muted);
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0;
}
.nav-item {
  text-align: left;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #374151;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.nav-item:hover {
  background: color-mix(in oklab, var(--card) 70%, transparent);
  border-color: var(--stroke);
  color: var(--text);
}
.nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  color: #111827;
}
.side-foot {
  padding: 14px;
  border-top: 1px solid var(--stroke);
}
.mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}
.mini-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--card) 80%, transparent);
  color: var(--muted);
}
.badge.ok {
  color: color-mix(in oklab, var(--ok) 85%, var(--text));
  border-color: color-mix(in oklab, var(--ok) 25%, var(--stroke));
}

.content {
  min-height: auto;
}
.view {
  display: block;
}
.content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 12px;
  margin: 4px 2px 12px;
}
.content-head > div:first-child {
  flex: 0 0 auto;
}
.h1 {
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}
.content-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}
.content-actions > * {
  flex: 0 1 auto;
  min-width: 0;
}
.content-actions .btn,
.content-actions .select,
.content-actions .search input {
  height: 36px;
}

.search input {
  width: clamp(150px, 22vw, 280px);
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--card) 92%, transparent);
}
.content-actions .select {
  width: clamp(150px, 18vw, 210px);
}

.files-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed var(--stroke);
  background: color-mix(in oklab, var(--card) 90%, transparent);
}
.files-preview.is-empty {
  border-style: solid;
}
.files-preview-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.files-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.files-preview-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--card) 94%, transparent);
}
.files-preview-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.18),
    rgba(6, 182, 212, 0.12)
  );
  color: var(--text);
  font-size: 16px;
}
.files-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.files-preview-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.files-preview-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.files-preview-size {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Cards + tables */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  padding: 14px;
}

.table-wrap {
  overflow: visible;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--card) 95%, transparent);
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}
.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: middle;
  word-break: break-word;
}
.table td.mono,
.table .mono {
  word-break: break-all;
}
.table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.table tr:hover td {
  background: color-mix(in oklab, var(--primary) 6%, transparent);
}
.table-strong {
  font-weight: 700;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--card);
  cursor: pointer;
}
.icon-btn:hover {
  transform: translateY(-1px);
}
.icon-btn.danger {
  border-color: color-mix(in oklab, var(--bad) 35%, var(--stroke));
  background: color-mix(in oklab, var(--bad) 10%, var(--card));
}

.tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--card) 92%, transparent);
}
.kv-row .k {
  color: var(--muted);
}
.kv-row .v {
  color: var(--text);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.crypto-profile .kv-row {
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}
.crypto-profile .v {
  max-width: none;
  text-align: right;
}
.crypto-profile .chip {
  font-size: 12px;
}
.access-link {
  word-break: break-all;
  white-space: normal;
}
.doc-link {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  word-break: break-all;
}
.doc-link:hover {
  color: var(--text);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.22);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
}
[data-theme="dark"] .modal {
  background: rgba(0, 0, 0, 0.55);
}
.modal-card {
  width: min(760px, 96vw);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  overflow: hidden;
}
.modal-card.wide {
  width: min(1100px, 98vw);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
}
.modal-title {
  font-weight: 900;
}
.modal-body {
  padding: 14px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--stroke);
}
.copyline {
  display: flex;
  gap: 10px;
  align-items: center;
}
.copyline input {
  flex: 1;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cipher {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  background: color-mix(in oklab, var(--card) 92%, transparent);
}
.cipher-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
}
.cipher-title {
  font-weight: 900;
}
.cipher-pre {
  margin: 0;
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  max-height: 340px;
  overflow: auto;
}

/* Toggles */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  margin-bottom: 10px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input {
  display: none;
}
.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 18%, var(--card));
  border: 1px solid var(--stroke);
  transition: 0.18s;
}
.slider:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--text) 85%, white);
  transition: 0.18s;
}
.switch input:checked + .slider {
  background: color-mix(in oklab, var(--primary) 22%, var(--card));
  border-color: color-mix(in oklab, var(--primary) 25%, var(--stroke));
}
.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* Audit */
.audit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.audit-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: color-mix(in oklab, var(--card) 92%, transparent);
}
.audit-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-right {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .shell.layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 100%;
  }
  .search input {
    width: clamp(140px, 30vw, 220px);
  }
}
@media (max-width: 900px) {
  .topbar-inner {
    flex-wrap: wrap;
  }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .content-actions .btn {
    padding: 9px 10px;
  }
  .content-actions .select {
    width: clamp(140px, 28vw, 200px);
  }
  .table,
  .table thead,
  .table tbody,
  .table tr,
  .table td,
  .table th {
    display: block;
    width: 100%;
  }
  .table thead {
    display: none;
  }
  .table tr {
    padding: 12px;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    margin-bottom: 12px;
    background: color-mix(in oklab, var(--card) 96%, transparent);
  }
  .table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
  }
  .table td::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
  }
  .table td[colspan] {
    justify-content: center;
    text-align: center;
  }
  .table td[colspan]::before {
    content: "";
    display: none;
  }
  .table td.right {
    justify-content: space-between;
  }
  .row-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 820px) {
  .content-head {
    flex-wrap: wrap;
  }
  .content-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .content-actions > * {
    flex: 1 1 200px;
  }
  .content-actions .btn,
  .content-actions .select,
  .content-actions .search {
    width: 100%;
  }
}
@media (max-width: 720px) {
  .topbar-inner {
    padding: 10px 12px;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-item {
    flex: 1 1 45%;
    text-align: center;
  }
  .kv-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .kv-row .v {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    word-break: break-word;
  }
  .crypto-profile .v {
    text-align: left;
  }
  .toggle-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .audit-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .audit-right {
    width: 100%;
    justify-content: space-between;
  }
}
@media (max-width: 620px) {
  .auth-card {
    padding: 14px;
  }
  .auth-brand {
    flex-wrap: wrap;
  }
  .row.inline {
    flex-wrap: wrap;
  }
  .content-actions > * {
    flex: 1 1 100%;
  }
  .content-actions .btn {
    width: 100%;
  }
  .copyline {
    flex-direction: column;
    align-items: stretch;
  }
  .copyline .btn {
    width: 100%;
  }
}
@media (max-width: 560px) {
  .content-head {
    gap: 8px;
  }
  .h1 {
    font-size: 20px;
  }
  .content-actions .btn {
    font-size: 12px;
  }
  .content-actions .select,
  .search input {
    width: clamp(120px, 34vw, 170px);
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .files-preview-item {
    grid-template-columns: 32px 1fr;
  }
  .files-preview-size {
    grid-column: 2 / -1;
  }
}

@media (max-width: 480px) {
  .concept-banner {
    font-size: 12px;
    padding: 8px 12px;
  }
  .auth-card {
    width: 100%;
  }
  .topbar-inner {
    padding: 8px 12px;
  }
}
