* { box-sizing: border-box; }

body.dark {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #050816;
  color: #f3f4f6;
}

.top-warning {
  background: #f97316;
  color: #111827;
  text-align: center;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.app-header {
  background: #0b1020;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f2937;
}

.app-header h1 { margin: 0; font-size: 18px; }
.subtitle { margin: 0; font-size: 12px; color: #9ca3af; }

.content { padding: 16px; }

.screen { display: none; }
.screen.active { display: block; }

.card {
  background: #0f172a;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

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

.big-number { font-size: 28px; margin: 10px 0 4px; }

.muted { color: #9ca3af; }
.small { font-size: 12px; }

.pill {
  background: #2563eb;
  color: #e5e7eb;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

label { display: block; font-size: 13px; margin-top: 10px; margin-bottom: 4px; }

input, textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 14px;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
}

.btn.primary { background: #f97316; color: #111827; font-weight: 800; }
.btn.secondary { background: #2563eb; color: #e5e7eb; font-weight: 800; }
.btn.ghost { background: transparent; border: 1px solid #4b5563; color: #e5e7eb; }
.btn.small { padding: 4px 10px; font-size: 12px; }

.actions-card { display: flex; gap: 12px; }
.actions-card .btn { flex: 1; margin-top: 0; }

.error-text { color: #f97373; font-size: 12px; margin-top: 10px; }

.notice {
  margin-top: 12px;
  padding: 10px;
  background: #020617;
  border: 1px solid #111827;
  border-radius: 10px;
  font-size: 12px;
  color: #cbd5e1;
}

/* Canvas chart */
.balance-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 10px;
}

/* Status */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
}

.status-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #1f2937;
  background: #020617;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th, .table td {
  border-bottom: 1px solid #111827;
  padding: 8px 6px;
  text-align: left;
  vertical-align: middle;
}

.table th { font-weight: 800; color: #9ca3af; }

.table td input[type="number"] { max-width: 110px; }

.full-width { grid-column: 1 / -1; }

/* Admin layout */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) {
  .admin-grid { grid-template-columns: 1.1fr 1fr; }
}

/* Popup */
.popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.popup-backdrop.hidden { display: none; }

.popup {
  background: #020617;
  padding: 16px;
  border-radius: 12px;
  max-width: 380px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
