/* Dashboard extras (2026-10-17) - see js/dashboard-plus.js */

/* slim briefing banner: greeting + insight of the day instead of a 160px empty block */
.briefing-card {
    padding: 1rem 1.5rem !important;
}
.briefing-card .briefing-title {
    font-size: 1.5rem;
    margin: 0 0 0.35rem 0;
}
.briefing-card .briefing-date {
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
}
.briefing-card .fa-city {
    font-size: 6rem;
}
.briefing-insight {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.92rem;
    line-height: 1.4;
    max-width: 52rem;
}
.briefing-insight i {
    color: #fde68a;
    margin-top: 0.2rem;
}
.briefing-insight:empty {
    display: none;
}

/* toolbar */
.dp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.dp-spacer {
    flex: 1 1 auto;
}
.dp-view {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--ds-bg-card, #fff);
    border: 1px solid var(--ds-border, #e2e8f0);
    border-radius: 10px;
    padding: 0.25rem 0.6rem;
}
.dp-view select {
    border: 0;
    background: transparent;
    font-weight: 600;
    color: inherit;
    max-width: 14rem;
}
.dp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--ds-bg-card, #fff);
    border: 1px solid var(--ds-border, #e2e8f0);
    color: var(--ds-text, #0f172a);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
}
.dp-btn:hover {
    border-color: #6366f1;
    color: #4f46e5;
}
.dp-stamp {
    font-size: 0.75rem;
    color: var(--ds-text-muted, #64748b);
}

/* needs-action bar */
.dp-actions {
    background: var(--ds-bg-card, #fff);
    border: 1px solid var(--ds-border, #e2e8f0);
    border-radius: 14px;
    padding: 0.75rem 1rem;
}
.dp-actions:empty {
    display: none;
}
.dp-actions-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--ds-text, #0f172a);
}
.dp-actions-title i {
    color: #f59e0b;
}
.dp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.dp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--ds-border, #e2e8f0);
    background: var(--ds-bg-page, #f8fafc);
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    text-align: start;
    color: var(--ds-text, #0f172a);
}
.dp-chip span {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.dp-chip b {
    font-size: 0.85rem;
}
.dp-chip small {
    font-size: 0.74rem;
    color: var(--ds-text-muted, #64748b);
}
.dp-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
.dp-chip.bad {
    border-color: #fca5a5;
    background: #fef2f2;
}
.dp-chip.bad i {
    color: #dc2626;
}
.dp-chip.warn {
    border-color: #fcd34d;
    background: #fffbeb;
}
.dp-chip.warn i {
    color: #d97706;
}
.dp-chip.ok i {
    color: #16a34a;
}
.dp-chip.info i {
    color: #4f46e5;
}
@media (prefers-color-scheme: dark) {
    .dp-chip.bad,
    .dp-chip.warn {
        background: rgba(255, 255, 255, 0.05);
    }
}
body.dark-mode .dp-chip.bad,
body.dark-mode .dp-chip.warn,
[data-theme='dark'] .dp-chip.bad,
[data-theme='dark'] .dp-chip.warn {
    background: rgba(255, 255, 255, 0.05);
}

/* month-on-month arrows */
.dp-delta {
    font-size: 0.78rem;
    margin-top: 0.15rem;
    font-weight: 600;
}
.dp-delta small {
    font-weight: 400;
    color: var(--ds-text-muted, #64748b);
}
.dp-delta.good {
    color: #16a34a;
}
.dp-delta.bad {
    color: #dc2626;
}
.dp-delta.neutral {
    color: #4f46e5;
}
.dp-delta.na small {
    font-size: 0.7rem;
    opacity: 0.8;
}
.dp-viewtag {
    margin-inline-start: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4338ca;
    padding: 0.15rem 0.6rem;
    border-radius: 99px;
}
.dp-cur-note {
    margin-inline-start: auto;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ds-text-muted, #64748b);
}
.dp-missing {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.82rem;
}

/* cash to prepare */
.dp-big {
    font-size: 0.9rem;
}
.dp-big b {
    font-size: 1.15rem;
}
.dp-segs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.dp-seg {
    display: flex;
    flex-direction: column;
    min-width: 7.5rem;
    text-align: start;
    border: 0;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    color: #fff;
}
.dp-seg-label {
    font-size: 0.74rem;
    opacity: 0.9;
}
.dp-seg-amt {
    font-size: 1.15rem;
    font-weight: 700;
}
.dp-seg-n {
    font-size: 0.72rem;
    opacity: 0.85;
}
.dp-seg.bad {
    background: #dc2626;
}
.dp-seg.s30 {
    background: #f59e0b;
}
.dp-seg.s90 {
    background: #6366f1;
}
.dp-seg.sAfter {
    background: #64748b;
}
.dp-cash-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}
.dp-mine {
    color: #4338ca;
}

/* returns */
.dp-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--grid-gap, 1.25rem);
}
@media (max-width: 900px) {
    .dp-two {
        grid-template-columns: 1fr;
    }
}
.dp-irr {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
.dp-irr-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: #059669;
}
.dp-irr-sub,
.dp-irr-meta,
.dp-foot,
.dp-hint {
    font-size: 0.8rem;
    color: var(--ds-text-muted, #64748b);
}
.dp-irr-meta {
    margin: 0.25rem 0 0.75rem;
}
.dp-scroll {
    max-height: 230px;
    overflow: auto;
}
.dp-mini {
    font-size: 0.8rem;
    margin: 0;
}
.dp-mini .num {
    text-align: end;
    white-space: nowrap;
}
.dp-pos {
    color: #16a34a;
}
.dp-neg {
    color: #dc2626;
}
.dp-chart-wrap {
    position: relative;
    height: 240px;
}
.dp-foot {
    margin-top: 0.5rem;
}
.dp-rental-top {
    margin-bottom: 0.5rem;
}

/* widget visibility */
.dp-hidden {
    display: none !important;
}
.dp-section + .dp-section {
    margin-top: 0;
}

/* map pins + legend */
.dp-pin span {
    display: flex;
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.dp-pin span b {
    transform: rotate(45deg);
    color: #fff;
    font-size: 0.8rem;
}
.dp-legend {
    background: rgba(255, 255, 255, 0.92);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.dp-legend span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-inline-end: 6px;
}
.dp-pop {
    min-width: 200px;
    color: #0f172a;
}
.dp-pop-unit {
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
}
.dp-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-inline-end: 5px;
}

/* modal */
.dp-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.dp-modal-box {
    background: var(--ds-bg-card, #fff);
    color: var(--ds-text, #0f172a);
    border-radius: 16px;
    width: min(560px, 100%);
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.dp-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ds-border, #e2e8f0);
}
.dp-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
}
.dp-x {
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}
.dp-modal-body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.dp-modal-body label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
}
.dp-modal-body h4 {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
}
.dp-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
.dp-lay {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.dp-lay li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--ds-border, #e2e8f0);
    border-radius: 10px;
    background: var(--ds-bg-page, #f8fafc);
}
.dp-lay li label {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.dp-grip {
    cursor: grab;
    color: #94a3b8;
}
.dp-mini-btn {
    border: 1px solid var(--ds-border, #e2e8f0);
    background: var(--ds-bg-card, #fff);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: inherit;
}
.dp-cur-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.dp-cur-list label {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}
.dp-rate {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.dp-rate input {
    max-width: 10rem;
}
.dp-pre {
    background: var(--ds-bg-page, #f8fafc);
    border: 1px solid var(--ds-border, #e2e8f0);
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 50vh;
    overflow: auto;
}

/* zero notification badge: hide it (the red '0' on the logo / bell was noise) */
.notification-badge.dp-zero {
    display: none !important;
}

/* meeting / presentation mode: no partner-level amounts, only general charts */
body.dp-present .dp-view,
body.dp-present #dp-customize,
body.dp-present #dp-digest,
body.dp-present #dp-actions,
body.dp-present .dashboard-sidebar,
body.dp-present .sidebar,
body.dp-present .dp-btn:not(#dp-present) {
    display: none !important;
}
body.dp-present .dashboard-container {
    grid-template-columns: 1fr;
}
body.dp-present .main-content,
body.dp-present .main-wrapper {
    margin-inline-start: 0 !important;
}
.dp-exit {
    position: fixed;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 10001;
    background: #0f172a;
    color: #fff;
    border: 0;
    border-radius: 99px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* skeleton loading (first load / manual navigation) */
@keyframes dp-shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}
.dp-skel .stat-card-value,
.dp-skel .kpi-value,
.dp-skel .pc-kpi-value,
.dp-skel .stat-card-sub,
.dp-skel .kpi-trend,
.dp-skel .stat-card-change {
    color: transparent !important;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 400px 100%;
    animation: dp-shimmer 1.2s infinite linear;
    border-radius: 6px;
    min-width: 5rem;
    min-height: 1.1em;
}
.dp-skel #dashboard-balances,
.dp-skel #dashboard-milestones,
.dp-skel #risk-concentration,
.dp-skel #payment-health,
.dp-skel #developer-ranking,
.dp-skel #overdue-alerts,
.dp-skel #handover-timeline,
.dp-skel #milestones-calendar,
.dp-skel #property-details-table,
.dp-skel #partner-capital-table {
    min-height: 90px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 400px 100%;
    animation: dp-shimmer 1.2s infinite linear;
    border-radius: 10px;
}
.dp-skel .fa-spinner {
    visibility: hidden;
}

/* Hebrew: right-to-left */
body.dp-he .dp-chip,
body.dp-he .dp-seg {
    text-align: right;
}
[dir='rtl'] .dp-two,
[dir='rtl'] .dp-segs {
    direction: rtl;
}

/* phones / foldables */
@media (max-width: 640px) {
    .dp-btn span {
        display: none;
    }
    .dp-chip {
        flex: 1 1 100%;
    }
    .dp-seg {
        flex: 1 1 45% !important;
    }
    .briefing-card {
        padding: 0.8rem 1rem !important;
    }
}

.dp-mini th,
.dp-mini td {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.78rem !important;
    white-space: nowrap;
}
.dp-mini td:first-child {
    white-space: normal;
}
