:root {
  --bg: #0f1115;
  --bg-card: #181b22;
  --bg-card-hover: #20242c;
  --border: #262b34;
  --text: #e6e8eb;
  --muted: #8b94a3;
  --accent: #f7931a;
  --accent-2: #3aa17e;
  --pos: #3aa17e;
  --neg: #e0533d;
  --danger: #e0533d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

header { border-bottom: 1px solid var(--border); background: #0c0e12; }
header .nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand {
  color: var(--accent); font-weight: 700; font-size: 20px; text-decoration: none;
  letter-spacing: 0.3px;
}
.nav-links { display: flex; gap: 18px; flex: 1; margin-left: 24px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--text); }

/* Admin dropdown (native <details>, no JS required to open) */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after { content: " ▾"; font-size: 10px; }
.nav-dropdown[open] > summary,
.nav-dropdown > summary:hover { color: var(--text); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.nav-dropdown-menu a {
  padding: 7px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--bg-card-hover); }

.currency-form { display: flex; align-items: center; gap: 8px; }
.currency-form label { color: var(--muted); font-size: 13px; }

.year-form { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.year-form label { color: var(--muted); font-size: 13px; }

.tag-help { margin: 8px 0 16px; }
.tag-help summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
.tag-help summary:hover { color: var(--text); }
.tag-help dl { margin: 12px 0 0; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; }
.tag-help dt { margin-top: 10px; font-weight: 600; }
.tag-help dt:first-child { margin-top: 0; }
.tag-help dd { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tag-help dd em { color: var(--text); opacity: 0.85; }

select, input, button {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); padding: 8px 10px; border-radius: 6px;
  font-size: 14px; font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
button {
  background: var(--accent); color: #111; border: none; cursor: pointer;
  font-weight: 600;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger { background: var(--danger); color: #fff; }
button:not(.danger):not(.btn-sync) {}
.btn-sync { background: var(--accent-2); color: #fff; }

.hero { margin: 24px 0; }
.hero h1 { margin: 8px 0 4px; }
.muted { color: var(--muted); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px; margin: 12px 0;
}
.card h2 { margin-top: 0; }

.grid { display: grid; gap: 12px; margin: 12px 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi { font-size: 22px; font-weight: 600; margin-top: 4px; }
.kpi-sub { color: var(--muted); font-size: 13px; margin-left: 6px; font-weight: 400; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.row-between { display: flex; justify-content: space-between; align-items: center; }

.form-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 180px; }

table.data { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.data th, table.data td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
table.data tr:hover td { background: var(--bg-card-hover); }
table.data .actions { display: flex; gap: 6px; }
table.data .actions form { display: inline; }
table.data a { color: var(--accent); text-decoration: none; }
table.data a:hover { text-decoration: underline; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tag-form select { padding: 4px 6px; font-size: 12px; }

.fee-form { display: inline-flex; gap: 4px; align-items: center; }
.fee-form input { width: 80px; padding: 4px 6px; font-size: 12px; }
.fee-form button { padding: 4px 8px; font-size: 12px; }

.banner {
  background: rgba(247, 147, 26, 0.12);
  border: 1px solid rgba(247, 147, 26, 0.4);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
}
.banner strong { color: var(--accent); }
.banner em { font-style: normal; background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

.pill {
  display: inline-block;
  background: rgba(247, 147, 26, 0.18);
  color: var(--accent);
  border: 1px solid rgba(247, 147, 26, 0.4);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-left: 4px;
}

/* --- auth UI --- */
.user-block { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.user-email { color: var(--muted); font-size: 13px; text-decoration: none; }
.user-email:hover { color: var(--text); }
.logout-form button {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  padding: 6px 10px; font-size: 13px; font-weight: 500;
}
.logout-form button:hover { color: var(--text); border-color: var(--muted); }

.auth-wrap { max-width: 420px; margin: 64px auto; }
.auth-card h1 { margin: 0 0 4px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.auth-form label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.auth-form button { margin-top: 16px; padding: 10px 12px; }

.banner-error {
  background: rgba(224, 83, 61, 0.12);
  border-color: rgba(224, 83, 61, 0.4);
  color: var(--neg);
}
.banner-ok {
  background: rgba(58, 161, 126, 0.12);
  border-color: rgba(58, 161, 126, 0.4);
  color: var(--pos);
}

details.inline-reset { display: inline-block; }
details.inline-reset summary {
  cursor: pointer; color: var(--muted); font-size: 12px;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
}
details.inline-reset[open] summary { color: var(--text); }
details.inline-reset .fee-form { margin-top: 6px; }
details.inline-reset .fee-form input { width: 130px; }

.sync-error {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(224, 83, 61, 0.12);
  border: 1px solid rgba(224, 83, 61, 0.4);
  border-radius: 4px;
  color: var(--neg);
  font-size: 11px;
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-status.muted {
  background: rgba(139, 148, 163, 0.12);
  border: 1px solid var(--border);
  color: var(--muted);
}
.sync-status.muted::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: sync-spin 0.8s linear infinite;
}
.sync-status.pos {
  background: rgba(58, 161, 126, 0.12);
  border: 1px solid rgba(58, 161, 126, 0.4);
  color: var(--pos);
}
@keyframes sync-spin { to { transform: rotate(360deg); } }

.impersonation-banner {
  background: rgba(247, 147, 26, 0.15);
  border-bottom: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 0;
  font-size: 14px;
}
.impersonation-banner strong { color: var(--accent); }
.impersonation-banner form { display: inline; margin-left: 12px; }
.impersonation-banner button {
  background: var(--accent);
  color: #0c0e12;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.impersonation-banner button:hover { filter: brightness(1.1); }

.access-log-table { font-size: 13px; }
.access-log-table .ip { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.access-log-table .path { font-family: ui-monospace, "SF Mono", Menlo, monospace; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-log-table .ua { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-log-table .impersonation-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  background: rgba(247, 147, 26, 0.18); color: var(--accent);
  border-radius: 4px; font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.access-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.access-filters a {
  padding: 4px 10px; border-radius: 4px; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-size: 13px;
}
.access-filters a.active { background: rgba(247, 147, 26, 0.18); color: var(--accent); border-color: var(--accent); }
.access-filters a:hover { color: var(--text); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 14px; }
.pager a { color: var(--accent); text-decoration: none; }
.pager a:hover { text-decoration: underline; }

.app-modal {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  min-width: 320px;
  max-width: min(440px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.app-modal::backdrop { background: rgba(8, 10, 14, 0.65); backdrop-filter: blur(2px); }
.app-modal[open] { animation: app-modal-in 120ms ease-out; }
@keyframes app-modal-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.app-modal-body { margin: 0; padding: 20px 22px 18px; }
.app-modal-title { margin: 0 0 6px; font-size: 16px; }
.app-modal-message { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.app-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.app-modal-cancel {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); font-weight: 500;
}
.app-modal-cancel:hover:not(:disabled) { border-color: var(--muted); filter: none; }

/* --- Loading state for buttons (in-flight requests) --- */
button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  width: 16px; height: 16px;
  border: 2px solid #111;
  border-top-color: transparent;
  border-radius: 50%;
  animation: sync-spin 0.7s linear infinite;
}
button.danger.is-loading::after { border-color: #fff; border-top-color: transparent; }

/* --- Add-account modal (chooser + form) --- */
.add-account-modal { width: min(520px, calc(100vw - 32px)); max-width: 520px; }
.add-account-modal .app-modal-body { padding: 20px 24px 22px; }
.add-account-modal .modal-header {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.add-account-modal .modal-header h3 {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--text);
  flex: 1; letter-spacing: -0.01em;
}
.add-account-modal .modal-back {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.add-account-modal .modal-back:hover:not(:disabled) {
  color: var(--text); border-color: var(--muted); background: var(--bg-card-hover); filter: none;
}
.add-account-modal .modal-close {
  background: transparent; color: var(--muted);
  border: none; padding: 0;
  width: 28px; height: 28px; border-radius: 6px;
  font-size: 20px; font-weight: 400; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.add-account-modal .modal-close:hover:not(:disabled) {
  color: var(--text); background: var(--bg-card-hover); filter: none;
}

/* High-specificity selector to beat the global `button { background: var(--accent) }` rule. */
.add-account-modal .modal-tile-list { display: flex; flex-direction: column; gap: 10px; }
.add-account-modal button.modal-tile {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.add-account-modal button.modal-tile:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  filter: none;
  transform: translateY(-1px);
}
.add-account-modal button.modal-tile:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.add-account-modal .modal-tile .tile-icon {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.18), rgba(247, 147, 26, 0.08));
  color: var(--accent);
  font-size: 18px; font-weight: 700; line-height: 1;
}
.add-account-modal .modal-tile .tile-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.add-account-modal .modal-tile .tile-title {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.2;
}
.add-account-modal .modal-tile .tile-desc {
  font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.4;
}
.add-account-modal .modal-tile .tile-chev {
  flex: 0 0 auto;
  color: var(--muted); font-size: 22px; line-height: 1; font-weight: 300;
  transition: color 120ms ease, transform 120ms ease;
}
.add-account-modal button.modal-tile:hover .tile-chev {
  color: var(--accent); transform: translateX(2px);
}

.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-form input, .modal-form select, .modal-form textarea {
  width: 100%;
}
.modal-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; resize: vertical; min-height: 90px;
}
.modal-form .field-help {
  color: var(--muted); font-size: 12px; margin: -4px 0 4px;
}
.modal-form details { margin-top: 2px; }
.modal-form details summary {
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0;
}
.modal-form details summary:hover { color: var(--text); }
.modal-form details > div, .modal-form details > p {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  padding: 10px 12px; margin-top: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border); border-radius: 6px;
}
.modal-form .modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px;
}
.modal-error { margin: 0 0 12px; padding: 10px 12px; font-size: 13px; }

/* --- Account cards (unified wallet + exchange list) --- */
.account-card { padding: 0; overflow: hidden; }
.account-card .ac-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.account-card .ac-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(247, 147, 26, 0.12); color: var(--accent);
  font-size: 15px; font-weight: 700; flex: 0 0 auto;
}
.account-card .ac-title { flex: 1; min-width: 0; }
.account-card .ac-label {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.account-card .ac-sub {
  color: var(--muted); font-size: 12px; margin-top: 2px;
}
.account-card .ac-body { padding: 0; }
.account-card .ac-body table.data { margin-top: 0; }
.account-card .ac-body table.data th:first-child,
.account-card .ac-body table.data td:first-child { padding-left: 16px; }
.account-card .ac-body table.data th:last-child,
.account-card .ac-body table.data td:last-child { padding-right: 16px; }
.account-card .ac-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; }

/* Inline rename UI */
.ac-rename-form { display: inline-flex; gap: 6px; align-items: center; }
.ac-rename-form input {
  font-size: 14px; padding: 4px 8px;
  min-width: 200px;
}
.ac-rename-form button { padding: 4px 10px; font-size: 13px; }
.ac-rename-form .ac-rename-cancel {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); font-weight: 500;
}

/* Overflow menu (rename / disconnect / delete) */
.overflow-menu { position: relative; }
.overflow-menu .ov-trigger {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px; font-size: 16px; font-weight: 600;
  line-height: 1;
}
.overflow-menu .ov-trigger:hover { color: var(--text); border-color: var(--muted); }
.overflow-menu .ov-panel {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; min-width: 180px; z-index: 10;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 4px;
}
.overflow-menu[hidden], .overflow-menu .ov-panel[hidden] { display: none; }
.overflow-menu .ov-item {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--text);
  border: none; padding: 8px 12px; font-size: 13px;
  border-radius: 4px; cursor: pointer; font-weight: 500;
}
.overflow-menu .ov-item:hover { background: var(--bg-card-hover); }
.overflow-menu .ov-item.ov-danger { color: var(--danger); }
.overflow-menu .ov-item.ov-danger:hover { background: rgba(224, 83, 61, 0.12); }
.overflow-menu .ov-divider {
  height: 1px; background: var(--border); margin: 4px 0;
}

/* "+ Add account" hero button */
.add-account-card {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.06), rgba(58, 161, 126, 0.04));
}
.add-account-card .row-between { gap: 12px; flex-wrap: wrap; }
#btn-open-add-account {
  padding: 10px 18px; font-size: 14px;
}

/* TOTP enrollment page */
.mfa-setup {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.mfa-qr {
  flex: 0 0 auto;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 0;
}
.mfa-qr svg { display: block; width: 200px; height: 200px; }
.mfa-instructions { flex: 1 1 280px; min-width: 0; }
.mfa-secret {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 6px 10px;
  background: var(--bg-alt, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 6px;
  word-break: break-all;
}

/* ---------- Cockpit ---------- */

.cockpit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cockpit-bar h1 { margin: 0 0 4px; }
.cockpit-actions { display: flex; gap: 8px; align-items: center; }

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary { background: var(--accent, #3aa17e); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: transparent;
  color: inherit;
  border-color: var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); }

.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.cockpit-widget {
  background: var(--card, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cockpit-widget .widget-head h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.cockpit-widget .widget-body { flex: 1; min-width: 0; }
.widget-canvas-wrap { position: relative; width: 100%; min-height: 220px; }
.widget-canvas-wrap canvas { width: 100% !important; max-height: 320px; }

.w-small  { grid-column: span 3; }
.w-medium { grid-column: span 6; }
.w-large  { grid-column: span 8; }
.w-full   { grid-column: span 12; }

@media (max-width: 980px) {
  .w-small { grid-column: span 6; }
  .w-medium { grid-column: span 12; }
  .w-large { grid-column: span 12; }
}
@media (max-width: 640px) {
  .w-small, .w-medium, .w-large, .w-full { grid-column: span 12; }
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi-strip .kpi-cell { min-width: 0; }
@media (max-width: 640px) {
  .kpi-strip { grid-template-columns: 1fr 1fr; }
}

.top-movers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .top-movers { grid-template-columns: 1fr; }
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

/* ---- Cockpit editor ---- */

.editor-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 800px) {
  .editor-grid { grid-template-columns: 1fr; }
}

.dnd-zone {
  list-style: none;
  margin: 12px 0 0;
  padding: 8px;
  min-height: 80px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dnd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: grab;
}
.dnd-item:active { cursor: grabbing; }
.dnd-item-main { flex: 1; min-width: 0; }
.dnd-item-title { font-weight: 600; }
.dnd-item-desc { font-size: 12px; }
.dnd-size { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.dnd-size select { font-size: 12px; padding: 2px 4px; }
.dnd-ghost { opacity: 0.4; }
.dnd-empty { padding: 12px; font-style: italic; }

/* ---------- feedback ---------- */
.feedback-modal { width: min(560px, calc(100vw - 32px)); max-width: 560px; }
.feedback-modal .app-modal-body { padding: 20px 24px 22px; }
.feedback-form { display: flex; flex-direction: column; gap: 6px; }
.feedback-form label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  font: inherit;
}
.feedback-form textarea { resize: vertical; min-height: 110px; }
.feedback-form .app-modal-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-bug { background: rgba(224, 83, 61, 0.15); color: #f0907e; border-color: rgba(224, 83, 61, 0.4); }
.badge-feature { background: rgba(58, 161, 126, 0.15); color: #6cc6a3; border-color: rgba(58, 161, 126, 0.4); }
.badge-open { background: rgba(247, 147, 26, 0.15); color: #f7b65a; border-color: rgba(247, 147, 26, 0.4); }
.badge-resolved { background: rgba(139, 148, 163, 0.15); color: var(--muted); }

.feedback-table .feedback-message { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
.feedback-table .row-actions { white-space: nowrap; display: flex; gap: 6px; }

/* ---------- transfers ---------- */
.transfer-cell { white-space: nowrap; }
.xfer-dir { color: var(--muted); font-weight: 600; margin-right: 4px; }
.sankey-wrap { position: relative; height: 420px; max-width: 100%; }
.sankey-note { margin-top: 10px; font-size: 12px; }
