/* StaffBot.my — Customer Dashboard Styles */
:root {
    --primary: #1E3A5F;
    --primary-light: #2c5282;
    --secondary: #F59E0B;
    --accent: #3B82F6;
    --bg: #F8FAFC;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --text: #1E293B;
    --text-light: #64748B;
    --border: #E2E8F0;
    --card: #FFFFFF;
    --sidebar: #1E3A5F;
    --sidebar-hover: #2c5282;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--sidebar); color: white; padding: 0; position: fixed; height: 100vh; overflow-y: auto; z-index: 100; }
.sidebar-brand { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand h2 { font-size: 18px; font-weight: 700; }
.sidebar-brand span { font-size: 12px; color: var(--secondary); }
.sidebar-nav { padding: 16px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; transition: all 0.2s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--sidebar-hover); color: white; }
.sidebar-nav a.active { border-right: 3px solid var(--secondary); }
.main-content { margin-left: 260px; flex: 1; padding: 24px 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.topbar h1 { font-size: 24px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-badge { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }

/* Cards */
.card { background: var(--card); border-radius: 12px; border: 1px solid var(--border); padding: 24px; margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h3 { font-size: 16px; font-weight: 600; }
.stat-card { padding: 20px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #CBD5E1; }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #2563EB; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: border-color 0.2s; }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: white; }
select.form-input { appearance: auto; }

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:hover td { background: #F1F5F9; }

/* Status badges */
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-active { background: #D1FAE5; color: #065F46; }
.status-pending { background: #FEF3C7; color: #92400E; }
.status-error { background: #FEE2E2; color: #991B1B; }
.status-suspended { background: #F3F4F6; color: #4B5563; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-active { background: var(--success); }
.dot-error { background: var(--danger); }
.dot-pending { background: var(--warning); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 16px; padding: 32px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 14px 20px; border-radius: 8px; color: white; font-size: 14px; animation: slideIn 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Chat */
.chat-container { height: calc(100vh - 200px); display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 80%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-user { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.chat-bot { align-self: flex-start; background: #F1F5F9; border-bottom-left-radius: 4px; }
.chat-input-area { display: flex; gap: 12px; padding: 16px; border-top: 1px solid var(--border); background: white; border-radius: 0 0 12px 12px; }
.chat-input-area input { flex: 1; }
.chat-msg .msg-time { font-size: 11px; opacity: 0.7; margin-top: 4px; }

/* Loading */
.loading { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-brand h2, .sidebar-brand span, .sidebar-nav a span { display: none; }
    .main-content { margin-left: 60px; padding: 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1E3A5F 0%, #2c5282 100%); }
.login-card { background: white; border-radius: 16px; padding: 40px; width: 400px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.login-card h1 { font-size: 24px; margin-bottom: 8px; }
.login-card p { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }
