/* ================================================================
   CLIENT PORTAL · Extends portal.css
   Adds: 4-card client grid, modal viewer, recs editor with EBTG dropdown + category pills
   Colors: purple-deep, gold-royal, cream (matches student portal)
   ================================================================ */

/* Client-facing 4-card grid */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
}

.client-card {
  background: var(--card-bg, #FFF);
  border: 1px solid var(--card-border, #E5E1D4);
  border-radius: 14px;
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgba(45, 27, 61, 0.22);
  border-color: #C9A961;
}

.client-card-featured {
  background: linear-gradient(140deg, #2d1b3d 0%, #3D1556 100%);
  color: #F8F4EA;
  border-color: #C9A961;
}
.client-card-featured .client-card-eyebrow { color: #C9A961; }
.client-card-featured .client-card-title { color: #F8F4EA; }
.client-card-featured .client-card-desc { color: rgba(248, 244, 234, 0.82); }
.client-card-featured .client-card-arrow { color: #C9A961; }
.client-card-featured .client-card-icon { background: rgba(201, 169, 97, 0.18); color: #C9A961; }

.client-card-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3EBFB;
  color: #2d1b3d;
}
.client-card-icon svg { width: 26px; height: 26px; }

.icon-blueprint { background: #F3EBFB; color: #2d1b3d; }
.icon-recs { background: #FBF3E6; color: #8A6923; }
.icon-notes { background: #EAF3EE; color: #2F5D3B; }
.icon-resources { background: #FBEAF2; color: #A01B5E; }

.client-card-body {
  flex: 1;
  min-width: 0;
}
.client-card-eyebrow {
  font-family: 'General Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7A6088;
  margin-bottom: var(--space-2);
}
.client-card-title {
  font-family: 'Zodiak', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d1b3d;
  margin-bottom: var(--space-2);
  line-height: 1.25;
}
.client-card-desc {
  font-family: 'General Sans', sans-serif;
  font-size: 0.92rem;
  color: #5a4a68;
  line-height: 1.5;
}
.client-card-arrow {
  width: 20px; height: 20px;
  color: #7A6088;
  align-self: center;
  flex-shrink: 0;
}

/* Message strip */
.client-message-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: #FBF6E9;
  border: 1px solid #E8D9A8;
  border-radius: 12px;
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}
.client-message-title { font-weight: 600; color: #2d1b3d; margin-bottom: 4px; }
.client-message-desc { color: #6b5a45; font-size: 0.9rem; }

/* Modal viewer */
.client-modal {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 61, 0.72);
  backdrop-filter: blur(6px);
  z-index: 200;
  overflow-y: auto;
  padding: var(--space-4);
}
.client-modal-inner {
  max-width: 900px;
  margin: var(--space-6) auto;
  background: #FFF;
  border-radius: 16px;
  padding: var(--space-5) var(--space-6);
  min-height: 60vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.modal-section-title {
  font-family: 'Zodiak', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #2d1b3d;
  margin-bottom: var(--space-3);
}
.modal-section-desc {
  color: #5a4a68;
  margin-bottom: var(--space-4);
}

/* Recommendation list on client side */
.rec-item {
  background: #FBF9F4;
  border: 1px solid #E5E1D4;
  border-radius: 10px;
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: start;
}
.rec-item-name { font-weight: 600; color: #2d1b3d; margin-bottom: 4px; font-size: 1.05rem; }
.rec-item-dose { color: #5a4a68; font-size: 0.9rem; margin-bottom: 4px; }
.rec-item-notes { color: #6b5a68; font-size: 0.88rem; margin-top: 6px; }
.rec-item-source {
  display: inline-block;
  font-family: 'General Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 6px;
}
.src-ebtg { background: #F3EBFB; color: #2d1b3d; }
.src-home { background: #EAF3EE; color: #2F5D3B; }
.src-csa { background: #FBF3E6; color: #8A6923; }
.src-beauty { background: #FBEAF2; color: #A01B5E; }

.rec-item-buy-btn {
  background: #2d1b3d;
  color: #F8F4EA;
  border: 1px solid #C9A961;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'General Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.rec-item-buy-btn:hover { background: #C9A961; color: #2d1b3d; }

/* Session note timeline */
.note-item {
  background: #FBF9F4;
  border-left: 3px solid #C9A961;
  border-radius: 0 10px 10px 0;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}
.note-date { font-size: 0.8rem; color: #7A6088; font-weight: 600; letter-spacing: 0.05em; margin-bottom: 6px; }
.note-body { color: #3d2d4a; line-height: 1.5; white-space: pre-wrap; }

/* Blueprint viewer */
.blueprint-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid #E5E1D4;
  border-radius: 10px;
  background: #FBF9F4;
}

/* ============================================================
   ADMIN · Recommendations Builder
   ============================================================ */

.rec-source-picker {
  background: #FBF9F4;
  border: 1px solid #E5E1D4;
  border-radius: 12px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.rec-source-primary {
  background: linear-gradient(135deg, #2d1b3d 0%, #3D1556 100%);
  color: #F8F4EA;
  border: 2px solid #C9A961;
  border-radius: 10px;
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.rec-source-primary-label {
  color: #C9A961;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.rec-source-primary-title { color: #F8F4EA; font-weight: 600; font-size: 1.05rem; margin-bottom: 8px; }
.rec-source-primary select {
  width: 100%;
  background: #F8F4EA;
  color: #2d1b3d;
  border: 1px solid #C9A961;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'General Sans', sans-serif;
  font-size: 0.95rem;
}

.rec-category-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}
.rec-pill {
  border: 1px solid #E5E1D4;
  background: #FFF;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: 'General Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #5a4a68;
}
.rec-pill:hover { border-color: #C9A961; color: #2d1b3d; }
.rec-pill.active { background: #2d1b3d; color: #F8F4EA; border-color: #C9A961; }
.rec-pill-home.active { background: #2F5D3B; }
.rec-pill-csa.active { background: #8A6923; }
.rec-pill-beauty.active { background: #A01B5E; }

.rec-category-panel {
  background: #FFF;
  border: 1px solid #E5E1D4;
  border-radius: 10px;
  padding: var(--space-3);
  margin-top: var(--space-3);
}
.rec-category-panel select {
  width: 100%;
  background: #FBF9F4;
  border: 1px solid #E5E1D4;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'General Sans', sans-serif;
  font-size: 0.95rem;
  color: #2d1b3d;
}

.rec-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.rec-form-grid label { font-size: 0.85rem; font-weight: 600; color: #2d1b3d; }
.rec-form-grid input, .rec-form-grid textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #E5E1D4;
  border-radius: 6px;
  font-family: 'General Sans', sans-serif;
  font-size: 0.9rem;
  color: #2d1b3d;
  background: #FBF9F4;
}
.rec-form-grid textarea { grid-column: 1 / -1; min-height: 60px; resize: vertical; }
.rec-form-actions { grid-column: 1 / -1; display: flex; gap: var(--space-2); }

/* Admin table for clients */
.client-admin-list {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-3);
  font-family: 'General Sans', sans-serif;
}
.client-admin-list th, .client-admin-list td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #E5E1D4;
  font-size: 0.9rem;
}
.client-admin-list th { font-weight: 600; color: #2d1b3d; background: #FBF9F4; }
.client-admin-list td { color: #3d2d4a; }
.client-admin-list .passcode { font-family: 'Berkeley Mono', 'Menlo', monospace; letter-spacing: 0.1em; color: #8A6923; }

.admin-action-btn {
  background: transparent;
  border: 1px solid #E5E1D4;
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'General Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  color: #2d1b3d;
  margin-right: 4px;
}
.admin-action-btn:hover { border-color: #C9A961; background: #FBF6E9; }
.admin-action-btn.danger { color: #A01B5E; border-color: #F2C5DA; }
.admin-action-btn.danger:hover { background: #FBEAF2; }

/* Product catalog list */
.product-cat-section {
  background: #FBF9F4;
  border: 1px solid #E5E1D4;
  border-radius: 12px;
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.product-cat-title { font-weight: 600; color: #2d1b3d; margin-bottom: var(--space-2); }
.product-cat-sub { font-size: 0.85rem; color: #7a6088; margin-bottom: var(--space-3); }
.product-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}
.product-row input {
  padding: 6px 10px;
  border: 1px solid #E5E1D4;
  border-radius: 6px;
  font-size: 0.88rem;
  background: #FFF;
  color: #2d1b3d;
}

/* Blueprint / Notes / Resources edit forms */
.editor-form {
  background: #FBF9F4;
  border: 1px solid #E5E1D4;
  border-radius: 12px;
  padding: var(--space-4);
}
.editor-form label { display: block; font-size: 0.85rem; font-weight: 600; color: #2d1b3d; margin-top: var(--space-3); margin-bottom: 6px; }
.editor-form input, .editor-form textarea, .editor-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #E5E1D4;
  border-radius: 6px;
  font-family: 'General Sans', sans-serif;
  font-size: 0.9rem;
  color: #2d1b3d;
  background: #FFF;
}
.editor-form textarea { min-height: 120px; resize: vertical; }

/* Activity log */
.activity-log-list {
  font-family: 'General Sans', sans-serif;
  font-size: 0.9rem;
}
.activity-log-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  padding: 8px 12px;
  border-bottom: 1px solid #E5E1D4;
  gap: var(--space-2);
}
.activity-log-row:first-child { font-weight: 600; background: #FBF9F4; color: #2d1b3d; }
.activity-log-row .ts { color: #7a6088; font-size: 0.85rem; }

/* Dark mode overrides */
body.dark .client-card { background: #251930; border-color: #4a3a5a; color: #F0E8DA; }
body.dark .client-card-title { color: #F0E8DA; }
body.dark .client-card-desc { color: #C4B8CE; }
body.dark .client-card-eyebrow { color: #C9A961; }
body.dark .client-modal-inner { background: #1E1424; color: #F0E8DA; }
body.dark .modal-section-title { color: #F0E8DA; }
body.dark .modal-section-desc { color: #C4B8CE; }
body.dark .rec-item, body.dark .note-item, body.dark .editor-form, body.dark .rec-source-picker { background: #251930; border-color: #4a3a5a; }
body.dark .rec-item-name, body.dark .rec-item-dose { color: #F0E8DA; }
body.dark .rec-item-notes, body.dark .note-body { color: #C4B8CE; }
body.dark .client-message-strip { background: #2A1F1A; border-color: #5B4A2C; }
body.dark .client-message-title { color: #F0E8DA; }
body.dark .client-message-desc { color: #C4B8CE; }

/* Mobile */
@media (max-width: 640px) {
  .client-grid { grid-template-columns: 1fr; }
  .client-modal-inner { margin: var(--space-3) auto; padding: var(--space-4); }
  .rec-form-grid { grid-template-columns: 1fr; }
  .product-row { grid-template-columns: 1fr; }
  .activity-log-row { grid-template-columns: 1fr; }
}

/* ============================================================
   V2 FEATURES · Scripture card, Lineage tag, Citation link,
   Weekly Check-In form + admin
   ============================================================ */

.client-card-icon.icon-checkin {
  background: linear-gradient(135deg, #C9A961 0%, #3D1556 100%);
}

/* Scripture card · minimalist, no side border · gold top rule + soft cream */
.scripture-card {
  background: #FBF7EC;
  border-top: 2px solid #C9A961;
  border-radius: 4px;
  padding: 24px 28px 22px;
  margin-top: 20px;
}
.scripture-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #C9A961;
  margin-bottom: 12px;
}
.scripture-body {
  font-size: 1rem;
  line-height: 1.7;
  color: #2d1b3d;
  font-style: italic;
}
.scripture-ref {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #7a6088;
  font-weight: 500;
}

/* Recommendation meta row · source + lineage together */
.rec-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.rec-lineage-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #3D1556;
  background: rgba(61, 21, 86, 0.08);
  padding: 3px 8px;
  border-radius: 3px;
}
.rec-citation-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: #01696F;
  text-decoration: none;
  font-weight: 500;
}
.rec-citation-link:hover {
  text-decoration: underline;
}

/* Check-In client form */
.checkin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 520px) {
  .checkin-form-grid { grid-template-columns: 1fr; }
}
.checkin-form-grid input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E5E1D4;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
}
.checkin-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: #3d2d4a;
}
.checkin-scores strong { color: #2d1b3d; }

/* Check-In admin cards */
.checkin-admin-card {
  background: #FBF9F4;
  border: 1px solid #E5E1D4;
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 12px;
}
.checkin-admin-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.checkin-admin-client {
  font-weight: 600;
  color: #2d1b3d;
  font-size: 0.95rem;
}
.checkin-admin-date {
  font-size: 0.82rem;
  color: #7a6088;
  margin-top: 2px;
}
.checkin-admin-notes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #E5E1D4;
  color: #3d2d4a;
  font-size: 0.9rem;
  line-height: 1.55;
}
