/* ============================================================================
   Daily Brief Panel
   Prefix: dbp-
   One unified right slide-in showing every training entry + every wellness
   metric for a given day, used by both portals when the athlete or coach
   clicks View -> on a row in the Message Centre day summary strip.
============================================================================ */

.dbp-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 990; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.dbp-overlay.visible { opacity: 1; pointer-events: auto; }

.dbp-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 560px; max-width: 100vw;
  background: #fff;
  border-left: 0.5px solid #e0e0dc;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
.dbp-panel.open { transform: translateX(0); }

@media (max-width: 480px) {
  .dbp-panel { width: 100vw; }
}

.dbp-hdr {
  padding: 12px 18px;
  background: #1a2332;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.dbp-hdr-title { font-size: 14px; font-weight: 500; color: #fff; }
.dbp-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: #94a3b8; line-height: 1; padding: 0;
}
.dbp-close:hover { color: #fff; }

.dbp-body {
  flex: 1; overflow-y: auto; padding: 16px 18px; background: #f5f5f3;
}

.dbp-section-label {
  font-size: 10px; font-weight: 500; color: #999;
  text-transform: uppercase; letter-spacing: 0.07em;
  margin: 14px 0 6px;
}
.dbp-section-label.first { margin-top: 0; }

.dbp-card {
  background: #fff; border: 0.5px solid #e0e0dc;
  padding: 14px 16px; margin-bottom: 10px;
}
/* Athlete side: visually distinguish items that aren't shared with the coach */
.dbp-card.dbp-private {
  background: #f5f5f3;
  border-color: #e0e0dc;
  opacity: 0.72;
}
.dbp-card.dbp-private .dbp-card-title,
.dbp-card.dbp-private .dbp-row-label,
.dbp-card.dbp-private .dbp-row-val { color: #777; }

.dbp-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.dbp-card-title { font-size: 14px; font-weight: 600; color: #1a1a18; }
.dbp-card-sub { font-size: 11px; color: #888; margin-top: 2px; }

.dbp-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 0.5px solid #f0f0ee;
}
.dbp-row:last-of-type { border-bottom: none; }
.dbp-row-label { color: #666; }
.dbp-row-val { font-weight: 500; color: #1a1a18; text-align: right; }

.dbp-note {
  font-size: 11px; color: #555; margin-top: 6px; line-height: 1.5;
  font-style: italic;
  padding: 6px 8px;
  background: #f9f9f7;
  border-left: 2px solid #e0e0dc;
}

/* Sharing row — toggles + edit button */
.dbp-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid #e0e0dc;
}
.dbp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border: 0.5px solid #ccc;
  background: #fff; color: #666;
  font-size: 10px; font-family: inherit;
  cursor: pointer; user-select: none;
}
.dbp-pill .dbp-dot {
  width: 8px; height: 8px; background: #ccc; display: inline-block;
}
.dbp-pill.on {
  background: #E1F5EE; border-color: #14b8a6; color: #085041;
}
.dbp-pill.on .dbp-dot { background: #14b8a6; }
.dbp-pill.busy { opacity: 0.5; pointer-events: none; }
.dbp-pill[data-disabled="1"] { cursor: default; }

/* Read-only badge shown on coach instance */
.dbp-badge {
  display: inline-flex; align-items: center;
  padding: 3px 7px;
  background: #f0f0ee; color: #666;
  font-size: 10px; font-weight: 500;
}
.dbp-badge.on { background: #E1F5EE; color: #085041; }

.dbp-edit-btn {
  margin-left: auto;
  padding: 4px 10px;
  background: transparent;
  border: 0.5px solid #185FA5;
  color: #185FA5;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dbp-edit-btn:hover { background: #E6F1FB; }
.dbp-portal-coach .dbp-edit-btn {
  border-color: #0F6E56; color: #0F6E56;
}
.dbp-portal-coach .dbp-edit-btn:hover { background: #E1F5EE; }

/* Inline wellness edit form */
.dbp-edit-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid #e0e0dc;
  display: flex; flex-direction: column; gap: 8px;
}
.dbp-edit-form label {
  font-size: 10px; font-weight: 500; color: #999;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.dbp-edit-form textarea {
  padding: 6px 8px;
  border: 0.5px solid #ccc;
  font-size: 12px; font-family: inherit;
  resize: vertical;
  min-height: 48px;
}
.dbp-edit-form textarea:focus {
  border-color: #185FA5; outline: none;
}
.dbp-edit-form-actions {
  display: flex; gap: 6px; justify-content: flex-end;
}
.dbp-btn-primary {
  padding: 6px 12px;
  background: #185FA5; color: #fff; border: none;
  font-size: 11px; font-family: inherit; cursor: pointer;
}
.dbp-btn-primary:hover { background: #124E8A; }
.dbp-btn-secondary {
  padding: 6px 12px;
  background: transparent; color: #666;
  border: 0.5px solid #ccc;
  font-size: 11px; font-family: inherit; cursor: pointer;
}
.dbp-btn-secondary:hover { background: #f0f0ee; }

.dbp-empty {
  padding: 24px; text-align: center; font-size: 12px; color: #999;
}

/* Reply button + inline compose (wireframe AP-07) */
.dbp-reply-btn {
  padding: 4px 10px;
  background: transparent;
  border: 0.5px solid #14b8a6;
  color: #085041;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dbp-reply-btn:hover { background: #E1F5EE; }

.dbp-reply-compose {
  margin-top: 10px;
  border: 0.5px solid #185FA5;
  background: #fff;
}
.dbp-portal-coach .dbp-reply-compose { border-color: #0F6E56; }

.dbp-reply-ctx {
  background: #E6F1FB;
  padding: 5px 10px;
  border-bottom: 0.5px solid #B5D4F4;
  display: flex; align-items: center; justify-content: space-between;
}
.dbp-portal-coach .dbp-reply-ctx {
  background: #E1F5EE; border-bottom-color: #9FE1CB;
}
.dbp-reply-ctx-lbl {
  font-size: 9px; color: #185FA5;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 1px;
}
.dbp-portal-coach .dbp-reply-ctx-lbl { color: #0F6E56; }
.dbp-reply-ctx-text { font-size: 11px; color: #0C447C; font-weight: 500; }
.dbp-portal-coach .dbp-reply-ctx-text { color: #085041; }
.dbp-reply-cancel {
  font-size: 11px; color: #999;
  background: none; border: none; font-family: inherit;
  cursor: pointer;
}
.dbp-reply-input {
  width: 100%;
  padding: 7px 10px;
  border: none;
  font-size: 12px;
  font-family: inherit;
  background: transparent;
  outline: none;
  resize: none;
  min-height: 46px;
  color: #1a1a18;
}
.dbp-reply-send-row {
  padding: 5px 10px;
  border-top: 0.5px solid #B5D4F4;
  display: flex; justify-content: flex-end;
}
.dbp-portal-coach .dbp-reply-send-row { border-top-color: #9FE1CB; }
.dbp-reply-send {
  padding: 4px 12px;
  background: #185FA5;
  color: #fff;
  border: none;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.dbp-reply-send:hover { background: #124E8A; }
.dbp-portal-coach .dbp-reply-send { background: #0F6E56; }
.dbp-portal-coach .dbp-reply-send:hover { background: #0a5442; }
