/* Tahona WMS - Dashboard Styles */

/* Wizard Cards Grid */
.wizard-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-6);
    transition: all 150ms ease;
    position: relative;
}

.wizard-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px color-mix(in oklab, var(--accent) 22%, transparent);
}

.wizard-card.completed {
    border-color: var(--pastel-green);
    background: color-mix(in oklab, var(--good) 6%, transparent);
}

.wizard-card.hidden-card {
    opacity: 0.5;
}

.wizard-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-4);
}

.wizard-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    font-size: 24px;
    flex-shrink: 0;
}

.wizard-card.completed .wizard-icon {
    background: color-mix(in oklab, var(--good) 12%, transparent);
}

.wizard-info {
    flex: 1;
}

.wizard-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-1);
}

.wizard-status {
    font-size: 12px;
    color: var(--text-secondary);
}

.wizard-menu-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 150ms ease;
}

.wizard-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-fg);
}

.wizard-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-4);
    line-height: 1.5;
}

.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-3);
}

.wizard-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Hidden Section */
.hidden-section {
    margin-top: var(--spacing-6);
    padding-top: var(--spacing-6);
    border-top: 1px solid var(--border-primary);
}

.hidden-toggle {
    background: none;
    border: none;
    color: var(--accent-fg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
}

.hidden-toggle:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Activity Items */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.activity-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    transition: all 150ms ease;
}

.activity-item:hover {
    background: var(--bg-hover);
}

.activity-text {
    color: var(--text-secondary);
}

.activity-time {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-3);
}

/* Responsive */
@media (max-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Plain link-styled button — SetupCards' "Show setup tasks" reveal when every card is hidden.
   Found undefined (no visual styling at all) while adding SetupCards.razor to
   ShellClassesDefinedTests's scan; this component's classes were never linted before. */
.link { background: none; border: none; padding: 0; color: var(--accent-fg); font-size: 13px; font-weight: 700; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* Setup Cards — dismissible per-module card grid, collapsed by default behind .setup-strip. */
.setup-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--spacing-4); padding: 0 var(--spacing-4) var(--spacing-4); }
.setup-card { position: relative; display: flex; flex-direction: column; gap: var(--spacing-3); }
.setup-card-pinned { border-color: var(--accent); }
.setup-card-dismiss { position: absolute; top: var(--spacing-3); right: var(--spacing-3); background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; line-height: 1; }
.setup-card-comingsoon { color: var(--text-muted); font-size: 13px; }

/* Setup strip — the single slim disclosure row that replaced the "Get set up" heading + grid.
   Collapsed is the default: a full grid open on every visit was what pushed the widgets below
   the fold. Full-width shell chrome, so it lives beside the setup cards it discloses. */
.setup-strip { margin-top: var(--spacing-6); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.setup-strip-toggle { display: flex; align-items: center; gap: var(--spacing-2); width: 100%; padding: var(--spacing-3) var(--spacing-4); background: none; border: none; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 700; text-align: left; }
.setup-strip-toggle:hover { background: var(--surface-2); }
.setup-strip-toggle[aria-expanded="true"] { border-bottom: 1px solid var(--border); }
.setup-strip-label { flex: 1; }
.setup-strip-chevron { color: var(--text-3); transition: transform 150ms ease; flex: 0 0 auto; }
.setup-strip-chevron-collapsed { transform: rotate(-90deg); }

/* Orders list — the sentence under the Shopify column's badge (what happened, in full).
   Quieter than the row's own text, but never so quiet it can't be read: when a push-back
   fails this sentence is the only instruction the operator gets. Capped and wrapping so a
   long channel error widens the column instead of pushing the table sideways. */
.channel-detail {
    margin-top: var(--spacing-1);
    max-width: 320px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
}

/* ---- Dashboard v2 (Phase 2) ------------------------------------------------ */

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--spacing-4); margin-bottom: var(--spacing-4); flex-wrap: wrap; }
.dash-head-actions { display: flex; align-items: center; gap: var(--spacing-2); }
.dash-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.dash-span-1 { grid-column: span 1; }
.dash-span-2 { grid-column: span 2; }
.dash-span-3 { grid-column: span 3; }
.dash-span-5 { grid-column: span 5; }
.dash-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--spacing-3); }
.dash-card-t { font-size: 14px; font-weight: 800; color: var(--text); }
.dash-card-s { font-size: 12px; color: var(--text-3); }
.dash-card-s a { color: var(--accent-fg); }
.dash-sub-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--spacing-3); margin-top: var(--spacing-2); padding-top: var(--spacing-3); border-top: 1px solid var(--border); }
.dash-hero { justify-content: space-between; }
.dash-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--spacing-3); }
.dash-hero-n { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dash-stat-n { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash-delta { font-size: 12px; font-weight: 700; }
.dash-spark { color: var(--accent-fg); flex: 0 0 auto; }
.dash-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.dash-mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-left: 6px; }
.dash-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-2); }
.dash-empty { font-size: 13px; color: var(--text-3); padding: var(--spacing-3) 0; }
.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-4); }

