:root {
    --primary: #1B3A5F;
    --secondary: #2A9D8F;
    --accent: #F48C22;
    --bg: #F4F6F8;
    --card: #FFFFFF;
    --text: #1F2937;
    --muted: #6B7280;
    --border: #E5E7EB;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.navbar {
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar a {
    color: #fff;
    font-weight: 600;
}

.navbar .nav-links a {
    margin-left: 16px;
    font-size: 0.95rem;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.input-help {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
    margin-bottom: 0;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    filter: brightness(1.05);
}

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

.btn-success {
    background: var(--secondary);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
}

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

.mt-2 {
    margin-top: 1rem;
}

.login-wrapper {
    max-width: 420px;
    margin: 60px auto;
}

.logo {
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 800;
}

.logo span {
    color: var(--accent);
}

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar .nav-links {
        margin-top: 8px;
    }

    .navbar .nav-links a {
        margin-left: 0;
        margin-right: 12px;
    }
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary);
}

.stat-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-search {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    max-width: 480px;
}

.admin-search .form-control {
    flex: 1;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--primary);
}

.admin-table tr:hover {
    background: #FAFBFC;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-warning {
    background: #D97706;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-active {
    background: #D1FAE5;
    color: #065F46;
}

.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge-expired,
.badge-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.inline-form {
    display: inline;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plan-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border);
}

.plan-card h3 {
    margin: 0 0 12px;
    color: var(--primary);
}

.plan-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 12px;
}

.plan-price small {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 400;
}

.plan-card p {
    color: var(--muted);
    margin: 0 0 20px;
}

.plan-card .btn {
    width: 100%;
}

.chat-container {
    display: flex;
    height: calc(100vh - 48px);
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 0;
}

.chat-sidebar {
    width: 280px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    background: #FAFBFC;
}

.chat-sidebar h3 {
    margin: 0 0 16px;
    color: var(--primary);
}

.chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-list li {
    margin-bottom: 8px;
    border-radius: var(--radius);
    overflow: hidden;
}

.chat-list li a {
    display: block;
    padding: 12px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.chat-list li.active a,
.chat-list li a:hover {
    border-color: var(--secondary);
}

.chat-list li strong {
    display: block;
    font-weight: 600;
}

.chat-list li small,
.chat-list li span {
    color: var(--muted);
    display: block;
    font-size: 0.85rem;
}

.chat-list li span {
    font-size: 0.75rem;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.chat-header h3 {
    margin: 0;
    color: var(--primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #eef2f5;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.message {
    display: flex;
    margin-bottom: 12px;
}

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

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

.message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-break: break-word;
}

.message-out .message-bubble {
    background: var(--secondary);
    color: #fff;
}

.message-bubble p {
    margin: 0 0 6px;
}

.message-media img,
.message-media video,
.message-media audio {
    max-width: 100%;
    border-radius: 6px;
    display: block;
}

.message-meta {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: right;
}

.chat-form {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.chat-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-inputs .form-control {
    flex: 1;
}

.chat-inputs input[type="file"] {
    flex: 0 0 180px;
}

@media (max-width: 640px) {
    .chat-container {
        flex-direction: column;
        height: auto;
    }

    .chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 200px;
    }

    .chat-messages {
        min-height: 300px;
    }

    .chat-inputs {
        flex-wrap: wrap;
    }

    .chat-inputs input[type="file"] {
        flex: 1 1 100%;
    }
}

/* Sidebar layout */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #0B1B2E;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 24px 0 16px;
    z-index: 100;
    overflow-y: auto;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px 32px;
    text-decoration: none;
}

.sidebar .brand img {
    max-height: 44px;
    max-width: 90%;
    border-radius: 8px;
}

.sidebar .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #2A9D8F;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar .brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-left: 10px;
}

.sidebar nav {
    flex: 1;
}

.sidebar nav ul {
    list-style: none;
    padding: 0 16px;
    margin: 0;
}

.sidebar nav li {
    margin: 2px 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar nav a .icon,
.sidebar nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #2A9D8F;
    color: #fff;
}

.sidebar .upgrade-card {
    margin: 16px;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2A9D8F 0%, #1B3A5F 100%);
    color: #fff;
    text-align: center;
}

