/* ========== RENIUM ADMIN ==========
   Styles for the project editor: language tabs, metric rows, the optional
   breakdown section and the save/status feedback bar. Loaded after the base
   sheets so it can widen the modal the editor lives in.
   ================================== */

/* The editor carries far more fields than the demo form, so it gets its own
   width step above .modal.lg and scrolls internally on short screens. */
.modal.xl {
  max-width: 760px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
@media (max-width: 820px) {
  .modal.xl { max-width: 100%; padding: 28px 20px; }
}

/* Client / status / year sit on one line; .field .row is a fixed 2-column grid. */
.field .row.apm-row-3 { grid-template-columns: 2fr 1.2fr 1fr; }
@media (max-width: 620px) {
  .field .row, .field .row.apm-row-3 { grid-template-columns: 1fr; }
}

/* ===== language tabs ===== */
.apm-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 22px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.apm-tabs button {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-3);
  background: var(--line);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.apm-tabs button:hover { color: var(--ink); }
.apm-tabs button.on { background: var(--ink); color: #fff; }
.apm-tabs-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-4);
  text-align: right;
  max-width: 320px;
  line-height: 1.4;
}
@media (max-width: 620px) {
  .apm-tabs { flex-wrap: wrap; }
  .apm-tabs-hint { margin-left: 0; text-align: left; max-width: none; }
}

/* ===== optional breakdown ===== */
.apm-more {
  margin: 6px 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10,10,20,.015);
}
.apm-more > summary {
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
}
.apm-more > summary::-webkit-details-marker { display: none; }
.apm-more > summary::before {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(-45deg);
  transition: transform .2s var(--ease);
  flex: none;
  margin-left: 2px;
}
.apm-more[open] > summary::before { transform: rotate(45deg); }
.apm-more > summary:hover { color: var(--ink); }
.apm-more > *:not(summary) { padding-left: 16px; padding-right: 16px; }
.apm-more > *:last-child { padding-bottom: 16px; }
.apm-note {
  font-size: 11.5px;
  color: var(--ink-4);
  line-height: 1.5;
  margin: 0 0 14px;
}

/* ===== metric rows ===== */
.apm-metric {
  display: grid;
  grid-template-columns: 130px 1fr 32px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.apm-metric .apm-metric-v { font-family: 'JetBrains Mono', monospace; }
.apm-metric-del {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(10,10,20,.05);
  color: var(--ink-3);
  display: grid; place-items: center;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.apm-metric-del:hover { background: #FDE8E8; color: #C72A2A; }
@media (max-width: 620px) {
  .apm-metric { grid-template-columns: 1fr 32px; }
  .apm-metric .apm-metric-v { grid-column: 1 / -1; }
}

.apm-img-clear {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: underline;
  transition: color .2s var(--ease);
}
.apm-img-clear:hover { color: #C72A2A; }

/* ===== save / sync status ===== */
/* Content changes now hit the server, so the admin needs to see whether a save
   landed. Anchored bottom-right, out of the way of the editor. */
.rn-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 18px 40px -12px rgba(10,10,20,.4);
  animation: rnToastIn .28s cubic-bezier(.2,.8,.2,1);
  max-width: min(420px, calc(100vw - 40px));
}
.rn-toast.err { background: #C72A2A; }
.rn-toast.warn { background: #A35A00; }
.rn-toast-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--accent);
  flex: none;
}
.rn-toast.err .rn-toast-dot, .rn-toast.warn .rn-toast-dot { background: #fff; }
.rn-toast button {
  margin-left: 6px;
  color: rgba(255,255,255,.7);
  font-size: 12px;
  text-decoration: underline;
}
.rn-toast button:hover { color: #fff; }
@keyframes rnToastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rn-toast { animation: none; }
}
