/* MyAvatar App Design System Override
   Converts the purple/violet theme to the new grey/green design system.
   Applied on top of dashboard_v2.css and existing styles. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --color-primary: #58595B;
    --color-accent: #8DC63F;
    --color-accent-hover: #7ab234;
    --color-accent-light: rgba(141, 198, 63, 0.1);
    --color-accent-rgb: 141, 198, 63;
    --color-bg: #FFFFFF;
    --color-surface: #F4F4F4;
    --color-border: #E0E0E0;
    --color-dark: #EBEBEB;
    --color-text: #58595B;
    --color-text-muted: #888888;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-elevated: 0 4px 16px rgba(0,0,0,0.12);
    --nav-height: 64px;
    --sidebar-width: 240px;
}

/* ===== GLOBAL RESETS ===== */
body {
    font-family: var(--font-family) !important;
    background: var(--color-surface) !important;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* ===== SIDEBAR ===== */
.sidebar, .sidebar-left {
    background: var(--color-dark) !important;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    box-shadow: 1px 0 4px rgba(0,0,0,0.06) !important;
}

.sidebar .sidebar-header,
.sidebar-left .sidebar-header {
    padding: 16px 16px !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

.sidebar .logo, .sidebar-left .logo {
    color: #58595B !important;
    gap: 10px !important;
}

.sidebar .logo-image, .sidebar-left .logo-image {
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
}

.sidebar .logo-text, .sidebar-left .logo span {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #58595B !important;
}

/* Nav items */
.sidebar .nav-link,
.sidebar-left .nav-item,
.sidebar-left .asset-nav-item {
    color: #58595B !important;
    border-radius: var(--radius-md) !important;
    transition: all 0.2s ease !important;
    font-size: 0.875rem !important;
}

.sidebar .nav-link:hover,
.sidebar-left .nav-item:hover,
.sidebar-left .asset-nav-item:hover {
    background: rgba(141, 198, 63, 0.12) !important;
    color: var(--color-accent) !important;
}

.sidebar .nav-link.active,
.sidebar-left .nav-item.active {
    background: rgba(141, 198, 63, 0.15) !important;
    color: var(--color-accent) !important;
    font-weight: 600 !important;
}

.sidebar .nav-link i,
.sidebar-left .nav-item i,
.sidebar-left .asset-nav-item i {
    width: 20px !important;
    text-align: center !important;
}

/* Section titles */
.sidebar .nav-section-title,
.sidebar-left .nav-section-header {
    color: #9ca3af !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    padding: 8px 16px !important;
}

/* Premium badge */
.premium-badge, .badge.coming-soon {
    background: var(--color-accent) !important;
    color: #fff !important;
    font-size: 0.625rem !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
}

/* Identity card in dashboard sidebar */
.identity-card {
    background: rgba(141, 198, 63, 0.08) !important;
    border: 1px solid rgba(141, 198, 63, 0.2) !important;
    border-radius: var(--radius-lg) !important;
}

.identity-logo, .identity-photo {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%) !important;
}

.identity-edit {
    color: var(--color-accent) !important;
}

.identity-edit:hover {
    color: var(--color-accent-hover) !important;
}

/* Stat icon wrappers in sidebar */
.stat-icon-wrapper.purple,
.stat-icon-wrapper.green {
    background: var(--color-accent) !important;
}

.stat-icon-wrapper.pink {
    background: #f97316 !important;
}

.stat-icon-wrapper.orange {
    background: #06b6d4 !important;
}

/* Sidebar stats - light theme */
.sidebar .sidebar-stat-item {
    background: rgba(0,0,0,0.03) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
}

.sidebar .sidebar-stat-item:hover {
    background: rgba(0,0,0,0.05) !important;
    border-color: rgba(141, 198, 63, 0.3) !important;
}

.sidebar .sidebar-stat-value {
    color: #58595B !important;
}

.sidebar .sidebar-stat-label {
    color: #9ca3af !important;
}

/* Submenu items */
.nav-subitem {
    color: #6b7280 !important;
    font-size: 0.8125rem !important;
}

.nav-subitem:hover {
    color: var(--color-accent) !important;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    background: var(--color-surface) !important;
    margin-left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
}

/* ===== HEADER BAR ===== */
.header {
    background: var(--color-bg) !important;
    border-bottom: 1px solid var(--color-border) !important;
    height: var(--nav-height) !important;
    box-shadow: none !important;
}

.header .user-avatar {
    background: var(--color-accent) !important;
    color: #fff !important;
}

.header-btn {
    color: var(--color-text-muted) !important;
}

.header-btn:hover {
    color: var(--color-accent) !important;
}

.search-bar {
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-md) !important;
}

.search-bar:focus-within {
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.1) !important;
}

/* ===== CARDS & STATS ===== */
.stat-card, .card, .welcome-section {
    background: var(--color-bg) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-card) !important;
    border: none !important;
}

.stat-card:hover, .card:hover {
    box-shadow: var(--shadow-elevated) !important;
}

.stat-icon {
    background: var(--color-accent-light) !important;
    color: var(--color-accent) !important;
    border-radius: 10px !important;
}

.stat-value {
    color: var(--color-primary) !important;
    font-weight: 700 !important;
}

.stat-label {
    color: var(--color-text-muted) !important;
    font-size: 0.8125rem !important;
}

/* ===== BUTTONS ===== */
.btn-primary, .action-btn, .quick-action-btn {
    background: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: #fff !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-family) !important;
}

.btn-primary:hover, .action-btn:hover {
    background: var(--color-accent-hover) !important;
    border-color: var(--color-accent-hover) !important;
}

