/* Future Is Now - Main Styles - DARK THEME */
/* FORCED DARK MODE - Override everything */

* {
    color-scheme: dark;
}

html, body {
    background-color: #0F172A !important;
    color: #ffffff !important;
    overflow-x: hidden;
    max-width: 100vw;
}

:root {
    /* Brand Colors - Turchese come www.futureisnow.cloud */
    --primary: #3AA6B9;
    --primary-dark: #2d8a9a;
    --primary-light: #CAE6E8;
    --secondary: #2C3E50;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --info: #4299e1;

    /* Sample/Example Data Color Convention */
    /* Valori di esempio = giallo chiaro, valori reali = bianco */
    --sample-value: #FDE68A;
    --real-value: #ffffff;

    /* Dark Theme Colors */
    --bg-primary: #0F172A;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --surface: #1e293b;
    --surface-hover: #334155;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Grays - Dark Mode */
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #e2e8f0;
    --gray-700: #f1f5f9;
    --gray-800: #f8fafc;
    --gray-900: #ffffff;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Header - Brand Colors (NO VIOLA!) */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, #1e293b 0%, #0F172A 100%) !important;
    border-bottom: 1px solid var(--bg-tertiary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    gap: 15px;
    flex-wrap: nowrap;
}

.header-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search button - uses header-btn styles */
.search-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: var(--space-1);
    align-items: center;
    flex-wrap: nowrap;
}

.nav-item {
    padding: var(--space-2) var(--space-2);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.85rem;
}

.nav-item:hover {
    color: #3AA6B9 !important;
    background: rgba(58, 166, 185, 0.15) !important;
}

.nav-item.active {
    color: #3AA6B9 !important;
    background: rgba(58, 166, 185, 0.25) !important;
    border-bottom: 2px solid #3AA6B9 !important;
    border-radius: 6px 6px 0 0;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid var(--bg-tertiary);
}

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

.nav-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
}

.status-dot.connected {
    background: var(--success);
}

.status-dot.disconnected {
    background: var(--danger);
}

/* Main Content */
.main {
    padding: var(--space-6);
    max-width: 1400px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: var(--space-6);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.page-header p {
    color: var(--gray-600);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-tertiary);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

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

/* Sections */
.section {
    background: #1e293b !important;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155 !important;
}

.section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

/* Two Columns Layout */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

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

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 1.5rem;
}

/* Activity List - Live Feed */
.activity-list {
    max-height: 350px;
    overflow-y: auto;
    padding: var(--space-2);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: var(--surface-hover);
    transform: translateX(3px);
}

.activity-item.new-activity {
    animation: slideIn 0.4s ease-out;
    background: rgba(58, 166, 185, 0.15);
    border-left-color: var(--primary);
}

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

.activity-item.type-meeting { border-left-color: var(--warning); }
.activity-item.type-chat { border-left-color: var(--info); }
.activity-item.type-task { border-left-color: var(--success); }
.activity-item.type-system { border-left-color: var(--gray-500); }
.activity-item.type-agent { border-left-color: var(--primary); }
.activity-item.type-knowledge { border-left-color: var(--secondary); }

.activity-time {
    color: var(--gray-500);
    font-size: 0.75rem;
    min-width: 45px;
    flex-shrink: 0;
}

.activity-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.activity-agent {
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Agent Status Grid */
.agent-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-2);
    max-height: 300px;
    overflow-y: auto;
}

.agent-status-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: #1e293b !important;
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: #cbd5e1;
}

.agent-status-item .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.agent-status-item .status-indicator.idle { background: var(--gray-400); }
.agent-status-item .status-indicator.active { background: var(--success); }
.agent-status-item .status-indicator.busy { background: var(--warning); }
.agent-status-item .status-indicator.offline { background: var(--danger); }

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.filter-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.agent-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-tertiary);
    transition: all 0.2s;
    cursor: pointer;
}

.agent-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(58, 166, 185, 0.2);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

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

.agent-role {
    color: var(--primary);
    font-size: 0.85rem;
}

.agent-department {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: var(--space-2);
}

/* Chat */
.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-4);
    height: calc(100vh - 200px);
    min-height: 500px;
}

.chat-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-tertiary);
    overflow-y: auto;
}

.chat-sidebar h3 {
    margin-bottom: var(--space-4);
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.agent-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.agent-list-item:hover {
    background: var(--gray-100);
}

.agent-list-item.active {
    background: var(--primary);
    color: white;
}

.chat-main {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-tertiary);
    overflow: hidden;
}

.chat-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--bg-tertiary);
}

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

.chat-agent-role {
    color: var(--primary);
    font-size: 0.85rem;
}

.chat-messages {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
    background: var(--bg-primary);
}

.chat-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-500);
}

.message {
    margin-bottom: var(--space-4);
    max-width: 80%;
}

.message.user {
    margin-left: auto;
}

.message-content {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
}

.message.user .message-content {
    background: linear-gradient(135deg, #3AA6B9 0%, #2d8a9a 100%) !important;
    color: white;
    border: none;
}

.message-sender {
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: var(--space-1);
}

.chat-input-area {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border-top: 1px solid var(--gray-200);
}

.chat-input-area textarea {
    flex: 1;
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    resize: none;
    font-family: inherit;
}

.send-btn {
    padding: var(--space-3) var(--space-5);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Meetings */
.meetings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.meeting-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-tertiary);
}

.meeting-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.meeting-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.meeting-status {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
}

.meeting-status.scheduled { background: var(--info); color: white; }
.meeting-status.in_progress { background: var(--success); color: white; }
.meeting-status.completed { background: var(--gray-400); color: white; }

.meeting-participants {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-3);
}

.participant-badge {
    padding: var(--space-1) var(--space-2);
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 0.8rem;
}

/* Spy Mode */
.spy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}

.spy-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.spy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.spy-card.idle::before { background: var(--gray-400); }
.spy-card.active::before { background: var(--success); }
.spy-card.busy::before { background: var(--warning); }
.spy-card.thinking::before { background: var(--info); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.spy-agent-name {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.spy-agent-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: var(--space-2);
}

.spy-agent-status {
    font-size: 0.85rem;
    color: var(--gray-600);
    text-transform: uppercase;
    font-weight: 500;
}

.spy-task {
    margin-top: var(--space-3);
    padding: var(--space-2);
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--bg-tertiary);
}

.modal-content.modal-large {
    max-width: 800px;
}

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

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

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

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--bg-tertiary);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 166, 185, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(58, 166, 185, 0.4);
}

.btn-secondary {
    padding: var(--space-3) var(--space-5);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

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

/* Participant Selector */
.participant-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-2);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--space-2);
    background: var(--gray-50);
    border-radius: var(--radius);
}

.participant-option {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3);
    background: var(--bg-secondary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.participant-option strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.participant-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.participant-option:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
}

