/**
 * Manage dashboard — edit forms (trips, schedules, boats, ports, operators).
 */

.rbbe-manage-edit .rbbe-me-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e9ee;
}

.rbbe-manage-edit .rbbe-me-head h1 {
  margin: 8px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a2b36;
}

.rbbe-manage-edit .rbbe-me-back {
  font-size: 0.86rem;
  font-weight: 600;
  color: #2c5f6b;
  text-decoration: none;
}

.rbbe-manage-edit .rbbe-me-back:hover {
  text-decoration: underline;
}

.rbbe-manage-edit .rbbe-me-route {
  margin: 0 0 16px;
  color: #6d7f8c;
  font-size: 0.9rem;
}

.rbbe-manage-edit .rbbe-me-form {
  margin-bottom: 20px;
}

.rbbe-manage-edit .rbbe-me-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.rbbe-manage-edit .rbbe-me-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rbbe-manage-edit .rbbe-me-hint {
  font-size: 0.72rem;
  color: #6d7f8c;
  line-height: 1.35;
}

.rbbe-manage-edit .rbbe-me-field--full {
  grid-column: 1 / -1;
}

.rbbe-manage-edit .rbbe-me-field > span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6d7f8c;
}

.rbbe-manage-edit .rbbe-me-field input[type="text"],
.rbbe-manage-edit .rbbe-me-field input[type="email"],
.rbbe-manage-edit .rbbe-me-field input[type="number"],
.rbbe-manage-edit .rbbe-me-field input[type="time"],
.rbbe-manage-edit .rbbe-me-field input[type="date"],
.rbbe-manage-edit .rbbe-me-field select,
.rbbe-manage-edit .rbbe-me-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d5e0e6;
  border-radius: 10px;
  background: #fff;
  color: #1a2b36;
  font-size: 0.92rem;
}

.rbbe-manage-edit .rbbe-me-radios {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 14px;
  border: 0;
  padding: 0;
}

.rbbe-manage-edit .rbbe-me-radios legend {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #6d7f8c;
  margin-bottom: 6px;
}

.rbbe-manage-edit .rbbe-me-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.rbbe-manage-edit .rbbe-me-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #e2e9ee;
}

.rbbe-manage-edit .rbbe-me-section h2,
.rbbe-manage-edit .rbbe-me-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #1a2b36;
}

.rbbe-manage-edit .rbbe-me-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rbbe-manage-edit .rbbe-me-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rbbe-manage-edit .rbbe-me-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 12px;
  border: 1px solid #e2e9ee;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f8fafb;
}

.rbbe-manage-edit .rbbe-me-list a {
  font-weight: 600;
  color: #1a2b36;
  text-decoration: none;
}

.rbbe-manage-edit .rbbe-me-muted {
  color: #6d7f8c;
  font-size: 0.88rem;
}

.rbbe-manage-edit .rbbe-me-delete {
  display: inline-block;
  margin-top: 14px;
  color: #b42318;
  font-size: 0.86rem;
}

.rbbe-manage-edit .rbbe-me-columns {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
}

.rbbe-manage-edit .rbbe-me-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rbbe-manage-edit .rbbe-me-table th,
.rbbe-manage-edit .rbbe-me-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e9ee;
  text-align: left;
}

.rbbe-manage-edit .rbbe-me-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6d7f8c;
}

.rbbe-manage-edit .rbbe-me-table__actions {
  white-space: nowrap;
}

.rbbe-manage-edit .rbbe-me-table__actions a {
  margin-right: 10px;
  color: #2c5f6b;
  font-weight: 600;
  text-decoration: none;
}

.rbbe-manage-edit .rbbe-me-inv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 20px;
}

.rbbe-manage-edit .rbbe-me-inv-cell {
  padding: 10px;
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  background: #f8fafb;
  text-align: center;
  font-size: 0.82rem;
}

