/* iHub - Apple/Steam Light Inspired Design */

:root {
    /* Colors - Apple/Steam Light inspired */
    --primary: #0071e3;
    --primary-hover: #0077ed;
    --primary-light: #e8f4fd;
    --secondary: #1d1d1f;
    --background: #f5f5f7;
    --surface: #ffffff;
    --surface-secondary: #fbfbfd;
    --border: #d2d2d7;
    --border-light: #e8e8ed;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    --info: #5856d6;
    --purple: #af52de;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.login-form input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--surface);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--border-light);
}

.btn-block {
    width: 100%;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9375rem;
}

.alert-error {
    background: #ffebee;
    color: var(--danger);
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-toggle {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.sidebar-toggle:hover {
    background: var(--border-light);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-divider {
    padding: 16px 16px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    height: var(--header-height);
}

.mobile-menu-btn {
    display: none;
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.content-wrapper {
    flex: 1;
    padding: 24px;
}

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

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-icon.yellow { background: #fff8e1; color: #f57f17; }
.stat-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-icon.purple { background: #f3e5f5; color: #7b1fa2; }

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

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

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-body {
    padding: 24px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--border-light);
    transform: translateY(-2px);
}

.action-btn svg {
    color: var(--primary);
}

.action-btn span {
    font-size: 0.875rem;
    font-weight: 500;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--surface-secondary);
}

.data-table tr:hover {
    background: var(--surface-secondary);
}

.data-table tr.highlight {
    animation: highlightRow 3s ease-out;
}

@keyframes highlightRow {
    0% { background: var(--primary-light); }
    100% { background: transparent; }
}

.data-table code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8125rem;
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 600; }

/* Status */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-muted); }

.status-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
    background: white;
}

.status-select.status-pending { border-color: var(--warning); color: var(--warning); }
.status-select.status-confirmed { border-color: var(--info); color: var(--info); }
.status-select.status-completed { border-color: var(--success); color: var(--success); }
.status-select.status-cancelled { border-color: var(--danger); color: var(--danger); }

/* Badges */
.badge-purple { background: #f3e5f5; color: #7b1fa2; }
.badge-blue { background: #e3f2fd; color: #1976d2; }
.badge-gray { background: var(--border-light); color: var(--text-secondary); }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 4px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-lg {
    max-width: 700px;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.modal-close:hover {
    background: var(--border-light);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.input-with-action {
    display: flex;
    gap: 8px;
}

.input-with-action input {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.date-filter {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

/* Connection Status */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--border-light);
    margin-bottom: 16px;
}

.connection-status .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.connection-status.connected .status-indicator {
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Styles */
.chat-page .content-wrapper {
    padding: 0;
}

.chat-container {
    display: flex;
    height: calc(100vh - var(--header-height));
    background: linear-gradient(135deg, #e8f0fe 0%, #f3e8ff 100%);
}

.chat-sidebar {
    width: 340px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.05);
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #5856d6 100%);
    color: white;
}

.chat-sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
}

.chat-sidebar-header .btn {
    color: white;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-sidebar-header .btn:hover {
    background: rgba(255,255,255,0.3);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    background: white;
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: #f0f7ff;
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.conversation-item.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, #ede9fe 100%);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,113,227,0.15);
}

.conversation-item .avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #5856d6 100%);
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    box-shadow: 0 2px 8px rgba(0,113,227,0.3);
}

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

.conversation-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.conversation-preview {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.conversation-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.unread-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff3b30 0%, #ff6b5b 100%);
    color: white;
    border-radius: 11px;
    box-shadow: 0 2px 6px rgba(255,59,48,0.4);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chat-header .avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, #5856d6 100%);
    box-shadow: 0 2px 8px rgba(0,113,227,0.3);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-user-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
}

.message {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    animation: messageSlide 0.3s ease-out;
}

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

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

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

.message-content {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.9375rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.message.sent .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, #5856d6 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,113,227,0.3);
}

.message.received .message-content {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(0,0,0,0.05);
}

.message-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.message-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-image img:hover {
    transform: scale(1.02);
}

.message-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 6px;
    padding: 0 4px;
    font-weight: 500;
}

.message.sent .message-time {
    text-align: right;
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.attachment-buttons {
    display: flex;
    gap: 4px;
}

.attachment-buttons .btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-secondary);
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-buttons .btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.chat-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-light);
    border-radius: 28px;
    font-size: 0.9375rem;
    background: #f8fafc;
    transition: var(--transition-fast);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.chat-input-area .btn-primary {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #5856d6 100%);
    box-shadow: 0 4px 12px rgba(0,113,227,0.4);
}

.chat-input-area .btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,113,227,0.5);
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius-lg);
    margin: 20px;
}

.chat-empty svg {
    opacity: 0.2;
}

.chat-empty p {
    font-size: 1rem;
    font-weight: 500;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .btn {
    margin-top: 12px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: white;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.camera-modal video {
    width: 100%;
    border-radius: var(--radius-md);
}

.image-preview-modal {
    cursor: zoom-out;
}

.image-preview-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* User List */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-list-item:hover {
    background: var(--surface-secondary);
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

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

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

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-normal);
    }

    .mobile-overlay.show {
        opacity: 1;
        visibility: visible;
    }

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

    .mobile-menu-btn {
        display: block;
    }

    .chat-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 10;
        transform: translateX(-100%);
        transition: var(--transition-normal);
    }

    .chat-sidebar.show {
        transform: translateX(0);
    }

    .mobile-only {
        display: block !important;
    }
}

@media (min-width: 1025px) {
    .mobile-only {
        display: none !important;
    }
}

/* Connection Status */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 16px;
    transition: var(--transition-normal);
}

.connection-status.connected {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
}

.connection-status.disconnected {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.connected .status-indicator {
    background: var(--success);
}

.disconnected .status-indicator {
    background: var(--warning);
    animation: blink 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Row Highlight Animation for Realtime Updates */
.data-table tbody tr.highlight {
    animation: highlightRow 3s ease-out;
}

@keyframes highlightRow {
    0% {
        background: rgba(0, 113, 227, 0.2);
        transform: scale(1.01);
    }
    50% {
        background: rgba(0, 113, 227, 0.1);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* New item pulse effect */
.data-table tbody tr.highlight td:first-child {
    position: relative;
}

.data-table tbody tr.highlight td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--primary);
    border-radius: 2px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scaleY(0);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scaleY(1);
    }
}

/* Utilities */
[x-cloak] { display: none !important; }