.participant-option.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.participant-option.selected strong,
.participant-option.selected .participant-role {
    color: white;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    padding: var(--space-4) var(--space-5);
    background: var(--gray-800);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

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

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Page Header Actions */
.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.page-header-actions p {
    margin: 0;
}

/* Form Row (two columns) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Additional Buttons */
.btn-danger {
    padding: var(--space-3) var(--space-5);
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-success {
    padding: var(--space-3) var(--space-5);
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-success:hover {
    background: #38a169;
}

/* Agent Details */
.agent-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
}

.agent-details-section {
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.agent-details-section.full-width {
    grid-column: 1 / -1;
}

.agent-details-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-details-section p {
    margin-bottom: var(--space-2);
    color: var(--gray-700);
}

.agent-details-section p strong {
    color: var(--gray-600);
    font-weight: 500;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active { background: #c6f6d5; color: #22543d; }
.status-badge.idle { background: var(--gray-200); color: var(--gray-600); }
.status-badge.working { background: #fed7aa; color: #c05621; }
.status-badge.terminated { background: #fed7d7; color: #c53030; }
.status-badge.offline { background: var(--gray-300); color: var(--gray-700); }

/* Prompt Preview */
.prompt-preview {
    background: var(--bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    border: 1px solid var(--gray-200);
}

/* Spy Card Working State */
.spy-card.working::before {
    background: var(--warning);
    animation: pulse 1s infinite;
}

/* Agent Status Indicator for working */
.agent-status-item .status-indicator.working { background: var(--warning); }

/* Checkbox styling */
.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: var(--space-2);
}

/* Ambient Chat Section */
.ambient-section {
    background: rgba(58, 166, 185, 0.1);
    border: 1px solid var(--primary);
}

.ambient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.ambient-status {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
}

.ambient-status.active {
    background: var(--success);
    color: white;
}

.ambient-status.paused {
    background: var(--gray-300);
    color: var(--gray-700);
}

.ambient-chat-list {
    max-height: 400px;
    overflow-y: auto;
}

.ambient-chat-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

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

.ambient-chat-topic {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ambient-chat-exchange {
    margin-bottom: var(--space-2);
}

.ambient-chat-exchange:last-child {
    margin-bottom: 0;
}

.ambient-agent-name {
    font-weight: 600;
    color: var(--primary);
}

.ambient-agent-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: var(--space-1);
}

.ambient-message {
    margin-top: var(--space-1);
    color: var(--gray-700);
    line-height: 1.5;
}

.ambient-chat-time {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: var(--space-2);
    text-align: right;
}

.ambient-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.ambient-tokens {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-left: var(--space-2);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: var(--space-3);
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main {
        padding: var(--space-4);
    }

    .chat-container {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        display: none;
    }

    .agent-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Header buttons for setup/logout */
.header-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Agent Card Actions */
.agent-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.agent-card-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.agent-card-actions .btn-chat {
    background: linear-gradient(135deg, #3AA6B9 0%, #2d8a9a 100%);
    color: white;
}

.agent-card-actions .btn-chat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 166, 185, 0.4);
}

.agent-card-actions .btn-activity {
    background: rgba(255,255,255,0.1);
    color: #e0e0e0;
}

.agent-card-actions .btn-activity:hover {
    background: rgba(255,255,255,0.2);
}

/* Emoji avatar */
.agent-avatar.emoji {
    font-size: 24px;
    line-height: 40px;
    background: transparent;
}

/* Agent card header clickable */
.agent-card-header {
    cursor: pointer;
}

.agent-card-header:hover {
    opacity: 0.9;
}

/* Activity Modal */
.activity-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.activity-modal-content {
    background: #1e1e2f;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.activity-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-modal-header h3 {
    margin: 0;
    color: #fff;
}

.close-modal {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.activity-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.activity-type {
    font-size: 10px;
    text-transform: uppercase;
    color: #3AA6B9;
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-title {
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}

.activity-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.activity-time {
    font-size: 11px;
    color: #666;
}

.no-activity, .error {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

.loading {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================
   ENHANCED TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--info);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-info { border-left-color: var(--info); }
.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--danger); }

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-info .toast-icon { background: rgba(66, 153, 225, 0.15); color: var(--info); }
.toast-success .toast-icon { background: rgba(72, 187, 120, 0.15); color: var(--success); }
.toast-warning .toast-icon { background: rgba(237, 137, 54, 0.15); color: var(--warning); }
.toast-error .toast-icon { background: rgba(245, 101, 101, 0.15); color: var(--danger); }

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.4;
}

.toast-action {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.toast-action:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Dark mode toast for SpyMode/Analytics */
body[data-theme="dark"] .toast,
.dark-theme .toast {
    background: #1e1e2f;
    color: #e0e0e0;
}

body[data-theme="dark"] .toast-title,
.dark-theme .toast-title {
    color: #fff;
}

body[data-theme="dark"] .toast-message,
.dark-theme .toast-message {
    color: #a0a0a0;
}

body[data-theme="dark"] .toast-close,
.dark-theme .toast-close {
    color: #666;
}

body[data-theme="dark"] .toast-close:hover,
.dark-theme .toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ==========================================
   GLOBAL SEARCH
   ========================================== */

.global-search {
    position: relative;
    margin-right: 15px;
}

.global-search input {
    width: 200px;
    padding: 8px 60px 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
    transition: all 0.3s;
}

.global-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.global-search input:focus {
    width: 280px;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

.search-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.search-modal-content {
    width: 90%;
    max-width: 650px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    gap: 15px;
}

.search-modal-header input {
    flex: 1;
    padding: 12px 0;
    border: none;
    font-size: 18px;
    outline: none;
    color: var(--gray-800);
}

.search-modal-header input::placeholder {
    color: var(--gray-400);
}

.search-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.search-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.search-filters {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.search-filter {
    padding: 6px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--gray-600);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.search-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.search-results {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.search-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.search-result-icon.agent { background: rgba(58, 166, 185, 0.15); }
.search-result-icon.knowledge { background: rgba(156, 39, 176, 0.15); }
.search-result-icon.message { background: rgba(76, 175, 80, 0.15); }
.search-result-icon.meeting { background: rgba(255, 152, 0, 0.15); }

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.search-result-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.search-result-description {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-description mark {
    background: rgba(58, 166, 185, 0.2);
    color: var(--primary);
    padding: 1px 3px;
    border-radius: 3px;
}

.search-result-type {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    flex-shrink: 0;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--gray-400);
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.search-no-results h3 {
    margin-bottom: 8px;
    color: var(--gray-600);
}

/* ==========================================
   ORGANIGRAMMA INTERATTIVO
   ========================================== */

.orgchart-section {
    margin-top: var(--space-6);
}

.orgchart-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.orgchart-controls {
    display: flex;
    gap: var(--space-2);
}

.orgchart-controls select {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    background: var(--bg-secondary);
    cursor: pointer;
}

.orgchart-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow);
    min-height: 400px;
    overflow: auto;
}

.orgchart-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-radius: 0;
    min-height: 100vh;
}

.orgchart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-3);
    background: #0F172A !important;
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    border: 1px solid #334155;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.75rem;
    color: var(--gray-600);
}

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.executive { background: linear-gradient(135deg, #3AA6B9, #2d8a9a); }
.dot.consulting { background: #4299e1; }
.dot.it_operations { background: #48bb78; }
.dot.marketing { background: #ed8936; }
.dot.customer_success { background: #f97316; }
.dot.legal { background: #718096; }
.dot.wellness { background: #f56565; }
.dot.education { background: #38b2ac; }

.orgchart-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4);
}

/* Department View */
.org-departments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    width: 100%;
}

.org-department {
    background: #1e293b !important;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    border-top: 4px solid #3AA6B9;
    border: 1px solid #334155;
}

.org-department.executive { border-top-color: #3AA6B9; }
.org-department.consulting { border-top-color: #4299e1; }
.org-department.it_operations { border-top-color: #48bb78; }
.org-department.marketing { border-top-color: #ed8936; }
.org-department.customer_success { border-top-color: #f97316; }
.org-department.legal { border-top-color: #718096; }
.org-department.wellness { border-top-color: #f56565; }
.org-department.education { border-top-color: #38b2ac; }

.org-department-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
}

.org-department-name {
    font-weight: 600;
    color: var(--gray-800);
    text-transform: capitalize;
}

.org-department-count {
    font-size: 0.75rem;
    background: var(--gray-200);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--gray-600);
}

.org-agents {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.org-agent {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: #0F172A !important;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #334155;
}

.org-agent:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.org-agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3AA6B9 0%, #2d8a9a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.org-agent-info {
    flex: 1;
    min-width: 0;
}

.org-agent-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-agent-role {
    font-size: 0.7rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-agent-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.org-agent-status.idle { background: var(--gray-400); }
.org-agent-status.active, .org-agent-status.working { background: var(--success); }
.org-agent-status.busy { background: var(--warning); }
.org-agent-status.speaking { background: var(--info); }

/* Hierarchy View */
.org-hierarchy {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.org-level {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    position: relative;
    padding: var(--space-4) 0;
}

.org-level:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: var(--gray-300);
}

.org-level-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--gray-400);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.org-node {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    box-shadow: var(--shadow);
    min-width: 140px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.org-node:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.org-node-avatar {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--space-2);
    border-radius: 50%;
    background: linear-gradient(135deg, #3AA6B9 0%, #2d8a9a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.org-node-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-800);
}

.org-node-role {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ============================================= */
/* SAMPLE/EXAMPLE DATA CONVENTION               */
/* Valori esempio = giallo, valori reali = bianco */
/* ============================================= */

.sample-value,
.example-value,
[data-sample="true"] {
    color: var(--sample-value) !important;
}

.real-value,
[data-sample="false"] {
    color: var(--real-value) !important;
}

/* Sample value indicator (small label) */
.sample-indicator {
    font-size: 0.65rem;
    color: var(--sample-value);
    font-style: italic;
    margin-left: 4px;
}

/* Sample value with tooltip */
.sample-value::after {
    content: " *";
    font-size: 0.8em;
    opacity: 0.7;
}

/* No asterisk variant */
.sample-value-clean {
    color: var(--sample-value) !important;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE - Warm theme for CEO
   Activated via body.light-mode class (toggled from settings/office)
   ═══════════════════════════════════════════════════════════════ */

/* Theme toggle button (global, shown on all pages) */
.theme-toggle-global {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.3);
    color: #888;
    font-size: 18px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.theme-toggle-global:hover {
    background: rgba(58,166,185,0.2);
    border-color: rgba(58,166,185,0.4);
    color: #3AA6B9;
    transform: scale(1.1);
}

body.light-mode {
    color-scheme: light;
}

body.light-mode,
body.light-mode html {
    background-color: #FEFCF8 !important;
    color: #2d3748 !important;
}

body.light-mode .header {
    background: rgba(255,255,255,0.95) !important;
    border-bottom: 1px solid #e8e0d4 !important;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    color: #2d3748;
}

body.light-mode .logo-text,
body.light-mode .logo {
    color: #2d3748 !important;
}

body.light-mode .nav-item {
    color: #555 !important;
}

body.light-mode .nav-item:hover {
    color: #3AA6B9 !important;
    background: rgba(58,166,185,0.1) !important;
}

body.light-mode .nav-item.active {
    color: #3AA6B9 !important;
    background: rgba(58,166,185,0.15) !important;
}

body.light-mode .nav-icons .nav-icon-item {
    color: #555 !important;
}

body.light-mode .nav-icons .nav-icon-item:hover,
body.light-mode .nav-icons .nav-icon-item.active {
    color: #3AA6B9 !important;
}

body.light-mode .section,
body.light-mode .card,
body.light-mode .settings-section,
body.light-mode .stat-card,
body.light-mode .org-node {
    background: rgba(255,255,255,0.85) !important;
    border-color: #e8e0d4 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    color: #2d3748;
}

body.light-mode .section h2,
body.light-mode .section-header h3,
body.light-mode h1, body.light-mode h2, body.light-mode h3 {
    color: #2d3748 !important;
}

body.light-mode p,
body.light-mode span,
body.light-mode label,
body.light-mode td,
body.light-mode th,
body.light-mode li {
    color: #4a5568;
}

body.light-mode .text-muted,
body.light-mode .setting-label {
    color: #777 !important;
}

body.light-mode input,
body.light-mode textarea,
body.light-mode select {
    background: rgba(0,0,0,0.02) !important;
    border-color: #ddd5c9 !important;
    color: #2d3748 !important;
}

body.light-mode .btn-primary,
body.light-mode .btn-teal {
    background: linear-gradient(135deg, #3AA6B9, #2d8a9a);
    color: #fff;
}

body.light-mode .connection-status .status-text {
    color: #555 !important;
}

body.light-mode .mobile-nav-overlay {
    background: rgba(255,255,255,0.98) !important;
}

body.light-mode .mobile-nav-panel {
    background: #fff !important;
    color: #2d3748 !important;
}

body.light-mode .mobile-nav-items a,
body.light-mode .mobile-nav-item {
    color: #2d3748 !important;
}

body.light-mode .site-footer {
    color: #999;
}

body.light-mode .theme-toggle-global {
    background: rgba(255,255,255,0.8);
    border-color: #ddd5c9;
    color: #555;
}

body.light-mode .theme-toggle-global:hover {
    color: #3AA6B9;
}
