/* ─────────────────────────────────────────────────────────────────────
   HOMEi Live Manager — «خطة اليوم» (PLAN-2, HO-3450; design approved by the
   Project Owner 2026-10-06 on the house design system — built literally).

   Colours: the house tokens (--lm-d-* in resources/css/tokens.css, with
   their dark mirror); no colour literal here — the ratchet holds this sheet
   at zero. Text never under 12px. RTL-safe: logical properties only.
   Scoped by `.dp-page` (the page class) and `.dp`.

   Registered as a Filament asset — a change here ships NOTHING until
   `php artisan filament:assets` is run and public/css/app/ is committed in
   the same change.
   ──────────────────────────────────────────────────────────────────── */

/* ── 1. the ground and the head ── */
body:has(.dp-page) { background: var(--lm-d-page); }
body:has(.dp-page) .fi-main-ctn { background: transparent; }
.dp-page .fi-header-heading { font-size: 28px; font-weight: 700; line-height: 1.25; color: var(--lm-d-ink); }
.dp-page .fi-header-subheading { margin-block-start: 4px; font-size: 14px; color: var(--lm-d-muted); }
.dp-page .fi-header-actions-ctn .fi-btn { min-block-size: 44px; border-radius: 12px; padding-inline: 16px; background: var(--lm-d-surface); color: var(--lm-d-ink); box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); font-weight: 700; }

