:root {
  --bg: #080c11;
  --bg-soft: #0d131b;
  --panel: #101822;
  --panel-2: #0c1219;
  --border: #1d2836;
  --border-soft: #17212d;
  --text: #e8eef6;
  --muted: #8a99ab;
  --muted-2: #64748b;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.12);
  --up: #4ade80;
  --down: #f87171;
  --blue: #60a5fa;
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(74, 222, 128, 0.09), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(96, 165, 250, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

button { font-family: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 22px 56px;
}

/* ---------------- header ---------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #05160c;
  background: linear-gradient(145deg, #6ee7a0, #34d399 55%, #22c55e);
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.logo svg { width: 23px; height: 23px; }

h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tagline {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.06s ease,
              color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.btn:hover { background: #16202c; border-color: #2a394c; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn .icon { width: 15px; height: 15px; }

.btn-primary {
  background: linear-gradient(180deg, #53e28c, #2fc96e);
  border-color: rgba(0, 0, 0, 0.15);
  color: #04150b;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #63eda0, #38d878);
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-primary .icon { stroke-width: 2.4; }

.btn-ghost { background: transparent; }

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}

.btn-danger-ghost:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.5);
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover { background: #1b2532; color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------- auto refresh switch ---------------- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px 0 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  cursor: pointer;
  user-select: none;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch-track {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: #2a3644;
  position: relative;
  transition: background 0.18s ease;
}

.switch-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #9aa9bb;
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .switch-track { background: rgba(74, 222, 128, 0.32); }
.switch input:checked + .switch-track .switch-dot {
  transform: translateX(13px);
  background: var(--accent);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ---------------- summary cards ---------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 22px;
}

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
              var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 15px 17px 14px;
  min-width: 0;
}

.card-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.card-value {
  margin-top: 7px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos { color: var(--up); }
.neg { color: var(--down); }

/* ---------------- panel + table ---------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
}

.panel-head h2 {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

thead th {
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 14px;
  background: #0b1118;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

thead th:first-child { text-align: left; padding-left: 18px; }
thead th:last-child { padding-right: 18px; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }

th.sorted { color: var(--text); }
th.sorted::after {
  content: "↓";
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.85;
}
th.sorted.asc::after { content: "↑"; }

tbody td {
  padding: 13px 14px;
  border-top: 1px solid var(--border-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr:first-child td { border-top: 0; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.022); }

td:first-child { text-align: left; padding-left: 18px; }
td:last-child { padding-right: 14px; }

.ticker-cell { display: flex; align-items: center; gap: 10px; }

.symbol {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  min-width: 0;
}

.name {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: none;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
}

.num-sub {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.qty { color: #cbd5e1; }

.muted-dash { color: var(--muted-2); }

.err-tag {
  color: #fca5a5;
  font-size: 10.5px;
  cursor: help;
  border-bottom: 1px dotted rgba(248, 113, 113, 0.5);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.14s ease;
}

tbody tr:hover .row-actions,
tbody tr:focus-within .row-actions { opacity: 1; }

.row-actions .icon-btn { width: 28px; height: 28px; }
.row-actions .icon-btn svg { width: 15px; height: 15px; }
.row-actions .icon-btn:hover { background: #1e2a38; }
.icon-btn.delete:hover { color: #fca5a5; }

/* price flash */
@keyframes flashUp { from { background: rgba(74, 222, 128, 0.16); } to { background: transparent; } }
@keyframes flashDown { from { background: rgba(248, 113, 113, 0.14); } to { background: transparent; } }
tr.flash-up td { animation: flashUp 0.9s ease-out; }
tr.flash-down td { animation: flashDown 0.9s ease-out; }

/* ---------------- empty state ---------------- */

.empty {
  padding: 48px 24px 52px;
  text-align: center;
  border-top: 1px solid var(--border-soft);
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.empty-icon svg { width: 26px; height: 26px; }

.empty h3 { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 13px; }

.chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 20px;
  flex-wrap: wrap;
}

.chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.chip:hover { border-color: #35485f; color: var(--text); background: #16202c; }

/* ---------------- notice ---------------- */

.notice {
  padding: 11px 18px;
  border-top: 1px solid rgba(251, 191, 36, 0.18);
  background: rgba(251, 191, 36, 0.06);
  color: #fcd34d;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------------- footer ---------------- */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 0 4px;
  color: var(--muted-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* ---------------- dialog ---------------- */

.editor {
  width: min(480px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid #263545;
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.editor::backdrop {
  background: rgba(3, 6, 10, 0.66);
  backdrop-filter: blur(4px);
}

.editor[open] { animation: dialogIn 0.16s ease-out; }

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}

.dialog-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }

.dialog-body { padding: 4px 20px 8px; }

.field { margin-bottom: 15px; min-width: 0; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #0a1017;
  border: 1px solid #22303f;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.field input::placeholder { color: #4b5a6b; }

.field input:focus {
  outline: none;
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

#symbolInput { text-transform: uppercase; }
#symbolInput::placeholder { text-transform: none; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.45;
  min-height: 16px;
}

.hint strong { color: var(--muted); font-weight: 600; }

#costCurrency { color: var(--muted-2); font-weight: 600; }

/* suggestions */

.search-wrap { position: relative; }

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  background: #0c131c;
  border: 1px solid #263545;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  padding: 5px;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.suggestion:hover,
.suggestion.active { background: #1a2534; }

.suggestion .s-sym {
  font-weight: 700;
  font-size: 12.5px;
  min-width: 74px;
  color: var(--text);
}

.suggestion .s-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion .s-exch {
  flex: none;
  font-size: 9.5px;
  color: var(--muted-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
}

.suggestion-empty {
  padding: 11px 10px;
  font-size: 12px;
  color: var(--muted-2);
}

.form-error {
  margin: 2px 0 6px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(248, 113, 113, 0.09);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
  font-size: 12.5px;
  line-height: 1.45;
}

.dialog-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 20px 18px;
}

.spacer { flex: 1; }

/* ---------------- toasts ---------------- */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 11px 14px;
  border-radius: 10px;
  background: #121b26;
  border: 1px solid #263545;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 12.5px;
  color: var(--text);
  animation: toastIn 0.18s ease-out;
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: #201317;
  color: #fecaca;
}

.toast-action {
  margin-left: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toast-action:hover { color: #86efac; }

.spinning .icon { animation: spin 0.85s linear infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-value { font-size: 21px; }
}

@media (max-width: 620px) {
  .wrap { padding: 22px 14px 44px; }
  .top { gap: 14px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .switch { order: 3; }
  .cards { gap: 10px; }
  .card { padding: 13px 14px; }
  .card-value { font-size: 18px; }
  .foot { flex-direction: column; gap: 4px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .row-actions { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Navigatie & subpagina's
   ========================================================================== */

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(13, 19, 27, 0.75);
}

.nav a {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav a:hover { color: var(--text); background: #141d28; }

.nav a.active {
  color: var(--text);
  background: #1b2634;
  box-shadow: inset 0 0 0 1px #2b3b4e;
}

.page-head { margin: 4px 0 22px; }
.page-head h1 { font-size: 24px; letter-spacing: -0.025em; }
.page-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 68ch;
}

.section { margin-bottom: 18px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.section-head .muted { font-size: 12px; color: var(--muted-2); }

.panel-pad { padding: 18px; }

/* crypto strip op dashboard */

.split {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  padding: 13px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgba(247, 147, 26, 0.07), rgba(96, 165, 250, 0.04) 45%, transparent 70%),
    var(--panel);
}

.split-block { display: flex; flex-direction: column; gap: 2px; }

.split-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.split-value {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.split-link {
  margin-left: auto;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.split-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* forms op subpagina's */

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

.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  background: #0a1017;
  border: 1px solid #22303f;
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
}

.field select:focus {
  outline: none;
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

.help-text {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted-2);
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
}

.toolbar .field { margin: 0; }

.toolbar .btn { height: 42px; }

/* segmented control */

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #0b1118;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.seg button:hover { color: var(--text); }
.seg button.active { background: #1c2735; color: var(--text); }

/* tabel-uitbreidingen */

td .pos, td .neg { font-weight: 600; }

.type-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  vertical-align: 1px;
}

.type-badge.crypto {
  background: rgba(247, 147, 26, 0.14);
  color: #fdba74;
}

/* analysis chart */

.chart-card {
  position: relative;
  padding: 6px 10px 2px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 55%), var(--panel);
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 0;
  font-size: 11.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.chart-wrap { width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: 260px; overflow: visible; }
.chart-empty {
  height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 12.5px;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  padding: 7px 9px;
  border-radius: 8px;
  background: #182230;
  border: 1px solid #2b3a4c;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.1s ease;
  z-index: 5;
}

.chart-tooltip.visible { opacity: 1; }
.chart-tooltip .tt-date { color: var(--muted); display: block; font-size: 10.5px; margin-bottom: 2px; }
.chart-tooltip .tt-value { font-weight: 650; font-variant-numeric: tabular-nums; }

/* analysis extras */

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-stat {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--panel-2);
}

.mini-stat .k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  font-weight: 600;
}

.mini-stat .v {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mini-stat .s { font-size: 11px; color: var(--muted-2); margin-top: 1px; }

.crypto-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid rgba(247, 147, 26, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(500px 160px at 0% 0%, rgba(247, 147, 26, 0.1), transparent 70%),
    var(--panel);
}

.crypto-title { display: flex; align-items: center; gap: 10px; }
.crypto-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(247, 147, 26, 0.16);
  color: #f7931a;
  font-weight: 800;
  font-size: 15px;
}
.crypto-panel .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); font-weight: 600; }
.crypto-panel .v { margin-top: 3px; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.crypto-panel .s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* plan */

.plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.plan-form { padding: 18px; }

.plan-form .field { margin-bottom: 14px; }

.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.plan-actions .btn { flex: 1; min-width: 150px; }

.plan-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.plan-stat {
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
}

.plan-stat .k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.plan-stat .v {
  margin-top: 5px;
  font-size: 21px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.plan-stat .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: #1a2431;
  overflow: hidden;
  margin: 6px 0 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #4ade80);
  transition: width 0.25s ease;
}

.progress-fill.over { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

.schedule-wrap { max-height: 420px; overflow: auto; border-radius: 14px; }

.schedule-table { width: 100%; min-width: 0; }

.schedule-table th, .schedule-table td { padding: 9px 14px; }

.schedule-table tr.highlight td { background: rgba(74, 222, 128, 0.06); }

/* beheer */

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-2);
  margin-bottom: 18px;
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.tabs button:hover { color: var(--text); }
.tabs button.active { background: #1c2735; color: var(--text); }

.tab-panel[hidden] { display: none; }

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
}

.option-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option-card:hover { border-color: #35485f; }

.option-card.selected {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(74, 222, 128, 0.055);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.09);
}

.option-card input { position: absolute; opacity: 0; pointer-events: none; }

.option-radio {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid #3a4b5e;
  display: grid;
  place-items: center;
}

.option-card.selected .option-radio { border-color: var(--accent); }
.option-card.selected .option-radio::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.option-title { font-size: 13.5px; font-weight: 650; }
.option-desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

.settings-block {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--panel);
  padding: 18px;
  margin-bottom: 16px;
}

.settings-block h2 { font-size: 14.5px; font-weight: 650; margin-bottom: 4px; }
.settings-block > p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.settings-row { margin-top: 15px; }

.currency-name { font-variant-numeric: tabular-nums; color: var(--muted); }

/* import */

.instructions { display: grid; gap: 10px; margin-bottom: 16px; }

.instructions details {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.instructions summary {
  padding: 12px 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.instructions summary::-webkit-details-marker { display: none; }
.instructions summary::after {
  content: "+";
  color: var(--muted-2);
  font-weight: 500;
  font-size: 16px;
}
.instructions details[open] summary::after { content: "–"; }

.instructions .body {
  padding: 0 15px 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.instructions ol { margin: 4px 0 0; padding-left: 18px; }
.instructions li { margin-bottom: 3px; }

.import-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 150px;
  padding: 24px;
  border: 1.5px dashed #2c3d50;
  border-radius: 14px;
  background: #0b1118;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.import-drop:hover, .import-drop.dragging {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(74, 222, 128, 0.04);
}

.import-drop .drop-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #152030;
  color: var(--muted);
  margin-bottom: 6px;
}

.import-drop .drop-icon svg { width: 21px; height: 21px; }
.import-drop strong { font-size: 13.5px; font-weight: 600; }
.import-drop span { font-size: 12px; color: var(--muted-2); }

.import-preview { margin-top: 16px; }
.import-preview[hidden] { display: none; }

.preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px 12px 0 0;
  background: #0c131b;
}

.preview-head .broker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: 999px;
}

.preview-head .numbers {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.preview-body {
  border: 1px solid var(--border-soft);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--panel);
  overflow: hidden;
}

.preview-section { padding: 15px 16px; border-top: 1px solid var(--border-soft); }
.preview-section:first-child { border-top: 0; }
.preview-section h3 {
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  margin-bottom: 9px;
}

.mapping-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.mapping-row .m-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-row input {
  width: 120px;
  height: 32px;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  background: #0a1017;
  border: 1px solid #22303f;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
}

.mapping-row input:focus {
  outline: none;
  border-color: rgba(74, 222, 128, 0.5);
}

.preview-table { width: 100%; min-width: 0; }
.preview-table th, .preview-table td { padding: 8px 10px; font-size: 12px; }
.preview-table th { font-size: 10px; }
.preview-table td:first-child { padding-left: 10px; }

.import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.import-actions .mode { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.import-actions select {
  height: 34px;
  background: #0a1017;
  border: 1px solid #22303f;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 0 8px;
}

.import-actions .spacer { flex: 1; }

.warning-list {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 12px;
  color: #fcd34d;
  line-height: 1.55;
}

.warning-list li { margin-bottom: 2px; }

.import-done {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.07);
  color: #bbf7d0;
  font-size: 12.5px;
  line-height: 1.6;
}

/* responsive subpagina's */

@media (max-width: 980px) {
  .plan-layout { grid-template-columns: 1fr; }
  .crypto-panel { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav a { flex: 1; text-align: center; }
  .split { gap: 16px; }
  .split-link { margin-left: 0; width: 100%; }
  .plan-summary { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .crypto-panel { grid-template-columns: 1fr; gap: 12px; }
  .toolbar { align-items: stretch; }
  .toolbar .field { flex: 1 1 100%; }
  .toolbar .seg { width: 100%; }
  .toolbar .seg button { flex: 1; }
}

@media (max-width: 560px) {
  .form-grid, .form-grid.two { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 21px; }
}

/* ==========================================================================
   Versie 2: accounts, mobiel eerst, favorieten, watcher, privacy, PWA
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; }
body { padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--blue); }

/* avatar + gebruikerschip */
.user-chip { display: inline-flex; align-items: center; text-decoration: none; margin-left: auto; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  font-size: 18px; font-weight: 700; color: #05160c; object-fit: cover;
  box-shadow: 0 0 0 2px var(--border);
}
.avatar.lg { width: 56px; height: 56px; font-size: 28px; }
.avatar.xl { width: 84px; height: 84px; font-size: 42px; }

/* onderbalk (mobiel) */
.tabbar { display: none; }
.sheet {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet-panel {
  width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px 20px 0 0; padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 4px;
}
.sheet-user { display: flex; gap: 12px; align-items: center; padding: 6px 8px 14px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.sheet-user div { display: flex; flex-direction: column; min-width: 0; }
.sheet-user span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.sheet-panel a, .sheet-logout {
  display: block; padding: 14px 12px; border-radius: 12px; color: var(--text);
  text-decoration: none; font-size: 15px; font-weight: 600; background: none; border: 0; text-align: left; cursor: pointer;
}
.sheet-panel a.active, .sheet-panel a:hover { background: #16202c; }
.sheet-logout { color: var(--down); }

@media (max-width: 720px) {
  .top .nav { display: none; }
  body.has-tabbar .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(10, 15, 21, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 600;
    background: none; border: 0; cursor: pointer; min-height: 48px; justify-content: center;
  }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--accent); }
  .top { margin-bottom: 18px; flex-wrap: nowrap; }
  .top .tagline { display: none; }
  .top .actions { width: auto; }
  .btn, .field input, .field select { min-height: 44px; }
  .field input, .field select, textarea { font-size: 16px; } /* geen inzoomen op iOS */
}

/* privacy: grote bedragen standaard vervaagd, tik om te tonen */
.privacy-on [data-private] { cursor: pointer; transition: filter 0.2s ease; }
.privacy-on [data-private]:not(.revealed) { filter: blur(9px); user-select: none; }
.privacy-hint { font-size: 11.5px; color: var(--muted-2); margin: -12px 0 16px; }
html:not(.privacy-on) .privacy-hint { display: none; }

/* favorietenstrip / kaartjes */
.fav-strip { margin-bottom: 18px; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.quote-card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 12px 13px; min-width: 0; position: relative; text-decoration: none; color: var(--text);
}
.quote-card .qc-sym { font-weight: 700; font-size: 14px; }
.quote-card .qc-name { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-card .qc-price { margin-top: 8px; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.quote-card .qc-chg { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quote-card.big .qc-price { font-size: 22px; }
.star-btn {
  background: none; border: 0; cursor: pointer; color: var(--muted-2); padding: 4px; line-height: 0;
}
.star-btn svg { width: 18px; height: 18px; }
.star-btn.on { color: #fbbf24; }
.star-btn.on svg { fill: currentColor; }
.quote-card .star-btn { position: absolute; top: 6px; right: 6px; }
.sym-cell { display: flex; align-items: flex-start; gap: 6px; }

/* lijsten met volgorde (watcher) */
.sort-list { list-style: none; margin: 0; padding: 0; }
.sort-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft); background: var(--panel); touch-action: pan-y;
}
.sort-item:last-child { border-bottom: 0; }
.sort-item.dragging { opacity: 0.9; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); position: relative; z-index: 2; background: #16202c; }
.drag-handle {
  cursor: grab; color: var(--muted-2); padding: 8px 4px; touch-action: none; background: none; border: 0; line-height: 0;
}
.drag-handle svg { width: 20px; height: 20px; }
.sort-main { flex: 1; min-width: 0; }
.sort-main .s1 { font-weight: 700; }
.sort-main .s2 { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sort-quote { text-align: right; font-variant-numeric: tabular-nums; }
.sort-quote .p { font-weight: 650; }
.sort-quote .c { font-size: 12px; font-weight: 600; }
.sort-btns { display: flex; gap: 2px; }
.mini-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.mini-btn:hover { color: var(--text); background: #16202c; }
.mini-btn:disabled { opacity: 0.35; cursor: default; }
.mini-btn svg { width: 16px; height: 16px; }

/* formulieren / auth-pagina's */
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 48px 18px 40px; }
.auth-card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 18px; padding: 22px 20px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin-bottom: 18px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; justify-content: center; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.check { display: flex; align-items: center; gap: 9px; margin: 6px 0 12px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.ok-box { background: var(--accent-dim); border: 1px solid rgba(74, 222, 128, 0.3); color: #bbf7d0; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; }
textarea {
  width: 100%; background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
  border-radius: 11px; padding: 10px 12px; font: inherit; resize: vertical; min-height: 90px;
}
.field input[type="checkbox"] { width: auto; min-height: 0; }

/* instellingen / admin */
.stack { display: flex; flex-direction: column; gap: 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.set-row:last-child { border-bottom: 0; }
.set-row .t { font-weight: 600; }
.set-row .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin: 10px 0; }
.emoji-grid button, .color-grid button {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft);
  font-size: 22px; cursor: pointer; padding: 0;
}
.emoji-grid button.sel, .color-grid button.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.codes { font-family: ui-monospace, Menlo, Consolas, monospace; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg-soft); padding: 12px; border-radius: 12px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.tbl th { color: var(--muted-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: #1b2634; color: var(--muted); }
.pill.green { background: var(--accent-dim); color: var(--accent); }
.pill.red { background: rgba(248, 113, 113, 0.12); color: var(--down); }
.pill.blue { background: rgba(96, 165, 250, 0.12); color: var(--blue); }
.admin-users { display: flex; flex-direction: column; gap: 8px; }
.admin-user { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; flex-wrap: wrap; }
.admin-user .who { flex: 1; min-width: 180px; }
.admin-user .who span { display: block; color: var(--muted); font-size: 12px; }
.admin-user select { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 7px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* tabel op telefoon compacter */
@media (max-width: 620px) {
  #tableWrap thead th:nth-child(2), #tableWrap tbody td:nth-child(2),
  #tableWrap thead th:nth-child(3), #tableWrap tbody td:nth-child(3),
  #tableWrap thead th:nth-child(4), #tableWrap tbody td:nth-child(4) { display: none; }
  .fav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emoji-grid, .color-grid { grid-template-columns: repeat(8, 1fr); gap: 4px; }
  .emoji-grid button { font-size: 18px; }
}
