/*  Dashboard (dash-) — the "/" landing page: quick-access tiles, the widget grid and
    the widget internals (stats, release notes, product lists, contact block). Built on
    mds- tokens/primitives only; the shared news card lives in news.css. Mobile-first:
    base = phones, widened at 768/1024px. */

/* ---- quick-access tiles ---------------------------------------------------- */
.dash-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--mds-space-3);
    margin: var(--mds-space-4) 0 var(--mds-space-5); }
.dash-tile { display: flex; flex-direction: column; align-items: center; gap: var(--mds-space-2);
    padding: var(--mds-space-4) var(--mds-space-2);
    background: var(--mds-surface); border: 1px solid var(--mds-line); border-radius: var(--mds-radius-lg);
    color: var(--mds-title); text-decoration: none;
    font-size: var(--mds-text-sm); font-weight: 600; text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.dash-tile:hover { border-color: var(--mds-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transform: translateY(-1px); }
.dash-tile__icon { display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 50%; background: var(--mds-tint); color: var(--mds-accent-ink); font-size: 17px; }
@media (min-width: 768px)  { .dash-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .dash-tiles { grid-template-columns: repeat(5, 1fr); } }

/* ---- widget grid ------------------------------------------------------------ */
/* Mobile: one column, reordered so the fast DB widgets appear above the (slower)
   news — main/side become display:contents and the cards order themselves. */
.dash-grid { display: flex; flex-direction: column; gap: var(--mds-space-4); }
.dash-grid__main, .dash-grid__side { display: contents; }
.dash-card--changes { order: 1; }
.dash-card--news    { order: 2; }
.dash-card--rn      { order: 3; }
.dash-card--about   { order: 4; }

@media (min-width: 1024px) {
    .dash-grid { display: grid; grid-template-columns: 2fr 1fr; align-items: start; }
    .dash-grid__main, .dash-grid__side { display: flex; flex-direction: column;
        gap: var(--mds-space-4); min-width: 0; }
}

/* ---- shared widget bits ------------------------------------------------------ */
.dash-card { min-width: 0; }
.dash-card__foot { margin-top: var(--mds-space-3); padding-top: var(--mds-space-2);
    border-top: 1px solid var(--mds-line); text-align: right; font-size: var(--mds-text-sm); }

/* The news grid inside the "Latest news" widget (2-up on wide). */
.dash-newsgrid { display: grid; grid-template-columns: 1fr; gap: var(--mds-space-4); }
@media (min-width: 768px) { .dash-newsgrid { grid-template-columns: repeat(2, 1fr); } }

/* A section heading inside a widget ("Newest products", month names). */
.dash-sub, .dash-rn__month { margin: var(--mds-space-3) 0 var(--mds-space-2);
    font-size: var(--mds-text-xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--mds-muted); }

/* Collapsed continuation ("Recently updated", "Earlier updates"). */
.dash-more { margin-top: var(--mds-space-3); border-top: 1px solid var(--mds-line); }
.dash-more__head { display: flex; align-items: center; gap: var(--mds-space-2);
    padding: var(--mds-space-2) 0; cursor: pointer; list-style: none;
    font-size: var(--mds-text-sm); font-weight: 600; color: var(--mds-title); }
.dash-more__head::-webkit-details-marker { display: none; }
.dash-more__head:hover { color: var(--mds-accent-ink); }
.dash-more[open] > .dash-more__head .mds-accordion__chev { transform: rotate(180deg); }

/* ---- "Database changes" ------------------------------------------------------ */
.dash-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--mds-space-3);
    margin-bottom: var(--mds-space-1); }
.dash-stat { padding: var(--mds-space-3); background: var(--mds-tint);
    border-radius: var(--mds-radius); text-align: center; }
.dash-stat__num { display: block; font-size: var(--mds-text-2xl); font-weight: 700;
    color: var(--mds-accent-ink); }
.dash-stat__label { font-size: var(--mds-text-xs); color: var(--mds-muted); }
.dash-stats__meta { margin-bottom: var(--mds-space-2); font-size: var(--mds-text-xs);
    color: var(--mds-muted); text-align: center; }

.dash-plist { list-style: none; margin: 0; padding: 0; font-size: var(--mds-text-sm); }
.dash-plist li { padding: var(--mds-space-1-5) 0; border-bottom: 1px solid var(--mds-line); }
.dash-plist li:last-child { border-bottom: none; }
.dash-plist__meta { display: block; font-size: var(--mds-text-xs); color: var(--mds-muted); }

/* ---- "What's new in MIRACLE" (release notes) --------------------------------- */
.dash-rn { display: flex; align-items: flex-start; gap: var(--mds-space-3);
    padding: var(--mds-space-2) 0; border-bottom: 1px solid var(--mds-line); }
.dash-rn__badge { flex: none; min-width: 86px; padding: 2px var(--mds-space-2);
    border-radius: 999px; text-align: center;
    font-size: var(--mds-text-xs); font-weight: 700; }
.dash-rn__badge--new { background: var(--mds-tint); color: var(--mds-accent-ink); }
.dash-rn__badge--fix { background: color-mix(in srgb, var(--mds-success) 12%, var(--mds-surface));
    color: var(--mds-success); }
.dash-rn__badge--improvement { background: color-mix(in srgb, var(--mds-title) 10%, var(--mds-surface));
    color: var(--mds-title); }
.dash-rn__text { min-width: 0; }
.dash-rn__title { font-size: var(--mds-text-sm); font-weight: 600; color: var(--mds-title); }
.dash-rn__desc { margin: var(--mds-space-0-5) 0 0; font-size: var(--mds-text-sm);
    color: var(--mds-text); line-height: 1.5; }
.dash-rn__footnote { margin: var(--mds-space-1) 0 0; font-size: var(--mds-text-xs);
    color: var(--mds-muted); font-style: italic; }

/* ---- "About & contact" -------------------------------------------------------- */
.dash-about__version { display: flex; align-items: baseline; gap: var(--mds-space-2);
    margin-bottom: var(--mds-space-3); font-size: var(--mds-text-sm); color: var(--mds-title); }
.dash-about__year { font-size: var(--mds-text-xs); color: var(--mds-muted); }
.dash-contact { margin-top: var(--mds-space-3); padding-top: var(--mds-space-3);
    border-top: 1px solid var(--mds-line);
    font-size: var(--mds-text-sm); line-height: 1.6; color: var(--mds-text); }
.dash-contact__name { font-weight: 700; color: var(--mds-title); }
