/*--------------------------------------------------------------
# DotEcho - app-wide page components layered on dotecho.css.
# Everything here uses the tokens of the design system so both themes stay in sync.
--------------------------------------------------------------*/

.muted { color: var(--text-muted); }
.de-note { font-size: .8rem; color: var(--text-muted); }
.de-pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; }
.de-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.de-split { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.de-split .grow { flex: 1 1 auto; }

/* Card header with title on the left and actions on the right */
.de-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.de-card-head .card-title { margin-bottom: 2px; }
.de-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Page toolbar: filters on the left, primary actions on the right */
.de-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.de-toolbar .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.de-toolbar .de-select, .de-toolbar .de-input { width: auto; min-width: 150px; }

/* Stat tile that is also a link */
a.de-stat-link { text-decoration: none; display: block; }
a.de-stat-link:hover .stat-value { color: var(--emerald); }

/* Alerts strip on the Command Center */
.de-alerts { display: flex; flex-direction: column; gap: 8px; }
.de-alert {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
    border: 1px solid var(--hairline-strong); background: var(--surface-color); color: var(--text-soft);
    text-decoration: none; transition: border-color .15s, transform .15s;
}
a.de-alert:hover { border-color: var(--emerald); color: var(--text-soft); transform: translateY(-1px); }
.de-alert > i:first-child { font-size: 1.15rem; flex: 0 0 auto; }
.de-alert .t { font-weight: 600; color: var(--text-strong); font-size: .9rem; }
.de-alert .d { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.de-alert .go { margin-left: auto; color: var(--text-faint); }
.de-alert.bad { border-left: 3px solid var(--status-bad); }
.de-alert.bad > i:first-child { color: var(--status-bad-text); }
.de-alert.warn { border-left: 3px solid var(--status-warn); }
.de-alert.warn > i:first-child { color: var(--status-warn-text); }
.de-alert.info { border-left: 3px solid var(--status-info); }
.de-alert.info > i:first-child { color: var(--status-info-text); }

/* Generic row list */
.de-list { display: flex; flex-direction: column; }
.de-list-row {
    display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--hairline);
    color: var(--text-soft); text-decoration: none; transition: background .15s;
}
.de-list-row:last-child { border-bottom: 0; }
a.de-list-row:hover { background: rgba(34, 197, 94, .05); color: var(--text-soft); border-radius: 8px; }
.de-list-row .grow { flex: 1 1 auto; min-width: 0; }
.de-list-row .t { font-weight: 600; color: var(--text-strong); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.de-list-row .d { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.de-list-row.selected { background: rgba(34, 197, 94, .08); border-radius: 8px; }

/* Activity feed */
.de-feed { display: flex; flex-direction: column; }
.de-feed-row {
    display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--hairline);
    color: var(--text-soft); text-decoration: none; align-items: flex-start;
}
.de-feed-row:last-child { border-bottom: 0; }
a.de-feed-row:hover { background: rgba(34, 197, 94, .05); color: var(--text-soft); border-radius: 8px; }
.de-feed-row .ico { font-size: 1rem; color: var(--text-muted); margin-top: 2px; flex: 0 0 auto; }
.de-feed-row .grow { flex: 1 1 auto; min-width: 0; }
.de-feed-row .t { font-weight: 600; color: var(--text-strong); font-size: .86rem; }
.de-feed-row .d { font-size: .8rem; color: var(--text-muted); margin-top: 2px; white-space: pre-wrap; }
.de-feed-row .tm { font-size: .72rem; color: var(--text-faint); margin-top: 3px; }

/* Key/value rows */
.de-kv { display: flex; flex-direction: column; }
.de-kv-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 4px;
    border-bottom: 1px solid var(--hairline); color: var(--text-soft); text-decoration: none; font-size: .88rem;
}
.de-kv-row:last-child { border-bottom: 0; }
a.de-kv-row:hover { color: var(--emerald); }
.de-kv-row strong { color: var(--text-strong); font-family: var(--nav-font); }

/* Score bubble */
.de-score {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%;
    font-family: var(--nav-font); font-weight: 700; font-size: .82rem; flex: 0 0 auto; border: 2px solid var(--hairline-strong);
    color: var(--text-muted);
}
.de-score.good { color: var(--status-good-text); border-color: rgba(34, 197, 94, .5); }
.de-score.warn { color: var(--status-warn-text); border-color: rgba(245, 158, 11, .5); }
.de-score.bad { color: var(--status-bad-text); border-color: rgba(239, 68, 68, .5); }

/* Platform icon */
.de-platform { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--text-muted); }
.de-platform i { font-size: .95rem; }

/* Loading line */
.de-loading { display: flex; align-items: center; gap: 10px; padding: 18px 4px; color: var(--text-muted); font-size: .88rem; }

/* Current cycle summary */
.de-cycle-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .82rem; }
.de-cycle-objective { font-size: .95rem; color: var(--text-strong); line-height: 1.5; margin: 0 0 14px; }
.de-goals { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-soft); font-size: .9rem; }
.de-goals li { line-height: 1.45; }

