/* ── Page header ───────────────────────────────────────────── */
.rec-page-header {
    background: linear-gradient(135deg, var(--arch-blue) 0%, var(--arch-blue-mid) 100%);
    border-radius: 14px;
    padding: 20px 26px;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 4px 20px rgba(30,111,217,0.22);
}
.rec-header-left {
    display: flex; align-items: center; gap: 16px;
}
.rec-header-icon {
    font-size: 2rem;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 10px 14px;
    line-height: 1;
    flex-shrink: 0;
}
.rec-page-header h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.rec-page-header p  { margin: 3px 0 0; opacity: 0.8; font-size: 0.85rem; }
.rec-header-right { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-stat-pill {
    background: rgba(255,255,255,0.18);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
}

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.filter-tabs { display: flex; gap: 4px; }
.ftab {
    background: none; border: none;
    padding: 7px 15px; border-radius: 8px;
    font-size: 0.86rem; font-weight: 600;
    color: #64748b; cursor: pointer;
    transition: background 0.18s, color 0.18s;
    display: flex; align-items: center; gap: 5px;
}
.ftab:hover  { background: #f1f5f9; color: var(--arch-blue); }
.ftab.active { background: var(--arch-blue-mid); color: #fff; }

.filter-search {
    display: flex; align-items: center; gap: 8px;
    background: #f8fafd; border: 2px solid #e2e8f0;
    border-radius: 9px; padding: 6px 12px;
    flex: 1; min-width: 180px; max-width: 320px;
    transition: border-color 0.18s;
}
.filter-search:focus-within { border-color: var(--arch-blue-mid); }
.filter-search i { color: #94a3b8; font-size: 0.88rem; flex-shrink: 0; }
.filter-search input {
    border: none; background: none; outline: none;
    font-size: 0.88rem; width: 100%; color: #1e293b;
}

/* ── Call card ──────────────────────────────────────────────── */
.call-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.07);
    margin-bottom: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.18s;
    border-left: 5px solid transparent;
}
.call-card:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,0.11);
    transform: translateY(-2px);
}