.sidebar .upgrade-card h4 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.sidebar .upgrade-card p {
    margin: 0 0 16px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.sidebar .upgrade-card .btn {
    background: #fff;
    color: #0B1B2E;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
}

.sidebar .app-version {
    padding: 12px 24px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-top: auto;
    text-align: center;
}

.main-content {
    min-height: 100vh;
}

.has-sidebar .main-content {
    padding: 24px;
    background: #F4F6F8;
    margin-left: 280px;
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 16px 0;
    }

    .has-sidebar .main-content {
        margin-left: 0;
    }
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.page-title h1 {
    margin: 0;
    font-size: 1.7rem;
    color: #1F2937;
}

.page-title p {
    margin: 4px 0 0;
    color: #6B7280;
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 14px 10px 38px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #fff;
    width: 260px;
    font-size: 0.95rem;
    color: #6B7280;
}

.search-box input:focus {
    outline: none;
    border-color: #2A9D8F;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

.search-box .search-icon svg,
.search-box .search-icon .icon {
    width: 18px;
    height: 18px;
    display: block;
}

.notification-btn {
    position: relative;
    color: #6B7280;
    display: flex;
    align-items: center;
}

.notification-btn svg,
.notification-btn .icon {
    width: 22px;
    height: 22px;
}

.notification-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 0.65rem;
    background: #EF4444;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-card {
    max-width: 600px;
    margin: 0 auto;
}

.doc-content h2,
.doc-content h3,
.doc-content h4 {
    color: var(--primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.doc-content p {
    margin-bottom: 12px;
}

.doc-content ul,
.doc-content ol {
    margin-bottom: 16px;
    padding-left: 20px;
}

.doc-content li {
    margin-bottom: 8px;
}

.doc-content code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary);
    font-family: monospace;
}

.doc-content a {
    color: var(--secondary);
    text-decoration: underline;
}

/* Modern scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.85rem;
}

/* Cards */
.card {
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    background: #fff;
}

/* Stats */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.stat-card {
    border-radius: 12px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card h3 {
    font-size: 2.4rem;
    margin: 0 0 8px;
    color: var(--primary);
}

.stat-card p {
    color: var(--muted);
    font-weight: 500;
    margin: 0;
    font-size: 0.9rem;
}

/* Charts */
.chart-container {
    position: relative;
    height: 280px;
    margin-top: 16px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.chart-card {
    border-radius: 12px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.chart-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--primary);
}

/* Dashboard layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg,
.stat-icon .icon {
    width: 26px;
    height: 26px;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #1F2937;
}

.stat-info p {
    margin: 4px 0 0;
    color: #6B7280;
    font-size: 0.9rem;
}

.stat-trend {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-trend svg,
.stat-trend .icon {
    width: 14px;
    height: 14px;
}

.stat-trend small {
    display: none;
}

.stat-trend.trend-up {
    color: #22C55E;
}

.stat-trend.trend-down {
    color: #EF4444;
}

.dashboard-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.charts-row {
    grid-template-columns: 2fr 1fr;
}

.two-col {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 992px) {
    .charts-row,
    .two-col {
        grid-template-columns: 1fr;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1F2937;
}

.view-all {
    font-size: 0.85rem;
    color: #2A9D8F;
    font-weight: 500;
}

.filter-badge {
    padding: 6px 12px;
    border-radius: 20px;
    background: #F3F4F6;
    color: #6B7280;
    font-size: 0.8rem;
    font-weight: 500;
}

.chart-container {
    height: 300px;
    position: relative;
}

.doughnut-wrap {
    height: 260px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-avatar,
.recent-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #EEF2FF;
    color: #4F46E5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.recent-icon svg,
.recent-icon .icon {
    width: 18px;
    height: 18px;
}

.recent-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.recent-body strong {
    color: #1F2937;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-body span {
    color: #6B7280;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-time,
.recent-amount {
    font-size: 0.85rem;
    color: #9CA3AF;
    white-space: nowrap;
}

.recent-amount {
    font-weight: 600;
    color: #1F2937;
}

.badge-soft-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-soft-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-soft-warning {
    background: #FEF3C7;
    color: #92400E;
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    color: #9CA3AF;
    font-size: 0.85rem;
    border-top: 1px solid #E5E7EB;
    margin-top: 20px;
}

.dashboard-footer .heart {
    color: #EF4444;
}

/* Login split screen */
.login-split {
    display: flex;
    min-height: 100vh;
    background: #fff;
}

.login-left {
    flex: 1;
    background: #0B1B2E;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(42,157,143,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-left .login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

.login-left .login-brand img {
    max-height: 40px;
}

.login-left .login-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #2A9D8F;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.login-left .login-brand .brand-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.login-tagline {
    margin: -24px 0 48px 50px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.login-hero {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.login-hero h2 {
    font-size: 2.2rem;
    margin: 0 0 16px;
    line-height: 1.25;
}

.login-hero > p {
    color: rgba(255,255,255,0.7);
    margin: 0 0 40px;
    font-size: 1.05rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(42,157,143,0.2);
    color: #2A9D8F;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg,
.feature-icon .icon {
    width: 22px;
    height: 22px;
}

.feature-list strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-list span {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
}

.login-trust {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trust-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2A9D8F;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px;
    background: #fff;
}

.login-form-card {
    width: 100%;
    max-width: 460px;
    padding: 0;
}

.login-form-card h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
    color: #1F2937;
}

.login-form-card > p {
    margin: 0 0 28px;
    color: #6B7280;
}

.input-icon {
    position: relative;
}

.input-icon .icon,
.input-icon svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9CA3AF;
    pointer-events: none;
}

.input-icon input {
    padding-left: 42px;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 24px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4B5563;
    cursor: pointer;
}

.remember-me input {
    accent-color: #2A9D8F;
    width: 16px;
    height: 16px;
}

.forgot-link {
    color: #2A9D8F;
    font-weight: 500;
}

.btn-signin {
    background: linear-gradient(90deg, #2A9D8F 0%, #3B82F6 100%);
    color: #fff;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-signin:hover {
    filter: brightness(1.05);
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #9CA3AF;
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E5E7EB;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-social:hover {
    background: #F9FAFB;
}

.btn-social .icon,
.btn-social svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-signup {
    text-align: center;
    margin: 24px 0 0;
    color: #6B7280;
    font-size: 0.9rem;
}

.login-signup a {
    color: #2A9D8F;
    font-weight: 600;
}

.login-footer-right {
    margin-top: 32px;
    color: #9CA3AF;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .login-split {
        flex-direction: column;
    }

    .login-left,
    .login-right {
        padding: 32px;
    }

    .login-left {
        min-height: auto;
    }

    .login-hero h2 {
        font-size: 1.6rem;
    }
}

/* Branding */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 8px;
}

.brand img {
    max-height: 50px;
    max-width: 90%;
    width: auto;
    border-radius: 8px;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--secondary);
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

/* Login brand */
.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-brand img {
    max-height: 70px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.login-brand h1 {
    font-size: 1.6rem;
    margin: 0;
    color: var(--primary);
}

.login-brand h1 span {
    color: var(--muted);
    font-weight: 400;
}

/* Profile dropdown */
.profile-menu {
    position: relative;
    margin-left: auto;
}

.profile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.profile-toggle:hover {
    filter: brightness(1.1);
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 46px;
    min-width: 150px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 200;
}

.profile-dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.profile-dropdown a:last-child {
    border-bottom: none;
}

.profile-dropdown a:hover {
    background: var(--bg);
}

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

/* Table page layout */
.page-header {
    margin-bottom: 24px;
}

.breadcrumb {
    color: #9CA3AF;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.breadcrumb a {
    color: #9CA3AF;
}

.page-header h2 {
    margin: 0;
    font-size: 1.6rem;
    color: #1F2937;
}

.page-subtitle {
    margin: 4px 0 0;
    color: #6B7280;
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.page-actions-left,
.page-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.admin-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-stat-icon svg,
.admin-stat-icon .icon {
    width: 24px;
    height: 24px;
}

.admin-stat-info h3 {
    margin: 0;
    font-size: 1.6rem;
    color: #1F2937;
}

.admin-stat-info p {
    margin: 4px 0 0;
    color: #6B7280;
    font-size: 0.85rem;
}

.table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #F3F4F6;
    gap: 12px;
    flex-wrap: wrap;
}

.table-toolbar-left,
.table-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.entries-select {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6B7280;
    font-size: 0.9rem;
}

.entries-select select {
    padding: 6px 10px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #fff;
}

.search-input {
    position: relative;
}

.search-input input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    width: 260px;
    font-size: 0.9rem;
}

.search-input .icon,
.search-input svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9CA3AF;
}

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

.data-table thead {
    background: #FAFBFC;
}

.data-table th {
    padding: 16px 24px;
    text-align: left;
    font-weight: 600;
    color: #6B7280;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #F3F4F6;
    color: #1F2937;
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: #FAFBFC;
}

.data-table .customer-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-table .customer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #EEF2FF;
    color: #4F46E5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.data-table .customer-info strong {
    display: block;
    font-weight: 500;
    color: #1F2937;
}

.data-table .customer-info span {
    color: #9CA3AF;
    font-size: 0.8rem;
}

.data-table .plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: #EEF2FF;
    color: #4F46E5;
    font-weight: 500;
    font-size: 0.85rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-active {
    background: #D1FAE5;
    color: #065F46;
}

.status-trial {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-cancelled,
.status-expired {
    background: #FEE2E2;
    color: #991B1B;
}

.status-inactive,
.status-suspended {
    background: #F3F4F6;
    color: #4B5563;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #F3F4F6;
    color: #6B7280;
    font-size: 0.85rem;
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    color: #6B7280;
    font-size: 0.85rem;
    text-decoration: none;
    background: #fff;
    border: 1px solid #E5E7EB;
}

.pagination a.active,
.pagination a:hover {
    background: #2A9D8F;
    color: #fff;
    border-color: #2A9D8F;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-filter {
    background: #fff;
    border: 1px solid #E5E7EB;
    color: #4B5563;
}

.btn-export {
    background: #fff;
    border: 1px solid #E5E7EB;
    color: #4B5563;
}

.btn-new {
    background: #2563EB;
    color: #fff;
}

.btn-new:hover {
    filter: brightness(1.05);
}

.action-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0;
    border: none;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s, transform 0.1s;
}

.btn-icon:hover {
    filter: brightness(1.1);
}

.btn-icon .icon,
.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon-primary { background: #3B82F6; }
.btn-icon-success { background: #22C55E; }
.btn-icon-warning { background: #F59E0B; }
.btn-icon-danger { background: #EF4444; }

/* Pricing page */
.pricing-page {
    padding-bottom: 40px;
}

.pricing-hero {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-hero h1 {
    font-size: 2.2rem;
    color: #111827;
    margin: 0 0 12px;
}

.pricing-hero p {
    color: #6B7280;
    font-size: 1.05rem;
    margin: 0;
}

.billing-toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    font-weight: 500;
    color: #374151;
}

.billing-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.billing-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #E5E7EB;
    border-radius: 26px;
    transition: 0.2s;
}

.slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.billing-toggle input:checked + .slider {
    background: #2563EB;
}

.billing-toggle input:checked + .slider::before {
    transform: translateX(22px);
}

.save-badge {
    background: #D1FAE5;
    color: #065F46;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    align-items: start;
    margin-bottom: 40px;
}

.pricing-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    padding: 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.pricing-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.pricing-card.popular {
    border: 2px solid #6366F1;
    box-shadow: 0 10px 30px rgba(99,102,241,0.12);
    transform: scale(1.03);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #6366F1;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.plan-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.plan-icon .icon,
.plan-icon svg {
    width: 26px;
    height: 26px;
}

.pricing-card h3 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    color: #111827;
}

.plan-desc {
    color: #6B7280;
    font-size: 0.9rem;
    margin: 0 0 20px;
    min-height: 40px;
}

.pricing-card-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 24px;
    color: #111827;
}

.price-main {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
}

.price-currency {
    font-size: 1rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
}

.price-period {
    font-size: 0.9rem;
    color: #9CA3AF;
    margin-left: 4px;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    flex-grow: 1;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    color: #4B5563;
    font-size: 0.9rem;
}

.pricing-features .icon,
.pricing-features svg {
    width: 18px;
    height: 18px;
    color: #22C55E;
    flex-shrink: 0;
    margin-top: 1px;
}

.pricing-card-footer {
    margin-top: auto;
}

.btn-choose,
.btn-outline {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s;
}

.btn-choose {
    background: #2563EB;
    color: #fff;
    border: 1px solid #2563EB;
}

.pricing-card.popular .btn-choose {
    background: #6366F1;
    border-color: #6366F1;
}

.btn-outline {
    background: #fff;
    color: #2563EB;
    border: 1px solid #2563EB;
}

.pricing-card.enterprise .btn-outline {
    color: #F59E0B;
    border-color: #F59E0B;
}

.btn-choose:hover,
.btn-outline:hover {
    filter: brightness(1.05);
}

.pricing-footer {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.pricing-info-box,
.pricing-help-box {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.pricing-info-box .icon,
.pricing-info-box svg,
.pricing-help-box .icon,
.pricing-help-box svg {
    width: 24px;
    height: 24px;
    color: #3B82F6;
    flex-shrink: 0;
}

.pricing-info-box h4,
.pricing-help-box h4 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: #111827;
}

.pricing-info-box p,
.pricing-help-box p {
    margin: 0;
    font-size: 0.85rem;
    color: #6B7280;
    line-height: 1.5;
}

.pricing-copyright {
    text-align: center;
    color: #9CA3AF;
    font-size: 0.8rem;
    margin-top: 40px;
}

@media (max-width: 900px) {
    .pricing-footer {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card.popular {
        transform: none;
    }
}
.btn-icon-info { background: #6B7280; }

/* Messenger / Chat */
.messenger {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    grid-template-rows: minmax(0, 1fr);
    height: calc(100vh - 125px);
    overflow: hidden;
    border-top: 1px solid #E5E7EB;
    background: #fff;
}

.messenger-sidebar {
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    background: #FAFBFC;
}

.messenger-sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E5E7EB;
}

.messenger-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #111827;
}

.messenger-actions {
    display: flex;
    gap: 6px;
}

.messenger-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: #F3F4F6;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}

.messenger-btn:hover {
    background: #E5E7EB;
}

.messenger-btn .icon,
.messenger-btn svg {
    width: 18px;
    height: 18px;
}

.messenger-btn.assign-btn {
    width: auto;
    padding: 0 10px;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.messenger-search {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid #E5E7EB;
}

.messenger-search .search-icon {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    width: 16px;
    height: 16px;
}

.messenger-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #fff;
    font-size: 0.9rem;
    outline: none;
}

.messenger-search input:focus {
    border-color: #3B82F6;
}

.messenger-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #E5E7EB;
    overflow-x: auto;
}

.filter-tab {
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: #6B7280;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

.filter-tab.active {
    background: #E0F2FE;
    color: #2563EB;
}

.filter-count {
    margin-left: 4px;
    background: #E5E7EB;
    color: #4B5563;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.conversation-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.conversation-list li {
    border-bottom: 1px solid #F3F4F6;
}

.conversation-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.conversation-list li.active a,
.conversation-list li a:hover {
    background: #F0F9FF;
}

.conversation-empty {
    padding: 20px;
    text-align: center;
    color: #9CA3AF;
    font-size: 0.9rem;
}

.conversation-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #DBEAFE;
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

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

.conversation-top,
.conversation-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.conversation-name {
    color: #111827;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.75rem;
    color: #9CA3AF;
    flex-shrink: 0;
}

.conversation-preview {
    font-size: 0.82rem;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.conversation-badge {
    background: #10B981;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0 5px;
}

.messenger-chat {
    display: flex;
    flex-direction: column;
    background: #F8FAFC;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.messenger-chat-header {
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chat-header-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #111827;
}

.chat-header-info span {
    font-size: 0.8rem;
    color: #6B7280;
}

.chat-header-actions {
    display: flex;
    gap: 6px;
}

.messenger-chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.chat-date-divider {
    text-align: center;
    font-size: 0.75rem;
    color: #9CA3AF;
    background: #EFF6FF;
    padding: 4px 12px;
    border-radius: 20px;
    align-self: center;
    margin: 8px 0;
}

.message {
    display: flex;
    max-width: 70%;
}

.message-in {
    align-self: flex-start;
}

.message-out {
    align-self: flex-end;
}

.message-bubble {
    padding: 12px 14px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    word-break: normal;
    overflow-wrap: break-word;
}

.message-in .message-bubble {
    background: #fff;
    color: #111827;
    border-bottom-left-radius: 4px;
}

.message-out .message-bubble {
    background: #DCFCE7;
    color: #111827;
    border-bottom-right-radius: 4px;
}

.message-content p {
    margin: 0 0 6px;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: break-word;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-media img,
.message-media video {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.chat-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563EB;
    text-decoration: none;
    font-size: 0.85rem;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #9CA3AF;
}

.message-out .message-meta {
    color: #4B5563;
}

.message-status .icon,
.message-status svg {
    width: 12px;
    height: 12px;
}

.messenger-chat-form {
    background: #fff;
    border-top: 1px solid #E5E7EB;
    padding: 12px 20px 16px;
    flex-shrink: 0;
}

.chat-input-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    padding-left: 4px;
    position: relative;
}

.chat-tool-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
    position: relative;
    padding: 0;
}

.chat-tool-btn:hover {
    background: #F3F4F6;
}

.chat-tool-btn .icon,
.chat-tool-btn svg {
    width: 20px;
    height: 20px;
}

.chat-tool-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F3F4F6;
    border-radius: 24px;
    padding: 6px 6px 6px 18px;
}

.chat-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    padding: 8px 0;
    color: #111827;
}

.chat-input::placeholder {
    color: #9CA3AF;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #10B981;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 0.15s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    filter: brightness(1.05);
}

.chat-send-btn .icon,
.chat-send-btn svg {
    width: 18px;
    height: 18px;
}

.file-input,
.hidden {
    display: none !important;
}

.file-preview {
    font-size: 0.85rem;
    color: #6B7280;
    align-self: center;
    margin-left: auto;
}

.emoji-panel {
    display: none;
    position: absolute;
    bottom: 44px;
    left: 0;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-width: 280px;
    max-height: 220px;
    overflow-y: auto;
}

.emoji-panel.visible {
    display: block;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    font-size: 1.4rem;
    text-align: center;
}

.emoji-grid span {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    user-select: none;
}

.emoji-grid span:hover {
    background: #F3F4F6;
}

.messenger-info {
    border-left: 1px solid #E5E7EB;
    background: #fff;
    overflow-y: auto;
    padding: 20px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.info-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #111827;
}

.info-header span {
    font-size: 0.8rem;
    color: #6B7280;
}

.info-header .messenger-btn {
    margin-left: auto;
}

.info-section {
    margin-bottom: 24px;
}

.info-section h5 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #111827;
    font-weight: 600;
}

.info-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.info-section-header h5 {
    margin: 0;
}

.info-section-header a {
    font-size: 0.8rem;
    color: #2563EB;
    text-decoration: none;
    font-weight: 500;
}

.info-text-muted {
    color: #9CA3AF;
    font-size: 0.85rem;
    margin: 0;
}

.info-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-label {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.label-client {
    background: #D1FAE5;
    color: #065F46;
}

.label-new {
    background: #E0E7FF;
    color: #3730A3;
}

.label-important {
    background: #FEF3C7;
    color: #92400E;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 0.85rem;
    color: #6B7280;
}

.info-row span:last-child {
    color: #111827;
    font-weight: 500;
}

.status-open {
    color: #10B981;
    background: #D1FAE5;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.info-order {
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px;
}

.info-order-id {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.info-order-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: #6B7280;
}

.badge-completed {
    background: #D1FAE5;
    color: #065F46;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.info-order-amount {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.messenger-empty {
    grid-column: 2 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8FAFC;
    color: #6B7280;
}

.messenger-empty-state {
    text-align: center;
}

.messenger-empty-state .icon,
.messenger-empty-state svg {
    width: 48px;
    height: 48px;
    color: #CBD5E1;
    margin-bottom: 12px;
}

.webhook-log-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.log-block {
    background: #1E293B;
    color: #E2E8F0;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 1100px) {
    .messenger {
        grid-template-columns: 260px 1fr;
    }

    .messenger-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .messenger {
        grid-template-columns: 1fr;
    }

    .messenger-sidebar {
        display: none;
    }

    .messenger-chat {
        min-width: 0;
    }

    .message {
        max-width: 85%;
    }
}
