/* ============================================================
   TomatoFarm UI · Shared Tokens + Components
   Loaded via <link href="_content/TomatoFarm.Ui.Shared/tomato-ui.css">
   from the consuming app's index.html (after MudBlazor if used).
   ============================================================ */

:root {
    /* ---- Color tokens ---- */
    --tf-bg:          #0a0d14;
    --tf-bg-soft:     #11151f;
    --tf-card:        #161b27;
    --tf-border:      #1f2433;

    --tf-text:        #d8dde8;
    --tf-text-soft:   #8892a8;
    --tf-text-muted:  #4a5068;

    --tf-tomato:      #ff6b4a;
    --tf-leaf:        #5db075;
    --tf-sky:         #5fa8d3;
    --tf-warn:        #f5b945;
    --tf-error:       #ef5350;
    --tf-purple:      #a78bfa;

    /* ---- Font tokens ---- */
    --tf-mono:        'JetBrains Mono', ui-monospace, monospace;
    --tf-sans:        'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   SectionHeader — brand stripe with border-left + gradient
   ============================================================ */
.tfs-section-header {
    font-family: var(--tf-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e2e8f0;
    padding: 8px 12px;
    margin: 24px 0 14px;
    border-left: 3px solid #4a5068;
    background: #12141c;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tfs-section-header-icon { font-size: 16px; display: inline-flex; align-items: center; }

.tfs-section-header-tomato { border-left-color: var(--tf-tomato); color: #fed7aa; }
.tfs-section-header-leaf   { border-left-color: var(--tf-leaf);   color: #86efac; }
.tfs-section-header-sky    { border-left-color: var(--tf-sky);    color: #67e8f9; }
.tfs-section-header-warn   { border-left-color: var(--tf-warn);   color: #fde68a; }
.tfs-section-header-purple { border-left-color: var(--tf-purple); color: #c4b5fd; }

/* ============================================================
   StatusBadge — mono uppercase pill
   ============================================================ */
.tfs-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-family: var(--tf-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 1px solid;
    line-height: 1;
}
.tfs-status-badge-good     { color: var(--tf-leaf);  background: rgba(93,176,117,.12); border-color: rgba(93,176,117,.5); }
.tfs-status-badge-watch    { color: var(--tf-warn);  background: rgba(245,185,69,.12); border-color: rgba(245,185,69,.5); }
.tfs-status-badge-thirsty  { color: var(--tf-sky);   background: rgba(95,168,211,.12); border-color: rgba(95,168,211,.5); }
.tfs-status-badge-stressed { color: var(--tf-error); background: rgba(239,83,80,.12);  border-color: rgba(239,83,80,.5);  }
.tfs-status-badge-unknown,
.tfs-status-badge-info     { color: var(--tf-text-muted); background: rgba(74,80,104,.18); border-color: rgba(74,80,104,.5); }
.tfs-status-badge-online   { color: var(--tf-leaf);  background: rgba(93,176,117,.12); border-color: rgba(93,176,117,.5); }
.tfs-status-badge-offline  { color: var(--tf-error); background: rgba(239,83,80,.12);  border-color: rgba(239,83,80,.5);  }
.tfs-status-badge-stale    { color: var(--tf-warn);  background: rgba(245,185,69,.12); border-color: rgba(245,185,69,.5); }
.tfs-status-badge-warn     { color: var(--tf-warn);  background: rgba(245,185,69,.12); border-color: rgba(245,185,69,.5); }
.tfs-status-badge-error    { color: var(--tf-error); background: rgba(239,83,80,.12);  border-color: rgba(239,83,80,.5);  }

/* ============================================================
   MetricChip
   ============================================================ */
.tfs-chip {
    background: var(--tf-card);
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    min-height: 88px;
}
.tfs-chip-label {
    font-family: var(--tf-mono);
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--tf-text-muted);
}
.tfs-chip-value-row { display: flex; align-items: baseline; gap: 6px; }
.tfs-chip-value {
    font-family: var(--tf-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--tf-text);
    line-height: 1.05;
}
.tfs-chip-unit { font-family: var(--tf-mono); font-size: 13px; color: var(--tf-text-soft); }

.tfs-chip-stale { opacity: 0.55; }
.tfs-chip-stale .tfs-chip-value { color: var(--tf-text-soft); }
.tfs-chip-stale-pill {
    position: absolute; top: 10px; right: 10px;
    background: rgba(245, 185, 69, 0.18); color: var(--tf-warn);
    border: 1px solid rgba(245, 185, 69, 0.45);
    font-family: var(--tf-mono); font-size: 9px; letter-spacing: 0.8px;
    text-transform: uppercase; padding: 2px 6px; border-radius: 999px;
}

/* ============================================================
   TeaserTile
   ============================================================ */
.tfs-tile {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 18px 18px 16px;
    background: var(--tf-card);
    border: 1px solid var(--tf-border);
    border-left: 3px solid var(--tf-text-muted);
    border-radius: 8px;
    text-decoration: none !important; color: inherit;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.tfs-tile:hover {
    transform: translateY(-2px);
    border-color: #2c3142;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.tfs-tile-icon { font-size: 28px; line-height: 1; }
.tfs-tile-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tfs-tile-title { font-size: 15px; font-weight: 700; color: var(--tf-text); }
.tfs-tile-subtitle { font-size: 13px; color: var(--tf-text-soft); line-height: 1.4; }
.tfs-tile-arrow {
    font-family: var(--tf-mono); color: var(--tf-text-muted); font-size: 18px;
    transition: transform 160ms ease, color 160ms ease;
}
.tfs-tile:hover .tfs-tile-arrow { transform: translateX(3px); color: var(--tf-text); }

.tfs-tile-accent-tomato { border-left-color: var(--tf-tomato); }
.tfs-tile-accent-leaf   { border-left-color: var(--tf-leaf); }
.tfs-tile-accent-sky    { border-left-color: var(--tf-sky); }
.tfs-tile-accent-warn   { border-left-color: var(--tf-warn); }
.tfs-tile-accent-purple { border-left-color: var(--tf-purple); }

/* ============================================================
   PlantCardShell — slots for narrator / metrics / actions
   ============================================================ */
.tfs-pc {
    display: flex; flex-direction: column;
    background: var(--tf-card);
    border: 1px solid var(--tf-border);
    border-left: 3px solid var(--tf-text-muted);
    border-radius: 8px; overflow: hidden;
    text-decoration: none !important; color: inherit;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    position: relative;
}
.tfs-pc:hover {
    transform: translateY(-2px);
    border-color: #2c3142;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tfs-pc.tfs-pc-status-good     { border-left-color: var(--tf-leaf); }
.tfs-pc.tfs-pc-status-watch    { border-left-color: var(--tf-warn); }
.tfs-pc.tfs-pc-status-thirsty  { border-left-color: var(--tf-sky); }
.tfs-pc.tfs-pc-status-stressed { border-left-color: var(--tf-error); }
.tfs-pc.tfs-pc-status-unknown  { border-left-color: var(--tf-text-muted); }

.tfs-pc-photo {
    aspect-ratio: 1 / 1;
    background: #0a0d14;
    position: relative;
    overflow: hidden;
}
.tfs-pc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tfs-pc-photo-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 64px; opacity: 0.45;
}
.tfs-pc-hint {
    position: absolute; bottom: 10px; right: 10px;
    font-family: var(--tf-mono); font-size: 10px; letter-spacing: 1.2px;
    color: var(--tf-text);
    background: rgba(10, 13, 20, 0.78);
    padding: 4px 8px; border-radius: 4px;
    backdrop-filter: blur(4px);
    opacity: 0; transform: translateY(2px);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
}
.tfs-pc:hover .tfs-pc-hint { opacity: 1; transform: translateY(0); }

.tfs-pc-body {
    padding: 16px 18px 18px;
    display: flex; flex-direction: column; gap: 10px;
}
.tfs-pc-header { display: flex; align-items: center; gap: 10px; }
.tfs-pc-pos {
    font-family: var(--tf-mono); font-weight: 700; font-size: 13px;
    padding: 3px 8px; border-radius: 4px; border: 1px solid; line-height: 1;
}
.tfs-pc-name {
    font-size: 15px; font-weight: 700; color: var(--tf-text);
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tfs-pc-pill {
    font-family: var(--tf-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 3px 8px; border-radius: 999px; border: 1px solid;
}

.tfs-pc-status-text-good {
    color: var(--tf-leaf);  background: rgba(93,176,117,.12); border-color: rgba(93,176,117,.5);
}
.tfs-pc-status-text-watch {
    color: var(--tf-warn);  background: rgba(245,185,69,.12); border-color: rgba(245,185,69,.5);
}
.tfs-pc-status-text-thirsty {
    color: var(--tf-sky);   background: rgba(95,168,211,.12); border-color: rgba(95,168,211,.5);
}
.tfs-pc-status-text-stressed {
    color: var(--tf-error); background: rgba(239,83,80,.12);  border-color: rgba(239,83,80,.5);
}
.tfs-pc-status-text-unknown {
    color: var(--tf-text-muted); background: rgba(74,80,104,.18); border-color: rgba(74,80,104,.5);
}

.tfs-pc-subline {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
    font-size: 12px; color: var(--tf-text-soft); margin-top: -4px;
}
.tfs-pc-archetype-emoji { font-size: 14px; }
.tfs-pc-archetype-text  { color: var(--tf-text); font-weight: 600; }
.tfs-pc-mood {
    color: var(--tf-text-muted);
    font-family: var(--tf-mono);
    font-size: 11px;
    letter-spacing: 0.3px;
}
/* Pre-sprout identity placeholder — quiet, mono, no colour energy.
   A plant with no persona yet should read as "system waiting", not
   as a styled persona line. */
.tfs-pc-pending-label {
    color: var(--tf-text-muted);
    font-family: var(--tf-mono);
    font-size: 11px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.tfs-pc-narrator-wrap p {
    margin: 0; font-size: 14px; line-height: 1.55; color: var(--tf-text);
}
.tfs-pc-narrator-wrap .tfs-narrator-dim {
    color: var(--tf-text-muted); font-style: italic;
}
.tfs-pc-metrics {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.tfs-pc-footer {
    display: flex; gap: 6px; align-items: baseline;
    font-family: var(--tf-mono); font-size: 11px;
    color: var(--tf-text-muted);
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.tfs-pc-actions {
    display: flex; gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
