/* ==========================================================================
   Dashboard — mobile-first pass ("m2")
   --------------------------------------------------------------------------
   Loaded after app.css. Styles the two pieces the dashboard gained — the
   shortcut row and the "today" row — and tidies what changed around them.

   What is deliberately untouched: the ATM hero card, the storefront card, the
   widget cards and every chart colour (the chart palette is CVD-validated).
   Primary text stays true black.

   Removing this file's <link> in index.php leaves the new rows unstyled but
   working; reverting dashboard.js alongside restores the previous dashboard.
   ========================================================================== */

/* ---- Shortcut row --------------------------------------------------------- */

.db2-quick {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 0 12px;
    padding: 12px 4px 10px;
    background: var(--surface, #fff);
    border: 1px solid var(--border-light, #eef0f2);
    border-radius: 18px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
}
.db2-quick::-webkit-scrollbar { display: none; }

.db2-qa {
    flex: 1 0 68px;
    min-width: 68px;
    border: 0;
    background: transparent;
    padding: 2px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
    scroll-snap-align: start;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
}
.db2-qa:active .db2-qa-ic { transform: scale(.94); }
.db2-qa:focus-visible { outline: 2px solid var(--accent, #059669); outline-offset: 2px; }
.db2-qa-ic {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 21px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
    transition: transform .12s ease;
}
.db2-qa-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e1251b;
    color: #fff;
    border: 2px solid var(--surface, #fff);
    font-style: normal;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: content-box;
}

/* ---- Today row, under the hero -------------------------------------------- */

.db2-today {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
    margin: 12px 0 0;
    background: var(--surface, #fff);
    border: 1px solid var(--border-light, #eef0f2);
    border-radius: 18px;
    overflow: hidden;
}
.db2-today-cell {
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 12px 8px 11px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: #000;
}
.db2-today-cell + .db2-today-cell { border-left: 1px solid var(--border-light, #eef0f2); }
.db2-today-cell:active { background: rgba(15, 23, 42, .03); }
.db2-today-k {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #4b5563;
    white-space: nowrap;
}
.db2-today-k i { font-size: 12px; color: var(--accent, #059669); }
.db2-today-cell b {
    max-width: 100%;
    font-size: clamp(13px, 3.6vw, 17px);
    font-weight: 800;
    letter-spacing: -.02em;
    color: #000;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db2-today-cell small {
    font-size: 11.5px;
    font-weight: 600;
    color: #5c636e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.db2-today-cell small.up { color: #047857; }
.db2-today-cell small.down { color: #b91c1c; }

/* ---- The hero's period is now the control that changes it ------------------ */

.dsz-hero-range.dsz-hero-range-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font: inherit;
    font-size: .64rem;
    font-weight: 800;
    color: #ecfdf5;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    padding: 5px 10px;
    min-height: 28px;
}
.dsz-hero-range-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsz-hero-range-btn i { font-size: .72rem; flex: none; }
.dsz-hero-range-btn:hover { background: rgba(255, 255, 255, .24); }
.dsz-hero-range-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* The floating filter button sat over figures on phones; the hero's period
   button opens the same drawer. */
#dashboard-filters-fab { display: none !important; }

/* ---- Widget headings: bolder title, quieter "see all" --------------------- */

.dsb-dashboard-grid .dsb-widget-title {
    font-size: 1rem;
    font-weight: 800;
    color: #000;
    letter-spacing: -.02em;
}
.dsb-dashboard-grid .dsb-mini-btn {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 4px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 4px 2px !important;
    font-size: .8rem;
    font-weight: 700;
    color: #4b5563;
}
.dsb-dashboard-grid .dsb-mini-btn:hover { color: #000; }
.dsb-dashboard-grid .dsb-mini-btn i { font-size: .78rem; }

/* ---- Money-flow legend chips ------------------------------------------------ */
/* Label and value shared one line, so on a phone the value was cut to
   "GHS 4…". Stacking them keeps both whole. */
@media (max-width: 520px) {
    .dsz-chip { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 11px 9px; }
    .dsz-chip b { font-size: .92rem; max-width: 100%; }
}

/* ---- Desktop ---------------------------------------------------------------- */

@media (min-width: 900px) {
    .db2-quick { padding: 14px 10px 12px; gap: 6px; }
    .db2-qa { flex: 1 0 84px; font-size: 12.5px; }
    .db2-qa-ic { width: 52px; height: 52px; font-size: 22px; }
    .db2-today-cell { padding: 14px 16px 13px; }
    .db2-today-cell b { font-size: 18px; }
}
