@import url('responsive_force.css');
/* ============================================
   CHATBOT INIKARIR - Modern CSS
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #7c3aed;
    /* Purple from logo */
    --primary-hover: #6d28d9;
    --secondary: #06b6d4;
    /* Cyan */
    --accent: #db2777;
    /* Pink */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    /* Slightly more rounded */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --font: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    /* Modern font */

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #06b6d4 0%, #7c3aed 50%, #db2777 100%);
    --gradient-hover: linear-gradient(135deg, #0891b2 0%, #6d28d9 50%, #be185d 100%);

    /* WhatsApp Colors */
    --wa-bg: #E5DDD5;
    --wa-message-out: #dcf8c6;
    --wa-message-in: #ffffff;
    --wa-check-blue: #34B7F1;
    --wa-check-gray: #999999;
    --wa-sidebar-bg: #ffffff;
    --wa-sidebar-active: #f0f2f5;
}

/* --- Utilities --- */
.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.btn-primary {
    background: var(--gradient-brand);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

/* =============================================
   DASHBOARD LAYOUT â€” Sidebar + Main
   ============================================= */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.dashboard-content {
    flex: 1;
    padding: 2rem;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    padding: 1rem 1.5rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: #94a3b8 !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(124, 58, 237, 0.1));
    border-left-color: #06b6d4;
}

.sidebar-link i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
}

/* Sidebar Dropdown */
.sidebar-dropdown-toggle {
    justify-content: flex-start;
    position: relative;
}

.sidebar-dropdown-toggle .sidebar-arrow {
    margin-left: auto;
    font-size: 1rem;
    transition: transform 0.2s ease;
    width: auto;
}

.sidebar-dropdown.open .sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.sidebar-dropdown.open .sidebar-dropdown-menu {
    max-height: 200px;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.5rem 0.55rem 3.2rem;
    color: #64748b !important;
    text-decoration: none !important;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-sublink i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.sidebar-sublink:hover {
    color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-sublink.active {
    color: #e2e8f0 !important;
    background: rgba(6, 182, 212, 0.08);
    border-left-color: #06b6d4;
}

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

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

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.sidebar-user-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.85rem;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: #64748b;
}

/* --- Topbar --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
}

.topbar-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Sidebar Overlay (Mobile) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
}

/* --- Responsive: Mobile Sidebar --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.open~.sidebar-overlay {
        display: block;
    }

    .sidebar-close {
        display: block;
    }

    .dashboard-main {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }

    .dashboard-content {
        padding: 1rem;
    }
}

/* Old .navbar (kept for login page compatibility) */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text) !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.navbar-links {
    display: flex;
    gap: 0.25rem;
}

.navbar-links a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none !important;
    transition: all .15s;
}

.navbar-links a:hover {
    background: var(--bg);
    color: var(--text);
}

.navbar-links a.active,
.nav-dropdown-menu a.active {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, .25);
}

