/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 14px; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; border: none; }
textarea { resize: none; }

/* ===== VARIABLES ===== */
:root {
    --wa-green: #25d366;
    --wa-dark-green: #128c7e;
    --wa-teal: #075e54;
    --wa-light-green: #dcf8c6;
    --wa-bg: #f0f2f5;
    --wa-sidebar-bg: #ffffff;
    --wa-header-bg: #f0f2f5;
    --wa-chat-bg: #efeae2;
    --wa-msg-out: #d9fdd3;
    --wa-msg-in: #ffffff;
    --wa-border: #e9edef;
    --wa-text: #111b21;
    --wa-text-secondary: #667781;
    --wa-icon: #54656f;
    --admin-sidebar: #1a1a2e;
    --admin-sidebar-hover: #16213e;
    --admin-accent: #25d366;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 16px;
}

/* ===== AUTH PAGES ===== */
.auth-body { background: linear-gradient(135deg, #075e54 0%, #128c7e 50%, #25d366 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.auth-container { display: flex; width: 900px; max-width: 95vw; min-height: 560px; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }

.auth-left { background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); flex: 1; padding: 50px 40px; display: flex; flex-direction: column; justify-content: center; color: white; }
.auth-brand { margin-bottom: 40px; }
.brand-icon { width: 70px; height: 70px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 20px; }
.auth-brand h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.auth-brand p { opacity: 0.85; font-size: 15px; }
.auth-features { display: flex; flex-direction: column; gap: 16px; }
.feature-item { display: flex; align-items: center; gap: 12px; font-size: 15px; opacity: 0.9; }
.feature-item i { width: 36px; height: 36px; background: rgba(255,255,255,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }

.auth-right { background: white; flex: 1; padding: 50px 40px; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 360px; }
.auth-header { margin-bottom: 30px; }
.auth-header h2 { font-size: 24px; font-weight: 700; color: var(--wa-text); margin-bottom: 6px; }
.auth-header p { color: var(--wa-text-secondary); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--wa-text-secondary); margin-bottom: 8px; }
.form-group label i { margin-right: 5px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--wa-border);
    border-radius: var(--radius); background: #f8f9fa; color: var(--wa-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,0.1); background: white;
}
.form-group .disabled-input { background: #f0f2f5; color: var(--wa-text-secondary); cursor: not-allowed; }

.phone-input { display: flex; border: 1.5px solid var(--wa-border); border-radius: var(--radius); overflow: hidden; background: #f8f9fa; transition: border-color 0.2s; }
.phone-input:focus-within { border-color: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,0.1); background: white; }
.country-code { padding: 12px 14px; background: #e9edef; color: var(--wa-text-secondary); font-weight: 600; border-right: 1px solid var(--wa-border); white-space: nowrap; }
.phone-input input { flex: 1; padding: 12px 14px; border: none; background: transparent; }

.btn-primary {
    width: 100%; padding: 13px; background: var(--wa-green); color: white;
    border-radius: var(--radius); font-size: 15px; font-weight: 600;
    transition: background 0.2s, transform 0.1s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--wa-dark-green); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.error-msg { background: #ffeaea; color: #e74c3c; padding: 10px 14px; border-radius: var(--radius); font-size: 13px; border-left: 3px solid #e74c3c; }

/* Simple centered login */
.simple-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.simple-login-card { background: white; border-radius: 20px; padding: 40px 36px; width: 380px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; }
.simple-login-icon { width: 72px; height: 72px; background: linear-gradient(135deg, #075e54, #25d366); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; color: white; margin: 0 auto 16px; }
.simple-login-card h2 { font-size: 22px; font-weight: 700; color: var(--wa-text); margin-bottom: 24px; }
.phone-input-simple { display: flex; border: 1.5px solid var(--wa-border); border-radius: var(--radius); overflow: hidden; background: #f8f9fa; margin-bottom: 16px; transition: border-color 0.2s; }
.phone-input-simple:focus-within { border-color: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,0.1); background: white; }
.phone-input-simple .country-code { padding: 13px 14px; background: #e9edef; color: var(--wa-text-secondary); font-weight: 600; border-right: 1px solid var(--wa-border); white-space: nowrap; font-size: 15px; }
.phone-input-simple input { flex: 1; padding: 13px 14px; border: none; background: transparent; font-size: 15px; color: var(--wa-text); }
.phone-input-simple input::placeholder { color: var(--wa-text-secondary); }

/* Admin Login */
.admin-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.admin-login-card { background: white; border-radius: 20px; padding: 45px 40px; width: 400px; max-width: 95vw; box-shadow: var(--shadow-md); }
.admin-login-header { text-align: center; margin-bottom: 30px; }
.admin-icon { background: rgba(7,94,84,0.1) !important; color: var(--wa-teal) !important; margin: 0 auto 15px !important; }
.admin-login-header h2 { font-size: 22px; font-weight: 700; color: var(--wa-text); margin-bottom: 5px; }
.admin-login-header p { color: var(--wa-text-secondary); font-size: 13px; }

/* ===== CHAT PAGE ===== */
.chat-body { background: var(--wa-bg); height: 100vh; overflow: hidden; }
.chat-wrapper { display: flex; height: 100vh; width: 100%; box-shadow: var(--shadow-md); }

/* Sidebar */
.chat-sidebar { width: 380px; min-width: 300px; background: var(--wa-sidebar-bg); border-right: 1px solid var(--wa-border); display: flex; flex-direction: column; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--wa-header-bg); min-height: 60px; }
.user-avatar-wrap { position: relative; cursor: pointer; }
.sidebar-actions { display: flex; gap: 4px; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
    width: 40px; height: 40px; border-radius: 50%; background: var(--wa-dark-green);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; cursor: pointer;
}
.avatar-placeholder.large { width: 80px; height: 80px; font-size: 32px; }
.avatar-placeholder.sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-placeholder.support-avatar { background: var(--wa-teal); font-size: 18px; }
.avatar-placeholder.support-avatar-sm { width: 40px; height: 40px; background: var(--wa-teal); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.avatar-placeholder.admin-av { background: #6c5ce7; }

.online-dot { position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; background: var(--wa-green); border-radius: 50%; border: 2px solid white; }

.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--wa-icon); font-size: 16px; transition: background 0.15s; }
.icon-btn:hover { background: rgba(0,0,0,0.06); }

.search-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--wa-header-bg); margin: 8px 8px 4px; border-radius: 8px; }
.search-bar i { color: var(--wa-text-secondary); font-size: 14px; }
.search-bar input { flex: 1; background: transparent; color: var(--wa-text); font-size: 14px; }
.search-bar input::placeholder { color: var(--wa-text-secondary); }

.chat-list { flex: 1; overflow-y: auto; }
.chat-list::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.chat-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--wa-border); }
.chat-list-item:hover, .chat-list-item.active { background: var(--wa-bg); }
.chat-item-avatar { position: relative; flex-shrink: 0; }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; color: var(--wa-text); font-size: 15px; margin-bottom: 3px; }
.chat-item-preview { color: var(--wa-text-secondary); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.chat-item-time { font-size: 11px; color: var(--wa-text-secondary); }
.unread-badge { background: var(--wa-green); color: white; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }

/* Chat Main */
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--wa-chat-bg); position: relative; overflow: hidden; }

