/* Today page (/dashboard) — the action inbox.
   ========================================================================
   Wears the friendly register (css/app-page.css: the .ap-page shell, title row, buttons, links, panels);
   this file holds only the Today pieces. Every selector starts with the page root .today-page, which sits
   on the same element as .ap-page, so nothing here reaches another page. Linked in Components/App.razor
   directly after css/products-page.css, so a Today rule wins over a shared one at equal weight.

   Layout: a main column of section panels and a 360px right rail; under 960px one column with the rail
   first. Type stays at the register's density: row titles 14px/600, subtitles 12.5px, chips 11px mono.

   Colours are --app-* tokens only (or a color-mix wash of one), so the page follows every preset and both
   modes. Row dots: red --app-danger-text (a problem), amber --app-warn-text (needs action soon), blue
   --app-info (waiting on someone else), green --app-status-ok, neutral --app-border-strong.
   Radii come only from the --ap-radius-* steps, 0, or 999px for the dots.
   ======================================================================== */

/* ── grid ───────────────────────────────────────────────────────────────── */

.today-page .today-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.today-page .today-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.today-page .today-rail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* The status line's count reads in the strong text colour, as the mockup's "7 things need you". */
.today-page .ap-status strong {
    color: var(--app-text-strong);
    font-weight: 600;
}

/* ── section panel ──────────────────────────────────────────────────────── */

.today-page .today-section {
    display: flex;
    flex-direction: column;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-panel);
    overflow: hidden;
}

.today-page .today-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--app-border-hairline);
}

.today-page .today-section-head .bi {
    font-size: 14px;
    color: var(--app-text-label);
}

.today-page .today-section-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--app-text-strong);
}

.today-page .today-count {
    padding: 1px 6px;
    border-radius: var(--ap-radius-chip);
    background: var(--app-surface-sunken);
    color: var(--app-text-label);
    font-family: var(--ap-mono);
    font-size: 11px;
    line-height: 1.4;
}

/* ── rows ───────────────────────────────────────────────────────────────── */

.today-page .today-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.today-page .today-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.today-page .today-row + .today-row {
    border-top: 1px solid var(--app-border-hairline);
}

.today-page .today-dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 999px;
    background: var(--app-border-strong);
}

.today-page .today-dot.is-danger {
    background: var(--app-danger-text);
}

.today-page .today-dot.is-warn {
    background: var(--app-warn-text);
}

.today-page .today-dot.is-info {
    background: var(--app-info);
}

.today-page .today-dot.is-ok {
    background: var(--app-status-ok);
}

.today-page .today-dot.is-neutral {
    background: var(--app-border-strong);
}

.today-page .today-row-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.today-page .today-row-title {
    overflow: hidden;
    color: var(--app-text-strong);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-page .today-row-title:hover {
    color: var(--app-text-strong);
    text-decoration: underline;
}

.today-page .today-row-sub {
    overflow: hidden;
    color: var(--app-text-label);
    font-size: 12.5px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-page .today-row-action {
    flex: none;
    white-space: nowrap;
}

/* "Show all N" / "Show fewer": a small link under the rows, at the right. */
.today-page .today-showall {
    align-self: flex-end;
    margin: 0 8px 8px;
    font-size: 12px;
}

/* ── quiet day and footer ───────────────────────────────────────────────── */

.today-page .today-caught-up {
    align-items: center;
    gap: 6px;
    padding: 24px 16px;
    text-align: center;
}

.today-page .today-caught-up-title {
    margin: 0;
    color: var(--app-text-strong);
    font-size: 16px;
    font-weight: 600;
}

.today-page .today-caught-up-sub {
    margin: 0;
    color: var(--app-text-label);
    font-size: 12px;
}

.today-page .today-caught-up .ap-btn {
    margin-top: 6px;
}

.today-page .today-foot {
    color: var(--app-text-label);
    font-size: 12px;
}

/* ── rail cards ─────────────────────────────────────────────────────────── */

.today-page .today-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-panel);
}