/* Card Header */
.card-header {
    background: linear-gradient(to right, #ffffff, #f8fafc);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

.card-header h2 {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    font-size: 1.1rem;
    margin: 0;
}

/* Login Page Styling */
body.login-page {
    /* More powerful animated gradient: Cyan -> Purple -> Pink */
    background: linear-gradient(-45deg, #06b6d4, #7c3aed, #db2777, #06b6d4);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Login Card - Modern Header Style */
.login-card {
    background: #ffffff;
    padding: 0;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    position: relative;
}

.login-header-bg {
    height: 140px;
    background: var(--gradient-brand);
    position: relative;
    clip-path: ellipse(150% 100% at 50% 0%);
}

.login-logo-wrapper {
    width: 100px;
    height: 100px;
    background: #ffffff;
    border-radius: 50%;
    padding: 15px;
    margin: -50px auto 20px;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-body {
    padding: 0 2.5rem 2.5rem;
    text-align: center;
}

.login-body .form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.login-body input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    background: #f8fafc;
}

.login-body input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
    background: #fff;
    outline: none;
}

.btn-block {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    margin-top: 1rem;
}

/* --- Navbar Dropdown --- */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 200px;
    z-index: 200;
    padding: 4px;
    animation: dropIn 0.15s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-dropdown-menu a.active {
    background: var(--primary);
    color: #fff;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* --- Page Header --- */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

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

.page-header .page-title {
    margin-bottom: 0;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Gradient Top Border */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-brand);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 1.75rem;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.stat-card:hover .stat-icon {
    background: var(--gradient-brand);
    color: #fff;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Monitor Card --- */
.monitor-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.monitor-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.monitor-item .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.monitor-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: var(--font);
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-group small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* --- Search Form --- */
.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.search-input-wrapper:focus-within {
    border-color: transparent;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--secondary);
}

.search-icon {
    padding-left: 1.25rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper input {
    border: none;
    background: transparent;
    padding: 0.85rem 1.25rem 0.85rem 0.75rem;
    width: 100%;
    font-size: 1rem;
    outline: none;
    color: var(--text);
    border-radius: 99px;
}

.search-input-wrapper input::placeholder {
    color: #94a3b8;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.15s ease;
    line-height: 1.4;
}

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

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

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* --- Tables --- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

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

.text-truncate {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-nowrap {
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* --- Alerts --- */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center;
}


/* --- Utilities --- */

/* --- Utilities --- */
.text-muted {
    color: var(--text-muted);
}

code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* --- Chat Application Layout --- */
.chat-app-container {
    display: flex;
    max-width: 100%;
    margin: 0;
    flex: 1;
    min-height: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    border: none;
    border-top: 1px solid var(--border);
}

/* Sidebar */
.chat-sidebar {
    width: 320px;
    background: var(--wa-sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 1rem;
    background: #f0f2f5;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.contact-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 1rem;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none !important;
    color: inherit;
}

.contact-item:hover {
    background: #f5f6f6;
    text-decoration: none;
}

.contact-item.active {
    background: #f0f2f5;
}

.contact-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #dfe6e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #636e72;
    margin-right: 12px;
}

.contact-info {
    flex: 1;
    overflow: hidden;
}

.contact-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-last-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 8px;
    white-space: nowrap;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--wa-bg);
    background-image: url("https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png");
    background-repeat: repeat;
    position: relative;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #888;
    text-align: center;
    padding: 2rem;
}

.chat-header {
    background-color: #f0f2f5;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 5%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 4px;
}

.message-in {
    justify-content: flex-start;
}

.message-out {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 65%;
    padding: 6px 7px 8px 9px;
    border-radius: 7.5px;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    font-size: 14.2px;
    line-height: 19px;
}

.message-in .message-bubble {
    background-color: var(--wa-message-in);
    border-top-left-radius: 0;
}

.message-out .message-bubble {
    background-color: var(--wa-message-out);
    border-top-right-radius: 0;
}

.message-sender {
    font-size: 12.8px;
    font-weight: 500;
    line-height: 22px;
    color: var(--primary);
    margin-bottom: 2px;
}

.message-text {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-meta {
    float: right;
    margin-left: 14px;
    margin-top: 4px;
    position: relative;
    top: 4px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    height: 15px;
}

.message-bubble::after {
    content: "";
    display: table;
    clear: both;
}

.status-icon {
    font-size: 14px;
    line-height: 1;
}

.status-check {
    color: var(--wa-check-gray);
}

.status-read {
    color: var(--wa-check-blue);
}

.date-divider {
    text-align: center;
    margin: 12px 0;
    position: relative;
}

.date-divider span {
    background-color: #e1f3fb;
    padding: 5px 12px;
    border-radius: 7.5px;
    font-size: 12.5px;
    color: #1c1e21;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    text-transform: uppercase;
}


/* --- Responsive --- */
@media (max-width: 768px) {

    /* Navbar Mobile */
    .navbar-container {
        padding: 0 1rem;
    }

    .navbar-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    .navbar-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .navbar-links.active {
        display: flex;
    }

    .navbar-user.desktop-only {
        display: none;
    }

    .navbar-mobile-user {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    /* Mobile dropdown: inline instead of absolute */
    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--bg);
        border-radius: 8px;
        margin-top: 4px;
        min-width: auto;
        animation: none;
    }

    .nav-dropdown .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    /* Chat Mobile */
    .chat-app-container {
        flex-direction: column;
        margin: 0;
        border: none;
        border-radius: 0;
        position: relative;
    }

    .chat-sidebar {
        width: 100%;
        height: 100%;
        border-right: none;
    }

    .chat-main {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 20;
        display: none;
        /* Hidden by default on mobile */
    }

    /* Toggling mechanics handled by PHP adding classes */
    .chat-app-container.mobile-chat-active .chat-sidebar {
        display: none;
    }

    .chat-app-container.mobile-chat-active .chat-main {
        display: flex;
    }

    .chat-back-btn {
        display: inline-flex;
        margin-right: 10px;
        align-items: center;
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
    }
}

@media (min-width: 769px) {
    .navbar-toggle {
        display: none;
    }

    .navbar-mobile-user {
        display: none;
    }

    .chat-back-btn {
        display: none;
    }
}

