/* ==========================================================================
   MONTHLY REPORTS MODULE STYLES
   Visual design system aligned with Weekly Reports & Rainbow Meeting:
   - 1. Next Month Action Plan (with Need Approval workflow)
   - 2. Payment Follow-up
   - 3. Client Health Status
   ========================================================================== */

:root {
  --mr-teal: #0d9488;
  --mr-teal-dark: #0f766e;
  --mr-teal-tint: #f0fdfa;
  --mr-teal-border: #99f6e4;
  --mr-navy: #0f172a;
  --mr-slate: #334155;
  --mr-muted: #64748b;
  --mr-border: #e2e8f0;
  --mr-surface: #ffffff;
  --mr-bg-alt: #f8fafc;
}

.mr-container {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px 64px;
  box-sizing: border-box;
}

/* Header */
.mr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.mr-header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mr-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--mr-teal-tint);
  border: 1.5px solid var(--mr-teal-border);
  color: var(--mr-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mr-header-title h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--mr-navy);
  letter-spacing: -0.02em;
}

.mr-header-title p {
  margin: 0;
  font-size: 13.5px;
  color: var(--mr-muted);
}

/* Quick Nav Tab Chips */
.mr-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 24px;
  padding: 4px 2px;
  max-width: 100%;
}

.mr-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1.5px solid var(--mr-border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mr-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mr-chip-btn:hover {
  border-color: var(--mr-teal);
  color: var(--mr-teal-dark);
  background: var(--mr-teal-tint);
}

.mr-chip-btn.active {
  background: var(--mr-teal);
  border-color: var(--mr-teal);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.mr-chip-btn svg {
  flex-shrink: 0;
}

/* Card Section */
.mr-card {
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
}

.mr-form-title {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--mr-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mr-editing-badge {
  display: inline-flex;
  align-items: center;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

/* Form Grid (3 columns on desktop like screenshot) */
.mr-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.mr-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .mr-form-grid,
  .mr-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.mr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mr-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mr-slate);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mr-field label .req {
  color: #ef4444;
  margin-left: 2px;
}

.mr-field input,
.mr-field select,
.mr-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid var(--mr-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--mr-navy);
  background: #ffffff;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.mr-field input:focus,
.mr-field select:focus,
.mr-field textarea:focus {
  border-color: var(--mr-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.mr-field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* Photo Dropzone (Matching Screenshot) */
.mr-dropzone {
  border: 2px dashed #99f6e4;
  background: #f0fdfa;
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 6px;
}

.mr-dropzone:hover,
.mr-dropzone.dragover {
  border-color: var(--mr-teal);
  background: #e6fffa;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.12);
}

.mr-dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ccfbf1;
  color: var(--mr-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.mr-dropzone-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--mr-navy);
  margin-bottom: 4px;
}

.mr-dropzone-hint {
  font-size: 12px;
  color: var(--mr-muted);
}

.mr-photo-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.mr-photo-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--mr-border);
  background: #0f172a;
}

.mr-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.mr-photo-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.mr-photo-del:hover {
  background: #dc2626;
}

/* Form Buttons */
.mr-btn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.mr-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--mr-teal);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 130px;
}

.mr-btn-primary:hover:not(:disabled) {
  background: var(--mr-teal-dark);
}

.mr-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.mr-btn-saved,
.mr-btn-saved:hover,
.mr-btn-saved:disabled {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: default !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
  transition: all 0.2s ease-in-out;
}

.mr-btn-cancel {
  background: #f1f5f9;
  border: 1px solid var(--mr-border);
  color: var(--mr-slate);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.mr-btn-cancel:hover {
  background: #e2e8f0;
  color: var(--mr-navy);
}

/* Filter Bar & History */
.mr-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.mr-history-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--mr-navy);
}

.mr-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.mr-filters input,
.mr-filters select {
  padding: 8px 12px;
  border: 1px solid var(--mr-border);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--mr-navy);
  background: #ffffff;
  outline: none;
}

.mr-filters input:focus,
.mr-filters select:focus {
  border-color: var(--mr-teal);
}

/* Reports Feed List */
.mr-reports-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mr-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--mr-muted);
  font-size: 14px;
  background: var(--mr-bg-alt);
  border-radius: 12px;
  border: 1.5px dashed var(--mr-border);
}

/* Individual Report Card */
.mr-report-card {
  background: #ffffff;
  border: 1px solid var(--mr-border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.mr-report-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.mr-report-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.mr-client-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mr-client-badge {
  font-weight: 700;
  font-size: 14px;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 6px;
}

.mr-client-meta {
  color: var(--mr-muted);
  font-size: 12.5px;
}

.mr-consultant-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--mr-slate);
  background: #f1f5f9;
  padding: 3px 9px;
  border-radius: 6px;
}

.mr-datetime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--mr-muted);
}

.mr-report-body {
  font-size: 14px;
  color: var(--mr-navy);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3.5px solid var(--mr-teal);
}

/* Status Pills */
.mr-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
}

.mr-status-pill.need-approval {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.mr-status-pill.approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.mr-status-pill.rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.mr-health-good {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.mr-health-stable {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.mr-health-warn {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.mr-health-bad {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Review & Remark Boxes */
.mr-remarks-block {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #065f46;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mr-remarks-block.rejected {
  border-color: #fee2e2;
  background: #fff5f5;
  color: #991b1b;
}

.mr-remarks-block.pending {
  border-color: #fef3c7;
  background: #fffbeb;
  color: #92400e;
}

/* Action Buttons */
.mr-report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.mr-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #ffffff;
  border: 1px solid var(--mr-border);
  color: var(--mr-slate);
}

.mr-action-btn:hover {
  background: #f8fafc;
  color: var(--mr-navy);
}

.mr-action-btn.approve {
  border-color: #059669;
  color: #059669;
  background: #f0fdf4;
}

.mr-action-btn.approve:hover {
  background: #059669;
  color: #ffffff;
}

.mr-action-btn.remark {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}

.mr-action-btn.remark:hover {
  background: #0284c7;
  color: #ffffff;
}

.mr-action-btn.edit:hover {
  border-color: var(--mr-teal);
  color: var(--mr-teal-dark);
}

.mr-action-btn.delete {
  color: #dc2626;
}

.mr-action-btn.delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Modal styles */
.mr-modal-detail-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--mr-border);
}

.mr-modal-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mr-modal-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mr-muted);
  text-transform: uppercase;
}

.mr-modal-detail-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mr-navy);
}

.mr-modal-content-box {
  background: #f8fafc;
  border: 1px solid var(--mr-border);
  border-radius: 8px;
  padding: 14px;
  font-size: 14px;
  color: var(--mr-navy);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin-bottom: 12px;
}
