/* Analytics → Time spent card (js/analytics-time-spent.js). Green = time, per the redesign's visual language. */

#timeSpentCard {
    --ats-green: #0F8A6A;
    --ats-green-soft: #E7F5F0;
}

#timeSpentCard .an-cardhead h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ats-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--ats-green-soft);
    color: var(--ats-green);
    font-size: 13px;
}

.ats-tracking {
    font-size: 11.5px;
    color: #9aa3b2;
    align-self: center;
}

.ats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.ats-tile {
    background: #f7f9fc;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    padding: 14px 16px;
}

.ats-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ats-green);
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.ats-unit {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7686;
}

.ats-label {
    margin-top: 6px;
    font-size: 11.5px;
    font-weight: 500;
    color: #6b7686;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ats-foot {
    margin-top: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 18px;
}

.ats-note {
    font-size: 11px;
    color: #9aa3b2;
}

.ats-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ats-pill--up { background: #e3f4ea; color: #16794a; }
.ats-pill--down { background: #fde8e8; color: #c53030; }
.ats-pill--flat,
.ats-pill--new { background: #eef1f5; color: #6b7686; }

/* Total time tile */
.ats-tile--wide {
    margin-bottom: 12px;
}

.ats-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 9px;
}

.ats-switch-btn {
    width: auto;
    padding: 4px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #4b5565;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ats-switch-btn:hover { background: #f1f4f8; }

.ats-switch-btn.is-on {
    background: #1F5FD6;
    color: #fff;
}

.ats-total-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 2fr;
    gap: 20px;
    align-items: center;
}

.ats-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e9edf3;
}

.ats-bar-seg { height: 100%; }
.ats-bar-seg.is-dim { opacity: 0.3; }

.ats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 8px;
    font-size: 11.5px;
    color: #4b5565;
}

.ats-legend-item i {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 2px;
}

.ats-insight {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f4f6fa;
    font-size: 12.5px;
    color: #374151;
}

.ats-empty {
    margin: 6px 0 2px;
    font-size: 13px;
    color: #6b7686;
}

.ats-error { color: #c53030; }

@media (max-width: 1100px) {
    .ats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ats-total-row { grid-template-columns: 1fr; }
}
