/* ── MODAL OVERRIDES FOR ACHIEVEMENTS ── */
/* Create/Edit modal — compact, no fixed height */
#modal-create .modal,
#modal-submit .modal,
#modal-review .modal {
  height: auto;
  max-height: 90vh;
}

#modal-create .modal-body,
#modal-submit .modal-body,
#modal-review .modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Symmetric 2-column grid for fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Full-width form rows */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row input,
.form-row select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.form-row input:focus,
.form-row select:focus {
  border-color: var(--accent);
}
.form-row select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239090a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── ACHIEVEMENTS ── */
.ach-view { padding: 32px 36px; }
.ach-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.ach-admin-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.ach-tab {
  padding: 8px 18px; border-radius: var(--radius);
  border: 1px solid var(--border2); background: transparent;
  color: var(--text2); font-family: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.ach-tab.active { background: var(--bg3); color: var(--text); border-color: var(--accent); }
.ach-tab:hover:not(.active) { background: var(--bg3); color: var(--text); }

/* Achievement cards grid */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.ach-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  display: flex; flex-direction: column;
  height: 100%;
}
.ach-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.ach-card-image {
  width: 100%; height: 140px; object-fit: cover;
  background: var(--bg3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ach-card-image img { width: 100%; height: 140px; object-fit: cover; }
.ach-card-image-placeholder { font-size: 48px; color: var(--text3); }
.ach-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ach-card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.ach-card-desc {
  font-size: 13px; color: var(--text2); flex: 1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ach-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.ach-meta-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 99px;
  background: var(--bg3); color: var(--text2); font-weight: 500;
}
.ach-card-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.ach-points {
  font-size: 18px; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 4px;
}
.ach-points-label { font-size: 11px; color: var(--text3); font-weight: 400; }

/* Status badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.status-pending  { background: rgba(245,166,35,0.12); color: #f5a623; }
.status-approved { background: rgba(62,207,142,0.12); color: #3ecf8e; }
.status-rejected { background: rgba(248,113,113,0.12); color: #f87171; }

/* List view */
.ach-list { display: flex; flex-direction: column; gap: 10px; }
.ach-list-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; align-items: center; gap: 14px;
}
.ach-list-item-image {
  width: 56px; height: 56px; border-radius: var(--radius);
  object-fit: cover; background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 24px; color: var(--text3);
  overflow: hidden;
}
.ach-list-item-image img { width: 100%; height: 100%; object-fit: cover; }
.ach-list-item-body { flex: 1; min-width: 0; }
.ach-list-item-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.ach-list-item-sub { font-size: 12px; color: var(--text2); }
.ach-list-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Preview box in submit modal */
.ach-preview-box {
  background: var(--bg3); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 12px;
  align-items: center; margin-bottom: 14px;
}
.ach-preview-img {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg4); display: flex; align-items: center;
  justify-content: center; font-size: 22px; overflow: hidden;
}
.ach-preview-img img { width: 100%; height: 100%; object-fit: cover; }

/* Image upload */
.image-upload-area {
  border: 1.5px dashed var(--border2); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer;
  transition: border-color 0.15s;
}
.image-upload-area:hover { border-color: var(--accent); }
#image-preview-area img { max-height: 120px; border-radius: 8px; }

/* Logs filters */
.logs-filters {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.logs-filters select,
.logs-filters input[type=date],
.logs-filters input[type=text] {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); padding: 8px 12px; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; outline: none; cursor: pointer;
  color-scheme: dark; height: 38px; box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
.logs-filters select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23606070' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.logs-filters input[type=date] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23606070' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: text;
}
.logs-filters input[type=text] { cursor: text; min-width: 160px; }
.logs-filters select:focus,
.logs-filters input:focus { border-color: var(--accent); }

/* Admin card extra */
.ach-card-admin-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}

.ach-filter-row { margin-bottom: 16px; }
.ach-filter-row select {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); padding: 8px 12px; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; outline: none;
}

@media (max-width: 600px) {
  .ach-view { padding: 16px; }
  .ach-grid { grid-template-columns: 1fr; }
}