.today-page .today-card-title {
    margin: 0;
    color: var(--app-text-strong);
    font-size: 14px;
    font-weight: 600;
}

.today-page .today-card-error {
    color: var(--app-danger-text);
    font-size: 12px;
}

/* A list card (follow-ups, recently opened): each row a link across the card's width. */
.today-page .today-card-list {
    margin: 0 -14px -12px;
    padding: 0;
    list-style: none;
}

.today-page .today-card-list li {
    border-top: 1px solid var(--app-border-hairline);
}

.today-page .today-card-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--app-text-data);
    text-decoration: none;
}

.today-page .today-card-link:hover {
    background: var(--app-surface-hover);
    color: var(--app-text-data);
}

.today-page .today-card-link-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* Clock: green wash while running; the elapsed time large and steady. */
.today-page .today-clock.is-running {
    background: color-mix(in srgb, var(--app-status-ok) 10%, var(--app-surface-panel));
    border-color: color-mix(in srgb, var(--app-status-ok) 35%, var(--app-border-hairline));
}

.today-page .today-clock-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--app-text-strong);
    font-size: 13px;
    font-weight: 500;
}

.today-page .today-clock.is-running .today-clock-head {
    color: var(--app-status-ok);
}

.today-page .today-clock-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.today-page .today-clock-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.today-page .today-clock-time {
    color: var(--app-text-strong);
    font-family: var(--ap-mono);
    font-size: 28px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.today-page .today-clock-sub {
    color: var(--app-text-data);
    font-size: 12.5px;
}

.today-page .today-clock-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.today-page .today-clock-form .ap-select {
    width: 100%;
    height: 32px;
}

.today-page .ap-btn.today-btn-danger {
    flex: none;
    height: 32px;
    border-color: var(--app-danger-text);
    background: color-mix(in srgb, var(--app-danger-text) 8%, transparent);
    color: var(--app-danger-text);
}

.today-page .ap-btn.today-btn-danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--app-danger-text) 14%, transparent);
    color: var(--app-danger-text);
}

.today-page .ap-btn.today-btn-danger:disabled {
    background: var(--app-surface-sunken);
    border-color: var(--app-border-hairline);
    color: var(--app-text-disabled);
}

/* Time to approve: the oldest group beside its Review button, smaller rows under it. */
.today-page .today-approve-first,
.today-page .today-approve-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.today-page .today-approve-row {
    padding-top: 8px;
    border-top: 1px solid var(--app-border-hairline);
    font-size: 12.5px;
}

.today-page .today-approve-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.today-page .today-approve-main {
    color: var(--app-text-data);
    font-size: 12.5px;
}

.today-page .today-approve-proj {
    overflow: hidden;
    color: var(--app-text-label);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-page .today-approve-row .ap-link {
    flex: none;
}

.today-page .today-approve-more {
    color: var(--app-text-label);
    font-size: 12px;
}

/* Follow-ups due. */
.today-page .today-fu-company {
    color: var(--app-text-strong);
    font-size: 14px;
    font-weight: 600;
}

.today-page .today-fu-label {
    color: var(--app-text-label);
    font-size: 12.5px;
}

.today-page .today-fu-when {
    flex: none;
    font-size: 12px;
    font-weight: 600;
}

.today-page .today-fu-when.is-today {
    color: var(--app-warn-text);
}

.today-page .today-fu-when.is-overdue {
    color: var(--app-danger-text);
}

/* Recently opened: a fixed-width mono number column, then the name. */
.today-page .today-recent-num {
    flex: none;
    min-width: 56px;
    color: var(--app-text-label);
    font-size: 11px;
}

.today-page .today-recent-name {
    overflow: hidden;
    color: var(--app-text-strong);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── narrow screens ─────────────────────────────────────────────────────── */

@media (max-width: 960px) {
    .today-page .today-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .today-page .today-rail {
        order: -1;
    }
}
