/* Dashboard-specific layout on top of common.css */
.dash-table-card .card-body { padding: 0; }
.dash-table-card table { margin-bottom: 0; font-size: 12px; }
.dash-table-card table th, .dash-table-card table td { padding: .5rem .8rem; }
.dash-quick-list { max-height: 280px; overflow-y: auto; }
.chart-card canvas { max-height: 260px; }

/* ==========================================================================
   Bento-style dashboard cards — a hero tile (total assets) plus four
   supporting stat tiles share one grid so the top of the dashboard reads as
   one composed panel instead of a uniform row of identical boxes. Reuses
   the existing .bg-c1..c6 gradients so tile colors stay consistent with the
   rest of the app.
   ========================================================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 108px;
    gap: .65rem;
}
.bento-tile {
    position: relative;
    border-radius: 18px;
    padding: .9rem 1rem;
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Raised, glassy 3D tile: bright top bevel + dark bottom bevel over the
       existing gradient, plus a soft ambient drop shadow so tiles read as
       physically lit panels rather than flat color blocks. */
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        inset 0 -6px 14px rgba(0,0,0,.18),
        0 10px 22px rgba(20,30,50,.16);
    transition: transform .18s ease, box-shadow .18s ease;
}
.bento-tile:hover {
    transform: translateY(-3px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -6px 14px rgba(0,0,0,.18),
        0 16px 30px rgba(20,30,50,.22);
}
/* Faint diagonal sheen, same cut-corner language used on the sidebar's brand
   icon / nav icons, so the dashboard ties back into that visual system. */
.bento-tile::before {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 90px; height: 90px;
    background: linear-gradient(135deg, rgba(255,255,255,.16) 0%, transparent 60%);
    pointer-events: none;
}
.bento-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(150deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,.1) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -2px 3px rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.25);
    font-size: 14px;
    flex: 0 0 auto;
}
.bento-tile-value { font-size: 22px; font-weight: 700; line-height: 1.15; margin-top: .5rem; }
.bento-tile-label { font-size: 11.5px; opacity: .92; }

.bento-hero {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
}

/* Same gradient set as .stat-card.bg-c1..c6 in common.css, reapplied here
   since those rules are scoped to `.stat-card.bg-cN` (both classes) and
   don't match `.bento-tile.bg-cN`. */
.bento-tile.bg-c1 { background: linear-gradient(135deg,#2f5f9e,#3f7cc4); }
.bento-tile.bg-c2 { background: linear-gradient(135deg,#1e8e5a,#28b476); }
.bento-tile.bg-c3 { background: linear-gradient(135deg,#c77c11,#e5a03d); }
.bento-tile.bg-c4 { background: linear-gradient(135deg,#b3261e,#dd4c40); }
.bento-tile.bg-c5 { background: linear-gradient(135deg,#5b4bc4,#7b6de0); }
.bento-tile.bg-c6 { background: linear-gradient(135deg,#0c6e8f,#1596bd); }
.bento-tile-top { display: flex; align-items: center; gap: .6rem; }
.bento-hero-label { font-size: 12.5px; font-weight: 600; opacity: .92; }
.bento-hero-value { font-size: 40px; font-weight: 800; line-height: 1; }
.bento-hero-breakdown { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: 11.5px; opacity: .95; }
.bento-hero-breakdown i { font-size: 6px; margin-right: .35rem; vertical-align: middle; }

/* ---------- Secondary metrics strip ---------- */
.bento-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .6rem;
}
.bento-mini {
    background: #fff;
    border: 1px solid rgba(20,30,50,.05);
    border-radius: 14px;
    padding: .65rem .8rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 4px 12px rgba(20,30,50,.05);
    transition: transform .15s ease, box-shadow .15s ease;
}
.bento-mini:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20,30,50,.1); }
.bento-mini-icon {
    width: 32px; height: 32px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; font-size: 13px;
    background: rgba(74,85,104,.08);
}
.bento-mini-value { font-size: 17px; font-weight: 700; line-height: 1.1; }
.bento-mini-label { font-size: 10.5px; color: var(--alms-text-muted); }

/* ---------- Entrance motion ----------
   .card already gets a one-shot fade-up on load (common.css); these two
   groups are flat sibling grids under our own control, so a nth-child
   stagger reads as a genuine cascade instead of everything popping in at
   once — the dashboard is the first thing most users see after login. */
@media (prefers-reduced-motion: no-preference) {
    .bento-tile, .bento-mini {
        opacity: 0;
        animation: alms-fade-up .5s cubic-bezier(.16,1,.3,1) forwards;
    }
    .bento-tile:nth-child(1) { animation-delay: .03s; }
    .bento-tile:nth-child(2) { animation-delay: .09s; }
    .bento-tile:nth-child(3) { animation-delay: .15s; }
    .bento-tile:nth-child(4) { animation-delay: .21s; }
    .bento-tile:nth-child(5) { animation-delay: .27s; }
    .bento-mini:nth-child(1) { animation-delay: .3s; }
    .bento-mini:nth-child(2) { animation-delay: .35s; }
    .bento-mini:nth-child(3) { animation-delay: .4s; }
    .bento-mini:nth-child(4) { animation-delay: .45s; }
    .bento-mini:nth-child(5) { animation-delay: .5s; }
    .bento-mini:nth-child(6) { animation-delay: .55s; }
}

@media (max-width: 991px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100px; }
    .bento-hero { grid-column: span 2; grid-row: span 1; min-height: 150px; }
}
@media (max-width: 480px) {
    .bento-grid { grid-template-columns: 1fr; }
    .bento-hero { grid-column: span 1; }
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] .bento-mini {
    background: #1b2530;
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 4px 12px rgba(0,0,0,.3);
}
[data-theme="dark"] .bento-mini-icon { background: rgba(255,255,255,.08); }
[data-theme="dark"] .bento-mini-value { color: #eef1f4; }
