/* ChiliDog 3.0 - Main Stylesheet */
/* Warm, friendly interface for TraffiCalm's AI Product Assistant */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Primary Colors */
    --primary-blue: #4a90e2;
    --primary-dark: #1e3a5f;
    --primary-light: #e8f4fd;

    /* Accent Colors */
    --accent-yellow: #ffeb3b;
    --accent-green: #28a745;
    --accent-orange: #ff9800;
    --accent-red: #e74c3c;
    --accent-purple: #667eea;

    /* Neutral Colors */
    --bg-light: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;

    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.15);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-med: 0.3s ease;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
}

.login-container {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.login-logo-text {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-dark);
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1em;
}

.login-form {
    text-align: left;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1em;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Password visibility toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.password-toggle:hover {
    opacity: 1;
}

.password-toggle .eye-icon {
    fill: var(--text-secondary);
}

.password-toggle.visible .eye-icon {
    fill: var(--primary-blue);
}

.login-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #357abd 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.login-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9em;
}

.login-footer {
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.login-footer a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   PASSWORD CHANGE SCREEN
   ============================================ */
.password-change-container {
    max-width: 450px;
}

.password-change-title {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 1.5em;
}

.password-change-subtitle {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 0.95em;
}

.password-requirements {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.requirement-icon {
    width: 20px;
    font-weight: bold;
    color: var(--accent-red);
}

.requirement.met .requirement-icon {
    color: var(--accent-green);
}

.requirement.met {
    color: var(--accent-green);
}

/* ============================================
   LOGIN LOCKOUT MESSAGE
   ============================================ */
.lockout-message {
    text-align: center;
    padding: 30px;
}

.lockout-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.lockout-title {
    color: var(--accent-red);
    font-size: 1.3em;
    margin-bottom: 10px;
}

.lockout-text {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.lockout-time {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1.1em;
}

.lockout-contact {
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--text-muted);
}

/* Login attempts remaining warning */
.login-warning {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9em;
}

/* ============================================
   MAIN APP LAYOUT
   ============================================ */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    grid-template-rows: auto 1fr;
    height: 100vh;
    max-width: 1800px;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
}

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

.logo {
    font-size: 2em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 48px;
    height: 48px;
}

.version-badge {
    font-size: 0.4em;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    padding: 0;
    margin-left: 8px;
    align-self: flex-end;
    margin-bottom: 5px;
}

.welcome-section {
    text-align: center;
    flex-grow: 1;
}

.welcome-name {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent-yellow);
}

