/**
 * Customer Info & Applicant Intelligence Portal Stylesheet
 * Fundlelo Accounting CRM
 */

.cip-container {
  width: 100%;
  animation: cipFadeIn 0.25s ease-out;
}

@keyframes cipFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cip-header {
  margin-bottom: 24px;
}

.cip-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.cip-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--foreground, #0f172a);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cip-subtitle {
  font-size: 13px;
  color: var(--muted-foreground, #64748b);
  margin: 0;
}

/* Search Bar & Applicant Bar */
.cip-search-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cip-search-flex {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.cip-search-input-wrapper {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.cip-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground, #94a3b8);
  font-size: 15px;
  pointer-events: none;
}

.cip-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 38px;
  background: var(--accent, #f8fafc);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  font-size: 13px;
  color: var(--foreground, #0f172a);
  transition: all 0.2s ease;
  outline: none;
}

.cip-search-input:focus {
  border-color: #e11d84;
  box-shadow: 0 0 0 3px rgba(225, 29, 132, 0.12);
  background: #ffffff;
}

.cip-select-wrapper {
  min-width: 240px;
}

.cip-applicant-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--accent, #f8fafc);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground, #0f172a);
  outline: none;
  cursor: pointer;
}

.cip-refresh-btn {
  padding: 10px 16px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.cip-refresh-btn:hover {
  background: #e2e8f0;
}

/* Overview Banner */
.cip-profile-banner {
  background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
  border: 1px solid #fbcfe8;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(225, 29, 132, 0.05);
}

.cip-profile-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cip-profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e11d84 0%, #db2777 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(225, 29, 132, 0.35);
  overflow: hidden;
  border: 2px solid #ffffff;
}

.cip-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cip-profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cip-profile-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cip-badge-green {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.cip-badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.cip-badge-purple {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.cip-badge-amber {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* SPECIAL HIGHLIGHT CARD: Email & Domain Age */
.cip-email-intel-card {
  background: #ffffff;
  border: 2px solid #e11d84;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(225, 29, 132, 0.08);
  position: relative;
  overflow: hidden;
}

.cip-email-intel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #e11d84, #f43f5e, #3b82f6);
}

.cip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.cip-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.cip-email-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.cip-email-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 20px;
  transition: all 0.2s ease;
}

.cip-email-box:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.cip-email-box-official {
  border-color: #fed7aa;
  background: #fffaf5;
}

.cip-email-box-official:hover {
  border-color: #fdba74;
}

.cip-email-type-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cip-email-address {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cip-domain-age-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
}

.cip-domain-age-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cip-age-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.cip-age-value {
  font-size: 16px;
  font-weight: 800;
  color: #059669;
}

.cip-domain-details-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

.cip-detail-item-label {
  color: #64748b;
  display: block;
  font-size: 11px;
}

.cip-detail-item-val {
  font-weight: 600;
  color: #1e293b;
}

/* Dossier Grid */
.cip-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.cip-section-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.cip-section-card-full {
  grid-column: 1 / -1;
}

.cip-section-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #f1f5f9);
}

.cip-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 18px;
}

.cip-kv-item {
  display: flex;
  flex-direction: column;
}

.cip-kv-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.cip-kv-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground, #0f172a);
  word-break: break-word;
}

.cip-kv-value.highlight {
  color: #e11d84;
}

/* Documents Gallery */
.cip-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.cip-doc-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.cip-doc-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cip-doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fee2e2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.cip-doc-name {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cip-doc-type {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
}

.cip-doc-link {
  color: #e11d84;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  transition: all 0.15s;
}

.cip-doc-link:hover {
  background: #fce7f3;
}

/* Empty State / Spinner */
.cip-loading-state,
.cip-empty-state {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 60px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.cip-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #f1f5f9;
  border-top-color: #e11d84;
  border-radius: 50%;
  animation: cipSpin 0.75s linear infinite;
}

@keyframes cipSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .cip-sections-grid {
    grid-template-columns: 1fr;
  }
  .cip-profile-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Document Preview Modal & Actions */
.cip-doc-link-ext {
  padding: 4px 8px !important;
  font-size: 13px !important;
}

.cip-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: cipFadeIn 0.2s ease-out;
}

.cip-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
}

.cip-modal-card {
  position: relative;
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.cip-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card, #ffffff);
}

.cip-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.cip-modal-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: #db2777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cip-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.cip-modal-btn-ext {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.cip-modal-btn-ext:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cip-modal-btn-dl {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

.cip-modal-btn-dl:hover {
  background: #fce7f3;
}

.cip-modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted-foreground, #64748b);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.cip-modal-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

.cip-modal-body {
  padding: 16px;
  background: #090d16;
  flex: 1;
  min-height: 380px;
  max-height: calc(90vh - 120px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cip-modal-img-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cip-modal-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.cip-modal-iframe {
  width: 100%;
  height: 72vh;
  border: none;
  border-radius: 8px;
  background: #ffffff;
}

.cip-modal-video {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 8px;
}

.cip-modal-audio {
  width: 90%;
  max-width: 500px;
}

.cip-modal-err {
  color: #cbd5e1;
  text-align: center;
  font-size: 13px;
  padding: 40px 20px;
}

.cip-modal-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--card, #ffffff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