/* Two-column form grid */
.de-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.de-form-grid .full { grid-column: 1 / -1; }
@media (max-width: 767px) { .de-form-grid { grid-template-columns: 1fr; } }
textarea.de-input { min-height: 96px; resize: vertical; line-height: 1.5; }
textarea.de-input.tall { min-height: 220px; }
.de-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* Calendar grid */
.de-cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.de-cal-head div { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); padding: 0 6px; }
.de-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.de-cal-day { min-height: 118px; border: 1px solid var(--hairline); border-radius: 10px; padding: 6px; background: var(--surface-deep); }
.de-cal-day.other { opacity: .45; }
.de-cal-day.today { border-color: var(--emerald); box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .35); }
.de-cal-date { font-size: .74rem; color: var(--text-faint); font-family: var(--nav-font); margin-bottom: 4px; }
.de-cal-day.today .de-cal-date { color: var(--emerald); font-weight: 700; }
.de-cal-item {
    display: flex; align-items: center; gap: 6px; font-size: .74rem; padding: 4px 6px; border-radius: 6px; margin-bottom: 4px;
    background: var(--surface-color); border: 1px solid var(--hairline); color: var(--text-soft); text-decoration: none;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.de-cal-item:hover { border-color: var(--emerald); color: var(--text-strong); }
.de-cal-item .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--emerald); }
.de-cal-item .txt { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991px) { .de-cal, .de-cal-head { grid-template-columns: repeat(1, 1fr); } .de-cal-head { display: none; } .de-cal-day { min-height: 0; } .de-cal-day.other { display: none; } }

/* Studio */
.de-studio { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1199px) { .de-studio { grid-template-columns: 1fr; } }
.de-brief dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); margin-top: 12px; }
.de-brief dd { margin: 3px 0 0; color: var(--text-soft); font-size: .9rem; line-height: 1.5; white-space: pre-wrap; }
.de-variant { border: 1px solid var(--hairline-strong); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: var(--surface-deep); }
.de-variant-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.de-variant-head .who { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-strong); }
.de-counter { font-size: .74rem; color: var(--text-faint); font-family: var(--nav-font); }
.de-counter.over { color: var(--status-bad-text); font-weight: 700; }
.de-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.de-score-tile { background: var(--surface-deep); border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 10px; }
.de-score-tile .v { font-family: var(--nav-font); font-weight: 700; font-size: 1.05rem; color: var(--text-strong); }
.de-score-tile .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.de-findings { list-style: none; margin: 0; padding: 0; }
.de-findings li { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid var(--hairline); font-size: .84rem; color: var(--text-soft); }
.de-findings li:first-child { border-top: 0; }
.de-findings .sev { flex: 0 0 auto; }

/* Approvals */
.de-approval { border: 1px solid var(--hairline-strong); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: var(--surface-color); }
.de-approval.decided { opacity: .7; }
.de-approval-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.de-approval-title { font-weight: 600; color: var(--text-strong); font-size: 1rem; }
.de-approval-preview { background: var(--surface-deep); border: 1px solid var(--hairline); border-radius: 10px; padding: 12px; margin: 10px 0; font-size: .88rem; white-space: pre-wrap; color: var(--text-soft); max-height: 320px; overflow: auto; }
.de-approval-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.de-approval-actions .de-input { flex: 1 1 240px; }

/* Engagement */
.de-msg { border: 1px solid var(--hairline-strong); border-radius: 14px; padding: 14px; background: var(--surface-deep); margin-bottom: 12px; }
.de-msg .from { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-strong); font-size: .9rem; flex-wrap: wrap; }
.de-msg .said { margin: 8px 0; white-space: pre-wrap; color: var(--text-soft); line-height: 1.5; }
.de-msg .meta { font-size: .76rem; color: var(--text-faint); display: flex; gap: 10px; flex-wrap: wrap; }
.de-reply { border-left: 3px solid var(--emerald); padding-left: 12px; margin-top: 10px; }

/* Policy rows */
.de-policy { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.de-policy:last-child { border-bottom: 0; }
.de-policy .t { font-weight: 600; color: var(--text-strong); font-size: .9rem; }
.de-policy .d { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* Markdown (learning reports) */
.de-md h2, .de-md h3, .de-md h4 { font-family: var(--heading-font); color: var(--text-strong); margin: 18px 0 8px; }
.de-md h2 { font-size: 1.15rem; } .de-md h3 { font-size: 1rem; } .de-md h4 { font-size: .92rem; }
.de-md p, .de-md li { color: var(--text-soft); line-height: 1.6; font-size: .9rem; }
.de-md ul, .de-md ol { padding-left: 22px; }
.de-md code { background: var(--hover-bg); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* Run tree */
.de-run-tree { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px dashed var(--hairline-strong); }
.de-run-tree li { padding: 6px 0; font-size: .84rem; }

/* Pagination */
.de-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: .82rem; color: var(--text-muted); }
.de-pager .pages { display: flex; gap: 6px; }

/* Segment control default look for filters that toggle */
.de-seg.wrap { flex-wrap: wrap; }
