/*
 * rx-list.css
 * Existing list-widget presentation plus a reusable tabular RX list style.
 */

.rx-list-widget ul
{
    margin: 0;
    padding-left: 20px;
}


.rx-list-widget li
{
    margin: 5px 0;
}


.rx-list
{
    width: 100%;
    border-collapse: collapse;
    background: var(--rx-surface);
}

.rx-list th,
.rx-list td
{
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--rx-border);
    text-align: left;
    vertical-align: top;
}

.rx-list th
{
    font-weight: 650;
    background: var(--rx-surface-soft);
}

.rx-list tbody tr:hover
{
    background: var(--rx-primary-soft);
}

.rx-list-empty
{
    padding: 1rem;
    color: var(--rx-text-muted);
    font-style: italic;
}


/* A list widget can be added directly to rx_page and fills the work area. */
.rx-list-widget
{
    flex: 1 1 auto;
    min-height: 0;

    margin: var(--rx-gap);
    padding: 14px;

    overflow: auto;

    background: var(--rx-surface);
    border: 1px solid var(--rx-border);
    border-top: 3px solid var(--rx-primary);
    border-radius: var(--rx-radius);
    box-shadow: var(--rx-shadow);
}

.rx-list-action
{
    color: var(--rx-primary);
    font-weight: 650;
    text-decoration: none;
}

.rx-list-action:hover
{
    color: var(--rx-primary-hover);
    text-decoration: underline;
}

/* Paging controls for database-backed lists. */
.rx-list-pager
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
}

.rx-list-pager-info
{
    color: var(--rx-text-muted);
    font-size: 0.9rem;
}

.rx-list-pager-actions
{
    display: flex;
    gap: 0.5rem;
}

.rx-list-page-link
{
    display: inline-block;
    min-width: 5rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--rx-border);
    border-radius: 0.25rem;
    background: var(--rx-surface);
    color: var(--rx-primary);
    text-align: center;
    text-decoration: none;
}

.rx-list-page-link:hover
{
    background: var(--rx-surface-soft);
}

.rx-list-page-link.is-disabled
{
    cursor: default;
    opacity: 0.45;
}

/* Every data cell in a device row opens the edit page. */
.rx-list-row-cell
{
    display: block;
    color: inherit;
    text-decoration: none;
}

.rx-list-row-cell:focus
{
    outline: 2px solid var(--rx-primary);
    outline-offset: 2px;
}
