/* === modals.css === */
/* ======================================================
   === SECTION: MODALS ===
   ====================================================== */
.crm-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.crm-modal-overlay.open { opacity: 1; pointer-events: all; }
.crm-modal {
  background: white; border-radius: 18px;
  max-width: 640px; width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  transform: translateY(20px); transition: transform 0.25s;
  max-height: 90vh; overflow-y: auto;
}
.crm-modal-overlay.open .crm-modal { transform: translateY(0); }
.crm-modal-header {
  padding: 22px 28px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.crm-modal-title { font-size: 1.1rem; font-weight: 800; color: #1e293b; }
.crm-modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: #f1f5f9; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 1rem; transition: all 0.2s;
}
.crm-modal-close:hover { background: #e2e8f0; }
.crm-modal-body { padding: 24px 28px; }
.crm-modal-footer { padding: 16px 28px; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; gap: 10px; }

/* Form styles within modal */
.form-group { margin-bottom: 18px; }
.form-label-crm { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: #64748b; display: block; margin-bottom: 6px; }
.form-control-crm {
  width: 100%; padding: 10px 14px; border: 2px solid #e2e8f0;
  border-radius: 9px; font-family: inherit; font-size: 0.88rem;
  color: #1e293b; outline: none; transition: border-color 0.2s;
}
.form-control-crm:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* XLSX Import */
.xlsx-drop-zone {
  border: 2px dashed #cbd5e1; border-radius: 12px;
  padding: 40px; text-align: center; color: #94a3b8;
  cursor: pointer; transition: all 0.2s; margin-bottom: 16px;
}
.xlsx-drop-zone:hover, .xlsx-drop-zone.drag-over { border-color: var(--accent); background: #eff6ff; color: var(--accent); }
.xlsx-drop-icon { font-size: 2rem; margin-bottom: 10px; }
.xlsx-preview {
  background: #f8fafc; border-radius: 10px; padding: 14px;
  font-size: 0.8rem; max-height: 200px; overflow-y: auto;
}

/* Toast notifications */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1e293b; color: white; padding: 12px 18px;
  border-radius: 10px; font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); display: flex; align-items: center; gap: 10px;
  transform: translateX(120%); transition: transform 0.3s;
  max-width: 300px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 4px solid var(--green); }
.toast-error { border-left: 4px solid var(--red); }
.toast-info { border-left: 4px solid var(--accent); }

/* ICS / Utilities */
.btn-crm {
  padding: 10px 20px; border-radius: 9px; font-weight: 800;
  font-size: 0.82rem; border: none; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.btn-crm-primary { background: var(--accent); color: white; box-shadow: 0 4px 12px var(--accent-glow); }
.btn-crm-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-crm-success { background: var(--green); color: white; }
.btn-crm-danger { background: var(--red); color: white; }
.btn-crm-ghost { background: #f1f5f9; color: #334155; }
.btn-crm-ghost:hover { background: #e2e8f0; }

/* Overdue pulse animation */
@keyframes pulse-red { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.overdue-pulse { animation: pulse-red 2s infinite; }

/* Google Meet integration */
.meet-link-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1px solid #bbf7d0;
  margin-bottom: 6px;
}
.meet-link-bar .meet-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, #00897b, #00acc1);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.75rem; flex-shrink: 0;
}
.meet-link-bar input {
  flex: 1; border: 1.5px solid #d1fae5; border-radius: 6px;
  padding: 5px 10px; font-size: 0.78rem; font-family: 'JetBrains Mono', monospace;
  outline: none; background: white; color: #1e293b;
}
.meet-link-bar input:focus { border-color: #00897b; }
.meet-link-bar input::placeholder { color: #94a3b8; font-family: inherit; }
.meet-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 0.68rem; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit; transition: all 0.15s;
  white-space: nowrap;
}
.meet-btn-gen { background: #00897b; color: white; }
.meet-btn-gen:hover { background: #00796b; }
.meet-btn-cal { background: #1a73e8; color: white; }
.meet-btn-cal:hover { background: #1565c0; }
.meet-btn-copy { background: #e2e8f0; color: #334155; }
.meet-btn-copy:hover { background: #cbd5e1; }
.meet-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 5px; font-size: 0.6rem;
  font-weight: 700; background: #d1fae5; color: #047857;
  cursor: pointer; transition: all 0.15s;
}
.meet-badge:hover { background: #a7f3d0; }
.meet-badge i { font-size: 0.55rem; }

/* Location Group Badge */
.group-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 5px; font-size: 0.6rem;
  font-weight: 700; background: #ede9fe; color: #6d28d9;
  cursor: pointer; transition: all 0.15s; margin-left: 6px;
  white-space: nowrap; position: relative;
}
.group-badge:hover { background: #ddd6fe; }
.group-badge i { font-size: 0.55rem; }

/* Group Popover */
.group-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 9999;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13); min-width: 220px; max-width: 320px;
  padding: 10px 0; font-size: 0.78rem; color: #1e293b;
}
.group-popover-header {
  font-weight: 700; font-size: 0.68rem; color: #6d28d9;
  padding: 0 12px 6px; border-bottom: 1px solid #f1f5f9;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.group-popover-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 5px 12px; cursor: pointer;
  transition: background 0.12s;
}
.group-popover-row:hover { background: #f8fafc; }
.group-popover-name { font-weight: 600; color: #1e293b; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-popover-label { font-size: 0.65rem; color: var(--accent); font-weight: 600; }
.group-popover-stage { font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: #f1f5f9; color: #64748b; flex-shrink: 0; }

/* Page section header */
.section-head { margin-bottom: 24px; }
.section-head h2 { font-size: 1.4rem; font-weight: 800; color: #1e293b; }
.section-head p { font-size: 0.82rem; color: #64748b; margin-top: 3px; }

/* Utility */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-accent { color: var(--accent); }
.fw-800 { font-weight: 800; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ======================================================
   === SECTION: PROFILE SELECTOR MODAL ===
   ====================================================== */
.profile-overlay {
  display: none; position: fixed; inset: 0; z-index: 10000;
  background: rgba(10,15,30,0.92); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
.profile-overlay.open { display: flex; }
.profile-card {
  background: white; border-radius: 16px; padding: 32px 36px;
  max-width: 400px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
}
.profile-card h2 { font-size: 1.1rem; font-weight: 800; color: #1e293b; margin: 0 0 4px; }
.profile-card .pc-sub { font-size: 0.72rem; color: #94a3b8; margin-bottom: 20px; }
.profile-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.profile-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 10px; border: 1px solid #e2e8f0; cursor: pointer;
  text-align: left; background: white; font-family: inherit; transition: all 0.2s;
}
.profile-item:hover { border-color: var(--accent); background: #f0f7ff; }
.profile-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 0.8rem; flex-shrink: 0;
}
.profile-info .pi-name { font-size: 0.82rem; font-weight: 700; color: #1e293b; }
.profile-info .pi-email { font-size: 0.68rem; color: #94a3b8; }
.profile-new-btn {
  display: block; width: 100%; padding: 10px; border-radius: 9px;
  background: #f8fafc; border: 1px dashed #cbd5e1; color: #64748b;
  font-size: 0.78rem; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.profile-new-btn:hover { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.profile-form { display: none; margin-top: 16px; text-align: left; }
.profile-form.open { display: block; }
.profile-form input {
  width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid #e2e8f0;
  font-family: inherit; font-size: 0.85rem; margin-bottom: 10px; outline: none;
}
.profile-form input:focus { border-color: var(--accent); }
.profile-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pf-btn {
  padding: 8px 18px; border-radius: 8px; font-size: 0.78rem; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit;
}
.pf-btn-primary { background: var(--accent); color: white; }
.pf-btn-ghost { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }

/* ── Invoice Status Badge ──────────────────────────────────────────── */
.invoice-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 5px; font-size: 0.6rem;
  font-weight: 700; cursor: default; white-space: nowrap;
  transition: opacity 0.15s;
}
.invoice-badge i { font-size: 0.55rem; }

/* Balance Due — amber, matches p03 fef9c3 / 854d0e palette */
.invoice-badge-balance {
  background: #fef9c3; color: #854d0e;
}
.invoice-badge-balance:hover { opacity: 0.85; }

/* Credit Due — blue, matches p03 eff6ff / 1d4ed8 palette */
.invoice-badge-credit {
  background: #eff6ff; color: #1d4ed8;
}
.invoice-badge-credit:hover { opacity: 0.85; }

/* Paid in Full — green, matches p03 dcfce7 / 166534 palette */
.invoice-badge-paid {
  background: #dcfce7; color: #166534;
}
.invoice-badge-paid:hover { opacity: 0.85; }
