/**
 * CSV Sheet Filter — plugin stylesheet
 *
 * Loaded after framework.css and relies entirely on its design tokens
 * (--space-*, --color-*, --radius-*, etc.) rather than hard-coded values,
 * so re-skinning the framework re-skins this plugin too, automatically.
 * This file only adds the handful of rules the framework doesn't already
 * cover for this specific layout.
 */

.ckf-wrapper {
    max-width: 100%;
    margin-block: var(--space-5);
}

.ckf-wrapper .card-body {
    padding: var(--space-5);
}

/* When multiple sheets are configured, .ckf-wrapper renders as .tabs
   instead of .card — the tab-panel already carries the framework's own
   padding, so nothing extra is needed there. Anchor-based tab buttons
   (rather than the framework's default <button> assumption) need the
   underline that links normally get switched off explicitly. */
.ckf-wrapper.tabs .tab-button {
    text-decoration: none;
    cursor: pointer;
}

/* The "enter a keyword" prompt shown before any filter has been applied. */
.ckf-wrapper .alert.alert-info {
    margin-bottom: 0;
}

/* Modest branding footer at the bottom of each widget instance. */
.ckf-wrapper .ckf-footer {
    margin: var(--space-5) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    text-align: right;
    font-size: var(--fs-sm);
}

.ckf-wrapper .ckf-footer a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.ckf-wrapper .ckf-footer a:hover {
    color: var(--color-text);
    text-decoration: underline;
}

/* Keep the label/input/buttons on one line on wider screens, and let them
   wrap naturally on narrow ones instead of overflowing. */
.ckf-filter-form .input-group {
    flex-wrap: wrap;
}

.ckf-filter-form .input-group .form-control {
    flex: 1 1 200px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.ckf-filter-form .input-group .btn {
    border-radius: 0;
    flex: 0 0 auto;
}

.ckf-filter-form .input-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

@media (max-width: 575px) {
    .ckf-filter-form .input-group .form-control {
        border-radius: var(--radius-md);
        margin-bottom: var(--space-2);
    }

    .ckf-filter-form .input-group .btn {
        border-radius: var(--radius-md);
    }
}

/* Results table: keep it readable without letting long CSV cells blow out
   the layout, and make sure very wide sheets scroll instead of squeezing. */
.ckf-wrapper .table-responsive {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.ckf-wrapper .table {
    margin-bottom: 0;
}

.ckf-wrapper .table th,
.ckf-wrapper .table td {
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ckf-wrapper .table tbody tr:last-child td {
    border-bottom: none;
}

/* Status badge row above the table. */
.ckf-wrapper .badge {
    margin-bottom: var(--space-1);
}

/* Empty state gets a little less vertical padding here than the
   framework's default — this sits inside a card already, so the outer
   card padding plus the full empty-state padding was too much air. */
.ckf-wrapper .empty-state {
    padding: var(--space-6) var(--space-4);
    background-color: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
}
