/* ═══════════════════════════════════════════════════════════
   Feedback — extracted from TNonline (app.css / FilterBar)
   Spinner, loading container, empty state, and the filter bar
   layout wrapper.
   ═══════════════════════════════════════════════════════════ */

/* ── Spinner ── */
@keyframes tn-spin {
    to { transform: rotate(360deg); }
}

.tn-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--tn-border);
    border-top-color: var(--tn-accent);
    border-radius: 50%;
    animation: tn-spin 0.6s linear infinite;
}

.tn-spinner--sm {
    width: 1rem;
    height: 1rem;
}

/* ── Loading container ── */
.tn-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--tn-space-md);
    min-height: 300px;
    color: var(--tn-text-secondary);
    font-size: var(--tn-font-size-sm);
}

.tn-loading p {
    margin: 0;
}

/* ── Empty state ──
   The "this section has nothing to show" slot — same position a table or
   list would otherwise fill. Two flavours share this one component:

     <div class="tn-empty">                       (nothing to show — neutral)
       <i class="bi bi-inbox"></i>
       <p>No bookings match your filters.</p>
     </div>

     <div class="tn-empty tn-empty--error">        (failed to load — not the
       <i class="bi bi-exclamation-triangle"></i>   same as empty, and must
       <p class="tn-empty-title">Couldn't load</p>  never be silently shown
       <p>A network error occurred.</p>              as if it were)
       <button class="tn-btn tn-btn--secondary tn-empty-action">
         <i class="bi bi-arrow-clockwise"></i> Retry
       </button>
     </div>

   .tn-empty-title is optional — add it when the state needs a heading above
   the body text (typically the --error tone, where "what happened" and
   "why" are two different things worth separating). .tn-empty-action wraps
   a .tn-btn to add the top margin without the button needing to know it's
   inside an empty state. Bare icon+<p> (no title, no action) — the
   original, simplest shape — still works unchanged. ── */
.tn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--tn-space-sm);
    padding: var(--tn-space-xl) var(--tn-space-md);
    color: var(--tn-text-muted);
    text-align: center;
}

.tn-empty .bi {
    font-size: 2rem;
    opacity: 0.5;
}

.tn-empty p {
    margin: 0;
    font-size: var(--tn-font-size-sm);
}

.tn-empty-title {
    margin: 0;
    font-size: var(--tn-font-size-lg);
    font-weight: 600;
    color: var(--tn-text-primary);
}

.tn-empty-action {
    margin-top: var(--tn-space-xs);
}

/* Error tone — a query failed; this is NOT the same state as "empty" and
   must never render silently in its place. That silent collapse is exactly
   the bug ColibriAuth #294/#295 fixed: a failed query was indistinguishable
   from an empty account across seven portal pages, and on four of them a
   transient DB error showed a CompanyAdmin "you're not an admin" with no
   log. --error exists so the two states can never be conflated again. */
.tn-empty--error .bi {
    color: var(--tn-danger);
    opacity: 0.85;
}

/* ── Filter bar ── */
.tn-filter-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--tn-space-md);
    padding: var(--tn-space-md) var(--tn-space-lg);
    margin-bottom: var(--tn-space-lg);
    background: var(--tn-bg-card);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-lg);
    flex-wrap: wrap;
}

.tn-filter-bar-fields {
    display: flex;
    align-items: flex-end;
    gap: var(--tn-space-md);
    flex-wrap: wrap;
}

.tn-filter-bar-extra {
    display: flex;
    align-items: flex-end;
    gap: var(--tn-space-sm);
}

@media (max-width: 768px) {
    .tn-filter-bar,
    .tn-filter-bar-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .tn-filter-bar-extra {
        width: 100%;
    }
}

/* ── Page header (title + subtitle) ── */
.tn-page-header {
    margin-bottom: var(--tn-space-lg);
}

.tn-page-title {
    /* fluid: scales between 2xl and 3xl with viewport width */
    font-size: clamp(var(--tn-font-size-2xl), 1.2rem + 1vw, var(--tn-font-size-3xl));
    font-weight: 700;
    color: var(--tn-text-primary);
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.02em;
}

.tn-page-subtitle {
    margin: 4px 0 0;
    font-size: var(--tn-font-size-sm);
    color: var(--tn-text-secondary);
}