.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--wa-header-bg); border-bottom: 1px solid var(--wa-border); min-height: 60px; position: relative; }
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-header-name { font-weight: 600; color: var(--wa-text); font-size: 15px; }
.chat-header-status { font-size: 12px; color: var(--wa-green); }
.chat-header-actions { display: flex; align-items: center; gap: 4px; position: relative; }

.dropdown-menu { position: absolute; top: 45px; right: 0; background: white; border-radius: var(--radius); box-shadow: var(--shadow-md); min-width: 180px; z-index: 100; overflow: hidden; }
.dropdown-item { padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--wa-text); font-size: 14px; transition: background 0.15s; }
.dropdown-item:hover { background: var(--wa-bg); }
.dropdown-item i { color: var(--wa-icon); width: 16px; }

/* Messages */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4d4d4' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

.loading-msgs { text-align: center; color: var(--wa-text-secondary); padding: 20px; font-size: 13px; }
.no-msgs { text-align: center; color: var(--wa-text-secondary); padding: 20px; font-size: 13px; }

.message { display: flex; margin-bottom: 2px; padding: 0 8px; }
.msg-out { justify-content: flex-end; }
.msg-in { justify-content: flex-start; }

.msg-bubble {
    max-width: 65%; padding: 8px 12px 6px; border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); position: relative;
}
.msg-out .msg-bubble { background: var(--wa-msg-out); border-radius: 8px 0 8px 8px; }
.msg-in .msg-bubble { background: var(--wa-msg-in); border-radius: 0 8px 8px 8px; }