/* ===== WELCOME SECTION ===== */
.welcome-section h1 {
    color: var(--color-primary) !important;
    font-family: var(--font-family) !important;
}

.welcome-section p {
    color: var(--color-text-muted) !important;
}

/* ===== QUICK ACTIONS GRID ===== */
.quick-action-card {
    background: var(--color-bg) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-card) !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.quick-action-card:hover {
    box-shadow: var(--shadow-elevated) !important;
    transform: translateY(-2px) !important;
}

.quick-action-card .action-icon {
    background: var(--color-accent-light) !important;
    color: var(--color-accent) !important;
    border-radius: 10px !important;
}

/* ===== TABLES ===== */
table th {
    background: var(--color-surface) !important;
    color: var(--color-primary) !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    border-bottom: 2px solid var(--color-border) !important;
}

table td {
    border-bottom: 1px solid var(--color-border) !important;
    font-size: 0.875rem !important;
}

table tbody tr:nth-child(even) {
    background: var(--color-surface) !important;
}

table tbody tr:hover {
    background: rgba(141, 198, 63, 0.05) !important;
}

/* ===== FORMS ===== */
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="search"], textarea, select {
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-family) !important;
    color: var(--color-text) !important;
}

.form-control:focus, input:focus, textarea:focus, select:focus {
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.15) !important;
    outline: none !important;
}

/* ===== SECTION HEADERS ===== */
.section-title, .page-content h2, .page-content h3 {
    color: var(--color-primary) !important;
    font-family: var(--font-family) !important;
}

/* ===== NOTIFICATION DOT ===== */
.notification-dot {
    background: var(--color-accent) !important;
}

/* ===== PROGRESS BARS ===== */
.progress-bar, .progress-fill {
    background: var(--color-accent) !important;
}

/* ===== BADGES & TAGS ===== */
.badge-success, .tag-success, .status-active {
    background: var(--color-accent-light) !important;
    color: var(--color-accent) !important;
}

/* ===== SUPPORT WIDGET ===== */
.support-avatar-widget {
    background: rgba(0,0,0,0.03) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

.support-avatar-header {
    background: transparent !important;
    color: #58595B !important;
}

.support-avatar-header:hover {
    background: rgba(0,0,0,0.04) !important;
}

/* ===== SCROLLBAR ===== */
.sidebar::-webkit-scrollbar,
.sidebar-left::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-left::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar, .sidebar-left {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.active, .sidebar-left.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ===== AGENT WIDGET BUBBLE ===== */
#agent-widget-bubble {
    background: var(--color-accent) !important;
}

/* ===== COMPREHENSIVE SIDEBAR LIGHT THEME ===== */
/* Force ALL sidebar elements to light-on-grey instead of white-on-dark */
.sidebar, .sidebar-left, .sidebar-right {
    background: #EBEBEB !important;
    color: #58595B !important;
}

/* All text inside sidebars */
.sidebar *,
.sidebar-left *,
.sidebar-right * {
    border-color: rgba(0,0,0,0.08);
}

/* Account widget */
.account-status-widget {
    background: rgba(0,0,0,0.03) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    backdrop-filter: none !important;
}

.account-usage {
    color: #6b7280 !important;
}

.usage-value {
    color: #58595B !important;
}

/* Quick action buttons in sidebar */
.quick-actions-widget .quick-action-btn.secondary {
    background: rgba(0,0,0,0.04) !important;
    color: #58595B !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

/* Platform items in sidebar */
.platform-item {
    background: rgba(0,0,0,0.03) !important;
    color: #58595B !important;
}

/* Connected items */
.connected-item {
    color: #58595B !important;
}

.connected-item span {
    color: #58595B !important;
}

/* Section dividers in sidebar */
.sidebar .section-divider,
.sidebar-left .section-divider {
    background: rgba(0,0,0,0.08) !important;
}

/* Support/host widgets */
.support-avatar-widget,
.host-message-widget {
    background: rgba(0,0,0,0.03) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    backdrop-filter: none !important;
}

.support-avatar-name {
    color: #58595B !important;
}

.support-avatar-status {
    color: #9ca3af !important;
}

.support-toggle-icon {
    color: #9ca3af !important;
}

.support-chat-container {
    border-top: 1px solid rgba(0,0,0,0.08) !important;
}

.support-chat-input {
    border-top: 1px solid rgba(0,0,0,0.08) !important;
}

.support-chat-input input {
    background: #fff !important;
    border: 1px solid rgba(0,0,0,0.12) !important;
    color: #58595B !important;
}

.support-chat-input input::placeholder {
    color: #9ca3af !important;
}

.message-content {
    color: #6b7280 !important;
}

.support-quick-actions .quick-action-btn {
    background: rgba(0,0,0,0.04) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    color: #6b7280 !important;
}

.support-quick-actions .quick-action-btn:hover {
    background: rgba(141, 198, 63, 0.1) !important;
    color: #8DC63F !important;
    border-color: rgba(141, 198, 63, 0.3) !important;
}

/* Right sidebar sections */
.sidebar-right .sidebar-section h3 {
    color: #6b7280 !important;
}

.sidebar-right .queue-empty {
    color: #9ca3af !important;
}

.sidebar-right .activity-item {
    border-bottom-color: rgba(0,0,0,0.06) !important;
}

.sidebar-right .activity-title {
    color: #58595B !important;
}

.sidebar-right .activity-time {
    color: #9ca3af !important;
}

/* Sidebar collapse button */
.sidebar-collapse-btn {
    background: #8DC63F !important;
    color: #fff !important;
}

/* ===== LINK COLORS ===== */
a {
    color: var(--color-accent);
}

a:hover {
    color: var(--color-accent-hover);
}
