/* ================================================================
   AI CLINIC DASHBOARD — Shared Design System v2
   Brand colors: Primary #7294b5 → #5a7a9e | Accent #37b183 → #2e9a72
   Include via _Layout.cshtml. All views share these components.
   ================================================================ */

/* ===== ANIMATIONS (defined once, no @@keyframes duplication needed) ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== TOPBAR (replaces floating top-header + user-utility-bar) ===== */
.page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 1.25rem;
    height: 52px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(114, 148, 181, 0.13);
    box-shadow: 0 2px 10px rgba(90, 122, 158, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark, #1e2d3d);
    letter-spacing: 0.2px;
}

.topbar-brand i {
    color: var(--primary-color, #7294b5);
    font-size: 1.05rem;
}

.topbar-brand .brand-text {
    color: var(--primary-color, #7294b5);
}

/* Content area: tighter, consistent padding */
.content-area {
    padding: 1rem 1.25rem 1.5rem 1.25rem;
    flex: 1;
}

/* ===== MAIN CARD ===== */
.main-card {
    background: #fff;
    border-radius: 20px;
    padding: 0.25rem 1.5rem;
    box-shadow: 0 4px 20px rgba(90, 122, 158, 0.09);
    animation: fadeIn 0.3s ease;
}

/* ===== PAGE HEADER (inside main-card or standalone) ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid #edf2f7;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.header-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #7294b5 0%, #5a7a9e 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(114, 148, 181, 0.25);
}

.header-icon i {
    color: #fff;
    font-size: 1.1rem;
}

.header-title h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e2d3d;
    margin: 0 0 0.1rem;
}

.header-title p {
    font-size: 0.77rem;
    color: #718096;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.stats-container {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ===== STATS BADGES ===== */
.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.32rem 0.875rem;
    border-radius: 30px;
    font-size: 0.77rem;
    font-weight: 600;
    white-space: nowrap;
    background: linear-gradient(135deg, #37b183 0%, #2d8a6a 100%);
    color: #fff;
}

.stats-badge.secondary {
    background: linear-gradient(135deg, #7294b5 0%, #5a7a9e 100%);
}

.stats-badge i {
    font-size: 0.78rem;
}

/* ===== SHARED BUTTONS ===== */
.btn-add,
.btn-filter,
.btn-reset,
.btn-back,
.search-btn,
.reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.38rem 0.875rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    border: none;
}

.btn-add {
    background: linear-gradient(135deg, #7294b5 0%, #5a7a9e 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(114, 148, 181, 0.22);
}

.btn-add:hover {
    background: linear-gradient(135deg, #37b183 0%, #2e9a72 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(55, 177, 131, 0.32);
}

.btn-filter,
.search-btn {
    background: linear-gradient(135deg, #7294b5 0%, #5a7a9e 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(114, 148, 181, 0.2);
}

.btn-filter:hover,
.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(114, 148, 181, 0.3);
    color: #fff;
}

.btn-reset,
.reset-btn {
    background: #fff;
    color: #4a5568;
    border: 1.5px solid #d4dce6;
}

.btn-reset:hover,
.reset-btn:hover {
    background: #f7fafc;
    border-color: #7294b5;
    color: #5a7a9e;
}

.btn-back {
    background: #fff;
    color: #4a5568;
    border: 1.5px solid #d4dce6;
    border-radius: 30px;
    padding: 0.38rem 1rem;
}

.btn-back:hover {
    background: #f0f5fa;
    border-color: #7294b5;
    color: #5a7a9e;
}

/* ===== FILTER SECTION ===== */
.filter-section {
    background: #f8fafc;
    border-radius: 14px;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e9eef4;
}

.filter-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.filter-fields {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.filter-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 0.32rem 0.625rem 0.32rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-width: 155px;
    transition: border-color 0.2s;
}

.filter-group:hover,
.filter-group:focus-within {
    border-color: #7294b5;
}

.filter-group>i {
    color: #7294b5;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.filter-input {
    border: none;
    font-size: 0.8rem;
    width: 100%;
    background: transparent;
    outline: none;
    color: #2d3748;
    padding: 0.15rem 0;
}

.filter-input::placeholder {
    color: #a0aec0;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.7rem 0.875rem;
    border-radius: 10px;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.82rem;
    border-left: 3px solid transparent;
    animation: slideIn 0.25s ease;
}

.alert-danger {
    background: #fff1f1;
    color: #7f1d1d;
    border-left-color: #f87171;
}

.alert-success {
    background: #f0fdf4;
    color: #14532d;
    border-left-color: #4ade80;
}

.alert-info {
    background: #eff6ff;
    color: #1e3a5f;
    border-left-color: #60a5fa;
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #edf2f7;
    margin-top: 0.75rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 550px;
}

th {
    background: #f8fafc;
    color: #4a5568;
    font-weight: 600;
    padding: 0.6rem 0.875rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

th i {
    color: #7294b5;
    margin-right: 6px;
    font-size: 0.78rem;
}

td {
    padding: 0.6rem 0.875rem;
    color: #2d3748;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f7fafc;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons,
.action-buttons-container {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.28rem 0.7rem;
    border-radius: 8px;
    font-size: 0.77rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-edit {
    background: #fefce8;
    color: #a16207;
    border-color: #fde68a;
}

.btn-edit:hover {
    background: #a16207;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(161, 98, 7, 0.28);
}

.btn-delete {
    background: #fff5f5;
    color: #b91c1c;
    border-color: #fecaca;
}

.btn-delete:hover {
    background: #b91c1c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(185, 28, 28, 0.28);
}

.action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 0.85rem;
}

.action-icon:hover {
    transform: translateY(-1px);
}

.action-icon.audio:hover {
    background: #37b183;
    border-color: #37b183;
    color: #fff;
    box-shadow: 0 3px 8px rgba(55, 177, 131, 0.3);
}

.action-icon.transcript:hover {
    background: #7294b5;
    border-color: #7294b5;
    color: #fff;
    box-shadow: 0 3px 8px rgba(114, 148, 181, 0.3);
}

.action-icon i {
    font-size: 0.85rem;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 45, 0.6);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: #fff;
    border-radius: 22px;
    width: 90%;
    max-width: 850px;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.28s ease;
}

.modal-header {
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #7294b5, #5a7a9e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: #f8fafc;
    border-radius: 40px;
    border: 1px solid #e2e8f0;
    margin-top: 1rem;
}

.pagination-info {
    font-size: 0.77rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-info i {
    color: #7294b5;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-arrows {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #fff;
    padding: 3px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
}

.arrow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    color: #4a5568;
    border: none;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.8rem;
}

.arrow-btn:hover:not(.disabled) {
    background: #7294b5;
    color: #fff;
}

.arrow-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.current-page-info {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #fff;
    padding: 3px 0.875rem;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
}

.page-number {
    font-weight: 700;
    color: #7294b5;
}

/* ===== NO DATA ===== */
.no-data {
    text-align: center;
    padding: 2.5rem 1rem;
}

.no-data i {
    font-size: 2.5rem;
    color: #cbd5e0;
    display: block;
    margin-bottom: 0.875rem;
}

.no-data h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.35rem;
}

.no-data p {
    font-size: 0.8rem;
    color: #718096;
}

/* ===== FORM STYLES ===== */
.form-section {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1.125rem 1.25rem;
    border: 1px solid #e9eef4;
}

.form-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1.125rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-title i {
    color: #7294b5;
    font-size: 0.82rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    position: relative;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0;
}

.form-label i {
    color: #7294b5;
    font-size: 0.75rem;
    width: 14px;
}

.form-control {
    padding: 0.52rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    color: #1e2d3d;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: #7294b5;
    box-shadow: 0 0 0 3px rgba(114, 148, 181, 0.12);
    background-color: #fff;
}

.form-control.is-invalid {
    border-color: #f87171;
    background: #fff8f8;
}

textarea.form-control {
    min-height: 88px;
    resize: vertical;
}

.field-validation-error {
    font-size: 0.72rem;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 3px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}

/* ===== BTN (form submit buttons) ===== */
.btn {
    padding: 0.52rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #37b183 0%, #2e9a72 100%);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(55, 177, 131, 0.3);
    color: #fff;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: #4a5568;
    border: 1.5px solid #d4dce6;
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: #7294b5;
    color: #5a7a9e;
}

/* ===== VALIDATION SUMMARY ===== */
.validation-summary-errors {
    background: #fff5f5;
    border: 1px solid #f87171;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.875rem;
    color: #7f1d1d;
    font-size: 0.82rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.validation-summary-errors li {
    margin-bottom: 0.2rem;
}

/* ===== CARD WITH GRADIENT HEADER ===== */
.details-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(90, 122, 158, 0.09);
    animation: fadeIn 0.3s ease;
}

.card-header {
    background: linear-gradient(135deg, #7294b5 0%, #5a7a9e 100%);
    padding: 1.125rem 1.5rem;
    color: #fff;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header .header-icon {
    background: rgba(255, 255, 255, 0.18);
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: none;
}

.header-text h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.header-text p {
    opacity: 0.88;
    font-size: 0.85rem;
    margin: 0;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

/* ===== SECTION GRID (info cards) ===== */
.section-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.125rem 1.25rem;
    border: 1px solid #edf2f7;
    transition: all 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    border-color: #c5d5e4;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-title i {
    color: #7294b5;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-title h3 {
    color: #2d3748;
    font-size: 0.95rem;
    font-weight: 600;
}

.info-item {
    margin-bottom: 0.875rem;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #718096;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.22rem;
}

.info-label i {
    color: #7294b5;
    font-size: 0.65rem;
}

.info-value {
    color: #1a202c;
    font-size: 0.9rem;
    font-weight: 500;
    padding-left: 1.1rem;
    word-break: break-word;
}

.info-value.empty {
    color: #a0aec0;
    font-style: italic;
    font-weight: 400;
}

.metadata-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.875rem;
}

.metadata-item {
    background: #f7fafc;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e2e8f0;
}

.metadata-item i {
    color: #7294b5;
    font-size: 1rem;
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metadata-content {
    display: flex;
    flex-direction: column;
}

.metadata-label {
    color: #718096;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.metadata-value {
    color: #2d3748;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #7294b5;
}

.loading-spinner i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.badge-primary {
    background: #e0eaf4;
    color: #3b5998;
}

/* ===== COMPANY/BRANCH BADGES ===== */
.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.22rem 0.7rem;
    background: linear-gradient(135deg, #37b183, #2e9a72);
    color: #fff;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.22rem 0.7rem;
    background: linear-gradient(135deg, #7294b5, #5a7a9e);
    color: #fff;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 0.28rem 0.28rem 0.28rem 0.875rem;
    max-width: 100%;
}

.search-icon {
    color: #a0aec0;
    font-size: 0.8rem;
}

.search-input {
    border: none;
    background: transparent;
    font-size: 0.82rem;
    min-width: 175px;
    outline: none;
    color: #1e2d3d;
    padding: 0.22rem 0;
}

.search-input::placeholder {
    color: #a0aec0;
    font-size: 0.78rem;
}

.active-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e0eaf4;
    color: #3b5998;
    padding: 0.25rem 0.875rem;
    border-radius: 30px;
    font-size: 0.73rem;
    font-weight: 600;
}

.active-filter i {
    cursor: pointer;
}

.active-filter i:hover {
    color: #c53030;
}

/* ===== AUDIO PLAYER ===== */
.audio-player-modal {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.audio-player-modal audio {
    width: 100%;
    border-radius: 10px;
}

/* ===== PHONE / USER-AGENT BADGE ===== */
.phone-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 0.4rem 0.875rem;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    font-size: 0.88rem;
    width: fit-content;
}

.phone-item i {
    color: #37b183;
    font-size: 0.78rem;
}

/* ===== FORM BACK BUTTON ===== */
.btn-back-alt {
    background: #fff;
    color: #718096;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-back-alt:hover {
    background: #f7fafc;
    border-color: #37b183;
    color: #37b183;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .content-area {
        padding: 0.75rem 0.875rem 1.25rem;
    }

    .main-card {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-fields {
        flex-direction: column;
        width: 100%;
    }

    .filter-group {
        width: 100%;
        min-width: 0;
    }

    .filter-actions {
        width: 100%;
    }

    .btn-filter,
    .btn-reset {
        flex: 1;
        justify-content: center;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions,
    .stats-container {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .pagination-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }

    .page-topbar {
        padding: 0 1rem;
    }

    .topbar-brand {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-card {
        padding: 0.875rem;
        border-radius: 16px;
    }

    table {
        font-size: 0.77rem;
    }

    th,
    td {
        padding: 0.5rem 0.625rem;
    }

    .header-title h1 {
        font-size: 1.05rem;
    }

    .stats-badge {
        padding: 0.28rem 0.75rem;
        font-size: 0.72rem;
    }

    .action-btn {
        padding: 0.25rem 0.625rem;
        font-size: 0.75rem;
    }

    .page-topbar {
        height: 46px;
    }

    .topbar-brand {
        font-size: 0.82rem;
    }
}