/* ===========================================================================
   Daily Planner page — matched to the approved Carisma design.
   =========================================================================== */

.dp-page { display: flex; flex-direction: column; gap: 18px; }

/* -------------------------------- banner --------------------------------- */
.dp-banner {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(120deg, #f7ecef 0%, #faf3ee 55%, #fdfbfa 100%);
    border: 1px solid #f1e6e8; border-radius: 18px; padding: 12px 24px;
}
.dp-crumb { display: flex; align-items: center; gap: 8px; font-size: .8rem; margin-bottom: 4px; }
.dp-crumb a { color: #9a7b82; text-decoration: none; }
.dp-crumb a:hover { color: var(--primary-color); text-decoration: underline; }
.dp-crumb strong { color: var(--ink); font-weight: 700; }
.dp-crumb__sep { color: #cdbfc3; }
.dp-title { font-size: 1.5rem; font-weight: 800; color: #1c1416; margin: 0 0 2px; }
.dp-sub { color: #6b5f63; font-size: .85rem; margin: 0; }
.dp-banner__actions { display: flex; align-items: center; gap: 10px; }
.dp-icon-btn, .dp-export {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    border: 1px solid #d9dde3; background: #fff; border-radius: 10px;
    font-size: .88rem; font-weight: 600; color: var(--ink); padding: 9px 14px; white-space: nowrap;
}
.dp-icon-btn { padding: 9px 10px; }
.dp-icon-btn:hover, .dp-export:hover { border-color: var(--primary-color); color: var(--primary-color); }
.dp-icon-btn .material-symbols-rounded, .dp-export .material-symbols-rounded { font-size: 18px; }

/* ------------------------------- stat cards ------------------------------- */
.dp-stats { display: grid; grid-template-columns: repeat(4, 1fr) 1.45fr; gap: 14px; }
.dp-stat {
    background: #fff; border: 1px solid #eef0f3; border-radius: 14px;
    padding: 14px 18px; box-shadow: 0 1px 2px rgba(20,20,40,.04);
}
.dp-stat__label { font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: #7a6f73; margin-bottom: 6px; }
.dp-stat__value { font-size: 2rem; font-weight: 800; line-height: 1.05; color: #1c1416; }
.dp-stat__value.is-maroon { color: var(--primary-color); }
.dp-stat__note { font-size: .78rem; color: #6b5f63; margin-top: 4px; }
.dp-wl-bar { display: flex; gap: 2px; height: 8px; border-radius: 5px; overflow: hidden; margin: 14px 0 10px; background: #eef0f3; }
.dp-wl-bar > span { display: block; height: 100%; }
.dp-wl-legend { display: flex; gap: 6px; font-size: .72rem; color: #6b5f63; flex-wrap: nowrap; white-space: nowrap; }
.dp-wl-legend b { color: #1c1416; }
.dp-wl-item { border: 1px solid transparent; border-radius: 999px; background: none; padding: 2px 5px; margin: -3px -5px; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.dp-wl-item:hover { background: #f5f0f1; }
.dp-wl-item.is-active { border-color: var(--primary-color); background: #f3e4e7; }

/* --------------------------------- card ---------------------------------- */
.dp-card {
    background: #fff; border: 1px solid #eef0f3; border-top: 3px solid #e9c7d2;
    border-radius: 16px; box-shadow: 0 1px 2px rgba(20,20,40,.04); overflow: hidden;
}

.dp-wtabs { display: inline-flex; background: #f4f5f7; border-radius: 10px; padding: 4px; gap: 2px; }
.dp-wtab {
    display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; cursor: pointer;
    font-size: .84rem; font-weight: 600; color: #4b4145; padding: 6px 13px; border-radius: 8px; white-space: nowrap;
}
.dp-wtab:hover { color: var(--primary-color); }
.dp-wtab.is-active { background: var(--primary-color); color: #fff; box-shadow: 0 1px 3px rgba(122,31,43,.3); }
.dp-wtab .material-symbols-rounded { font-size: 15px; }
.dp-clear {
    border: none; background: transparent; cursor: pointer; padding: 6px 0;
    font-size: .76rem; font-weight: 600; color: var(--primary-color); white-space: nowrap;
}
.dp-clear:hover { text-decoration: underline; }

/* sub row */
.dp-subrow {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 20px; background: #faf7f8; border-top: 1px solid #ECE6E2; border-bottom: 1px solid #ECE6E2;
    font-size: .8rem; color: #7a6f73;
}
.dp-subrow__left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.dp-subrow__count { white-space: nowrap; }
.dp-subrow__btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Accountant filter, right next to Expand all / Collapse all. */
.dp-subrow__filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-right: 4px; }
.dp-subrow__filters .ms { min-width: 0; }
.dp-subrow__filters .ms-trigger { padding: 6px 9px; font-size: .78rem; border-radius: 8px; min-width: 110px; }

/* Job Name / Activity filter row, inline in the table grid under the headers. */
.dp-row--filter {
    min-height: 40px; padding-top: 6px; padding-bottom: 6px;
    background: #faf7f8; border-bottom: 1px solid #ECE6E2;
}
.dp-filter-cell { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.dp-filter-cell--clear { align-items: flex-start; }
.dp-filter-cell input[type="search"] {
    width: 100%; box-sizing: border-box; border: 1px solid #d9dde3; border-radius: 8px;
    padding: 6px 9px; font-size: .78rem; color: var(--ink); background: #fff; outline: none;
}
.dp-filter-cell input[type="search"]:focus {
    border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(122, 31, 43, .12);
}
.dp-filter-cell .ms { min-width: 0; width: 100%; }
.dp-filter-cell .ms-trigger { padding: 6px 9px; font-size: .78rem; border-radius: 8px; }

/* Manager Command, inline on the "Showing X of Y" row instead of its own banner. */
.dp-mgr-inline { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--primary-color); }
.dp-mgr-inline > .material-symbols-rounded { font-size: 16px; flex: none; }
.dp-mgr-inline__input {
    width: 220px; max-width: 40vw; box-sizing: border-box; border: 1px solid #d9dde3; border-radius: 8px;
    padding: 5px 8px; font-size: .76rem; color: var(--ink); background: #fff; outline: none;
}
.dp-mgr-inline__input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(122,31,43,.12); }
.dp-mgr-inline__add {
    border: 0; border-radius: 6px; padding: 5px 9px; background: var(--primary-color); color: #fff;
    font-size: .72rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.dp-mgr-inline__add:disabled { opacity: .5; cursor: not-allowed; }
.dp-mgr-inline__latest {
    max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .76rem; font-weight: 600; color: #3d3236;
}
.dp-mgr-history { position: relative; }
.dp-mgr-history > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #f3e4e7;
    color: var(--primary-color); font-size: .66rem; font-weight: 700;
}
.dp-mgr-history > summary::-webkit-details-marker { display: none; }
.dp-mgr-history__panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 300px; max-height: 260px; overflow-y: auto;
    background: #fff; border: 1px solid #eef0f3; border-radius: 10px; box-shadow: 0 8px 24px rgba(20,20,40,.12);
    padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.dp-mgr-history__panel .dp-command-note { border: 1px solid #eee6e8; border-radius: 7px; }
.dp-ghost {
    border: 1px solid #d9dde3; background: #fff; cursor: pointer; border-radius: 9px;
    font-size: .8rem; font-weight: 600; color: var(--ink); padding: 6px 13px;
}
.dp-ghost:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* ------------------------------- table rows ------------------------------- */
.dp-table { overflow-x: auto; }
.dp-row {
    display: grid;
    /* Keep all planner columns visible at desktop widths; narrower screens may scroll. */
    grid-template-columns: 210px 130px 72px minmax(56px, .7fr) minmax(48px, .7fr) minmax(78px, 1.1fr) repeat(3, minmax(48px, .7fr)) 26px;
    align-items: center; column-gap: 10px; padding: 0 12px; min-width: 0;
}
.dp-row.dp-row--client-notes {
    grid-template-columns: 210px 130px 72px minmax(54px, .65fr) minmax(48px, .7fr) minmax(76px, 1fr) repeat(3, minmax(46px, .65fr)) minmax(110px, 1.5fr) 24px;
}
.dp-row--head {
    min-height: 40px; height: auto; background: #faf7f8; border-bottom: 1px solid #ECE6E2;
    font-size: .68rem; font-weight: 700; color: #7a6f73;
}
/* Headers stay on one line; the table scrolls horizontally (with Job Name/Activity frozen)
   rather than wrapping or squeezing labels at narrow widths. */
.dp-row--head .bud-th--sort { font-size: .68rem; white-space: nowrap; }
.dp-r { text-align: right; justify-self: end; }
.dp-num { font-variant-numeric: tabular-nums; font-size: .78rem; color: #3d3236; }

/* The notes list and the add-box read as one compact unit instead of separate floating cards. */
.dp-client-command {
    display: flex; flex-direction: column; min-width: 0; margin: 4px 0;
    border: 1px solid #eee6e8; border-radius: 8px; background: #fff; overflow: hidden;
}
.dp-command-note { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 0; border-bottom: 1px solid #f1ebec; border-radius: 0; background: #fcf9fa; color: #3d3236; font-size: .68rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dp-command-note small { display: block; margin-top: 2px; color: #7a6f73; font-size: .64rem; }
.dp-command-muted, .dp-command-error { display: block; padding: 4px 6px; color: #7a6f73; font-size: .68rem; }
.dp-command-error { color: #b42318; }
.dp-command-addrow { display: flex; align-items: center; gap: 0; border-top: 1px solid #f1ebec; }
.dp-command-input { box-sizing: border-box; flex: 1; min-width: 0; height: 26px; border: 0; border-radius: 0; padding: 4px 6px; font: inherit; font-size: .68rem; color: var(--ink); background: #fff; }
.dp-command-input:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(122,31,43,.12); }
.dp-command-add { flex: none; border: 0; border-radius: 0; padding: 4px 9px; height: 26px; background: var(--primary-color); color: #fff; font-size: .64rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.dp-command-add:disabled { opacity: .5; cursor: not-allowed; }

/* accountant group */
.dp-acc { border-bottom: 1px solid #f0eaec; }
.dp-acc__head { min-height: 44px; padding-top: 4px; padding-bottom: 4px; cursor: pointer; background: #fff; }
.dp-acc__head .dp-acc__who { grid-column: 1 / span 2; }
.dp-acc__count { font-size: .78rem; color: #5b5156; }
.dp-acc__count b { color: #1c1416; font-weight: 700; }
.dp-tot { font-variant-numeric: tabular-nums; font-size: .8rem; font-weight: 700; color: #1c1416; }
.dp-tot.is-neg { color: #1c1416; }
.dp-chev-box {
    justify-self: end; width: 26px; height: 30px; border-radius: 8px; border: 1px solid transparent;
    display: inline-flex; align-items: center; justify-content: center;
}
.dp-acc.is-open .dp-chev-box { border-color: var(--primary-color); }
.dp-acc__head:hover { background: #fcf9fa; }
.dp-acc__who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dp-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    background: #f6e9ed; color: var(--primary-color); font-size: .76rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.dp-acc__nameline { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dp-acc__name { font-size: .88rem; font-weight: 700; color: #1c1416; }
.dp-acc__note { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: #5b5156; margin-top: 3px; }
.dp-wbadge { font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.dp-wbadge.is-ok { background: #e3f4ea; color: #1c6b3c; }
.dp-wbadge.is-partial { background: #fdf0d8; color: #9a6a12; }
.dp-wbadge.is-none { background: #eceef1; color: #6b7280; }
.dp-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.dp-dot.is-ok { background: #0F7A4A; }
.dp-dot.is-partial { background: #e0a93c; }
.dp-dot.is-none { background: #9aa1ad; }

.dp-acc__stats { display: flex; align-items: center; gap: 22px; font-size: .78rem; color: #6b5f63; white-space: nowrap; }
.dp-acc__stats b { color: #1c1416; font-weight: 700; font-variant-numeric: tabular-nums; }
.dp-acc__stats b.is-neg, .dp-num.is-neg { color: #B42318; }
.dp-acc__stats b.is-pos { color: #1c1416; }
.dp-chev { font-size: 22px; color: #7a6f73; transition: transform .15s ease; }
.dp-acc.is-open .dp-chev { transform: rotate(180deg); }

/* job rows */
.dp-acc__jobs { background: #fff; border-top: 1px solid #f0eaec; }
.dp-row--job { min-height: 40px; padding-top: 4px; padding-bottom: 4px; border-bottom: 1px solid #f3eef0; }
.dp-row--job:last-child { border-bottom: none; }
/* indented past the avatar (44px + 12px gap), so job names line up under the accountant's name */
.dp-job__name { display: flex; flex-direction: column; min-width: 0; padding-left: 38px; }
.dp-job__title { font-size: .78rem; font-weight: 600; color: #1c1416; line-height: 1.25; overflow-wrap: anywhere; }
.dp-job__sub { font-size: .68rem; color: #6b5f63; margin-top: 2px; }
.dp-job__activity { font-size: .75rem; color: #3d3236; overflow-wrap: anywhere; }
.dp-delivery {
    display: inline-block; font-size: .68rem; font-weight: 600; color: #5b5156;
    background: #f1edeb; border-radius: 999px; padding: 3px 6px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.dp-delivery.is-due { background: #f8e8ed; color: #7a1f2b; }
.dp-num.is-neg { font-weight: 700; }

.dp-empty { padding: 36px 20px; text-align: center; font-size: .9rem; color: #6b5f63; }
.dp-empty--sm { padding: 14px 20px; font-size: .84rem; }

/* Freeze Job Name and Activity (the first two columns) while the table scrolls horizontally.
   The accountant row merges them into one spanning cell (.dp-acc__who), so it only ever needs
   the :first-child rule; every other row has them as two separate cells, the second one marked
   .dp-sticky2, offset by the first column's fixed 210px width plus the 8px column gap. */
.dp-row > :first-child {
    position: sticky; left: 0; z-index: 2; background: #fff; align-self: stretch;
}
.dp-sticky2 {
    position: sticky; left: 220px; z-index: 2; background: #fff; align-self: stretch;
}
.dp-acc__head > :first-child, .dp-sticky2 { box-shadow: 6px 0 8px -6px rgba(0, 0, 0, .15); }
.dp-row--head > :first-child, .dp-row--head .dp-sticky2,
.dp-row--filter > :first-child, .dp-row--filter .dp-sticky2 { z-index: 6; background: #faf7f8; box-shadow: none; }
.dp-acc__head:hover > :first-child { background: #fcf9fa; }

/* ------------------------------ responsive ------------------------------- */
@media (max-width: 1250px) { .dp-stats { grid-template-columns: repeat(2, 1fr); } .dp-stat--workload { grid-column: 1 / -1; } }
@media (max-width: 640px) { .dp-stats { grid-template-columns: 1fr; } }

/* Number and date columns (est. time, est. delivery, budget, billed, balance) sit in the middle of their column. */
.dp-row > .dp-r, .dp-row > .dp-delcell { justify-self: center; text-align: center; }
.dp-row--head > .dp-r, .dp-row--head > .dp-delcell { justify-content: center; }

/* ------------------------------ yesterday view ------------------------------ */
.dp-banner__actions .dp-wtab { padding: 8px 14px; }
.dp-stat--over .dp-stat__label, .dp-stat--over .dp-stat__value.is-maroon, .dp-wl-none, .dp-wl-none b { color: #B42318; }
.dp-dot.is-nojobs { background: #B42318; }
.dp-loaded { text-align: center; }
.dp-loaded .dp-dot { width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; }
.dp-dot.is-leave { background: #6e6468; }

.dp-ystatus { padding: 16px 20px 20px; }
.dp-ystatus__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; color: #1c1416; }
.dp-ystatus__accent { width: 4px; height: 18px; border-radius: 3px; background: var(--primary-color); }
.dp-ystatus__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dp-ybox { border: 1px solid #eef0f3; border-radius: 12px; padding: 14px 18px; }
.dp-ybox--btn { display: block; width: 100%; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.dp-ybox--btn:hover { border-color: #e1c8cf; box-shadow: 0 2px 10px rgba(122, 31, 43, .08); }
.dp-ybox__queries { color: #8a5a00; }
.dp-ybox__review { color: #1d4f91; }

/* job · activity · loaded · available · delivery · est · billed (yesterday) · budget · billed · balance · chevron.
   Titles only show their sort arrows on hover or once sorted. */
.dp-page--yesterday .dp-row {
    grid-template-columns: 210px 130px 72px minmax(56px, .7fr) minmax(78px, 1.1fr) minmax(48px, .7fr) minmax(78px, 1fr) repeat(3, minmax(48px, .7fr)) 26px;
    min-width: 0;
}
.dp-page--yesterday .dp-row.dp-row--client-notes {
    grid-template-columns: 210px 130px 72px minmax(54px, .65fr) minmax(76px, 1fr) minmax(46px, .65fr) minmax(76px, .95fr) repeat(3, minmax(46px, .65fr)) minmax(110px, 1.5fr) 24px;
}
.dp-page--yesterday .dp-acc { border-bottom-color: #e6d3d9; }

/* popup listing the sent jobs: Movement's popup (mv-cellmodal) with its own columns */
.dp-sent-modal { max-width: 1080px; }
.mv-cellmodal-table.dp-sent-grid .mv-tr { grid-template-columns: 60px minmax(240px, 1fr) 190px 170px 180px 110px; }
.dp-sent-job { font-weight: 600; color: var(--primary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "All Jobs" popup opened from the global search box. */
.mv-cellmodal-table.dp-aj-grid .mv-tr { grid-template-columns: 60px minmax(220px, 1fr) 160px 150px 90px 90px 90px 90px; }
.dp-aj-count { margin-left: 8px; font-size: .78rem; font-weight: 700; color: var(--primary-color); background: #f6ecee; border-radius: 999px; padding: 2px 10px; }

@media (max-width: 1000px) { .dp-ystatus__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .dp-ystatus__grid { grid-template-columns: 1fr; } }

/* Yesterday table: roomier columns (labels no longer overlap); the table scrolls sideways on narrow screens. */
.dp-page--yesterday .dp-row {
    grid-template-columns: 210px 130px 84px 104px 124px 104px 150px 96px 96px 104px 30px;
    column-gap: 16px; min-width: 1400px;
}
.dp-page--yesterday .dp-row.dp-row--client-notes {
    grid-template-columns: 210px 130px 84px 104px 124px 104px 150px 96px 96px 104px minmax(160px, 1fr) 30px;
    min-width: 1580px;
}

/* Yesterday: the frozen Job Name / Activity columns follow the wider 16px column gap, and each one covers the gap after it
   so scrolled columns can't show through between them. */
.dp-page--yesterday .dp-sticky2 { left: 226px; }
.dp-page--yesterday .dp-row > :first-child::after,
.dp-page--yesterday .dp-sticky2::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 16px; background: inherit; }

/* job name opens the job detail popup */
.dp-job__title--link { color: var(--primary-color); cursor: pointer; }
.dp-job__title--link:hover { text-decoration: underline; }
