/* ============================================================================
 * toolbox-v2.css
 * Page-specific styles for the Team Toolbox (toolbox.html + js/toolbox-page.js).
 * The shared cd-*/cp-* components (modals, badges, buttons, tabs, toasts,
 * forms) come from css/clients-v2.css; only toolbox-unique pieces live here:
 * the storage-usage bar, tool rows, and the activity log rows.
 * ========================================================================== */

/* ── Storage usage bar ───────────────────────────────────────────────────── */
.tb-usage {
    padding: 12px 14px;
    margin-bottom: 14px;
}
.tb-usage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.tb-usage-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--v2-muted, #a8b1bd);
}
.tb-usage-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--v2-text, #f5f7fa);
}
.tb-usage-track {
    height: 8px;
    border-radius: 999px;
    background: var(--v2-surface-soft, rgba(31, 36, 43, 0.9));
    border: 1px solid var(--v2-border, rgba(176, 184, 194, 0.16));
    overflow: hidden;
}
.tb-usage-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--v2-accent, #6366f1);
    transition: width 0.3s ease;
}
.tb-usage-fill.is-warn { background: var(--v2-warning, #f59e0b); }
.tb-usage-fill.is-full { background: var(--v2-danger, #ef4444); }

/* ── Tool rows ───────────────────────────────────────────────────────────── */
.tb-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tb-tool {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.tb-tool-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}
.tb-tool-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}
.tb-tool-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--v2-text, #f5f7fa);
}
.tb-tool-desc { max-width: 70ch; }
.tb-tool-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.tb-checksum {
    font-family: ui-monospace, monospace;
    font-size: 0.7rem;
    cursor: pointer;
    border-bottom: 1px dashed color-mix(in srgb, var(--v2-muted, #a8b1bd) 55%, transparent);
}
.tb-checksum:hover { color: var(--v2-accent, #6366f1); }

/* two side-by-side fields in the tool modal (version / category) */
.tb-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Stored file being replaced when editing a file tool (see setFileGroupMode). */
.tb-file-current {
    display: block;
    margin-bottom: 6px;
    padding: 6px 8px;
    background: var(--v2-surface-soft, rgba(31, 36, 43, 0.9));
    border: 1px solid var(--v2-border, rgba(176, 184, 194, 0.16));
    border-radius: 8px;
    word-break: break-all;
}
.tb-file-current.hidden { display: none; }

/* ── Activity log rows ───────────────────────────────────────────────────── */
.tb-activity-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--v2-surface-soft, rgba(31, 36, 43, 0.9));
    border: 1px solid var(--v2-border, rgba(176, 184, 194, 0.16));
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--v2-text, #f5f7fa);
}
.tb-activity-icon { flex-shrink: 0; }
.tb-activity-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}
.tb-activity-time {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .tb-tool { flex-wrap: wrap; }
    .tb-tool-actions { width: 100%; justify-content: stretch; }
    .tb-tool-actions > * { flex: 1 1 auto; }
    .tb-two-col { grid-template-columns: 1fr; }
    .tb-activity-row { flex-wrap: wrap; }
    .tb-activity-time { width: 100%; text-align: right; }
}
