/* BreezesAdmin — shared services detail / form modals (WI-084 UX refresh)
 * Calm hierarchy: navy primary, neutrals, outline danger — not four saturated slabs.
 */

:root {
  --svc-modal-navy: #003b6d;
  --svc-modal-navy-hover: #002a4d;
  --svc-modal-border: #e2e8f0;
  --svc-modal-muted: #64748b;
  --svc-modal-surface: #ffffff;
  --svc-modal-overlay: rgba(15, 23, 42, 0.45);
}

.svc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: var(--svc-modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  animation: svcModalFadeIn 0.18s ease;
}

@keyframes svcModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.svc-modal-panel {
  background: var(--svc-modal-surface);
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 24px 48px -12px rgba(0, 59, 109, 0.18);
  width: 100%;
  max-width: 720px;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 59, 109, 0.08);
  animation: svcModalLift 0.22s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes svcModalLift {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.svc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--svc-modal-border);
  flex-shrink: 0;
}

.svc-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.svc-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--svc-modal-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.svc-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.svc-modal-close .material-icons {
  font-size: 20px;
}

.svc-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  color: #334155;
  line-height: 1.5;
}

/* Section cards inside modal body (optional utility) */
.svc-modal-section {
  background: #f8fafc;
  border: 1px solid var(--svc-modal-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.svc-modal-section:last-child {
  margin-bottom: 0;
}

.svc-modal-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--svc-modal-muted);
  margin: 0 0 10px;
}

.svc-modal-footer {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--svc-modal-border);
  flex-shrink: 0;
}

body:has(.agent-chat-fab).svc-modal-open .svc-modal-footer {
  padding-bottom: calc(20px + var(--ops-admin-fab-safe-bottom, 96px));
}

.svc-modal-btn {
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.svc-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary = Breezes navy (positive / main action) */
.svc-modal-btn--primary {
  background: var(--svc-modal-navy);
  color: #fff;
  border-color: var(--svc-modal-navy);
  box-shadow: 0 1px 2px rgba(0, 59, 109, 0.12);
}

.svc-modal-btn--primary:hover:not(:disabled) {
  background: var(--svc-modal-navy-hover);
  border-color: var(--svc-modal-navy-hover);
}

/* Secondary / neutral */
.svc-modal-btn--secondary {
  background: #fff;
  color: #475569;
  border-color: #cbd5e1;
}

.svc-modal-btn--secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Positive workflow (approve) — teal accent, not loud green */
.svc-modal-btn--positive {
  background: #0e7490;
  color: #fff;
  border-color: #0e7490;
}

.svc-modal-btn--positive:hover:not(:disabled) {
  background: #155e75;
  border-color: #155e75;
}

/* Destructive — outline first; reads serious without candy-button row */
.svc-modal-btn--danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

.svc-modal-btn--danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #f87171;
}

.svc-modal-btn--danger-filled {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.svc-modal-btn--danger-filled:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Staff note block */
.svc-modal-staff-notes {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--svc-modal-border);
}

.svc-modal-staff-notes label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--svc-modal-muted);
  display: block;
  margin-bottom: 8px;
}

.svc-modal-staff-notes textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
  box-sizing: border-box;
}

.svc-modal-staff-notes textarea:focus {
  outline: none;
  border-color: var(--svc-modal-navy);
  box-shadow: 0 0 0 3px rgba(0, 59, 109, 0.12);
}

body.svc-modal-open {
  overflow: hidden;
}