/* Type colours */
.call-card.type-incoming         { border-left-color: var(--arch-blue-mid); }
.call-card.type-inbound_assistance { border-left-color: var(--arch-blue); }
.call-card.type-robotard         { border-left-color: #f59e0b; }
.call-card.type-depollubot       { border-left-color: #16a34a; }
.call-card.type-outgoing         { border-left-color: #8b5cf6; }

/* Card main row */
.card-main {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    padding: 14px 18px;
    gap: 16px;
    cursor: pointer;
}
@media (max-width: 600px) {
    .card-main { grid-template-columns: 70px 1fr; }
    .card-actions { grid-column: span 2; justify-content: flex-end; }
}

/* Time column */
.card-time {
    text-align: center;
    flex-shrink: 0;
}
.card-time .time-big {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--arch-blue);
    line-height: 1;
}
.card-time .time-date {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 3px;
}

/* Info column */
.card-info { min-width: 0; }
.card-top  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }

.assistance-name {
    font-size: 0.78rem; font-weight: 600; color: #6366f1;
    background: #eef2ff; border-radius: 4px; padding: 1px 7px;
    white-space: nowrap;
}
.phone-number {
    font-weight: 700; font-size: 1rem; color: #1e293b;
    white-space: nowrap;
}
.call-type-badge {
    font-size: 0.72rem; font-weight: 700;
    padding: 2px 9px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: 0.3px;
    white-space: nowrap;
}
.badge-incoming, .badge-inbound_assistance { background: #dbeafe; color: #1d4ed8; }
.badge-robotard   { background: #fef9c3; color: #854d0e; }
.badge-depollubot { background: #dcfce7; color: #166534; }
.badge-outgoing   { background: #ede9fe; color: #6d28d9; }
.badge-default    { background: #f1f5f9; color: #475569; }

.card-meta {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 0.8rem; color: #64748b;
}
.meta-item { display: flex; align-items: center; gap: 4px; }
.meta-item i { font-size: 0.78rem; }

.status-chip {
    font-size: 0.72rem; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
}
.status-chip.ok       { background: #dcfce7; color: #166534; }
.status-chip.warn     { background: #fef9c3; color: #854d0e; }
.status-chip.err      { background: #fee2e2; color: #991b1b; }
.status-chip.neutral  { background: #f1f5f9; color: #475569; }

.card-summary {
    font-size: 0.82rem; color: #64748b;
    margin-top: 5px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* Actions column */
.card-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

.btn-icon {
    width: 36px; height: 36px; border-radius: 10px;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background 0.16s, transform 0.14s;
}
.btn-icon:hover { transform: scale(1.08); }

.btn-play {
    background: linear-gradient(135deg, var(--arch-blue), var(--arch-blue-mid));
    color: #fff;
}
.btn-play:hover  { opacity: 0.88; }
.btn-play:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.btn-expand { background: #f1f5f9; color: #475569; }
.btn-expand:hover { background: #e2e8f0; }
.btn-expand.open  { background: var(--arch-blue-mid); color: #fff; }

/* ── Transcript panel ───────────────────────────────────────── */
.transcript-panel {
    display: none;
    border-top: 1px solid #e8edf4;
    padding: 16px 20px 18px;
    background: #fafbfd;
    animation: slideDown 0.22s ease;
}
.transcript-panel.open { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.transcript-title {
    font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: #94a3b8; margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}

.conversation { display: flex; flex-direction: column; gap: 8px; }

.msg {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.45;
}
.msg.agent {
    background: linear-gradient(135deg, var(--arch-blue), var(--arch-blue-mid));
    color: #fff;
    border-radius: 12px 12px 12px 3px;
    align-self: flex-start;
}
.msg.user {
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 12px 12px 3px 12px;
    align-self: flex-end;
}
.msg.system-text {
    background: #fef9c3;
    color: #78350f;
    align-self: center;
    border-radius: 8px;
    font-size: 0.78rem;
    max-width: 90%;
}

.extra-info {
    display: flex; gap: 20px; flex-wrap: wrap;
    padding: 12px 0 0;
    border-top: 1px solid #e8edf4;
    margin-top: 14px;
    font-size: 0.8rem; color: #64748b;
}
.extra-item { display: flex; align-items: flex-start; gap: 5px; }
.extra-item strong { color: #334155; }
.events-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.event-tag {
    display: inline-flex; align-items: center; gap: 3px;
    background: #eff6ff; border: 1px solid #bfdbfe;
    color: #1e40af; border-radius: 4px;
    padding: 1px 7px; font-size: 0.75rem;
}
.event-tag em { color: #64748b; font-style: normal; }

/* ── Loading / empty states ─────────────────────────────────── */
.loading-state {
    text-align: center; padding: 52px 16px;
    color: #94a3b8;
}
.loading-state p { margin-top: 12px; font-size: 0.9rem; }

.empty-state {
    text-align: center; padding: 52px 16px;
    color: #94a3b8;
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 0.92rem; margin: 0; }

/* ── Load more ──────────────────────────────────────────────── */
.load-more-wrap { text-align: center; padding: 8px 0 32px; }
.btn-load-more {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 11px 28px;
    font-size: 0.9rem; font-weight: 600;
    color: var(--arch-blue); cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.14s;
    display: inline-flex; align-items: center; gap: 7px;
}
.btn-load-more:hover {
    background: #f0f7ff;
    border-color: var(--arch-blue-mid);
    transform: translateY(-1px);
}
#loadMoreCount {
    background: var(--arch-blue-light);
    color: #fff; border-radius: 20px;
    padding: 1px 8px; font-size: 0.78rem;
}

/* ── Fixed audio bar ────────────────────────────────────────── */
.audio-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: linear-gradient(135deg, var(--arch-blue), var(--arch-blue-mid));
    color: #fff;
    padding: 10px 22px;
    display: flex; align-items: center; gap: 18px;
    box-shadow: 0 -4px 20px rgba(30,111,217,0.25);
    z-index: 1000;
    flex-wrap: wrap;
}
.audio-bar-info { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.audio-bar-icon {
    font-size: 1.4rem;
    background: rgba(255,255,255,0.18);
    border-radius: 8px; padding: 6px 10px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}
.audio-bar-title { font-weight: 700; font-size: 0.9rem; }
.audio-bar-sub   { font-size: 0.76rem; opacity: 0.78; margin-top: 1px; }

.audio-bar audio {
    flex: 1; min-width: 200px; max-width: 500px;
    height: 36px;
    accent-color: #fff;
}
.audio-bar-close {
    background: rgba(255,255,255,0.18); border: none;
    border-radius: 8px; padding: 6px 10px;
    color: #fff; cursor: pointer; font-size: 1rem;
    transition: background 0.18s;
    flex-shrink: 0;
}
.audio-bar-close:hover { background: rgba(255,255,255,0.3); }

/* Bottom padding when audio bar is visible */
body.audio-playing .page-wrapper { padding-bottom: 100px; }