.tone-good { color: var(--good); }
.tone-warn { color: var(--warn); }
.tone-serious { color: var(--serious); }
.tone-crit { color: var(--crit); }
.tone-info { color: var(--info); }
.dash-pill.tone-crit { background: color-mix(in oklab, var(--crit) 16%, transparent); }

.dash-funnel { display: flex; height: 14px; border-radius: var(--radius-full); overflow: hidden; background: var(--surface-2); }
.dash-funnel-seg { flex: 0 0 auto; min-width: 2px; }
.dash-seg-1 { background: color-mix(in oklab, var(--accent) 18%, var(--surface-2)); }
.dash-seg-2 { background: color-mix(in oklab, var(--accent) 32%, var(--surface-2)); }
.dash-seg-3 { background: color-mix(in oklab, var(--accent) 48%, var(--surface-2)); }
.dash-seg-4 { background: color-mix(in oklab, var(--accent) 64%, var(--surface-2)); }
.dash-seg-5 { background: color-mix(in oklab, var(--accent) 82%, var(--surface-2)); }
.dash-seg-6 { background: var(--accent); }
.dash-legend { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; font-size: 12px; color: var(--text-2); }
.dash-legend-i { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dash-legend-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.dash-legend-i .dash-num { margin-left: auto; color: var(--text); }

.dash-bar { display: grid; grid-template-columns: 110px 1fr 56px; align-items: center; gap: 10px; font-size: 12px; }
.dash-bar-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-track { height: 8px; border-radius: var(--radius-full); background: var(--surface-2); overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-full); }
/* An operator bar names a person, so the label reads at full strength, not the muted bar tone. */
.dash-bar.dash-op .dash-bar-label { color: var(--text); }

.dash-q-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.dash-q-row:first-of-type { border-top: 0; }
.dash-q-ico { display: inline-flex; }
.dash-q-body { display: flex; flex-direction: column; min-width: 0; }
.dash-q-t { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Two lines, not one: the shortfall row names a product, its SKU and "N on hand, M needed", and
   a single clipped line lost the counts — the part a manager acts on. The full sentence is on
   the title attribute as well. */
.dash-q-m { font-size: 12px; color: var(--text-3); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.dash-q-a { font-size: 12px; font-weight: 700; color: var(--accent-fg); text-decoration: none; padding: 4px 10px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); }
.dash-q-a:hover { background: var(--accent-soft); }

.dash-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-tbl th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.dash-tbl td { padding: 8px; border-bottom: 1px solid var(--border); }
/* A numeric heading follows its numbers: .dash-tbl th is more specific than .dash-num. */
.dash-tbl th.dash-num { text-align: right; }
.dash-tbl tbody tr { cursor: pointer; }
.dash-tbl tbody tr:hover { background: var(--surface-2); }
.dash-tbl tr.dash-row-sel { background: var(--accent-soft); }
.dash-tbl tr.dash-row-sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.dash-skel { min-height: 120px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: dash-shimmer 1.2s infinite; }
@keyframes dash-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-span-1, .dash-span-2, .dash-span-3, .dash-span-5 { grid-column: span 2; }
    .dash-hero-n { font-size: 40px; }
}
@media (max-width: 640px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-span-1, .dash-span-2, .dash-span-3, .dash-span-5 { grid-column: span 1; }
    .dash-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-two { grid-template-columns: 1fr; }
    .dash-bar { grid-template-columns: 80px 1fr 56px; }
}
