:root {
  --bg: #0b0b0f;
  --panel: #14141c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f8;
  --muted: #9a9ab0;
  --accent: #6ee7b7;
  --accent-dim: rgba(110, 231, 183, 0.15);
  --danger: #f87171;
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse at top, #151525 0%, var(--bg) 55%);
  color: var(--text);
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.login-panel {
  max-width: 380px;
  margin: 12vh auto 0;
}

.brand { text-align: center; margin-bottom: 24px; }
.brand-icon { font-size: 42px; margin-bottom: 8px; }
.brand h1 { margin: 0 0 6px; font-size: 1.5rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f0f16;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #042f2e;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.topbar-actions { display: flex; gap: 8px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 14px;
}

.tab.active {
  color: var(--text);
  background: var(--accent-dim);
  border-color: rgba(110, 231, 183, 0.35);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.card .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.card .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.report-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow: auto;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.inline-form input { margin-bottom: 0; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 500;
  background: #101018;
}

.result-panel {
  margin-bottom: 16px;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

code {
  background: #0f0f16;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

@media (max-width: 640px) {
  .inline-form {
    grid-template-columns: 1fr;
  }
}
