/* RaPid — Sprint 24 — Jagatud komponendid.
   Kasutab `assets/design-tokens.css`-i tokeneid. Lehed peaksid laadima
   tokenid ENNE komponente. */

/* ── Nupud ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  user-select: none;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }

.btn-danger {
  background: var(--red); color: #fff; border-color: var(--red);
}
.btn-danger:hover { filter: brightness(.92); }

.btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

/* ── Sisendid ──────────────────────────────────────────────────────── */
.input, .select, .textarea {
  display: block; width: 100%;
  padding: 8px 12px;
  font-family: inherit; font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 80px; resize: vertical; }
.label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-2); margin-bottom: 4px;
}

/* ── Kaart ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: 16px;
}
.card-title { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.card-muted { font-size: 12px; color: var(--text-2); }

/* ── Modal ──────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  max-width: 520px; width: 100%;
  max-height: 90vh; overflow: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.modal-body { padding: 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border);
}

/* ── Märksed ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 500;
  border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.badge-green { background: var(--green-soft); color: var(--green); border-color: var(--green-soft); }
.badge-red   { background: var(--red-soft);   color: var(--red);   border-color: var(--red-soft); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-soft); }

/* ── Progress bar ──────────────────────────────────────────────────── */
.progress {
  width: 100%; height: 8px;
  background: var(--surface-2);
  border-radius: 999px; overflow: hidden;
}
.progress > .bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress.warn > .bar { background: var(--amber); }
.progress.danger > .bar { background: var(--red); }


/* ── Emoji ikoonid (Sprint 24 — asendab Font Awesome) ── */
.emoji-icon { display: inline-block; font-style: normal; line-height: 1; font-size: 1em; vertical-align: -0.05em; }
