* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #020617;
  color: #e5e7eb;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 12px 40px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 12px 8px;
  border-bottom: 1px solid #1f2937;
}

.top-left h1 {
  margin: 0;
  font-size: 1.4rem;
}

.subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
}

.top-right {
  font-size: 0.8rem;
  text-align: right;
}

.layout {
  margin-top: 8px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #1f2937;
  margin-bottom: 8px;
}

.tab-button {
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.9rem;
}

.tab-button.active {
  color: #e5e7eb;
  border-bottom: 2px solid #3b82f6;
}

.tab-content {
  margin-top: 8px;
}

.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.summary-item {
  background: #020617;
  border-radius: 6px;
  padding: 6px 8px;
  border: 1px solid #1f2937;
  font-size: 0.8rem;
}

.summary-label {
  color: #9ca3af;
}

.summary-value {
  font-weight: 600;
}

.panel {
  background: #020617;
  border-radius: 6px;
  border: 1px solid #1f2937;
  padding: 8px;
  margin-bottom: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th,
.data-table td {
  padding: 4px 6px;
}

.data-table th {
  text-align: left;
  color: #9ca3af;
  border-bottom: 1px solid #1f2937;
}

.data-table tbody tr:nth-child(even) {
  background-color: #020617;
}

.data-table tbody tr:nth-child(odd) {
  background-color: #020617;
}

.data-table tbody tr:hover {
  background-color: #0f172a;
}

.price-pos {
  color: #22c55e;
}

.price-neg {
  color: #ef4444;
}

.primary {
  background: #2563eb;
  color: #e5e7eb;
  border-radius: 999px;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.primary:disabled {
  opacity: 0.4;
  cursor: default;
}

button {
  font-family: inherit;
}

.news-panel {
  max-height: 420px;
  overflow-y: auto;
}

.news-item {
  border-bottom: 1px solid #1f2937;
  padding: 6px 0;
}

.news-meta {
  font-size: 0.7rem;
  color: #9ca3af;
}

.news-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.news-body {
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  margin-right: 4px;
}

.badge-macro {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
}

.badge-sector {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
}

.badge-company {
  background: rgba(248, 250, 252, 0.06);
  color: #e5e7eb;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 12px;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid #1f2937;
  font-size: 0.75rem;
  color: #9ca3af;
}

.trade-form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.trade-form input[type="number"] {
  background: #020617;
  border-radius: 6px;
  border: 1px solid #1f2937;
  color: #e5e7eb;
  padding: 4px 6px;
  width: 120px;
}

.filters select {
  background: #020617;
  border-radius: 6px;
  border: 1px solid #1f2937;
  color: #e5e7eb;
  padding: 4px 6px;
  font-size: 0.8rem;
}

#firm-summary,
#clients-panel {
  font-size: 0.8rem;
}

.client-card {
  border-bottom: 1px solid #1f2937;
  padding: 4px 0;
}

.client-name {
  font-weight: 600;
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .top-right {
    text-align: left;
  }
}
