/* CGOTickets Data Hub — table-first admin system
 *
 * This stylesheet is intentionally limited to Django/Unfold changelists and
 * admin table containers. Change forms keep their native form layout.
 */

/* Keep wide operational tables usable without forcing the whole page wider. */
#changelist-form .results,
#changelist .results,
.cgo-admin-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: stable;
}

/* Dense, scan-friendly result tables. */
#result_list {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    width: max-content;
}

#result_list thead th {
    background: var(--body-bg);
    position: sticky;
    top: 0;
    z-index: 4;
    white-space: nowrap;
}

#result_list thead th,
#result_list tbody th,
#result_list tbody td {
    padding-top: 8px;
    padding-bottom: 8px;
    vertical-align: middle;
}

#result_list tbody th,
#result_list tbody td {
    line-height: 1.3;
}

/* Horizontal reading aids for long operations lists. */
#result_list tbody tr:nth-child(even) {
    background-color: color-mix(in srgb, var(--body-fg) 2%, transparent);
}

#result_list tbody tr:hover {
    background-color: color-mix(in srgb, var(--primary) 7%, transparent);
}

/* Boolean/state columns are more useful when they remain compact. */
#result_list [class*="field-status"],
#result_list [class*="field-health"],
#result_list [class*="field-severity"],
#result_list [class*="field-enabled"],
#result_list [class*="field-active"],
#result_list [class*="field-dry_run"] {
    white-space: nowrap;
}

/* IDs, timestamps and counts should not wrap into unreadable stacks. */
#result_list [class*="field-created_at"],
#result_list [class*="field-updated_at"],
#result_list [class*="field-started_at"],
#result_list [class*="field-completed_at"],
#result_list [class*="field-last_"],
#result_list [class*="field-count"],
#result_list [class*="field-total"],
#result_list [class*="field-processed"],
#result_list [class*="field-failed"] {
    white-space: nowrap;
}

/* Keep titles/summaries readable instead of stretching the table indefinitely. */
#result_list [class*="field-summary"],
#result_list [class*="field-title"],
#result_list [class*="field-name"] {
    max-width: 36rem;
}

/* Filters and result controls stay visually secondary to the data table. */
#changelist .paginator,
#changelist-form .actions {
    font-size: 0.875rem;
}

/* Preserve usable tables on narrow screens. */
@media (max-width: 900px) {
    #result_list thead th,
    #result_list tbody th,
    #result_list tbody td {
        padding-left: 8px;
        padding-right: 8px;
    }
}