.msg-text { color: var(--wa-text); font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.msg-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 3px; }
.msg-time { font-size: 11px; color: var(--wa-text-secondary); }
.msg-ticks { font-size: 12px; color: var(--wa-text-secondary); }
.msg-ticks.read { color: #53bdeb; }

.system-msg { justify-content: center; margin: 8px 0; }
.system-bubble { background: rgba(255,255,255,0.85); color: var(--wa-text-secondary); padding: 6px 14px; border-radius: 20px; font-size: 12px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.08); max-width: 80%; }

.msg-animate { animation: msgSlideIn 0.2s ease-out; }
@keyframes msgSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Input Area */
.chat-input-area { padding: 8px 16px; background: var(--wa-header-bg); border-top: 1px solid var(--wa-border); }
.chat-input-wrap { display: flex; align-items: flex-end; gap: 8px; background: white; border-radius: 24px; padding: 6px 6px 6px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.chat-input-wrap textarea { flex: 1; max-height: 120px; line-height: 1.5; color: var(--wa-text); font-size: 15px; padding: 6px 0; background: transparent; }
.chat-input-wrap textarea::placeholder { color: var(--wa-text-secondary); }
.send-btn { width: 40px; height: 40px; background: var(--wa-green); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: background 0.2s, transform 0.1s; flex-shrink: 0; }
.send-btn:hover { background: var(--wa-dark-green); }
.send-btn:active { transform: scale(0.92); }
.emoji-btn { color: var(--wa-text-secondary); }

/* ===== MODALS ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); }
.modal-box { background: white; border-radius: var(--radius-lg); width: 420px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--wa-border); }
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--wa-text); display: flex; align-items: center; gap: 8px; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--wa-icon); transition: background 0.15s; }
.modal-close:hover { background: var(--wa-bg); }
.modal-body { padding: 24px; }

.profile-avatar-section { display: flex; justify-content: center; margin-bottom: 24px; }
.profile-avatar-wrap { position: relative; cursor: pointer; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.5); border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white; font-size: 18px; opacity: 0; transition: opacity 0.2s; gap: 2px;
}
.avatar-overlay span { font-size: 10px; font-weight: 600; }
.profile-avatar-wrap:hover .avatar-overlay { opacity: 1; }

/* ===== ADMIN PANEL ===== */
.admin-body { background: #f4f6f9; min-height: 100vh; }
.admin-wrapper { display: flex; min-height: 100vh; }

.admin-sidebar { width: 240px; background: var(--admin-sidebar); color: white; display: flex; flex-direction: column; flex-shrink: 0; }
.admin-sidebar-header { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.admin-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.admin-brand i { font-size: 20px; color: var(--wa-green); }

.admin-nav { padding: 12px 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.7); font-size: 14px; font-weight: 500; transition: all 0.15s; }
.nav-item:hover { background: var(--admin-sidebar-hover); color: white; }
.nav-item.active { background: rgba(37,211,102,0.15); color: var(--wa-green); border-right: 3px solid var(--wa-green); }
.nav-item i { width: 18px; text-align: center; }
.nav-logout { margin-top: auto; color: rgba(255,100,100,0.8); }
.nav-logout:hover { color: #ff6b6b; background: rgba(255,100,100,0.1); }

.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: white; border-bottom: 1px solid var(--wa-border); box-shadow: var(--shadow); }
.admin-topbar h1 { font-size: 18px; font-weight: 700; color: var(--wa-text); display: flex; align-items: center; gap: 10px; }
.admin-topbar h1 i { color: var(--wa-green); }
.admin-topbar-right { display: flex; align-items: center; gap: 10px; }
.admin-name { font-weight: 600; color: var(--wa-text); font-size: 14px; }
.admin-avatar-wrap { position: relative; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 24px 0; }
.stat-card { background: white; border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-icon.orange { background: #fff3e0; color: #f57c00; }
.stat-icon.red { background: #fce4ec; color: #c62828; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--wa-text); }
.stat-label { font-size: 12px; color: var(--wa-text-secondary); margin-top: 2px; }

/* Admin Chat Layout */
.admin-chat-layout { display: flex; flex: 1; margin: 16px 24px 24px; gap: 16px; overflow: hidden; min-height: 0; }

.admin-conv-list { width: 320px; background: white; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.conv-list-header { padding: 14px 16px; border-bottom: 1px solid var(--wa-border); display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--wa-text); font-size: 14px; }
.conv-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--wa-border); transition: background 0.15s; }
.conv-item:hover, .conv-item.active { background: var(--wa-bg); }
.conv-item.has-unread { background: #f0fff4; }
.conv-avatar { position: relative; flex-shrink: 0; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; color: var(--wa-text); font-size: 14px; margin-bottom: 3px; }
.conv-preview { color: var(--wa-text-secondary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.conv-time { font-size: 11px; color: var(--wa-text-secondary); }
.no-convs { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; color: var(--wa-text-secondary); gap: 10px; }
.no-convs i { font-size: 36px; opacity: 0.4; }

.admin-chat-window { flex: 1; background: white; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.no-chat-selected { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--wa-text-secondary); gap: 12px; }
.no-chat-selected i { font-size: 56px; opacity: 0.2; }
.no-chat-selected h3 { font-size: 18px; font-weight: 600; color: var(--wa-text); }
.no-chat-selected p { font-size: 14px; }

.admin-chat-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--wa-header-bg); border-bottom: 1px solid var(--wa-border); }

/* Buttons */
.btn-sm { padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s; cursor: pointer; border: none; }
.btn-primary.btn-sm { background: var(--wa-green); color: white; }
.btn-primary.btn-sm:hover { background: var(--wa-dark-green); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-warning { background: #fef3c7; color: #d97706; }
.btn-warning:hover { background: #d97706; color: white; }
.btn-success { background: #d1fae5; color: #059669; }
.btn-success:hover { background: #059669; color: white; }

/* Admin Content Card */
.admin-content-card { background: white; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin: 20px 24px; }
.admin-content-card h3 { font-size: 16px; font-weight: 700; color: var(--wa-text); }

/* Table */
.table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.table-header span { font-weight: 600; color: var(--wa-text-secondary); font-size: 13px; }
.search-input { padding: 8px 14px; border: 1.5px solid var(--wa-border); border-radius: 20px; font-size: 13px; color: var(--wa-text); width: 220px; transition: border-color 0.2s; }
.search-input:focus { border-color: var(--wa-green); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 700; color: var(--wa-text-secondary); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--wa-border); background: #fafafa; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--wa-border); color: var(--wa-text); font-size: 13px; vertical-align: middle; }
.data-table tr:hover td { background: #fafafa; }
.blocked-row td { opacity: 0.6; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-success { background: #d1fae5; color: #059669; }
.badge-danger { background: #fee2e2; color: #dc2626; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin: 16px 24px 0; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 3px solid #059669; }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 3px solid #dc2626; }

/* Admin Card */
.admin-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

/* Form Control */
.form-control { width: 100%; padding: 10px 14px; border: 1px solid #dde1e7; border-radius: 8px; font-size: 14px; color: #333; background: #fafafa; transition: border-color 0.2s; outline: none; }
.form-control:focus { border-color: #25d366; background: #fff; }

/* Auto Messages */
.auto-msg-card { border: 1.5px solid var(--wa-border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; transition: border-color 0.2s; }
.auto-msg-card:hover { border-color: var(--wa-green); }
.auto-msg-card.inactive { opacity: 0.6; }
.auto-msg-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.auto-msg-type { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trigger-badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.trigger-welcome { background: #e8f5e9; color: #2e7d32; }
.trigger-offline { background: #e3f2fd; color: #1565c0; }
.trigger-keyword { background: #fff3e0; color: #e65100; }
.keyword-tag { background: #f3e5f5; color: #6a1b9a; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: 0.3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--wa-green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Form Row */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Scrollbar */
.admin-conv-list::-webkit-scrollbar, .admin-chat-window .chat-messages::-webkit-scrollbar { width: 4px; }
.admin-conv-list::-webkit-scrollbar-thumb, .admin-chat-window .chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* Responsive */
@media (max-width: 768px) {
    .auth-container { flex-direction: column; }
    .auth-left { display: none; }
    .chat-sidebar { width: 100%; }
    .chat-main { display: none; }
    .chat-wrapper.show-chat .chat-sidebar { display: none; }
    .chat-wrapper.show-chat .chat-main { display: flex; width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { display: none; }
    .admin-chat-layout { flex-direction: column; }
    .admin-conv-list { width: 100%; max-height: 300px; }
}