.welcome-message {
    font-size: 1.1em;
    opacity: 0.95;
    margin-top: 3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-section {
    text-align: right;
    font-size: 1em;
    opacity: 0.9;
}

.logout-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all var(--transition-fast);
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */
.sidebar-left {
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.user-info {
    background: linear-gradient(135deg, var(--accent-green) 0%, #20c997 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.user-info .user-name {
    font-weight: bold;
    font-size: 1.1em;
}

.user-info .user-role {
    opacity: 0.9;
    font-size: 0.9em;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section h3 {
    color: var(--primary-dark);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin: 6px 0;
    border: none;
    background: var(--bg-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    text-align: left;
    font-size: 0.95em;
    color: var(--text-primary);
}

.nav-button:hover {
    background: var(--primary-light);
    transform: translateX(5px);
}

.nav-button.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #357abd 100%);
    color: white;
}

.nav-button-icon {
    font-size: 1.3em;
    width: 30px;
    text-align: center;
}

.beta-badge {
    display: inline-block;
    font-size: 0.6em;
    font-weight: bold;
    background: var(--accent-orange);
    color: white;
    padding: 2px 5px;
    border-radius: 8px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coming-soon-badge {
    display: inline-block;
    font-size: 0.55em;
    font-weight: bold;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Coming Soon Placeholder Content */
.coming-soon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    margin: 20px;
    border: 2px dashed var(--border-color);
}

.coming-soon-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.7;
}

.coming-soon-content h3 {
    font-size: 1.8em;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.coming-soon-content > p {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 20px;
}

.coming-soon-content ul {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 400px;
}

.coming-soon-content li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.95em;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.coming-soon-content li:last-child {
    border-bottom: none;
}

.coming-soon-content li::before {
    content: "✨";
    position: absolute;
    left: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
    position: relative;
}

.view-container {
    display: none;
    flex-direction: column;
    height: 100%;
}

.view-container.active {
    display: flex;
}

.view-header {
    padding: 25px 30px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.view-header h2 {
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.view-header p {
    color: var(--text-secondary);
}

.view-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ============================================
   CHAT CONTAINER
   ============================================ */
.chat-container {
    flex-grow: 1;
    padding: 20px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.6;
    animation: fadeIn var(--transition-med);
}

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

.message.user {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #357abd 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message.assistant {
    background: white;
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: var(--shadow-sm);
}

.message.assistant .sender {
    color: var(--primary-blue);
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}

.message-content {
    white-space: pre-wrap;
}

/* Chat Headings */
.chat-heading {
    color: var(--primary-blue);
    font-size: 1.1em;
    font-weight: 600;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-light);
}

/* Chat Links */
.chat-link {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.chat-link:hover {
    color: var(--primary-dark);
}

.message.assistant .chat-link {
    color: var(--primary-blue);
}

/* Product Cards in Chat */
.product-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
}

.product-card h4 {
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.product-card .sku {
    color: var(--accent-green);
    font-weight: bold;
    font-family: monospace;
}

.product-card .price {
    color: var(--accent-red);
    font-weight: bold;
    font-size: 1.2em;
    margin-top: 8px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background: white;
    border-radius: 18px;
    align-self: flex-start;
    box-shadow: var(--shadow-sm);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

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

/* ============================================
   INPUT AREA
   ============================================ */
.input-area {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.input-wrapper {
    flex-grow: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1em;
    resize: none;
    min-height: 50px;
    max-height: 150px;
    transition: border-color var(--transition-fast);
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-button {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #357abd 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.3em;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.send-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.new-chat-button {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.2em;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.new-chat-button:hover {
    background: linear-gradient(135deg, var(--primary-red) 0%, #c0392b 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(217, 74, 74, 0.4);
}

.new-chat-button:active {
    transform: scale(0.95);
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.quick-action {
    background: var(--primary-light);
    border: 1px solid var(--primary-blue);
    color: #357abd;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action:hover {
    background: var(--primary-blue);
    color: white;
}

/* Prompting Tips Button */
.prompting-tips-container {
    margin-top: 15px;
    text-align: center;
}

.chat-container .prompting-tips-container .prompting-tips-button,
.prompting-tips-button {
    background: #D94A4A !important;
    background: linear-gradient(135deg, #D94A4A 0%, #c0392b 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 12px 25px !important;
    font-size: 1em !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 3px 10px rgba(217, 74, 74, 0.3) !important;
    text-shadow: none !important;
    display: inline-block !important;
}

.prompting-tips-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 20px rgba(217, 74, 74, 0.4) !important;
}

.prompting-tips-button:active {
    transform: translateY(0) !important;
}

/* ============================================
   RIGHT SIDEBAR
   ============================================ */
.sidebar-right {
    background: white;
    border-left: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.context-section {
    margin-bottom: 25px;
}

.context-section h3 {
    color: var(--primary-dark);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-light) 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-card .value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-dark);
}

.stat-card .label {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-top: 3px;
}

.cost-tracker {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.cost-tracker .cost-label {
    font-size: 0.8em;
    color: #856404;
}

.cost-tracker .cost-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #856404;
}

.recent-products {
    list-style: none;
}

.recent-products li {
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.recent-products li:hover {
    background: var(--primary-light);
}

.recent-products li.empty-state {
    color: var(--text-muted);
    cursor: default;
}

.recent-products li.empty-state:hover {
    background: var(--bg-light);
}

.recent-products .sku {
    color: var(--accent-green);
    font-family: monospace;
    font-weight: bold;
}

.context-summary {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Learning Badge */
.learning-badge {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.learning-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.learning-badge:active {
    transform: translateY(0);
}

.learning-badge h4 {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.learning-badge p {
    font-size: 0.85em;
    opacity: 0.9;
}

.learning-badge-hint {
    display: block;
    font-size: 0.75em;
    opacity: 0.7;
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

/* Learning Info Modal */
.learning-modal-content {
    max-width: 600px;
}

.learning-modal-header {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #764ba2 100%);
}

.learning-modal-header h3 {
    color: white;
}

.learning-modal-body {
    padding: 20px 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.learning-intro {
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.learning-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.learning-section h4 {
    color: var(--accent-purple);
    margin-bottom: 10px;
    font-size: 1em;
}

.learning-section p {
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 8px;
}

.learning-examples {
    margin: 10px 0;
    padding-left: 20px;
}

.learning-examples li {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 5px;
    font-style: italic;
}

.learning-tip {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid var(--accent-purple);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    margin-top: 15px;
}

.learning-tip strong {
    color: var(--accent-purple);
}

.learning-tip em {
    font-style: italic;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 250px 1fr;
    }
    .sidebar-right {
        display: none;
    }
}

/* ============================================
   HAMBURGER MENU BUTTON
   ============================================ */
.hamburger-btn {
    display: none;  /* Hidden on desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger to X transformation when active */
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    /* Show hamburger button on mobile */
    .hamburger-btn {
        display: flex;
    }

    /* Show overlay when active on mobile */
    .mobile-overlay.active {
        display: block;
    }

    /* Sidebar - hidden by default, slides in when open */
    .sidebar-left {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -280px;  /* Hidden off-screen */
        width: 280px;
        height: 100vh;
        z-index: 1000;
        background: white;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding-top: 60px;  /* Account for close area at top */
    }

    .sidebar-left.mobile-open {
        left: 0;  /* Slide in */
    }

    .header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        text-align: center;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .header-right {
        flex-direction: row;
        gap: 10px;
    }

    /* Make logo section more compact on mobile */
    .logo-section {
        gap: 8px;
    }

    .logo-section h1 {
        font-size: 1.3em;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    /* Hide greeting on very small screens */
    @media (max-width: 480px) {
        .user-greeting {
            display: none;
        }
    }
}

/* ============================================
   PRODUCT BROWSER
   ============================================ */
.products-toolbar {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1em;
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.search-box .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

.category-filter select {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.category-filter select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.product-count {
    color: var(--text-muted);
    font-size: 0.9em;
    white-space: nowrap;
}

.products-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    flex: 1;
    overflow: hidden;
}

.products-list {
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 320px);
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.product-item:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

.product-item.selected {
    border-color: var(--primary-blue);
    background: rgba(76, 144, 214, 0.1);
}

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

.product-item-sku {
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-green);
    font-size: 0.9em;
}

.product-item-name {
    color: var(--text-primary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-item-category {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 2px;
}

.product-item-price {
    font-weight: bold;
    color: var(--accent-red);
    white-space: nowrap;
    margin-left: 15px;
}

/* Product Detail Panel */
.product-detail-panel {
    background: white;
    border-left: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 320px);
}

.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.detail-placeholder .placeholder-icon {
    font-size: 4em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.product-detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.product-detail-header h3 {
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.product-detail-header .detail-sku {
    font-family: monospace;
    color: var(--accent-green);
    font-weight: bold;
}

.product-detail-header .detail-category {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 5px;
}

.product-detail-section {
    margin-bottom: 20px;
}

.product-detail-section h4 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-detail-section p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.product-detail-price {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent-red);
    margin: 15px 0;
}

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

.specs-table tr {
    border-bottom: 1px solid var(--border-color);
}

.specs-table td {
    padding: 8px 5px;
    font-size: 0.9em;
}

.specs-table td:first-child {
    color: var(--text-muted);
    width: 40%;
}

.specs-table td:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.detail-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all var(--transition-fast);
}

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

.detail-btn-primary:hover {
    background: var(--primary-dark);
}

.detail-btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Pagination */
.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

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

#page-info {
    color: var(--text-muted);
}

/* Empty state */
.products-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    text-align: center;
}

.products-empty .empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

/* Loading state */
.products-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ============================================
   MODAL / DIALOG
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-form {
    padding: 25px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-row textarea {
    resize: vertical;
    font-family: monospace;
}

.form-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.form-section-header {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary);
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary);
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.modal-btn-primary:hover {
    background: var(--primary-dark);
}

.modal-btn-cancel {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-btn-cancel:hover {
    background: var(--border-color);
}

/* ============================================
   USER MANAGEMENT
   ============================================ */
.users-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.user-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-blue);
}

.users-container {
    padding: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.users-table thead {
    background: var(--primary-blue);
    color: white;
}

.users-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.users-table tbody tr:hover {
    background: var(--bg-light);
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.user-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.user-status.active {
    background: #d4edda;
    color: #155724;
}

.user-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.user-role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: capitalize;
}

.user-role-badge.admin {
    background: #e74c3c;
    color: white;
}

.user-role-badge.superuser,
.user-role-badge.editor {
    background: #f39c12;
    color: white;
}

.user-role-badge.user {
    background: #3498db;
    color: white;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all var(--transition-fast);
}

.user-action-btn.edit {
    background: var(--primary-blue);
    color: white;
}

.user-action-btn.edit:hover {
    background: var(--primary-dark);
}

.user-action-btn.delete {
    background: var(--accent-red);
    color: white;
}

.user-action-btn.delete:hover {
    background: #c0392b;
}

.user-action-btn.unlock {
    background: var(--accent-green);
    color: white;
}

.user-action-btn.unlock:hover {
    background: #27ae60;
}

.user-action-btn.force-reset {
    background: #f39c12;
    color: white;
}

.user-action-btn.force-reset:hover {
    background: #e67e22;
}

/* User status badges container */
.user-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.user-status.password-reset {
    background: #fff3cd;
    color: #856404;
    font-size: 0.8em;
}

.user-status.locked {
    background: #f8d7da;
    color: #721c24;
    font-size: 0.8em;
}

/* ============================================
   LEARNING NUGGETS MANAGEMENT
   ============================================ */
.nuggets-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.nuggets-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nuggets-filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 0.9em;
}

.nugget-stats {
    display: flex;
    gap: 20px;
}

.nugget-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nugget-stats .stat-item.flagged .stat-value {
    color: var(--accent-red);
    font-weight: bold;
}

.nuggets-container {
    padding: 20px;
    overflow-x: auto;
}

.nuggets-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
    min-width: 900px;
}

.nuggets-table thead {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #764ba2 100%);
    color: white;
}

.nuggets-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nuggets-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9em;
}

.nuggets-table tbody tr:hover {
    background: var(--bg-light);
}

.nuggets-table tbody tr.flagged {
    background: #fff3cd;
}

.nuggets-table tbody tr.flagged:hover {
    background: #ffe8a1;
}

.nuggets-table tbody tr:last-child td {
    border-bottom: none;
}

/* Nugget relationship badges */
.nugget-relationship {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

.nugget-relationship.compatible {
    background: #d4edda;
    color: #155724;
}

.nugget-relationship.incompatible {
    background: #f8d7da;
    color: #721c24;
}

.nugget-relationship.requires {
    background: #cce5ff;
    color: #004085;
}

.nugget-relationship.optional {
    background: #e2e3e5;
    color: #383d41;
}

.nugget-relationship.complementary {
    background: #d1ecf1;
    color: #0c5460;
}

/* Confidence indicator */
.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.confidence-badge.low {
    background: #f8d7da;
    color: #721c24;
}

.confidence-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.confidence-badge.high {
    background: #d4edda;
    color: #155724;
}

/* Status badges */
.nugget-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.nugget-status.ok {
    background: #d4edda;
    color: #155724;
}

.nugget-status.flagged {
    background: #f8d7da;
    color: #721c24;
}

/* Nugget actions */
.nugget-actions {
    display: flex;
    gap: 6px;
}

.nugget-action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all var(--transition-fast);
}

.nugget-action-btn.edit {
    background: var(--primary-blue);
    color: white;
}

.nugget-action-btn.edit:hover {
    background: var(--primary-dark);
}

.nugget-action-btn.resolve {
    background: #28a745;
    color: white;
}

.nugget-action-btn.resolve:hover {
    background: #1e7e34;
}

.nugget-action-btn.delete {
    background: var(--accent-red);
    color: white;
}

.nugget-action-btn.delete:hover {
    background: #c0392b;
}

/* Nugget reason cell */
.nugget-reason {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nugget-reason:hover {
    white-space: normal;
    word-wrap: break-word;
}

/* Flagged warning in modal */
.flagged-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    color: #856404;
}

.flagged-warning strong {
    display: block;
    margin-bottom: 5px;
}

.flagged-warning p {
    margin: 0;
    font-size: 0.9em;
}

/* Delete button style for modals */
.modal-btn-danger {
    background: var(--accent-red);
    color: white;
}

.modal-btn-danger:hover {
    background: #c0392b;
}

/* ============================================
   AUDIT LOGS
   ============================================ */
.audit-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
}

.audit-stats {
    display: flex;
    gap: 30px;
}

.audit-container {
    padding: 20px;
}

.audit-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.audit-entry {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: all var(--transition-fast);
}

.audit-entry:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.audit-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.audit-entry-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.audit-action {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.audit-action.create {
    background: #d4edda;
    color: #155724;
}

.audit-action.update {
    background: #fff3cd;
    color: #856404;
}

.audit-action.delete {
    background: #f8d7da;
    color: #721c24;
}

.audit-user {
    font-weight: 600;
    color: var(--primary-blue);
}

.audit-entity {
    color: var(--text-muted);
    font-size: 0.9em;
}

.audit-timestamp {
    font-size: 0.85em;
    color: var(--text-muted);
}

.audit-entry-body {
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.audit-changes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.audit-change {
    display: grid;
    grid-template-columns: 150px 1fr 1fr;
    gap: 10px;
    font-size: 0.9em;
}

.audit-change-field {
    font-weight: 600;
    color: var(--primary-dark);
}

.audit-change-before {
    color: var(--accent-red);
    text-decoration: line-through;
}

.audit-change-after {
    color: var(--accent-green);
    font-weight: 500;
}

.audit-description {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-style: italic;
}

/* Online Banner */
.online-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-bottom: 1px solid #a5d6a7;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background: #4caf50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.online-text {
    font-weight: 500;
    color: #2e7d32;
}

/* Audit Tabs */
.audit-tabs {
    display: flex;
    gap: 5px;
    padding: 10px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.audit-tab {
    padding: 10px 20px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-bottom: none;
    margin-bottom: -1px;
}

.audit-tab:hover {
    background: white;
    color: var(--primary-blue);
}

.audit-tab.active {
    background: white;
    color: var(--primary-blue);
    font-weight: 600;
    border-bottom: 1px solid white;
}

.audit-tab-content {
    display: none;
}

.audit-tab-content.active {
    display: block;
}

/* Additional action badges */
.audit-action.login {
    background: #e3f2fd;
    color: #1565c0;
}

.audit-action.logout {
    background: #fce4ec;
    color: #c2185b;
}

.audit-action.login_failed {
    background: #ffebee;
    color: #c62828;
}

.audit-action.chat_message {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Session list */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.session-entry {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: all var(--transition-fast);
}

.session-entry:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.session-entry.active {
    border-left: 4px solid #4caf50;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.session-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-username {
    font-weight: 600;
    color: var(--primary-blue);
}

.session-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.session-status.online {
    background: #e8f5e9;
    color: #2e7d32;
}

.session-status.offline {
    background: #fafafa;
    color: var(--text-muted);
}

.session-duration {
    font-weight: 600;
    color: var(--primary-dark);
}

.session-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    font-size: 0.9em;
    color: var(--text-secondary);
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.session-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.session-detail-label {
    font-size: 0.85em;
    color: var(--text-muted);
}

.session-detail-value {
    color: var(--text-primary);
}

/* Checkbox label in filters */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-secondary);
}

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

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.dashboard-stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.dashboard-stat-card .stat-icon {
    font-size: 3em;
    opacity: 0.9;
}

.dashboard-stat-card .stat-info {
    flex: 1;
}

.dashboard-stat-card .stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-blue);
    line-height: 1;
    margin-bottom: 5px;
}

.dashboard-stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.dashboard-stat-card .stat-sublabel {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    padding: 0 20px 20px 20px;
}

.dashboard-panel {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.dashboard-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.dashboard-panel .panel-header h3 {
    color: var(--primary-dark);
    font-size: 1.2em;
    margin: 0;
}

.dashboard-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
}

.activity-chart {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 0;
}

.activity-date {
    font-size: 0.85em;
    color: var(--text-muted);
    width: 80px;
    flex-shrink: 0;
}

.activity-bar-container {
    flex: 1;
    background: var(--bg-light);
    height: 30px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.activity-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
    border-radius: 4px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.activity-bar-label {
    font-size: 0.75em;
    color: white;
    font-weight: 600;
}

.activity-stats {
    display: flex;
    gap: 8px;
    font-size: 0.85em;
}

.activity-stat {
    color: var(--text-secondary);
}

.chart-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.top-user-item:hover {
    background: var(--border-color);
    transform: translateX(5px);
}

.top-user-rank {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-blue);
    width: 40px;
    text-align: center;
}

.top-user-info {
    flex: 1;
    margin-left: 15px;
}

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

.top-user-username {
    font-size: 0.85em;
    color: var(--text-muted);
}

.top-user-stats {
    text-align: right;
}

.top-user-messages {
    font-weight: 600;
    color: var(--primary-blue);
}

.top-user-cost {
    font-size: 0.85em;
    color: var(--text-muted);
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cost-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
}

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

.cost-user-amount {
    font-weight: 600;
    color: var(--accent-red);
}

.cost-total {
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    border-radius: 8px;
    text-align: center;
    margin-top: 10px;
}

.cost-total-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.cost-total-value {
    font-size: 2em;
    font-weight: bold;
}

.popular-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popular-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.popular-product-item:hover {
    background: var(--border-color);
    transform: translateX(3px);
}

.popular-product-info {
    flex: 1;
}

.popular-product-sku {
    font-family: monospace;
    color: var(--accent-green);
    font-weight: 600;
    font-size: 0.9em;
}

.popular-product-name {
    color: var(--text-primary);
    margin-top: 3px;
}

.popular-product-category {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ============================================
   AUTOCOMPLETE SUGGESTIONS
   ============================================ */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: none;
}

.autocomplete-suggestions.active {
    display: block;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--primary-light);
}

.autocomplete-item .sku {
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-green);
    font-size: 0.95em;
}

.autocomplete-item .name {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item .category {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 2px;
}

.autocomplete-no-results {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   BID TAB SEARCH
   ============================================ */
.beta-badge {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.65em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 10px;
    animation: pulse-beta 2s infinite;
}

@keyframes pulse-beta {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.bid-search-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100% - 80px);
}

.bid-search-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.bid-search-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
}

.bid-search-form label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
}

.bid-search-form input,
.bid-search-form select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bid-search-form input:focus,
.bid-search-form select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    outline: none;
}

.bid-search-form .primary-button {
    padding: 10px 25px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.bid-search-form .primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.bid-search-form .primary-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.bid-results-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    overflow-y: auto;
    min-height: 300px;
}

.bid-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.bid-placeholder p:first-child {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.beta-note {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9em;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.bid-results-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.bid-results-header h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
}

.bid-results-header .bid-meta {
    color: var(--text-muted);
    font-size: 0.9em;
}

.bid-result-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bid-result-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.bid-result-item .result-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.bid-result-item .result-title a {
    color: inherit;
    text-decoration: none;
}

.bid-result-item .result-title a:hover {
    text-decoration: underline;
}

.bid-result-item .result-url {
    font-size: 0.85em;
    color: var(--accent-green);
    margin-bottom: 8px;
    word-break: break-all;
}

.bid-result-item .result-description {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.5;
}

.bid-result-item .result-age {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 8px;
}

.bid-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.bid-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.bid-error {
    text-align: center;
    padding: 40px;
    color: var(--danger-red);
}

/* ============================================
   BOM LOOKUP
   ============================================ */
.bom-toolbar {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    flex-wrap: wrap;
}

.bom-stats {
    color: var(--text-muted);
    font-size: 0.9em;
    white-space: nowrap;
    margin-left: auto;
}

.bom-container {
    flex: 1;
    overflow: hidden;
    padding: 20px;
}

.bom-results-panel {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    min-height: 400px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

.bom-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.bom-placeholder .placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.bom-placeholder p {
    font-size: 1.1em;
    margin-bottom: 8px;
}

.bom-placeholder .placeholder-hint {
    font-size: 0.9em;
    color: var(--text-muted);
    opacity: 0.8;
}

.bom-results-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 10px 10px 0 0;
}

.bom-results-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2em;
}

.bom-results-header .bom-sku {
    font-family: monospace;
    color: var(--accent-green);
    font-weight: bold;
}

.bom-results-header .bom-count {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 5px;
}

.bom-alt-view-link {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: var(--primary-light);
    color: var(--primary-blue);
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.bom-alt-view-link:hover {
    background: var(--primary-blue);
    color: white;
}

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

.bom-results-table th {
    background: var(--bg-light);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
}

.bom-results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.bom-results-table tr:hover {
    background: rgba(74, 144, 226, 0.05);
}

.bom-results-table .sku-cell {
    font-family: monospace;
    font-weight: bold;
    color: var(--primary-blue);
    cursor: pointer;
}

.bom-results-table .sku-cell:hover {
    text-decoration: underline;
    color: var(--accent-green);
}

.bom-results-table .qty-cell {
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
}

.bom-results-table .desc-cell {
    color: var(--text-secondary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bom-results-table .price-cell {
    font-weight: bold;
    color: var(--accent-green);
    text-align: right;
}

.bom-results-table .revision-cell {
    color: var(--text-muted);
    font-size: 0.9em;
    text-align: center;
}

.bom-error {
    padding: 40px 20px;
    text-align: center;
    color: var(--accent-red);
}

.bom-error .error-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.bom-error p {
    font-size: 1.1em;
}

.bom-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.bom-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* BOM Autocomplete */
.bom-search-box {
    position: relative;
}

.bom-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    display: none;
}

.bom-autocomplete.visible {
    display: block;
}

.bom-autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.bom-autocomplete-item:last-child {
    border-bottom: none;
}

.bom-autocomplete-item:hover,
.bom-autocomplete-item.selected {
    background: var(--primary-light);
}

.bom-autocomplete-item .sku {
    font-family: monospace;
    font-weight: bold;
    color: var(--primary-blue);
    font-size: 0.95em;
}

.bom-autocomplete-item .type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    margin-left: 8px;
    font-weight: 600;
}

.bom-autocomplete-item .type-badge.assembly {
    background: var(--accent-green);
    color: white;
}

.bom-autocomplete-item .type-badge.component {
    background: var(--accent-orange);
    color: white;
}

.bom-autocomplete-loading {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
}

.bom-autocomplete-no-results {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   SOLAR CALCULATOR
   ============================================ */
.solar-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 200px);
    overflow: hidden;
}

.solar-form-panel {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    overflow-y: auto;
}

.solar-section {
    margin-bottom: 25px;
}

.solar-section h3 {
    font-size: 1em;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.solar-form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.solar-form-group {
    flex: 1;
    min-width: 120px;
}

.solar-form-group label {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.solar-form-group input,
.solar-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color var(--transition-fast);
}

.solar-form-group input:focus,
.solar-form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Equipment List */
.solar-equipment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.solar-equipment-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    position: relative;
}

.solar-equipment-item .equipment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.solar-equipment-item .equipment-number {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.solar-equipment-item .remove-equipment {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.solar-equipment-item .remove-equipment:hover {
    opacity: 1;
}

.solar-equipment-item .equipment-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.solar-equipment-item .equipment-row:last-child {
    margin-bottom: 0;
}

.solar-equipment-item .sku-input-wrapper {
    flex: 2;
    position: relative;
}

.solar-equipment-item .sku-input-wrapper input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9em;
}

.solar-equipment-item .qty-input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
}

.solar-equipment-item .product-name {
    font-size: 0.85em;
    color: var(--text-secondary);
    padding: 5px 0;
    min-height: 20px;
}

.solar-equipment-item .device-type-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

.solar-equipment-item .device-type-label {
    font-size: 0.8em;
    color: var(--text-muted);
}

.solar-equipment-item .device-type-options {
    display: flex;
    gap: 10px;
}

.solar-equipment-item .device-type-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    cursor: pointer;
}

.solar-equipment-item .intermittent-fields {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.solar-equipment-item .intermittent-fields.visible {
    display: flex;
    gap: 10px;
}

.solar-equipment-item .intermittent-fields .solar-form-group {
    flex: 1;
}

.solar-equipment-item .intermittent-fields input {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

/* SKU Autocomplete for Solar */
.solar-sku-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-md);
    display: none;
}

.solar-sku-autocomplete.visible {
    display: block;
}

.solar-sku-autocomplete-item {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85em;
}

.solar-sku-autocomplete-item:last-child {
    border-bottom: none;
}

.solar-sku-autocomplete-item:hover {
    background: var(--primary-light);
}

.solar-sku-autocomplete-item .sku {
    font-family: monospace;
    font-weight: bold;
    color: var(--primary-blue);
}

.solar-sku-autocomplete-item .name {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add Equipment Button */
.solar-add-equipment-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.solar-add-equipment-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: var(--primary-light);
}

/* Calculate Button */
.solar-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.solar-calculate-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent-orange), #e67e22);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.solar-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.solar-calculate-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Panel */
.solar-results-panel {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
}

.solar-results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
    height: 100%;
}

.solar-results-placeholder .placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.solar-results-placeholder p {
    font-size: 1.1em;
    margin-bottom: 8px;
}

.solar-results-placeholder .placeholder-hint {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Results Content */
.solar-results-content {
    padding: 20px;
}

.solar-results-section {
    margin-bottom: 25px;
}

.solar-results-section h3 {
    font-size: 1em;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.solar-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.solar-summary-card {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.solar-summary-card .value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-blue);
}

.solar-summary-card .label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 5px;
}

.solar-summary-card.warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.solar-summary-card.warning .value {
    color: var(--accent-orange);
}

.solar-summary-card.success {
    background: #d4edda;
    border: 1px solid var(--accent-green);
}

.solar-summary-card.success .value {
    color: var(--accent-green);
}

/* Climate Data */
.solar-climate-info {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 0.9em;
}

.solar-climate-info .location {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.solar-climate-info .climate-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--text-secondary);
}

.solar-climate-info .climate-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Equipment Breakdown Table */
.solar-equipment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.solar-equipment-table th {
    background: var(--bg-light);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.solar-equipment-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.solar-equipment-table .sku {
    font-family: monospace;
    color: var(--primary-blue);
}

.solar-equipment-table .wh-value {
    font-weight: bold;
    text-align: right;
}

/* Product Recommendations */
.solar-product-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.solar-product-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.solar-product-option .product-info {
    flex: 1;
}

.solar-product-option .product-sku {
    font-family: monospace;
    font-weight: bold;
    color: var(--primary-blue);
}

.solar-product-option .product-name {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 2px;
}

.solar-product-option .product-qty {
    font-size: 0.85em;
    color: var(--text-muted);
}

.solar-product-option .product-cost {
    font-weight: bold;
    color: var(--accent-green);
    font-size: 1.1em;
}

/* Warnings */
.solar-warnings {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
}

.solar-warning-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    color: #856404;
    font-size: 0.9em;
}

.solar-warning-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 193, 7, 0.3);
}

.solar-warning-item .warning-icon {
    font-size: 1.2em;
}

/* Solar Details Grid */
.solar-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 5px;
    font-size: 0.9em;
}

.detail-item.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--accent-green);
}

