/* KUBER by AnandAnish - Premium Bright Theme CSS Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #f6f8fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #edf1f6;
    --bg-accent-light: #fef9e7;
    
    --accent-primary: #d4af37;
    --accent-secondary: #f39c12;
    --accent-gradient: linear-gradient(135deg, #f5d76e 0%, #d4af37 100%);
    --accent-hover: #b89327;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-gold: #c29b23;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-gold: #f5d76e;
    
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    
    --card-shadow: 0 10px 25px -5px rgba(20, 25, 35, 0.04), 0 8px 16px -6px rgba(20, 25, 35, 0.03);
    --hover-shadow: 0 20px 30px -8px rgba(20, 25, 35, 0.08), 0 12px 20px -8px rgba(212, 175, 55, 0.15);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Layout Framework */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02);
}

.brand-section {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.brand-logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 4px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item {
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    color: var(--text-gold);
    background-color: var(--bg-accent-light);
}

.sidebar-link.active {
    background-color: var(--bg-accent-light);
    color: var(--text-primary);
    font-weight: 600;
    border-left: 4px solid var(--accent-primary);
    padding-left: 12px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

/* Header Styling */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
}

.header-title h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.user-info {
    text-align: right;
}

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

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

/* Base Components & Container Styling */
.content-body {
    padding: 32px;
    flex-grow: 1;
}

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--hover-shadow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: var(--accent-gradient);
    opacity: 0.7;
}

.stat-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background-color: var(--bg-accent-light);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Custom Table Layout */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.9rem;
    text-align: left;
}

.custom-table th {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 14px 18px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.custom-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.custom-table tbody tr:hover {
    background-color: var(--bg-primary);
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.badge-success { background-color: var(--success-bg); color: var(--success); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); }
.badge-info { background-color: var(--info-bg); color: var(--info); }
.badge-gold { background-color: var(--bg-accent-light); color: var(--text-gold); border: 1px solid var(--border-gold); }

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.25);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Chat Dashboard Interface */
.chat-container {
    display: flex;
    height: calc(100vh - var(--header-height) - 64px);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-search-box {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}

.chat-item:hover {
    background-color: var(--bg-accent-light);
}

.chat-item.active {
    background-color: var(--bg-accent-light);
    border-left: 4px solid var(--accent-primary);
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-item-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.chat-window-header {
    height: 64px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-window-title {
    display: flex;
    flex-direction: column;
}

.chat-window-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.chat-window-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-window-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-messages {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-bubble {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: var(--border-radius);
    font-size: 0.92rem;
    position: relative;
    line-height: 1.45;
}

.message-bubble.lead {
    align-self: flex-start;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.message-bubble.ai {
    align-self: flex-end;
    background-color: var(--bg-accent-light);
    color: var(--text-primary);
    border-bottom-right-radius: 2px;
    border: 1px solid var(--border-gold);
}

.message-bubble.admin {
    align-self: flex-end;
    background-color: var(--info-bg);
    color: var(--text-primary);
    border-bottom-right-radius: 2px;
    border: 1px solid #bfdbfe;
}

.message-info {
    font-size: 0.72rem;
    margin-top: 6px;
    color: var(--text-muted);
    text-align: right;
    display: block;
}

.chat-input-area {
    padding: 16px 24px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Custom CRM Details Pane */
.chat-details-panel {
    width: 280px;
    border-left: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.details-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.details-title {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* Quick Note Styles */
.note-item {
    font-size: 0.85rem;
    padding: 10px;
    background-color: var(--bg-primary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Premium Login Form */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
}

.login-logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.login-logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

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

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fee2e2;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid #d1fae5;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.4s ease forwards;
}

/* Grid helper */
.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
.grid-equal-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 992px) {
    .grid-2, .grid-equal-2 {
        grid-template-columns: 1fr;
    }
}
