/* OmniFlow 4-Column Layout */
.app-container {
    display: grid;
    grid-template-columns: 120px 280px minmax(0, 1fr) 280px;
    height: 100vh;
    width: 100vw;
    gap: 0;
    position: relative;
    z-index: 1;
}

.app-container.app-shell-attendance {
    grid-template-columns: 120px minmax(0, 1fr) !important;
}

/* Column 1: Global Nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    gap: 1rem;
}

.nav-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s var(--ease-spring);
}

.nav-item:hover, .nav-item.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.logo-container {
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(16, 185, 129, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(14, 165, 233, 0.12);
}

.logo-role {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--primary);
    text-align: center;
    line-height: 1.1;
    width: 100%;
}

.sidebar-user-card {
    width: 100%;
    padding: 0.65rem 0.35rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user-name {
    max-width: 100%;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    word-break: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column 2: Secondary List (Sectors) */
.sub-sidebar {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.list-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s var(--ease-spring);
    gap: 0.75rem;
}

.list-item > i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.list-item:hover, .list-item.active {
    background: var(--glass-bg);
    color: var(--text-main);
    box-shadow: var(--glass-shadow);
}

.list-item-info {
    display: flex;
    flex-direction: column;
}

.list-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.list-item-status {
    font-size: 0.75rem;
    color: var(--accent);
}

/* Column 3: Main Canvas */
.main-canvas {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
    min-width: 0;
}

.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    gap: 1rem;
}

.canvas-header-focus {
    padding-top: 0.25rem;
    margin-bottom: 1rem;
}

.canvas-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.canvas-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.canvas-kicker {
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.main-canvas-focus {
    padding: 0 !important;
}

.body-attendance .bg-mesh {
    background: #f8fafc !important;
}

.body-attendance .canvas-header {
    display: none !important;
}

.canvas-content {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
}

/* Column 4: Right Sidebar */
.right-sidebar {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.status-card {
    background: white;
    padding: 1.25rem;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.status-indicator {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.65rem;
    background: #ecfdf5;
    color: #059669;
}

.status-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.status-label {
    color: var(--text-muted);
}

.status-value {
    font-weight: 600;
}

.inline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

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

/* Chat Simulator Styles */
.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.message-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.message {
    max-width: 80%;
    padding: 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bot {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    box-shadow: var(--glass-shadow);
}

.internal-note {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px dashed rgba(99, 102, 241, 0.3);
    margin-top: 0.5rem;
    font-weight: 500;
    display: inline-block;
}

.chat-input-area {
    padding: 1.5rem 0 0.5rem 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    text-align: left;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.5rem;
}

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

/* Login Page */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 1rem;
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 120px 250px minmax(0, 1fr);
    }
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 120px minmax(0, 1fr);
    }
    .sub-sidebar {
        display: none;
    }
    .main-canvas,
    .main-canvas-focus {
        padding-inline: 0.9rem;
    }
}

@media (max-width: 640px) {
    .canvas-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .canvas-actions {
        width: 100%;
        justify-content: flex-start;
    }
}


/* =========================================
   Multi-Agent UI Extensions (Omniflow Style)
   ========================================= */

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.agent-card {
    background: rgba(30, 31, 34, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.agent-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.agent-card-header {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
}

.agent-avatar {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-info {
    flex: 1;
}

.agent-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.agent-card-body {
    padding: 1.25rem;
    flex: 1;
}

.agent-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.agent-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.agent-card-actions {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.25rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.action-btn {
    padding: 0.5rem;
}

/* Config Sections (Collapsible) */
.config-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.config-section {
    padding: 0;
    overflow: hidden;
}

.config-section-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.config-section-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.config-section-header i {
    color: var(--text-muted);
}

.config-section-header h3 {
    font-weight: 500;
}

.chevron {
    transition: transform 0.3s ease;
}

.config-section-body {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

/* Toggle Switch */
.toggle-switch {
    appearance: none;
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease;
}

.toggle-switch:checked {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch:checked::after {
    transform: translateX(24px);
}