.detail-item.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Cost Summary */
.solar-cost-summary {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 15px;
}

.cost-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95em;
}

.cost-line:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.cost-line.total {
    border-top: 2px solid var(--primary-color);
    padding-top: 12px;
    margin-top: 5px;
    font-weight: 700;
    font-size: 1.1em;
    color: var(--primary-color);
}

/* Performance Graph */
.solar-graph-container {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.solar-graph-container img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Download Button */
.solar-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-green);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 15px;
}

.solar-download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.solar-download-section {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(255, 152, 0, 0.1));
    border-radius: 12px;
    border: 1px dashed var(--accent-green);
}

.download-hint {
    margin-top: 10px;
    font-size: 0.85em;
    color: var(--text-muted);
}

/* Loading State */
.solar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.solar-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.solar-loading p {
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 900px) {
    .solar-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .solar-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   KNOWLEDGE BASE VIEW
   ============================================ */
.kb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.kb-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.kb-stats .stat-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kb-stats .stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
}

.kb-stats .stat-value {
    font-weight: 600;
    color: var(--primary-blue);
}

.kb-sources-container {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.kb-sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.kb-source-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

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

.kb-source-card.disabled {
    opacity: 0.6;
    background: #f9f9f9;
}

.kb-source-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.kb-source-icon {
    font-size: 1.5em;
}

.kb-source-header h4 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.1em;
}

