/* ============================================================
   Modal — Unified (extracted from cashflow-core)
   - Neutral, reusable, app-wide
============================================================ */

.cf-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  font-family: inherit;
}

.cf-modal-hidden {
  display: none;
}

/* ============================================================
   Backdrop
============================================================ */

.cf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(2px);
}

/* ============================================================
   Dialog
============================================================ */

.cf-modal-dialog {
  position: relative;
  max-width: 520px;
  width: calc(100% - 32px);
  margin: 10vh auto;
  background: #0d0f17;
  border: 1px solid rgba(30, 41, 59, 0.9);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Header
============================================================ */

.cf-modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.75);
}

.cf-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #e5e7eb;
}

/* ============================================================
   Body
============================================================ */

.cf-modal-body {
  padding: 16px;
  color: rgba(226, 232, 240, 0.9);
  font-size: 15px;
  line-height: 1.45;
}

/* Optional helpers for rich modal bodies */
.cf-modal-section {
  margin-bottom: 14px;
}

.cf-modal-text {
  margin: 0 0 10px 0;
}

.cf-modal-list {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.cf-modal-list li {
  margin: 4px 0;
}

/* ============================================================
   Footer
============================================================ */

.cf-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(30, 41, 59, 0.75);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   Buttons
============================================================ */

.cf-modal-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
}

/* Primary */
.cf-modal-btn-primary {
  background: #38bdf8;
  color: #020617;
}

.cf-modal-btn-primary:hover:not(:disabled) {
  background: #60a5fa;
}

.cf-modal-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Secondary */
.cf-modal-btn-secondary {
  background: transparent;
  color: rgba(226, 232, 240, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
}

.cf-modal-btn-secondary:hover {
  border-color: rgba(148, 163, 184, 0.6);
}

/* ============================================================
   Utilities
============================================================ */

.cf-hidden {
  display: none !important;
}

/* ============================================================
   Responsive
============================================================ */

@media (max-width: 640px) {
  .cf-modal-dialog {
    margin: 6vh auto;
  }
}

/* ============================================================
   NOTES MODAL
   Requires: dialogClass = "cf-modal-dialog-notes"
============================================================ */

/* Wider dialog so notes feel intentional, not cramped */
.cf-modal-dialog-notes {
  width: min(720px, calc(100vw - 32px));
}

/* Body spacing */
.cf-modal-dialog-notes .cf-modal-body {
  padding-top: 18px;
}

/* Intro text */
.cf-modal-dialog-notes .cf-modal-text {
  margin: 0 0 12px;
  font-size: 14px;
  color: rgba(229, 231, 235, 0.9);
}

/* Notes field wrapper */
.cf-modal-dialog-notes .cf-modal-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Label */
.cf-modal-dialog-notes .cf-modal-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(156, 163, 175, 0.9);
}

/* Textarea (override browser default) */
.cf-modal-dialog-notes textarea,
.cf-modal-dialog-notes .cf-modal-input {
  background: rgba(2, 6, 23, 0.55);
  color: rgba(229, 231, 235, 0.95);

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;

  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;

  resize: vertical;
  min-height: 220px;

  outline: none;
}

/* Placeholder */
.cf-modal-dialog-notes textarea::placeholder {
  color: rgba(156, 163, 175, 0.65);
}

/* Focus state */
.cf-modal-dialog-notes textarea:focus {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* Error message */
.cf-modal-dialog-notes .cf-modal-error {
  margin-top: 8px;
  font-size: 13px;
  color: #f87171;
}

/* Footer spacing tweak (feels calmer) */
.cf-modal-dialog-notes .cf-modal-footer {
  padding-top: 16px;
}
