/* =============================================================================
   DEX Portal - Agent Meeko sub-pages (/Meeko-Calls, /Meeko-Meetings,
   /Meeko-Chasers; 16 Nov 2026, sub-pages 17 Nov 2026)

   The page reuses the shared page header, record tabs, toolbar, data table
   and Call Logs' Meeko call table. This file only sets the tiles (the AM
   soft card, 5px corners, not clickable), the period field in the
   toolbar, and the stacked cells of the lists. Sizes come from the tokens,
   so the phone breakpoints in design-tokens.css scale it.
   ============================================================================= */

.meeko-page {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* The tab text lines up with the title and the search box: the bar's own
   negative margin is dropped and a tab's 12px padding comes off the gutter. */
.record-tabs.meeko-page__tabs {
    flex-shrink: 0;
    margin: 4px 0 0;
    padding: 0 calc(var(--gutter) - 12px);
    overflow-x: auto;
    scrollbar-width: none;
}

.meeko-page__tabs::-webkit-scrollbar { display: none; }

.meeko-page__tabs .record-tab { white-space: nowrap; }

.meeko-page__toolbar {
    flex-shrink: 0;
    flex-wrap: wrap;
    row-gap: 10px;
}

.meeko-page__period {
    width: 168px;
    flex: none;
}

.meeko-page__refresh { flex: none; }

/* ---- Tiles ----------------------------------------------------------------------- */

.meeko-page__tiles { flex-shrink: 0; }

.meeko-page__tile-grid.summary-counters {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    padding: 4px var(--gutter) 4px;
}

/* The AM soft card (17 Nov 2026): a soft navy tinted surface with a hairline
   in the same family, so a tile reads as a tile and not a bare box. No side
   strip; the icon carries the tone in its own soft badge. */
.meeko-page__tile.summary-counter {
    cursor: default;
    border-radius: var(--radius-button);
    background: var(--am-blue-tint);
    border-color: var(--am-blue-soft);
    align-items: flex-start;
}

.meeko-page__tile.summary-counter:hover { border-color: var(--am-blue-soft); }

/* Every tile's icon is AM navy in the same soft navy badge (17 Nov 2026):
   the icon says what the tile counts, not how worried to be. */
.meeko-page__tile .meeko-page__tile-badge {
    flex: none;
    border-radius: var(--radius-button);
    background: var(--am-blue-soft, var(--accent-tint));
    color: var(--am-blue, var(--accent));
}

.meeko-page__tile .summary-counter__label {
    white-space: normal;
    color: var(--text-primary);
    font-weight: 500;
}

.meeko-page__tile-caption {
    display: block;
    margin-top: 2px;
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* ---- Lists ----------------------------------------------------------------------- */

.meeko-page__list {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    margin: 12px var(--gutter) var(--gutter);
}

.meeko-page__row { cursor: pointer; }
.meeko-page__row:hover td,
.meeko-page__row:focus-visible td { background: var(--accent-tint); }
.meeko-page__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.meeko-page__stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.meeko-page__reason {
    display: block;
    max-width: 46ch;
    font-size: var(--font-size-small);
    color: var(--text-secondary, var(--text-primary));
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.meeko-page__note {
    display: -webkit-box;
    max-width: 52ch;
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meeko-page__muted { color: var(--text-muted); }

.meeko-page__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ---- Tablet and phone -------------------------------------------------------------- */

@media (max-width: 900px) {
    .meeko-page__list {
        flex: none;
        overflow: visible;
    }

    .meeko-page__list > .meeko-page__table,
    .meeko-page__list > .meeko-calls__table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 560px) {
    .meeko-page__toolbar > .filter-field { flex: 1 1 100%; }
    .meeko-page__period { flex: 1 1 auto; width: auto; }
    .meeko-page__tile-grid.summary-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .meeko-page__tile.summary-counter { padding: 10px 12px; gap: 10px; }
    .meeko-page__tile .summary-counter__badge { width: 30px; height: 30px; }

    /* The columns that repeat the row's detail go; the task and its state stay,
       and what is left shares the width and wraps instead of scrolling sideways. */
    .meeko-page__table .meeko-page__phone-hidden { display: none; }

    /* The shared phone rule gives every data table a 640px floor so it
       scrolls; these tables drop columns instead, so they take the width. */
    .meeko-page__list > .meeko-page__table {
        display: table;
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .meeko-page__table th,
    .meeko-page__table td {
        padding-left: 10px;
        padding-right: 10px;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}