.kb-source-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.kb-stat {
    text-align: center;
}

.kb-stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-blue);
}

.kb-stat-label {
    font-size: 0.85em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kb-source-url {
    margin-bottom: 15px;
}

.kb-source-url a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9em;
    word-break: break-all;
}

.kb-source-url a:hover {
    text-decoration: underline;
}

.kb-sample-articles {
    background: var(--background);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.kb-sample-articles h5 {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.kb-sample-articles ul {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 0.85em;
    color: var(--text-primary);
}

.kb-sample-articles li {
    margin-bottom: 4px;
}

.kb-source-footer {
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8em;
    color: var(--text-muted);
}

.kb-info-panel {
    background: linear-gradient(135deg, #e6f3ff 0%, #f0f8ff 100%);
    border: 1px solid var(--primary-light);
    border-radius: 12px;
    padding: 20px;
    margin: 20px;
}

.kb-info-panel h3 {
    margin: 0 0 12px 0;
    color: var(--primary-dark);
}

.kb-info-panel p {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
}

.kb-info-panel ul {
    margin: 10px 0;
    padding: 0 0 0 25px;
}

.kb-info-panel li {
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.kb-loading,
.kb-error,
.kb-no-sources {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.kb-error {
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    margin: 20px;
}

.kb-error p {
    margin: 10px 0;
}

.kb-error .error-detail {
    font-size: 0.9em;
    color: #d32f2f;
}

/* KB Search Bar */
.kb-search-bar {
    padding: 15px 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
}

.kb-search-input-wrapper {
    display: flex;
    gap: 10px;
    max-width: 700px;
}

.kb-search-input-wrapper input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.kb-search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.kb-search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* KB Tabs */
.kb-tabs {
    display: flex;
    gap: 5px;
    padding: 10px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.kb-tab {
    padding: 10px 20px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-bottom: none;
    margin-bottom: -1px;
}

.kb-tab:hover {
    background: white;
    color: var(--primary-blue);
}

.kb-tab.active {
    background: white;
    color: var(--primary-blue);
    font-weight: 600;
    border-bottom: 1px solid white;
}

/* KB Tab Content */
.kb-tab-content {
    display: none;
    flex: 1;
    overflow: auto;
}

.kb-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* KB Browse Controls */
.kb-browse-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
}

.kb-browse-controls label {
    font-weight: 500;
    color: var(--text-secondary);
}

.kb-browse-controls select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95em;
    min-width: 200px;
    cursor: pointer;
}

.kb-browse-controls select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.kb-article-count {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* KB Article List */
.kb-article-list {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.kb-browse-placeholder,
.kb-search-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.kb-search-placeholder p {
    margin: 10px 0;
}

.kb-search-hint {
    font-size: 0.9em;
    color: var(--text-muted);
    font-style: italic;
}

.kb-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.kb-no-results strong {
    color: var(--primary-blue);
}

/* KB Article Groups (Browse) */
.kb-article-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kb-article-group {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.kb-group-header {
    background: var(--primary-blue);
    color: white;
    padding: 8px 15px;
    font-weight: 600;
    font-size: 1.1em;
}

.kb-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kb-group-list li {
    border-bottom: 1px solid var(--border-color);
}

.kb-group-list li:last-child {
    border-bottom: none;
}

.kb-article-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s;
}

.kb-article-link:hover {
    background-color: var(--background);
}

.kb-article-link:hover .kb-article-arrow {
    color: var(--primary-blue);
    transform: translateX(3px);
}

.kb-article-title {
    flex: 1;
}

.kb-article-arrow {
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    margin-left: 10px;
}

/* KB Search Results */
.kb-search-results {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.kb-search-summary {
    padding: 15px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #2e7d32;
}

.kb-search-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kb-search-result {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.2s;
}

.kb-search-result:hover {
    box-shadow: var(--shadow-md);
}

.kb-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.kb-result-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    font-size: 0.8em;
    font-weight: 600;
    flex-shrink: 0;
}

.kb-result-title {
    flex: 1;
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}

.kb-result-title:hover {
    text-decoration: underline;
}

.kb-result-score {
    background: #e3f2fd;
    color: var(--primary-blue);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.kb-result-url {
    font-size: 0.85em;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 5px;
}

.kb-result-source {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Warning notification type */
.notification-warning {
    border-left: 4px solid #ff9800;
    background: #fff3e0;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 40px 15px 15px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    position: relative;
}

.notification-success {
    border-left: 4px solid #4caf50;
    background: #f1f8e9;
}

.notification-error {
    border-left: 4px solid #f44336;
    background: #ffebee;
}

.notification-info {
    border-left: 4px solid var(--primary-blue);
    background: #e3f2fd;
}

.notification-message {
    flex: 1;
    color: var(--text-primary);
}

.notification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

.notification-close:hover {
    color: var(--text-primary);
}

.notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

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

/* ============================================
   FLOATING CHAT BUTTON (FAB) - In Header
   Irresistible, pulsing button that drops from top
   ============================================ */
.chat-fab {
    position: relative;
    z-index: 100;

    /* Layout */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 8px;
    margin: 0 20px;

    /* Warm gradient background */
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffb347 100%);
    border: none;
    border-radius: 50px;

    /* Warm glow shadow */
    box-shadow:
        0 4px 15px rgba(255, 107, 53, 0.4),
        0 6px 25px rgba(247, 147, 30, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    /* Cursor & interaction */
    cursor: pointer;

    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Drop down animation from top */
    animation: fabDropIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-fab:hover {
    transform: scale(1.05);
    box-shadow:
        0 6px 20px rgba(255, 107, 53, 0.5),
        0 10px 35px rgba(247, 147, 30, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chat-fab:active {
    transform: scale(0.98);
}

.chat-fab-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);

    /* Gentle bounce animation */
    animation: iconBounce 2s ease-in-out infinite;
}

.chat-fab-text {
    color: white;
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Pulsing ring effect */
.chat-fab-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: transparent;
    border: 2px solid rgba(255, 183, 77, 0.6);
    animation: fabPulse 2s ease-out infinite;
    pointer-events: none;
}

/* Animations */
@keyframes fabDropIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(8px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fabPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.12);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.25);
        opacity: 0;
    }
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* Hide FAB when on chat view (not needed there) */
.chat-fab.hidden {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
    pointer-events: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chat-fab {
        padding: 6px 14px 6px 6px;
        margin: 0 10px;
    }

    .chat-fab-icon {
        width: 30px;
        height: 30px;
    }

    .chat-fab-text {
        font-size: 13px;
    }
}

/* =========================================
   MY CONTRIBUTIONS VIEW
   ========================================= */

.contributions-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.contributions-stats .stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all var(--transition-fast);
}

.contributions-stats .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.contributions-stats .stat-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.contributions-stats .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-blue);
    line-height: 1;
}

.contributions-stats .stat-label {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contributions-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.contributions-section h3 {
    margin: 0 0 15px 0;
    color: var(--primary-dark);
    font-size: 1.1em;
}

.contributions-table-container {
    overflow-x: auto;
}

.contributions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.contributions-table th,
.contributions-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.contributions-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}

.contributions-table tr:hover {
    background: var(--bg-light);
}

.contributions-table .empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

.contributions-table .relationship-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.contributions-table .relationship-badge.compatible {
    background: #d4edda;
    color: #155724;
}

.contributions-table .relationship-badge.incompatible {
    background: #f8d7da;
    color: #721c24;
}

.contributions-table .relationship-badge.requires {
    background: #fff3cd;
    color: #856404;
}

.contributions-table .relationship-badge.replaces {
    background: #d1ecf1;
    color: #0c5460;
}

.contributions-table .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
}

.contributions-table .status-badge.confirmed {
    background: #d4edda;
    color: #155724;
}

.contributions-table .status-badge.flagged {
    background: #f8d7da;
    color: #721c24;
}

.contributions-table .status-badge.pending {
    background: #e2e3e5;
    color: #383d41;
}

.activity-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.activity-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.activity-item .action-name {
    font-weight: 500;
    color: var(--text-primary);
    text-transform: capitalize;
}

.activity-item .action-count {
    background: var(--primary-blue);
    color: white;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9em;
}

.activity-breakdown .empty-message {
    color: var(--text-muted);
    padding: 20px;
}

/* Responsive adjustments for contributions view */
@media (max-width: 768px) {
    .contributions-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .contributions-stats .stat-value {
        font-size: 1.5em;
    }

    .activity-breakdown {
        flex-direction: column;
    }

    .activity-item {
        min-width: auto;
    }
}
