/* Forms Studio — Nuwell brand theme (G7).
 *
 * Reuses the brand tokens defined in brand.css. This file fills in the
 * Forms Studio-specific utility classes that the templates already
 * reference (badges, form fields, wizard step pills, public layout) and
 * provides .btn/.btn-primary/.btn-secondary aliases so older templates
 * inherit the Nuwell look without per-template edits.
 */

/* ---- Generic .btn aliases (forward-compat with older templates) ---- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary {
  background: var(--nuwell-teal);
  color: #fff;
  border-color: var(--nuwell-teal);
}
.btn-primary:hover { background: #28a3b3; border-color: #28a3b3; }
.btn-secondary {
  background: var(--nuwell-navy);
  color: #fff;
  border-color: var(--nuwell-navy);
}
.btn-secondary:hover { background: var(--nuwell-navy-deep); border-color: var(--nuwell-navy-deep); }
.btn-ghost {
  background: transparent;
  color: var(--nuwell-navy);
  border-color: var(--nuwell-border);
}
.btn-ghost:hover { background: var(--nuwell-teal-soft); border-color: var(--nuwell-teal); }
.btn:disabled, .btn[disabled] {
  opacity: .55; cursor: not-allowed;
}

/* ---- Form fields ---- */
.db360-form .db360-field { margin: 0 0 16px; }
.db360-field label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--nuwell-navy);
}
.db360-field input[type="text"],
.db360-field input[type="email"],
.db360-field input[type="tel"],
.db360-field input[type="url"],
.db360-field input[type="number"],
.db360-field input[type="date"],
.db360-field input[type="datetime-local"],
.db360-field select,
.db360-field textarea,
.db360-input,
.db360-card input[type="text"],
.db360-card input[type="email"],
.db360-card input[type="tel"],
.db360-card input[type="url"],
.db360-card input[type="number"],
.db360-card select,
.db360-card textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--nuwell-border);
  border-radius: 6px;
  background: #fff;
  color: var(--nuwell-text);
  font: inherit;
  box-sizing: border-box;
}
.db360-field input:focus,
.db360-field select:focus,
.db360-field textarea:focus,
.db360-card input:focus,
.db360-card select:focus,
.db360-card textarea:focus {
  outline: none;
  border-color: var(--nuwell-teal);
  box-shadow: 0 0 0 3px rgba(47, 181, 199, .18);
}
.db360-field textarea { min-height: 92px; resize: vertical; }
.db360-field-help {
  font-size: 12px; color: var(--nuwell-muted); margin-top: 4px;
}