.dp { display: flex; flex-direction: column; gap: 14px; color: var(--lm-d-ink); }
.dp :focus-visible { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
.dp bdi { unicode-bidi: isolate; }
.dp .is-ink { color: var(--lm-d-ink); }
.dp .is-muted { color: var(--lm-d-muted); }
.dp .is-ok { color: var(--lm-d-ok); }
.dp .is-warn { color: var(--lm-d-warn); }
.dp .is-danger { color: var(--lm-d-danger); }
.dp .is-info { color: var(--lm-d-info); }

/* ── 2. the numbers strip ── */
.dp-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 16px; box-shadow: 0 1px 2px var(--lm-d-shadow); }
.dp-strip-c { padding: 12px 18px; border-inline-start: 1px solid var(--lm-d-divider); min-inline-size: 0; }
.dp-strip-c:first-child { border-inline-start: 0; }
.dp-k-l { font-size: 13px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-k-v { font-size: 26px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-k-s { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 3. the ruled card ── */
.dp-card { background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--lm-d-info); border-radius: 16px; box-shadow: 0 1px 2px var(--lm-d-shadow); display: flex; flex-direction: column; overflow: hidden; }
.dp-card.is-ok { border-block-start-color: var(--lm-d-ok); }
.dp-card--plain { border-block-start-width: 1px; border-block-start-color: var(--lm-d-border); }
.dp-card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 18px; border-block-end: 1px solid var(--lm-d-divider); }
.dp-card-t { font-size: 20px; font-weight: 700; margin: 0; }
.dp-card-t span { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }
.dp-card-b { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }

/* ── 4. chips · tags · notes · buttons ── */
.dp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dp-chip { display: inline-flex; align-items: center; gap: 6px; min-block-size: 34px; padding-inline: 12px; border: 1px solid var(--lm-d-border); border-radius: 10px; background: var(--lm-d-page); color: var(--lm-d-muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.dp-chip b { color: var(--lm-d-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.dp-chip.is-on { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); }
.dp-chip.is-on b { color: var(--lm-d-info); }
.dp-tag { display: inline-flex; align-items: center; gap: 6px; min-block-size: 26px; padding-inline: 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.dp-tag::before { content: ''; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; }
.dp-tag.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.dp-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.dp-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.dp-tag.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.dp-tag.is-quiet { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.dp-note { border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; border: 1px solid var(--lm-d-divider); }
.dp-note.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.dp-note.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.dp-note.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.dp-btn { display: inline-flex; align-items: center; gap: 8px; min-block-size: 42px; padding-inline: 16px; border-radius: 10px; border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; text-decoration: none; cursor: pointer; }
.dp-btn:hover { background: var(--lm-d-hover); }
.dp-btn.is-primary { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.dp-btn.is-primary:hover { filter: brightness(0.96); }
.dp-btn.is-sm { min-block-size: 36px; padding-inline: 14px; font-size: 13.5px; }
.dp-btn:disabled { opacity: .6; cursor: default; }
.dp-ic { inline-size: 18px; block-size: 18px; flex: none; }

/* ── 5. the split: the items and the aside ── */
.dp-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.dp-list { min-inline-size: 0; border-inline-end: 1px solid var(--lm-d-divider); }
.dp-aside { position: sticky; inset-block-start: 12px; display: flex; flex-direction: column; }
.dp-p-h { padding: 14px 18px 12px; border-block-end: 1px solid var(--lm-d-divider); }
.dp-p-t { font-size: 18px; font-weight: 700; }
.dp-p-s { margin-block-start: 2px; font-size: 13px; color: var(--lm-d-muted); }
.dp-p-b { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.dp-p-f { padding: 12px 18px; border-block-start: 1px solid var(--lm-d-divider); display: flex; gap: 8px; }
.dp-p-f > .dp-btn { flex: 1 1 0; justify-content: center; }
.dp-sec { font-size: 14px; font-weight: 700; margin-block-end: 6px; }
.dp-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-block-end: 1px solid var(--lm-d-divider); font-size: 13.5px; }
.dp-line:last-child { border-block-end: 0; }
.dp-line b { font-variant-numeric: tabular-nums; }

/* ── 6. the greeting ── */
.dp-greet { padding: 12px 18px; border-block-end: 1px solid var(--lm-d-divider); font-size: 14px; line-height: 1.7; }
.dp-greet .dp-ic { vertical-align: -4px; margin-inline-end: 6px; color: var(--lm-d-warn); }
.dp-greet b { font-size: 15px; }

/* ── 7. the three items, ranked (block flow on purpose — a flex container would split the <bdi> numbers) ── */
.dp-items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.dp-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px 14px; align-items: start; padding: 16px 18px; border-block-end: 1px solid var(--lm-d-divider); }
.dp-item:last-child { border-block-end: 0; }
.dp-item.is-now { background: var(--lm-d-row-hl); box-shadow: inset -3px 0 0 var(--lm-d-accent); }
[dir='ltr'] .dp-item.is-now { box-shadow: inset 3px 0 0 var(--lm-d-accent); }
.dp-item.is-done, .dp-item.is-carried, .dp-item.is-dropped { opacity: .92; }
.dp-rank { inline-size: 36px; block-size: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); border: 1px solid var(--lm-d-border); }
.dp-item.is-now .dp-rank { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.dp-item.is-done .dp-rank { background: var(--lm-d-ok-soft); border-color: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.dp-item.is-done .dp-rank .dp-ic { inline-size: 18px; block-size: 18px; }
.dp-body { min-inline-size: 0; display: flex; flex-direction: column; gap: 4px; }
.dp-do { font-size: 17px; font-weight: 700; line-height: 1.5; margin: 0; }
.dp-do .dp-tag { margin-inline-start: 8px; }
.dp-why { margin: 0; font-size: 13.5px; color: var(--lm-d-muted); position: relative; padding-inline-start: 22px; }
.dp-why .dp-ic { position: absolute; inset-inline-start: 0; inset-block-start: 3px; inline-size: 16px; block-size: 16px; color: var(--lm-d-subtle); }
.dp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 4px; }
.dp-meta .dp-chip { min-block-size: 28px; padding-inline: 10px; font-size: 12.5px; }
.dp-act { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-inline-size: 150px; }
.dp-act .dp-btn { justify-content: center; }
.dp-done-note { margin: 0; font-size: 13.5px; color: var(--lm-d-ok); font-weight: 600; }

/* ── 8. the midday nudge ── */
.dp-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 14px 18px 0; }
.dp-nudge p { margin: 0; flex: 1 1 320px; }
.dp-nudge .dp-btn { flex: none; }

/* ── 9. the evening score ── */
.dp-score { display: grid; gap: 14px; padding: 18px; }
.dp-score-h { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.35; }
.dp-score-p { margin: 0; font-size: 15px; line-height: 1.7; }
.dp-score-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dp-score-grid > div { border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.dp-score-grid span { font-size: 12.5px; color: var(--lm-d-muted); }
.dp-score-grid b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ── 10. states ── */
.dp-empty { display: grid; place-content: center; justify-items: center; gap: 6px; padding: 32px 24px; text-align: center; color: var(--lm-d-muted); font-size: 13px; }
.dp-empty b { color: var(--lm-d-ink); font-size: 15px; }
.dp-empty .dp-ic { inline-size: 36px; block-size: 36px; color: var(--lm-d-subtle); }
.dp-excuses { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-excuses .dp-chip { cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; }
.dp-excuses .dp-chip:hover { background: var(--lm-d-chip-bg); color: var(--lm-d-ink); }

/* ── 11. under 1024px the aside goes under the list; under 641px items stack and controls reach 44px ── */
@media (max-width: 1023.98px) {
    .dp-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dp-strip-c:nth-child(2n + 1) { border-inline-start: 0; }
    .dp-strip-c:nth-child(n + 3) { border-block-start: 1px solid var(--lm-d-divider); }
    .dp-split { grid-template-columns: minmax(0, 1fr); }
    .dp-list { border-inline-end: 0; }
    .dp-aside { position: static; border-block-start: 1px solid var(--lm-d-divider); }
    .dp-page .fi-header-heading { font-size: 22px; }
}
@media (max-width: 640px) {
    .dp-k-v { font-size: 22px; }
    .dp-chip, .dp-btn { min-block-size: 44px; }
    .dp-meta .dp-chip { min-block-size: 28px; }
    .dp-item { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 16px; }
    .dp-act { grid-column: 1 / -1; flex-direction: row; }
    .dp-act .dp-btn { flex: 1 1 0; }
    .dp-score-grid { grid-template-columns: minmax(0, 1fr); }
    .dp-do { font-size: 16px; }
}
