/* ============================================================
   Elysium Vet Clinic Software - Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0ea5e9;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #2563eb;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
}

/* --- Base --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-color);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* --- Mobile Sidebar Toggle (fixed hamburger) --- */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 210;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: background 0.15s;
}
.mobile-sidebar-toggle:hover {
    background: var(--body-bg);
}

/* --- Mobile Brand (topbar) --- */
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}
.mobile-brand i {
    font-size: 1.1rem;
}

/* --- Layout --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 260px;
    min-height: 100vh;
}

.app-topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
}

.app-topbar .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar .topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.app-body {
    padding: 1.5rem;
    flex: 1;
}

/* --- Flowboard --- */
.flowboard-container {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.flowboard-col {
    flex: 0 0 240px;
    min-width: 200px;
    max-width: 280px;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(37,99,235,0.15);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i {
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--sidebar-text);
    font-size: 0.6875rem;
    text-transform: capitalize;
}

.btn-logout {
    color: var(--sidebar-text);
    padding: 0.375rem;
    border-radius: 0.375rem;
    transition: all 0.15s;
}

.btn-logout:hover {
    color: var(--danger);
    background: rgba(220,38,38,0.1);
}

/* --- Cards --- */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h5,
.card-header h6 {
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* --- Stat Cards --- */
.stat-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    background: var(--card-bg);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.stat-icon.bg-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.bg-success { background: #dcfce7; color: var(--success); }
.stat-icon.bg-warning { background: #fef3c7; color: var(--warning); }
.stat-icon.bg-danger  { background: #fee2e2; color: var(--danger); }
.stat-icon.bg-info    { background: #e0f2fe; color: var(--info); }

/* --- Tables --- */
.table {
    font-size: 0.875rem;
    vertical-align: middle;
}

.table thead th {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f8fafc;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table-responsive {
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

/* --- Sidebar Divider --- */
.nav-divider {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    list-style: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 0.5rem;
}
.nav-divider:first-of-type {
    border-top: none;
    margin-top: 0;
}
.nav-divider span {
    opacity: 0.6;
}

/* --- Badges --- */
.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 500;
}

/* --- Auth Pages (legacy compat — see auth.css for new split-screen) --- */
.auth-body {
    background: #f8fafc;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-container-wide {
    max-width: 560px;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 1rem;
}

.auth-brand i {
    font-size: 1.75rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.auth-header p {
    color: var(--text-muted);
    margin: 0;
}

.auth-form .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    font-weight: 600;
    color: var(--primary);
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    font-size: 0.8125rem;
}

/* --- Manual sidebar --- */
.manual-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.manual-sidebar .nav-link {
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #555;
    border-radius: 4px;
}
.manual-sidebar .nav-link:hover {
    background: #f0f4f8;
    color: #0d6efd;
}
.manual-sidebar .nav-link.active {
    background: #e7f1ff;
    color: #0d6efd;
    font-weight: 600;
}

/* Desktop: force manual sidebar visible always (override Bootstrap collapse) */
@media (min-width: 992px) {
    .manual-sidebar.collapse {
        display: block !important;
    }
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .mobile-sidebar-toggle {
        display: flex;
    }
    .app-content {
        margin-left: 0;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 150;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .app-topbar {
        padding: 0.625rem 1rem 0.625rem 3.5rem;
    }
    .app-topbar .page-title {
        font-size: 1.1rem;
    }
    .app-topbar > .btn:first-child {
        flex-shrink: 0;
        order: -1;
    }
    .page-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .page-header h1 {
        font-size: 1.25rem;
    }
    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
    .stat-card .stat-value {
        font-size: 1.375rem;
    }
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .table-responsive {
        border-radius: 0.5rem;
    }
    .app-topbar .topbar-actions .btn .btn-text-mobile {
        display: none;
    }
    /* Templates category buttons: scroll horizontally */
    .topbar-actions .btn-group {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100vw;
    }
    .topbar-actions .btn-group::-webkit-scrollbar {
        display: none;
    }
    .topbar-actions .btn-group .btn {
        flex-shrink: 0;
    }
    /* Flowboard - vertical on mobile */
    .flowboard-container {
        flex-direction: column;
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }
    .flowboard-col {
        flex: none;
        min-width: 0;
        max-width: 100%;
        margin-bottom: 0.75rem;
    }
    .flowboard-col .card-body {
        max-height: none !important;
        min-height: auto !important;
    }
    /* Manual sidebar: collapsible on mobile, card style */
    .manual-sidebar {
        position: static;
        max-height: none;
        margin-bottom: 1.5rem;
        padding: 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: 0.75rem;
        background: var(--card-bg);
        overflow-y: auto;
        max-height: 60vh;
    }
    .manual-sidebar .nav-link {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .app-body {
        padding: 0.75rem;
    }
    .app-topbar {
        padding: 0.5rem 0.75rem 0.5rem 3.25rem;
    }
    .app-topbar .page-title {
        font-size: 1rem;
        flex: 1 1 0;
        min-width: 0;
    }
    .app-topbar > .btn:first-child {
        flex-shrink: 0;
        order: -1;
        margin-right: 0.25rem;
    }
    .app-topbar .mobile-brand {
        order: 0;
        font-size: 0.85rem;
    }
    .auth-card {
        padding: 1.25rem;
    }
    .stat-card {
        padding: 0.875rem;
    }
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
    .card-body {
        padding: 0.875rem;
    }
    .page-header h1 {
        font-size: 1.125rem;
    }
    .page-header {
        margin-bottom: 1rem;
    }
    .modal-dialog {
        margin: 0.25rem;
    }
    .modal-content {
        border-radius: 0.5rem;
    }
    .form-label {
        font-size: 0.8125rem;
    }
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    .flowboard-col {
        flex: none;
        min-width: 0;
        max-width: 100%;
        margin-bottom: 0.75rem;
    }
}

/* --- Buttons --- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-sm {
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
}

/* --- Loading Spinner --- */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--text-muted);
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- Notification Badge --- */
.notif-badge {
    position: relative;
}

.notif-badge .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.625rem;
    padding: 0.2em 0.45em;
}

/* --- Alert refinements --- */
.alert {
    border-radius: 10px;
    font-size: 0.9rem;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

/* --- Form refinements --- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

/* --- Badge refinements --- */
.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* --- Page transitions --- */
.app-body {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Floating Chat Widget
   ============================================================ */
.chat-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,0.35);
    z-index: 1050;
    transition: transform 0.2s;
}
.chat-fab:hover { transform: scale(1.08); }
.chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}
.chat-popup {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 8rem);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1051;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.chat-popup.show { display: flex; }
.chat-popup-header {
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-conv-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.chat-search-bar {
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.chat-conv-items {
    flex: 1;
    overflow-y: auto;
}
.chat-conv {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.chat-conv:hover { background: #f8fafc; }
.chat-conv-active { background: #eff6ff; }
.chat-conv-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0.75rem;
}
.chat-conv-info { flex: 1; min-width: 0; }
.chat-conv-name { font-weight: 600; font-size: 0.85rem; }
.chat-conv-preview {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}
.chat-conv-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.chat-conv-view-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: var(--primary);
    color: #fff;
}
.chat-conv-view-header .btn-outline-light {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
    padding: 0.15rem 0.4rem;
    font-size: 0.8rem;
}
.chat-conv-view-header .btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
}
.chat-conv-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: #f8fafc;
}
.chat-msg { margin-bottom: 0.5rem; display: flex; }
.chat-msg-me { justify-content: flex-end; }
.chat-msg-other { justify-content: flex-start; }
.chat-msg-bubble {
    max-width: 80%;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}
.chat-msg-me .chat-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg-other .chat-msg-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}
.chat-attachment-img {
    max-width: 180px;
    max-height: 140px;
    border-radius: 8px;
    margin-top: 4px;
    display: block;
}
.chat-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 4px;
    font-size: 0.75rem;
}
.chat-msg-other .chat-attachment-file {
    background: #f1f5f9;
    color: var(--primary);
}
.chat-msg-me .chat-attachment-file {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem;
    border-top: 1px solid #e2e8f0;
}
.chat-attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    font-size: 1.1rem;
    transition: background 0.15s;
    flex-shrink: 0;
}
.chat-attach-btn:hover { background: #f1f5f9; color: var(--primary); }
.chat-attach-btn.has-file { color: var(--primary); }

/* Chat mobile full-screen */
@media (max-width: 576px) {
    .chat-popup {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .chat-popup-header {
        border-radius: 0;
        padding: 0.75rem 1rem;
        padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    }
    .chat-fab {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}
