/* ================================
   FTOM Admin – consolidated styles
   (forms, tables, toggles, inline edits)
   ================================ */

/* Utilities */
.ftom-hidden { display: none !important; }

/* Feedback boxes */
.ftom-errors,
.ftom-ok {
  margin: .75rem 0;
  padding: .8rem;
  border-radius: 8px;
}
.ftom-errors { border: 1px solid #f4c8c8; background: #fff2f2; color: #8a1c1c; }
.ftom-ok     { border: 1px solid #c7d7ff; background: #eef3ff; }

/* Steward forms */
.ftom-form { max-width: 680px; }
.ftom-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ftom-form p { margin: .5rem 0; }
.ftom-form input[type="text"],
.ftom-form input[type="email"],
.ftom-form input[type="url"],
.ftom-form input[type="number"],
.ftom-form input[type="password"],
.ftom-form textarea,
.ftom-form select {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid #d3d7df;
  border-radius: 8px;
}
.ftom-form .button { padding: .6rem 1rem; border-radius: 10px; }
.ftom-form .req { color: #c0392b; margin-left: 4px; }
.ftom-form .hint { font-size: .85rem; opacity: .8; }
.ftom-form .preview { margin: .5rem 0; max-width: 240px; border-radius: 8px; display: block; }
@media (max-width:700px){ .ftom-form .row { grid-template-columns: 1fr; } }

/* Inline edit */
.ftom-editable { cursor: text; }
.ftom-inline-input {
  width: 220px; max-width: 100%;
  font: inherit; padding: .2rem .35rem;
  border: 1px solid #cfd6e4; border-radius: 6px; background: #fff;
}
.ftom-inline-input.slug { width: 200px; }

/* Toggle switch */
.ftom-switch { position: relative; display: inline-block; width: 42px; height: 22px; vertical-align: middle; }
.ftom-switch input { display: none; }
.ftom-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ddd; transition: .2s; border-radius: 14px;
}
.ftom-slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 2px; top: 2px;
  background: #fff; transition: .2s; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.ftom-switch input:checked + .ftom-slider { background: #2ecc71; }
.ftom-switch input:checked + .ftom-slider::before { transform: translateX(20px); }

/* Tables */
.ftom-table { width: 100%; border-collapse: collapse; }
.ftom-table th, .ftom-table td { padding: .5rem; }
.ftom-table tr { border-bottom: 1px solid #eee; }
.ftom-table thead tr { border-bottom: 1px solid #ddd; }

/* Meta label preview (JSON mini) */
.ftom-meta-hint { opacity: .7; margin-left: .4rem; font-size: 0.9em; }
.ftom-meta-hint.is-empty { opacity: .5; }

/* Steward cards / grid (used by Trucks & compact managers) */
.ftom-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; margin: 14px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ftom-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 12px; }
.ftom-field { grid-column: span 6; }
.ftom-field-full { grid-column: 1 / -1; }
.ftom-field label { font-weight: 600; display: block; margin-bottom: 6px; }
.ftom-field input[type=text],
.ftom-field input[type=email],
.ftom-field input[type=number],
.ftom-field input[type=file],
.ftom-field select,
.ftom-field textarea { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 10px; }
.ftom-actions { margin-top: 10px; }
@media (max-width:900px){ .ftom-field { grid-column: 1 / -1; } }

/* Modal (kept for future use) */
.ftom-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; z-index: 9998; }
.ftom-modal {
  position: fixed; inset: auto auto 10% 50%; transform: translateX(-50%);
  width: min(900px,92vw); max-height: 75vh; background: #fff; border-radius: 10px;
  box-shadow: 0 15px 50px rgba(0,0,0,.35); display: none; z-index: 9999; overflow: auto;
}
.ftom-modal header { padding: .9rem 1rem; border-bottom: 1px solid #eee; font-weight: 600; }
.ftom-modal .body { padding: 1rem; }
.ftom-modal .close { position: absolute; right: .6rem; top: .5rem; border: 0; background: transparent; font-size: 20px; cursor: pointer; }

/* Thank-you (legacy alias; .ftom-ok is primary) */
.ftom-thanks { margin: 1rem 0; padding: 1rem; border: 1px solid #c7d7ff; background: #eef3ff; border-radius: 6px; }

/* Minor helpers */
.ftom-row-actions .spinner { float: none; margin: 0 6px; visibility: hidden; }
.ftom-row-actions.ftom-busy .spinner { visibility: visible; }

/* Utilities for steward screens */
.ftom-table-wrap { margin-top: 1rem; overflow: auto; }

/* Status boxes (moved from inline) */
.ftom-status { margin: .75rem 0; padding: .8rem; border-radius: 8px; }
.ftom-status--warn  { border: 1px solid #f0c36d; background: #fff7df; }
.ftom-status--error { border: 1px solid #f1aeb5; background: #fde2e4; }