/* CMAS app-specific tweaks layered on top of Tailwind CDN. */

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

/* Toasts */
.cmas-toast {
  background: #0f172a;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  box-shadow: 0 10px 25px rgba(15,23,42,.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
  max-width: 320px;
}
.cmas-toast.show { opacity: 1; transform: translateY(0); }

/* Soap-builder layout */
.soap-section {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 0.5rem;
}
.soap-section header {
  padding: .65rem .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid #e2e8f0;
}
.soap-section header input.section-title {
  font-weight: 600;
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
}
.soap-section header input.section-title:hover,
.soap-section header input.section-title:focus {
  border-color: #cbd5e1;
  background: #f8fafc;
  outline: none;
}
.soap-section .subsections {
  padding: .5rem .75rem;
  display: grid;
  gap: .35rem;
}
.soap-sub {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .35rem;
  border-radius: 4px;
}
.soap-sub:hover { background: #f8fafc; }
.soap-sub input.sub-title {
  flex: 1;
  border: 1px solid transparent;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: .9rem;
}
.soap-sub input.sub-title:hover,
.soap-sub input.sub-title:focus {
  border-color: #cbd5e1;
  background: #fff;
  outline: none;
}
.btn-icon {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: .8rem;
  line-height: 1.2;
  cursor: pointer;
}
.btn-icon:hover { background: #f1f5f9; color: #0f172a; }
.btn-danger { color: #be123c; }
.btn-danger:hover { background: #fff1f2; color: #9f1239; }

/* Drag handles (Phase 1.1) */
.drag-handle {
  cursor: grab;
  user-select: none;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
}
.drag-handle:hover {
  color: #0f172a;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle.section-drag { font-size: 1.05rem; }

/* SortableJS ghost preview */
.soap-ghost {
  opacity: 0.5;
  background: #e0f2fe !important;
  border: 1px dashed #38bdf8 !important;
}

/* Modal (Phase 1.1) */
.soap-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 1rem;
}
.soap-modal-backdrop.is-open { display: flex; }
.soap-modal {
  background: #fff;
  border-radius: 0.625rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}
.soap-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.soap-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
}
.soap-tab {
  flex: 1;
  background: #f8fafc;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .55rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
}
.soap-tab.is-active {
  background: #fff;
  color: #0369a1;
  border-bottom-color: #0284c7;
}
.soap-modal-body {
  padding: 1rem;
  overflow-y: auto;
}
.soap-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.soap-restore-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: .35rem .55rem;
  background: #fff;
}
.soap-restore-item:hover { background: #f8fafc; }
