* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--tg-theme-bg-color, #ffffff);
  color: var(--tg-theme-text-color, #111111);
}

.loading, .empty {
  color: var(--tg-theme-hint-color, #888888);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
}

.error {
  color: #c0392b;
  font-size: 14px;
  padding: 16px;
  background: #fdecea;
  border-radius: 10px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 10px;
}

.card {
  background: var(--tg-theme-secondary-bg-color, #f4f4f5);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

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

.card-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}

.card-sub {
  font-size: 12px;
  color: var(--tg-theme-hint-color, #888888);
  margin: 2px 0 0;
}

.progress-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(120,120,128,0.16);
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: #34c759;
}

.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 8px;
  white-space: nowrap;
}

.badge-warn { background: #fdf0d5; color: #a15c00; }
.badge-danger { background: #fdecea; color: #c0392b; }
.badge-ok { background: #e6f7ea; color: #1a7d3c; }
.badge-info { background: #e8f0fe; color: #1a56db; }

button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
  cursor: pointer;
}

button.secondary {
  background: rgba(120,120,128,0.16);
  color: var(--tg-theme-text-color, #111111);
}

button:active { opacity: 0.8; }

.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row button { flex: 1; }

input, select {
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(120,120,128,0.3);
  background: var(--tg-theme-bg-color, #ffffff);
  color: var(--tg-theme-text-color, #111111);
  margin-bottom: 10px;
}

label {
  font-size: 12px;
  color: var(--tg-theme-hint-color, #888888);
  display: block;
  margin-bottom: 4px;
}

.id-box {
  font-family: monospace;
  font-size: 18px;
  background: rgba(120,120,128,0.12);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  margin: 10px 0;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.tabs button {
  flex: 1;
  background: rgba(120,120,128,0.12);
  color: var(--tg-theme-text-color, #111111);
}

.tabs button.active {
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
}