.rbbe-manage-edit .rbbe-me-form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.rbbe-manage-edit .rbbe-me-subsection {
  margin: 18px 0;
  padding: 14px;
  background: #f8fafb;
  border: 1px solid #e2e9ee;
  border-radius: 12px;
}

.rbbe-manage-edit .rbbe-me-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

/* Inline label row with action buttons (e.g. AI generate) */
.rbbe-me-field__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rbbe-trip-ai-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.rbbe-trip-ai-actions .rbbe-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rbbe-trip-ai-actions .rbbe-btn.is-busy {
  opacity: 0.7;
  cursor: progress;
}

.rbbe-trip-ai-icon {
  font-size: 0.95em;
  line-height: 1;
}

.rbbe-link--sm {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.78rem;
  color: #2c5f6b;
  cursor: pointer;
  text-decoration: underline;
}

.rbbe-link--sm:hover {
  color: #1a2b36;
}

.rbbe-trip-ai-panel {
  margin: 0 0 8px;
}

.rbbe-trip-ai-advanced {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0;
  padding: 12px;
  background: #f4fafc;
  border: 1px solid #cfe5ea;
  border-radius: 10px;
}

.rbbe-trip-ai-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rbbe-trip-ai-row > span {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a6571;
}

.rbbe-trip-ai-row select,
.rbbe-trip-ai-row textarea {
  width: 100%;
  border: 1px solid #cfe0e6;
  border-radius: 8px;
  padding: 6px 8px;
  background: #ffffff;
  font-size: 0.84rem;
  resize: vertical;
}

.rbbe-trip-ai-row--full {
  grid-column: 1 / -1;
}

.rbbe-trip-ai-row--check {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed #cfe0e6;
}

.rbbe-ai-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1a2b36;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.84rem;
}

.rbbe-ai-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2c5f6b;
  cursor: pointer;
}

.rbbe-ai-check-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 400;
  color: #6d7f8c;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
}

.rbbe-ai-sources {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f4fafc;
  border: 1px solid #cfe0e6;
  border-radius: 8px;
  font-size: 0.78rem;
}

.rbbe-ai-model-badge {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 4px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #2c5f6b;
  background: #e7f3f5;
  border: 1px solid #b8d9de;
  border-radius: 4px;
  vertical-align: middle;
  line-height: 1.4;
}

.rbbe-ai-model-badge:empty {
  display: none;
}

/* Highlight when user picks Article format so the cost/length expectation is obvious */
.rbbe-trip-ai-row select[data-rbbe-ai-format] option[value="article"] {
  font-weight: 700;
}

.rbbe-trip-ai-row select[data-rbbe-ai-format]:focus {
  outline: 2px solid #2c5f6b;
  outline-offset: 1px;
}

.rbbe-ai-sources strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #2c5f6b;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rbbe-ai-sources ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.rbbe-ai-sources li {
  margin: 2px 0;
  line-height: 1.4;
}

.rbbe-ai-sources a {
  color: #2c5f6b;
  text-decoration: none;
  word-break: break-all;
}

.rbbe-ai-sources a:hover {
  text-decoration: underline;
}

.rbbe-ai-notice {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  line-height: 1.4;
}

.rbbe-ai-notice--info {
  background: #eef6f8;
  border-color: #cfe0e6;
  color: #2c5f6b;
}

.rbbe-ai-notice--success {
  background: #e9f7ee;
  border-color: #bcdcc6;
  color: #1f6b39;
}

.rbbe-ai-notice--error {
  background: #fdecec;
  border-color: #f0c2c2;
  color: #8a2222;
}

@media (max-width: 900px) {
  .rbbe-manage-edit .rbbe-me-grid {
    grid-template-columns: 1fr;
  }

  .rbbe-manage-edit .rbbe-me-columns {
    grid-template-columns: 1fr;
  }

  .rbbe-manage-edit .rbbe-me-inv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rbbe-trip-ai-advanced {
    grid-template-columns: 1fr;
  }
}
