:root {
  --bg: #0f1026;
  --panel: #15182b;
  --text: #f8f9fa;
  --subtext: #b9bdc9;
  --border: #2a2f4a;
  --accent: #4f9deb;
  --success: #3fb984;
  --warn: #f5b700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background: radial-gradient(circle at top, #1f2240, var(--bg));
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--subtext);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

tbody tr:hover {
  background: rgba(79, 157, 235, 0.08);
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(79, 157, 235, 0.16) 0%, transparent 55%), var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #9dceff, var(--accent));
  box-shadow: 0 0 0 8px rgba(79, 157, 235, 0.12);
}

.logo-title {
  font-weight: 600;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--subtext);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--subtext);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 120ms ease;
}

.nav-link.active {
  background: rgba(79, 157, 235, 0.18);
  color: var(--text);
}

.nav-link:hover:not(.active) {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--subtext);
}

.content {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px;
}

.tab {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.tab.active {
  display: flex;
}

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

.toolbar-title {
  font-size: 16px;
  font-weight: 600;
}

.toolbar-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--subtext);
}

.primary-button {
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(90deg, rgba(79, 157, 235, 0.9) 0%, rgba(63, 185, 132, 0.8) 100%);
  color: var(--text);
  padding: 9px 18px;
  cursor: pointer;
}

.panel {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at top, rgba(79, 157, 235, 0.12), transparent 55%), var(--panel);
  overflow: hidden;
}

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

.mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.amount {
  white-space: nowrap;
}

.status {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-line {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.status-label {
  color: var(--subtext);
}

.status-line--comment {
  color: var(--subtext);
}

.ghost-button {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--subtext);
  padding: 7px 14px;
  cursor: pointer;
}

.ghost-button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.side {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.side.buy {
  background: rgba(63, 185, 132, 0.18);
  color: #7dffbf;
}

.side.sell {
  background: rgba(245, 99, 99, 0.18);
  color: #ff9b9b;
}

.positive {
  color: #7dffbf;
}

.negative {
  color: #ff9b9b;
}

.comment {
  color: var(--subtext);
}

/* Модалка */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 24, 0.72);
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 60px 120px -80px rgba(79, 157, 235, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--subtext);
}

.icon-button {
  border: none;
  background: transparent;
  color: var(--subtext);
  cursor: pointer;
  font-size: 16px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 26px 26px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  color: var(--subtext);
}

.field-input {
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  box-shadow: inset 0 0 0 1px var(--border);
}

.field-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(79, 157, 235, 0.9);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.hidden {
  display: none !important;
}
