/**
 * THERAPIES DASHBOARD CARD -- shared component
 * Powers the card/button layout on BOTH My Mind Therapies
 * (mind/myMindTherapiesDashboard.php) and My Sleep Therapies
 * (sleep_platform/sleep_planner/mySleepTherapiesDashboard.php) --
 * both pull from the one shared therapies_system table (show_in_mind /
 * show_in_sleep flags), so they share this one card design too.
 *
 * Moved out of common.css on 10 sep 2026 -- it was living there
 * unscoped even though only these two pages use it, and it referenced
 * 5 CSS variables (--teal, --red, --red-light, --mtd-text, --mtd-muted)
 * that were never defined anywhere on the site, so every button and
 * the card title/description rendered with no color at all. Fixed
 * here to use the site's real --brand-* tokens instead.
 *
 * Loaded only on Mind pages and Sleep pages (see functions.php).
 * Page-specific tweaks on top of this (intro banner, tab colors,
 * dropdown, etc.) stay in styleMind.css / styleSleep.css as before --
 * only the shared card/button base rules live here.
 */
.mtd-btn-add { background: transparent; color: var(--bsm3-color-body-deep-forest-green-166534-use-on-body-pillar-strong); border: var(--bsm3-border-thin) solid var(--bsm3-color-body-deep-forest-green-166534-use-on-body-pillar-strong) !important; cursor: pointer; }
.mtd-btn-remove { background: var(--bsm3-color-attention-pink-FEE2E2-use-on-status-alert-background); color: var(--bsm3-color-status-severe-red-C0392B-use-on-status-severe); cursor: pointer; }
.mtd-btn-view { background: var(--bsm3-color-body-deep-forest-green-166534-use-on-body-pillar-strong); color: var(--bsm3-color-white-FFFFFF-use-on-bg-day-general); cursor: pointer; position: relative; }
.mtd-media-dot { position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; border: 2px solid var(--bsm3-color-white-FFFFFF-use-on-bg-day-general); box-shadow: 0 0 0 1px rgba(0,0,0,0.15); }
/* Green dot on the View button when the therapy has a live Wellness Channel media item attached (media_status = live AND channel_id set on therapies_system) -- added 10 sep 2026. */
.mtd-card { background: var(--bsm3-color-white-FFFFFF-use-on-bg-day-general); border: var(--bsm3-border-thin) solid var(--bsm3-color-ink-navy-1E1B48-use-on-border); border-radius: var(--bsm3-radius-status-cards); box-shadow: var(--bsm3-elevation-soft); display: flex; flex-direction: column; padding: 15px; gap: 12px; }
.mtd-card-desc { color: var(--bsm3-color-ink-navy-1E1B48-use-on-primary-text); font-size: var(--bsm3-text-body-use-on-reading-text); line-height: 1.3; }
.mtd-card-row1 { display: flex; gap: 10px; align-items: flex-start; min-height: 3em; }
.mtd-card-row2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: stretch; text-align: center; height: 32px; }
.mtd-card-title { color: var(--bsm3-color-black-000000-use-on-bg-sleep); font-size: var(--bsm3-text-medium-14px-use-on-text); line-height: 1.3; font-weight: var(--bsm3-weight-bold-700-use-on-h1); }
.mtd-count-badge { display: inline-block; background: rgba(0,0,0,0.08); padding: 1px 8px; border-radius: var(--bsm3-radius-status-cards); font-size: var(--bsm3-text-small-12px-use-on-text); margin-left: 6px; }
.mtd-dropdown-group-label { font-size: var(--bsm3-text-small-12px-use-on-text); font-weight: var(--bsm3-weight-bold-700-use-on-h1); text-transform: uppercase; letter-spacing: 0.5px; color: var(--bsm3-color-ink-navy-1E1B48-use-on-primary-text); padding: 8px 8px 4px; }
.mtd-dropdown-item { padding: 8px 10px; border-radius: var(--bsm3-radius-mini-badges); font-size: var(--bsm3-text-body-use-on-reading-text); font-weight: var(--bsm3-weight-bold-700-use-on-h1); color: var(--bsm3-color-black-000000-use-on-bg-sleep); cursor: pointer; }
.mtd-dropdown-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; max-height: 320px; overflow-y: auto; background: var(--bsm3-color-white-FFFFFF-use-on-bg-day-general); border: var(--bsm3-border-thin) solid var(--bsm3-color-ink-navy-1E1B48-use-on-border); border-radius: var(--bsm3-radius-status-cards); box-shadow: var(--bsm3-elevation-strong); z-index: 50; padding: 6px; }
.mtd-dropdown-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: auto; white-space: nowrap; box-sizing: border-box; padding: 10px 12px; border: var(--bsm3-border-default) solid var(--bsm3-color-ink-navy-1E1B48-use-on-border); border-radius: var(--bsm3-radius-status-cards); font-family: var(--bsm3-font-body); font-size: var(--bsm3-text-medium-14px-use-on-text); font-weight: var(--bsm3-weight-bold-700-use-on-h1); color: var(--bsm3-color-black-000000-use-on-bg-sleep); background: var(--bsm3-color-white-FFFFFF-use-on-bg-day-general); cursor: pointer; }
.mtd-dropdown-wrap { position: relative; flex: 0 0 auto; }
.mtd-empty-state { padding: 30px; text-align: center; color: var(--bsm3-color-ink-navy-1E1B48-use-on-primary-text); font-size: var(--bsm3-text-body-use-on-reading-text); }
.mtd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
/* Forces exactly 3 cards per row on desktop -- added 10 sep 2026 per request (was auto-fill/minmax(270px) which fit 4 across and squeezed the row2 button row too narrow, causing the check-Added button text to wrap and rows to go uneven heights). Falls back to the original responsive auto-fill below 768px so phones/tablets still get as many columns as fit. */
@media (max-width: 900px) {
  .mtd-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
}
.mtd-panel { display: none; }
.mtd-panel-tab-btn { flex: 1; background: var(--bsm3-color-surface-pale-lavender-F1F0F9-use-on-card-background); border: var(--bsm3-border-default) solid transparent; border-radius: var(--bsm3-radius-status-cards); padding: 14px; text-align: center; font-weight: var(--bsm3-weight-bold-700-use-on-h1); color: var(--bsm3-color-ink-navy-1E1B48-use-on-primary-text); cursor: pointer; transition: 0.2s; }
.mtd-panel-tabs { display: flex; gap: 12px; margin-bottom: 20px; }
.mtd-search-input { flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: var(--bsm3-border-default) solid var(--bsm3-color-ink-navy-1E1B48-use-on-border); border-radius: var(--bsm3-radius-status-cards); font-size: var(--bsm3-text-medium-14px-use-on-text); color: var(--bsm3-color-black-000000-use-on-bg-sleep); background: var(--bsm3-color-white-FFFFFF-use-on-bg-day-general); box-sizing: border-box; }
.mtd-tag-badge { color: var(--bsm3-color-white-FFFFFF-use-on-bg-day-general); }
.mtd-tag-badge-preventative { background: #4AA3A2; }
.mtd-tag-badge-reactive { background: #e74c3c; }
/* Split out of the single inline PHP style on 10 sep 2026 so Reactive and Preventative can be recolored independently via the brand overrides tool -- they used to share the one .mtd-tag-badge class with only an inline background telling them apart, so any override to .mtd-tag-badge hit both at once. Colors below match what was previously hardcoded in myMindTherapiesDashboard.php. */
.mtd-wrap { font-family: var(--bsm3-font-body); }

