/* ── Personal Command Center (V1 dashboard) ─────────────────────────────────────
   Uses the app's theme tokens (--paper, --line, --ink, --teal, --coral, --amber, --d-accent),
   so light/dark mode and accent colours follow the Theme Dock automatically. */

.cc { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.cc-muted { color: var(--muted, #94a3b8); font-size: 12.5px; }

/* Greeting */
.cc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cc-greeting { font-family: var(--serif, Georgia, serif); font-size: clamp(26px, 3.6vw, 38px); font-weight: 400; letter-spacing: -.02em; color: var(--ink, #0f172a); line-height: 1.05; margin: 0 0 6px; }
.cc-greeting em { font-style: italic; color: var(--coral, #ea580c); }
.cc-context { font-size: 13px; color: var(--ink-2, #475569); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cc-ctx-name { font-weight: 600; color: var(--ink, #0f172a); }
.cc-bull { color: var(--muted, #94a3b8); }
.cc-summary { margin: 8px 0 0; font-size: 15px; color: var(--ink, #0f172a); font-weight: 500; }
.cc-head-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* Child selector (parents) */
.cc-children { display: flex; gap: 6px; margin-right: 8px; flex-wrap: wrap; }
.cc-child { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; border: 1px solid var(--line, rgba(11,16,32,.1)); background: var(--paper, #fff); color: var(--ink, #0f172a); font-size: 13px; cursor: pointer; }
.cc-child.on { border-color: var(--d-accent, #4f46e5); background: var(--d-accent-soft, rgba(79,70,229,.1)); font-weight: 600; }
/* Normalise MudAvatar background in child chips — MudBlazor's default varies */
.cc-child .mud-avatar { background: var(--bg, #f1f5f9) !important; color: var(--d-accent, #4f46e5) !important; }

/* Cards / section titles */
.cc-card { background: var(--paper, #fff); border: 1px solid var(--line, rgba(11,16,32,.08)); border-radius: 16px; padding: 16px 18px; }
.cc-sec-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2, #475569); margin: 0 0 8px; }
.cc-widget-head { display: flex; justify-content: space-between; align-items: center; }
.cc-empty { padding: 14px 4px; color: var(--muted, #94a3b8); font-size: 13.5px; }
.cc-fail { display: flex; align-items: center; gap: 12px; }
.cc-fail > div { flex: 1; }
.cc-allclear { padding: 12px 16px; border-radius: 14px; background: var(--teal-soft, rgba(13,148,136,.09)); color: var(--teal, #0d9488); font-weight: 600; font-size: 14px; }

/* Attention Required */
.cc-attn-list { display: flex; flex-direction: column; gap: 6px; }
.cc-attn-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--paper, #fff); border: 1px solid var(--line, rgba(11,16,32,.08)); border-left-width: 4px; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.cc-attn-item:hover, .cc-attn-item:focus-visible { box-shadow: 0 6px 22px -10px rgba(0,0,0,.2); transform: translateY(-1px); outline: none; }
.cc-attn-item.crit { border-left-color: #dc2626; }
.cc-attn-item.warn { border-left-color: var(--amber, #d97706); }
.cc-attn-item.info { border-left-color: #2563eb; }
.cc-attn-item.ok   { border-left-color: var(--teal, #0d9488); }
.cc-attn-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--bg, #f1f5f9); }
.cc-attn-item.crit .cc-attn-ic { background: rgba(220,38,38,.1); color: #dc2626; }
.cc-attn-item.warn .cc-attn-ic { background: var(--amber-soft, rgba(217,119,6,.1)); color: var(--amber, #d97706); }
.cc-attn-item.info .cc-attn-ic { background: rgba(37,99,235,.1); color: #2563eb; }
.cc-attn-body { flex: 1; min-width: 0; }
.cc-attn-title { font-weight: 600; font-size: 14.5px; color: var(--ink, #0f172a); }
.cc-attn-detail { font-size: 12.5px; color: var(--ink-2, #475569); margin-top: 2px; }
.cc-attn-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #94a3b8); white-space: nowrap; }
.cc-attn-act { flex: none; }
.cc-attn-err .cc-attn-title { font-weight: 500; color: var(--ink-2, #475569); }

/* Layout grid for widgets */
.cc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.cc-span-full { grid-column: 1 / -1; }
.cc-span-half { grid-column: span 1; min-width: 0; }
@media (max-width: 960px) { .cc-grid { grid-template-columns: 1fr; } }

/* Pinned top section — Key Numbers (KPIs), then the calendar. Always shown, always first, not
   part of the customizable .cc-grid below (see CommandCenter.razor); they inherit .cc's own
   14px gap from their neighbours, same as every other section. */

/* KPIs */
.cc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1200px) { .cc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phones: one swipeable row instead of a tall stack */
@media (max-width: 560px)  {
    .cc-kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
    .cc-kpis > .cc-kpi { flex: 0 0 72%; scroll-snap-align: start; }
}
.cc-kpi { position: relative; background: var(--paper, #fff); border: 1px solid var(--line, rgba(11,16,32,.08)); border-radius: 16px; padding: 13px 16px 11px; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.cc-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--d-accent, #4f46e5); }
.cc-kpi.teal::before  { background: var(--teal, #0d9488); }
.cc-kpi.coral::before { background: var(--coral, #ea580c); }
.cc-kpi.amber::before { background: var(--amber, #d97706); }
.cc-kpi.indigo::before { background: #4f46e5; }
.cc-kpi.click { cursor: pointer; }
.cc-kpi.click:hover, .cc-kpi.click:focus-visible { box-shadow: 0 8px 26px -10px rgba(0,0,0,.18); transform: translateY(-1px); outline: none; }
.cc-kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cc-kpi-title { font-size: 12.5px; font-weight: 600; color: var(--ink-2, #475569); }
.cc-kpi-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--d-accent-soft, rgba(79,70,229,.1)); color: var(--d-accent, #4f46e5); }
.cc-kpi.teal .cc-kpi-ic  { background: var(--teal-soft, rgba(13,148,136,.1));  color: var(--teal, #0d9488); }
.cc-kpi.coral .cc-kpi-ic { background: var(--coral-soft, rgba(234,88,12,.1)); color: var(--coral, #ea580c); }
.cc-kpi.amber .cc-kpi-ic { background: var(--amber-soft, rgba(217,119,6,.1)); color: var(--amber, #d97706); }
.cc-kpi-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--ink, #0f172a); margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.cc-kpi.crit .cc-kpi-val { color: #dc2626; }
.cc-kpi-empty { font-size: 14px; font-weight: 600; color: var(--teal, #0d9488); margin: 12px 0 6px; }
.cc-kpi-bot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 18px; }
.cc-kpi-ctx { font-size: 12px; color: var(--muted, #94a3b8); }
.cc-kpi-open { position: absolute; right: 10px; bottom: 10px; opacity: 0; color: var(--muted, #94a3b8); transition: opacity .15s; }
.cc-kpi:hover .cc-kpi-open, .cc-kpi:focus-visible .cc-kpi-open { opacity: 1; }
.cc-delta { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.cc-delta.up { color: #059669; background: rgba(5,150,105,.1); }
.cc-delta.down { color: #dc2626; background: rgba(220,38,38,.1); }

/* Quick actions */
.cc-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cc-action { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, rgba(11,16,32,.08)); color: var(--ink, #0f172a); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background .12s, border-color .12s; }
.cc-action:hover, .cc-action:focus-visible { background: var(--d-accent-soft, rgba(79,70,229,.08)); border-color: var(--d-accent, #4f46e5); outline: none; }
.cc-action.boost { border-color: var(--amber, #d97706); background: var(--amber-soft, rgba(217,119,6,.07)); }
.cc-action-ic { color: var(--d-accent, #4f46e5); display: grid; place-items: center; }
.cc-action-lbl { flex: 1; min-width: 0; }
.cc-action-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber, #d97706); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.cc-action-pin { color: var(--muted, #94a3b8); }

/* Today timeline */
.cc-today { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cc-today-item { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 10px; cursor: pointer; position: relative; }
.cc-today-item:hover, .cc-today-item:focus-visible { background: var(--bg, #f1f5f9); outline: none; }
.cc-today-item.done { opacity: .55; }
.cc-today-item.now { background: var(--d-accent-soft, rgba(79,70,229,.08)); }
.cc-today-time { width: 46px; font-family: var(--mono, monospace); font-size: 12.5px; color: var(--ink-2, #475569); flex: none; }
.cc-today-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg, #f1f5f9); color: var(--ink-2, #475569); flex: none; }
.cc-today-item.deadline .cc-today-dot { background: rgba(220,38,38,.1); color: #dc2626; }
.cc-today-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cc-today-title { font-size: 14px; font-weight: 500; color: var(--ink, #0f172a); }
.cc-today-sub { font-size: 12px; color: var(--muted, #94a3b8); }

/* This week (upcoming events, under Today's Work) */
.cc-upcoming-head { margin-top: 10px; padding: 0 6px; }
.cc-upcoming .cc-today-item.holiday .cc-today-dot { background: var(--amber-soft, rgba(217,119,6,.1)); color: var(--amber, #d97706); }
.cc-upcoming-date { font-family: var(--sans); font-weight: 600; color: var(--ink-2, #475569); }
.cc-view-more {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 10px; padding: 8px 6px; border-radius: 10px;
    font-size: 13px; font-weight: 600; color: var(--d-accent, #4f46e5); text-decoration: none;
}
.cc-view-more:hover, .cc-view-more:focus-visible { background: var(--d-accent-soft, rgba(79,70,229,.08)); outline: none; }
.cc-view-more .mud-icon-root { font-size: 16px; }

/* Pills */
.cc-pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg, #f1f5f9); color: var(--ink-2, #475569); white-space: nowrap; }
.cc-pill.now  { background: var(--d-accent, #4f46e5); color: #fff; }
.cc-pill.warn { background: var(--amber-soft, rgba(217,119,6,.12)); color: var(--amber, #b45309); }
.cc-pill.crit { background: rgba(220,38,38,.1); color: #dc2626; }
.cc-pill.info { background: rgba(37,99,235,.1); color: #2563eb; }
.cc-pill.ok   { background: var(--teal-soft, rgba(13,148,136,.1)); color: var(--teal, #0d9488); }
/* "Next →" on a workload row — jumps straight to the single most-urgent item instead of the
   general list/report link. Own colour (accent, not a status colour) and a hand cursor since,
   unlike the other pills, it's a real link, not just a status label. */
.cc-pill.next {
    margin-left: auto; background: var(--d-accent, #4f46e5); color: #fff; text-decoration: none;
    display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
}
.cc-pill.next:hover, .cc-pill.next:focus-visible { background: var(--d-accent-hover, #4338ca); outline: none; }
.cc-pill.next .mud-icon-root { font-size: 13px; }

/* Workload */
.cc-work { display: flex; flex-direction: column; gap: 14px; }
.cc-work-row { cursor: pointer; padding: 4px; border-radius: 10px; }
.cc-work-row:hover, .cc-work-row:focus-visible { background: var(--bg, #f1f5f9); outline: none; }
.cc-work-top { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 500; color: var(--ink, #0f172a); margin-bottom: 6px; }
.cc-work-top > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.cc-work-pct { font-variant-numeric: tabular-nums; color: var(--ink-2, #475569); font-size: 12.5px; }
.cc-work-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Trends */
.cc-trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cc-trend { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, rgba(11,16,32,.08)); cursor: pointer; }
.cc-trend:hover, .cc-trend:focus-visible { border-color: var(--d-accent, #4f46e5); outline: none; }
.cc-trend-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2, #475569); }
.cc-trend-val { font-size: 20px; font-weight: 700; color: var(--ink, #0f172a); margin: 4px 0; }
.cc-spark { width: 100%; height: 30px; }
.cc-spark.up { color: #059669; }
.cc-spark.down { color: #dc2626; }

/* Alerts */
.cc-alert-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #94a3b8); margin: 6px 0 4px; }
.cc-alerts, .cc-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cc-alert { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink, #0f172a); }
.cc-alert:hover, .cc-alert:focus-visible { background: var(--bg, #f1f5f9); outline: none; }
.cc-alert.crit { color: #dc2626; }
.cc-alert.warn .mud-icon-root { color: var(--amber, #d97706); }
.cc-alert.info .mud-icon-root { color: #2563eb; }
.cc-alert-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cc-alert-detail { font-size: 12px; color: var(--ink-2, #475569); }
.cc-alert-time { font-size: 11.5px; color: var(--muted, #94a3b8); white-space: nowrap; }

/* Activity */
.cc-activity a { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; text-decoration: none; color: var(--ink, #0f172a); font-size: 13.5px; }
.cc-activity a:hover, .cc-activity a:focus-visible { background: var(--bg, #f1f5f9); outline: none; }
.cc-act-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg, #f1f5f9); color: var(--ink-2, #475569); flex: none; }
.cc-act-body { display: flex; flex-direction: column; min-width: 0; }
.cc-act-time { font-size: 11.5px; color: var(--muted, #94a3b8); }
.cc-act-filter {
    border: none; background: transparent; color: var(--d-accent, #4f46e5);
    font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 3px 6px; border-radius: 6px;
}
.cc-act-filter:hover, .cc-act-filter:focus-visible { background: var(--d-accent-soft, rgba(79,70,229,.08)); outline: none; }

/* Skeletons */
.cc-skel { background: linear-gradient(90deg, var(--bg, #f1f5f9) 0%, rgba(148,163,184,.18) 50%, var(--bg, #f1f5f9) 100%); background-size: 200% 100%; animation: cc-shimmer 1.3s ease-in-out infinite; border-radius: 12px; }
.cc-skel-line { height: 16px; margin-top: 10px; }
.cc-skel-row  { height: 56px; }
.cc-skel-kpi  { height: 118px; }
.cc-skel-stat { height: 64px; }
.cc-skel-table { height: 220px; margin-top: 12px; }
.cc-attn-skel { display: flex; flex-direction: column; gap: 8px; }
.cc-widget-skel { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.cc-kpis-top-skel { margin-bottom: 8px; }
@keyframes cc-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .cc-skel { animation: none; } .cc-kpi, .cc-attn-item { transition: none; } }

/* Compact mode */
.cc-compact { gap: 12px; }
.cc-compact .cc-kpi { padding: 12px 14px 10px; }
.cc-compact .cc-kpi-val { font-size: 22px; margin: 4px 0 2px; }
.cc-compact .cc-card { padding: 12px 14px; }
.cc-compact .cc-attn-item { padding: 8px 12px; }

/* Pinned calendar (see .cc-kpis-top above) — full width, keeps the existing DashCalendar look */
.cc-calendar-top { min-width: 0; }

/* ── Detail dialog ─────────────────────────────────────────────────────── */
.cc-detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cc-detail-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--d-accent-soft, rgba(79,70,229,.1)); color: var(--d-accent, #4f46e5); }
.cc-detail-title { font-size: 18px; font-weight: 600; color: var(--ink, #0f172a); }
.cc-detail-value { margin-left: auto; font-size: 24px; font-weight: 700; color: var(--ink, #0f172a); font-variant-numeric: tabular-nums; }
.cc-detail-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.cc-detail-skel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cc-detail-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cc-stat { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, rgba(11,16,32,.08)); }
.cc-stat.warn { border-color: var(--amber, #d97706); }
.cc-stat.crit { border-color: #dc2626; }
.cc-stat.ok   { border-color: var(--teal, #0d9488); }
.cc-stat-label { font-size: 12px; color: var(--ink-2, #475569); }
.cc-stat-val { font-size: 18px; font-weight: 700; color: var(--ink, #0f172a); font-variant-numeric: tabular-nums; }
.cc-detail-chart { margin-bottom: 14px; }
.cc-detail-table { margin-top: 10px; }
.cc-detail-table-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.cc-detail-search { max-width: 240px; margin-left: auto; }
.cc-table-wrap { max-height: 50vh; overflow: auto; border: 1px solid var(--line, rgba(11,16,32,.08)); border-radius: 12px; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cc-table th { position: sticky; top: 0; background: var(--paper, #fff); text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-2, #475569); padding: 8px 10px; border-bottom: 1px solid var(--line, rgba(11,16,32,.08)); }
.cc-table td { padding: 7px 10px; border-bottom: 1px solid var(--line, rgba(11,16,32,.05)); color: var(--ink, #0f172a); }
.cc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cc-table tr.link { cursor: pointer; }
.cc-table tr.link:hover td { background: var(--bg, #f1f5f9); }
.cc-table tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--amber, #d97706); }
.cc-table tr.crit td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
@media (max-width: 600px) { .cc-detail-skel { grid-template-columns: repeat(2, 1fr); } .cc-detail-value { margin-left: 0; } }