/* ---- Badges ---- */
.badge,
.db360-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: var(--nuwell-teal-soft);
  color: var(--nuwell-navy);
  border: 1px solid transparent;
  line-height: 1.6;
}
.badge-navy,   .db360-badge-navy   { background: var(--nuwell-navy);  color: #fff; }
.badge-teal,   .db360-badge-teal   { background: var(--nuwell-teal);  color: #fff; }
.badge-green,  .db360-badge-green  { background: #DCF1E2; color: #1d6e3d; }
.badge-amber,  .db360-badge-amber  { background: #FBEFCD; color: #8a5a00; }
.badge-red,    .db360-badge-red    { background: #FADBD8; color: #8B1F12; }
.badge-grey,   .db360-badge-grey   { background: #E2E6EE; color: var(--nuwell-muted); }
.badge-gray,   .db360-badge-gray   { background: #E2E6EE; color: var(--nuwell-muted); }
.badge-purple, .db360-badge-purple { background: #ECDFF1; color: #5d2a6b; }

.db360-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--nuwell-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.db360-logo-frame-compact {
  padding: 6px 10px;
  border-radius: 10px;
}
.db360-logo-img {
  display: block;
  max-height: 56px;
  max-width: 260px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.db360-logo-img-compact {
  max-height: 24px;
  max-width: 120px;
}

/* ---- Alert / risk level pills ---- */
.db360-level             { background: var(--nuwell-teal-soft); color: var(--nuwell-navy); }
.db360-level-low         { background: #DCF1E2; color: #1d6e3d; }
.db360-level-medium      { background: #FBEFCD; color: #8a5a00; }
.db360-level-high        { background: #FADBD8; color: #8B1F12; }
.db360-level-critical    { background: #C0392B; color: #fff; }

.db360-status-open       { background: #FADBD8; color: #8B1F12; }
.db360-status-ack        { background: #FBEFCD; color: #8a5a00; }
.db360-status-resolved   { background: #DCF1E2; color: #1d6e3d; }
.db360-status-dismissed  { background: #E2E6EE; color: var(--nuwell-muted); }

/* ---- Wizard step pills ---- */
.db360-stepper {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px;
}
.db360-stepper .db360-step,
.db360-stepper a.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--nuwell-border);
  background: #fff; color: var(--nuwell-muted);
}
.db360-stepper a.btn-primary {
  background: var(--nuwell-navy); color: #fff;
  border-color: var(--nuwell-navy);
}
.db360-stepper a.btn-secondary {
  background: #fff; color: var(--nuwell-navy);
  border-color: var(--nuwell-border);
}
.db360-stepper a:hover { border-color: var(--nuwell-teal); color: var(--nuwell-navy); }

/* ---- Button row (replaces inline display:inline + margin hacks) ---- */
.db360-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 12px 0 0;
}
.db360-actions form { display: inline; }

/* ---- Definition list inside cards ---- */
.db360-card dl { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; margin: 0; }
.db360-card dl dt { color: var(--nuwell-muted); font-size: 13px; }
.db360-card dl dd { margin: 0; color: var(--nuwell-text); }

/* ---- Public (anonymous) form layout ---- */
.db360-public {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 16px;
}
.db360-public .db360-public-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.db360-public .db360-public-header img { height: 36px; }
.db360-public .db360-public-header .brand-text {
  font-weight: 700; color: var(--nuwell-navy); font-size: 18px;
}
.db360-public .db360-public-header .brand-text .accent { color: var(--nuwell-teal); }
.db360-public .db360-card { padding: 24px; }
.db360-public-footer {
  text-align: center; color: var(--nuwell-muted);
  font-size: 12px; margin: 24px 0 32px;
}
.db360-public-footer .powered { color: var(--nuwell-navy); font-weight: 600; }

/* =====================================================================
   G9/G10 — Forms Studio dashboard, stepper, channels, sidebar polish
   ===================================================================== */

/* Page chrome */
.db360-page { max-width: 1280px; margin: 0 auto; padding: 24px 28px 64px; }
.db360-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-bottom: 24px;
}
.db360-page-head h1 {
  margin: 0 0 6px; color: var(--nuwell-navy);
  font-size: 28px; letter-spacing: -0.01em;
}
.db360-page-sub { margin: 0; color: var(--nuwell-muted); max-width: 760px; line-height: 1.55; }
.db360-page-actions { display: flex; gap: 10px; flex-shrink: 0; }
.db360-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  background: var(--nuwell-surface); color: var(--nuwell-navy);
  border: 1px solid var(--nuwell-border); text-decoration: none;
  font-weight: 600; font-size: 14px; transition: all .15s;
}
.db360-btn:hover { border-color: var(--nuwell-teal); color: var(--nuwell-teal); }
.db360-btn-primary {
  background: var(--nuwell-navy); color: #fff; border-color: var(--nuwell-navy);
}
.db360-btn-primary:hover {
  background: var(--nuwell-navy-deep); color: #fff;
  border-color: var(--nuwell-navy-deep);
}

/* Metric cards */
.db360-metric-grid {
  display: grid; gap: 16px; margin-bottom: 28px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.db360-metric {
  display: block; padding: 18px 20px;
  background: var(--nuwell-surface); border-radius: 12px;
  border: 1px solid var(--nuwell-border);
  border-left: 4px solid var(--nuwell-teal);
  text-decoration: none; color: inherit;
  transition: transform .12s, box-shadow .12s;
}
.db360-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(27, 42, 94, .08);
}
.db360-metric-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--nuwell-muted); font-weight: 600;
}
.db360-metric-value {
  font-size: 32px; font-weight: 700; color: var(--nuwell-navy);
  line-height: 1.1; margin: 6px 0 4px;
}
.db360-metric-sub { font-size: 12px; color: var(--nuwell-muted); }
.db360-metric-navy       { border-left-color: var(--nuwell-navy); }
.db360-metric-navy-deep  { border-left-color: var(--nuwell-navy-deep); }
.db360-metric-teal       { border-left-color: var(--nuwell-teal); }
.db360-metric-teal-light { border-left-color: var(--nuwell-teal-light); }
.db360-metric-amber      { border-left-color: #d97706; }

/* Section / card layout */
.db360-section { margin-bottom: 28px; padding: 22px 24px; }
.db360-section-head { margin-bottom: 16px; }
.db360-section-head h2 {
  margin: 0 0 4px; color: var(--nuwell-navy);
  font-size: 18px; font-weight: 700;
}
.db360-section-sub { margin: 0; color: var(--nuwell-muted); font-size: 13px; }

.db360-two-col {
  display: grid; gap: 16px; margin-bottom: 28px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.db360-link-list { list-style: none; padding: 0; margin: 0; }
.db360-link-list li {
  padding: 8px 0; border-bottom: 1px solid var(--nuwell-bg);
  font-size: 14px; color: var(--nuwell-text);
}
.db360-link-list li:last-child { border-bottom: 0; }
.db360-link-list a { color: var(--nuwell-navy); font-weight: 600; text-decoration: none; }
.db360-link-list a:hover { color: var(--nuwell-teal); }

/* Two-LLM operating-model 5-step flow */
.db360-flow {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  counter-reset: dbflow;
}
.db360-flow-step {
  position: relative; padding: 16px 16px 16px 56px;
  background: var(--nuwell-bg);
  border-radius: 10px; border: 1px solid var(--nuwell-border);
}
.db360-flow-num {
  position: absolute; left: 14px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--nuwell-navy); color: #fff;
  font-weight: 700; font-size: 14px;
}
.db360-flow-title {
  color: var(--nuwell-navy); font-weight: 700; font-size: 14px;
  margin-bottom: 4px;
}
.db360-flow-body { color: var(--nuwell-muted); font-size: 12px; line-height: 1.5; }

/* Channel mini-cards (footer grid) */
.db360-channel-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.db360-channel {
  background: var(--nuwell-bg);
  border: 1px solid var(--nuwell-border); border-radius: 10px;
  padding: 14px 12px; text-align: center;
  transition: border-color .15s, transform .12s;
}
.db360-channel:hover {
  border-color: var(--nuwell-teal); transform: translateY(-1px);
}
.db360-channel-ico { font-size: 24px; margin-bottom: 4px; }
.db360-channel-name {
  font-weight: 700; color: var(--nuwell-navy);
  font-size: 13px; margin-bottom: 2px;
}
.db360-channel-desc { color: var(--nuwell-muted); font-size: 11px; line-height: 1.4; }

/* Sidebar polish (G10) */
.db360-sidebar-forms summary {
  display: flex; align-items: center; gap: 8px;
}
.db360-side-title { flex: 1; }
.db360-side-ico {
  display: inline-block; width: 18px; margin-right: 6px;
  text-align: center;
}
.db360-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; line-height: 1.4;
}
.db360-pill-teal {
  background: var(--nuwell-teal); color: #fff;
}
.db360-pill-soft {
  background: var(--nuwell-teal-soft); color: var(--nuwell-navy);
}

/* =====================================================================
   G11 — Send & Tracking console
   ===================================================================== */
.db360-track-table {
  width: 100%; border-collapse: collapse; margin-top: 12px;
}
.db360-track-table th, .db360-track-table td {
  padding: 10px 12px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--nuwell-bg);
}
.db360-track-table th {
  color: var(--nuwell-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; font-size: 11px;
}
.db360-track-table td .db360-mini { color: var(--nuwell-muted); font-size: 11px; }

/* =====================================================================
   G12 — Backend LLM flow visualization
   ===================================================================== */
.db360-backend-flow {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.db360-backend-node {
  background: var(--nuwell-bg);
  border: 1px solid var(--nuwell-border); border-radius: 10px;
  padding: 12px 14px;
}
.db360-backend-node.is-done {
  background: var(--nuwell-teal-soft); border-color: var(--nuwell-teal-light);
}
.db360-backend-node.is-active {
  background: #fff; border-color: var(--nuwell-teal); border-width: 2px;
}
.db360-backend-node.is-blocked {
  background: #fef3f2; border-color: #fecaca;
}
.db360-backend-title {
  font-weight: 700; color: var(--nuwell-navy); font-size: 13px;
  margin-bottom: 4px;
}
.db360-backend-status {
  font-size: 11px; color: var(--nuwell-muted); text-transform: uppercase;
  letter-spacing: .04em;
}

/* =====================================================================
   G13 — Field-type palette (wizard "What" step)
   ===================================================================== */
.db360-field-palette {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.db360-field-palette button {
  background: var(--nuwell-surface);
  border: 1px solid var(--nuwell-border); border-radius: 8px;
  padding: 10px 8px; text-align: left; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--nuwell-text);
  transition: all .15s;
}
.db360-field-palette button:hover {
  border-color: var(--nuwell-teal); background: var(--nuwell-teal-soft);
}
.db360-field-palette .pal-ico { font-size: 18px; margin-right: 4px; }
