/* ======================
   File: wwwroot/css/site.css
   ====================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --sidebar-width: 260px;
    --header-height: 72px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e1b4b 0%, #1f2937 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.nav-section-title {
    padding: 12px 16px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.status-toggle {
    margin-bottom: 12px;
}

.btn-status {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-status:hover {
    background: rgba(255, 255, 255, 0.15);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator.offline {
    background: var(--gray-400);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: var(--gray-50);
}

.content-wrapper {
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 15px;
    color: var(--gray-500);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.kpi-icon.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.2) 100%);
    color: var(--primary);
}

.kpi-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: var(--success);
}

.kpi-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: var(--warning);
}

.kpi-icon.info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.2) 100%);
    color: var(--info);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.chart-card, .stats-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.chart-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.chart-body {
    height: 280px;
    position: relative;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Inbox Layout */
.inbox-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    height: calc(100vh - 120px);
}

.inbox-sidebar {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inbox-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.inbox-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.filter-pill:hover {
    background: var(--gray-200);
}

.filter-pill.active {
    background: var(--primary);
    color: white;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
}

.conversation-item:hover {
    background: var(--gray-50);
}

.conversation-item.unread {
    background: rgba(99, 102, 241, 0.03);
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
}

.conversation-time {
    font-size: 12px;
    color: var(--gray-400);
}

.conversation-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preview-text {
    font-size: 14px;
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.conversation-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.status-onhold {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.status-resolved {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray-600);
}

.status-badge.status-queued {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.category-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-600);
}

.agent-name {
    font-size: 12px;
    color: var(--gray-500);
}

.inbox-placeholder {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: var(--gray-400);
}

.placeholder-content i {
    font-size: 64px;
    margin-bottom: 16px;
}

.placeholder-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.placeholder-content p {
    font-size: 14px;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Chat Layout */
.chat-layout {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-customer-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.customer-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.customer-phone {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

.chat-actions {
    display: flex;
    gap: 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(180deg, var(--gray-50) 0%, white 100%);
}

.message {
    display: flex;
    margin-bottom: 16px;
}

.message-incoming {
    justify-content: flex-start;
}

.message-outgoing {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: var(--radius);
}

.message-incoming .message-bubble {
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.message-outgoing .message-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.message-content {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.message-incoming .message-meta {
    color: var(--gray-400);
}

.message-outgoing .message-meta {
    color: rgba(255, 255, 255, 0.7);
    justify-content: flex-end;
}

.chat-input {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-200);
    background: white;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.btn-attachment {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: white;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
}

.btn-attachment:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.message-textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    min-height: 48px;
    max-height: 120px;
}

.message-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-send {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-send:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-send:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-top: 8px;
}

.file-preview span {
    flex: 1;
    font-size: 14px;
    color: var(--gray-700);
}

.btn-clear-file {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-300);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--gray-600);
    transition: all 0.2s;
}

.btn-clear-file:hover {
    background: var(--danger);
    color: white;
}

/* Business Grid */
.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.business-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s;
}

.business-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.business-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--gray-50);
}

.business-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.business-body {
    padding: 20px;
}

.business-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.business-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-600);
}

.info-item i {
    color: var(--gray-400);
}

.business-actions {
    padding: 16px 20px;
    background: var(--gray-50);
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--gray-200);
}

/* Forms */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 32px;
}

.form-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 15px;
    color: var(--gray-500);
}

.business-form {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.form-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
}

.form-control {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    font-size: 14px;
    color: var(--gray-700);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.text-danger {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.brand-icon-large {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.company-name {
    font-size: 13px;
    color: var(--gray-400);
}

.login-form {
    margin-bottom: 32px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 8px;
    display: block;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
}

.input-group .form-control {
    padding-left: 44px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-size: 15px;
}

.login-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: 24px;
}

.demo-credentials {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.credentials-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.credential-item {
    font-size: 12px;
    color: var(--gray-500);
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

/* Dropdown */
.dropdown-menu {
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    padding: 8px;
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray-700);
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Utilities */
.text-warning {
    color: var(--warning);
}

.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--gray-400);
}

.d-inline {
    display: inline;
}

.full-width {
    grid-column: 1 / -1;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--gray-50);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.category-body {
    padding: 20px;
}

.category-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.category-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.meta-label {
    color: var(--gray-500);
    font-weight: 500;
}

.meta-value {
    color: var(--gray-900);
    font-weight: 600;
}

.category-actions {
    padding: 16px 20px;
    background: var(--gray-50);
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--gray-200);
}

/* Users Table */
.users-table-container {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.users-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

.users-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.users-table tbody tr:hover {
    background: var(--gray-50);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-name-cell {
    font-weight: 600;
    color: var(--gray-900);
}

.user-email-cell {
    font-size: 13px;
    color: var(--gray-500);
}

.role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.role-admin {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.role-badge.role-supervisor {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.role-badge.role-agent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.status-online {
    color: var(--success);
}

.status-badge.status-offline {
    color: var(--gray-400);
}

.status-badge i {
    font-size: 8px;
    margin-right: 4px;
}

.chat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: var(--primary);
    color: white;
    border-radius: 16px;
    font-weight: 700;
    font-size: 13px;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

/* Webhook Logs */
.logs-container {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.logs-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

.logs-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.logs-table tbody tr:hover {
    background: var(--gray-50);
}

.logs-table code {
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Space Mono', monospace;
}

.log-error {
    background: rgba(239, 68, 68, 0.02);
}

.status-badge.status-success {
    color: var(--success);
}

.status-badge.status-error {
    color: var(--danger);
}

/* Webhook Details */
.webhook-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.detail-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.detail-value {
    font-size: 15px;
    color: var(--gray-900);
    font-weight: 500;
}

.error-text {
    color: var(--danger);
}

.json-payload {
    background: var(--gray-900);
    color: #f8f8f2;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'Space Mono', monospace;
}

.json-payload code {
    color: inherit;
    background: none;
}

/* Reports */
.chart-large {
    grid-column: span 2;
}

.chart-body-large {
    height: 360px;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.settings-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.2s;
}

.settings-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.settings-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.2) 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.settings-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.settings-content p {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.5;
}

.settings-info {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.settings-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.info-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}


/* Toast Notifications */
.toast-container {
    z-index: 11000;
}

.toast {
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    border: none;
    border-radius: var(--radius);
}

.toast-header {
    border-bottom: none;
    padding: 12px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.toast-body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.toast:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    transition: all 0.2s;
}

.toast.show {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* Date Divider in Inbox */
.date-divider {
    padding: 16px 20px 8px;
    position: sticky;
    top: 0;
    background: var(--gray-50);
    z-index: 10;
}

.date-divider-text {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

/* Auto Messages */
.auto-messages-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.business-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 32px;
    border: 1px solid var(--gray-200);
}

.business-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
}

.business-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.business-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.business-phone {
    font-size: 14px;
    color: var(--gray-500);
    margin: 4px 0 0 0;
}

.messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.message-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--gray-200);
}

.message-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.message-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-description {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0;
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: white;
}

.message-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.message-variables {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.variable-tag {
    padding: 4px 8px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Space Mono', monospace;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .messages-grid {
        grid-template-columns: 1fr;
    }
    
    .message-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
