/* ==========================================================================
   02-COMPONENTS — elemen UI reusable yang dipakai di banyak halaman:
   tombol, input/select, badge, banner peringatan, grid foto.
   ========================================================================== */

/* ---------- Buttons / forms ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.btn:hover {
  border-color: var(--amber-dim);
}
.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1a1206;
}
.btn--primary:hover {
  filter: brightness(1.08);
}
.btn--block {
  width: 100%;
  text-align: center;
}
.btn--ghost {
  background: transparent;
}
.btn--sm {
  padding: 5px 10px;
  font-size: 11.5px;
}

.select,
select,
input[type="text"],
input[type="date"],
textarea {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 100%;
}
.select {
  width: auto;
}
select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--amber-dim);
}

.badge-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge--teori {
  background: var(--cyan-soft);
  color: var(--cyan);
}
.badge--kejuruan {
  background: var(--magenta-soft);
  color: var(--magenta);
}
.badge--olahraga {
  background: var(--sage-soft);
  color: var(--sage);
}
.badge--khusus {
  background: var(--amber-soft);
  color: var(--amber);
}

/* ---------- Storage warning ---------- */
.storage-warning {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--red-soft);
  color: var(--red);
  border-bottom: 1px solid var(--red);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 10px 20px;
  text-align: center;
}

.icon-btn--tiny {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* ---------- Foto tugas / catatan materi ---------- */
.task-card__photo {
  display: block;
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 9px;
  padding: 0;
  background: var(--bg-elev);
  cursor: zoom-in;
  line-height: 0;
  position: relative;
}
.task-card__photo img {
  width: 100%;
  max-height: 130px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.task-card__photo:hover img {
  transform: scale(1.03);
}
.task-card__photo-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.4;
  pointer-events: none;
}

.photo-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  margin-bottom: 8px;
}

/* Grid thumbnail untuk multi-foto (form Tugas Baru/Edit & modal Kelola Foto) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.photo-grid__item {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elev);
}
.photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-grid__remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.photo-grid__remove:hover {
  background: var(--red);
}
