/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg-sidebar);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    color: var(--color-text);
    line-height: 1.5;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: var(--color-bg);
    overflow: hidden;
    visibility: hidden;
}

.app-container.visible {
    visibility: visible;
}

/* Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    z-index: 10;
}

.logo-container {
    position: absolute;
    left: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header settings gear — upper right, mirrors logo position */
.header-settings-container {
    position: absolute;
    right: 28px;
    display: flex;
    align-items: center;
}

.header-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: background 0.15s, color 0.15s;
}

.header-settings-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}

/* Cross-company notification dot on settings gear */
.cross-company-dot {
    position: absolute;
    top: 4px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: #22c55e;
    border: 2px solid var(--color-card-bg, #fff);
    pointer-events: none;
    display: none;
    z-index: 1;
}

.cross-company-dot--active {
    display: block;
}

/* Sidebar hamburger toggle — left edge, aligned with assistant name in flip toolbar */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-secondary, #6b7280);
    padding: 0;
    opacity: 0.65;
    transition: opacity 0.15s;
    position: absolute;
    left: 28px;
    z-index: 10;
}

.sidebar-toggle-btn:hover {
    opacity: 1;
}

.logo {
    height: 32px;
    width: auto;
}

.main-tabs {
    display: flex;
    background: linear-gradient(180deg, #f0f1f3 0%, #e8eaed 100%);
    border-radius: 10px;
    padding: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    justify-content: center;
    gap: 4px;
}

.tab-btn {
    padding: 8px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    min-width: 80px;
}

.tab-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.tab-btn:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    color: var(--color-text);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

/* Tab locking — post-onboarding policy gate */
.tab-btn.tab-locked {
    opacity: 0.45;
    cursor: not-allowed;
    position: relative;
}

.tab-btn.tab-locked::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.tab-btn.tab-locked:hover {
    color: #666;
    background: transparent;
}

/* Toast with HTML content (links) */
.toast a {
    color: #60a5fa;
    text-decoration: underline;
}

.toast a:hover {
    color: #93bbfd;
}

/* Inline flip button — sits next to page labels */
.inline-flip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.inline-flip-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text);
    border-color: rgba(0, 0, 0, 0.15);
}

.inline-flip-btn.hidden {
    display: none;
}

/* Red glow on input wrappers when voice mode is active */
.claude-input-wrapper.voice-glow {
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.04),
        0 0 0 3px rgba(220, 38, 38, 0.15),
        0 0 12px rgba(220, 38, 38, 0.1);
    animation: input-voice-pulse 2s ease-in-out infinite;
}

.room-input-wrapper.voice-glow {
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.04),
        0 0 0 3px rgba(220, 38, 38, 0.15),
        0 0 12px rgba(220, 38, 38, 0.1);
    animation: input-voice-pulse 2s ease-in-out infinite;
}

@keyframes input-voice-pulse {
    0%, 100% {
        box-shadow:
            inset 0 1px 2px rgba(0, 0, 0, 0.04),
            0 0 0 3px rgba(220, 38, 38, 0.15),
            0 0 12px rgba(220, 38, 38, 0.1);
    }
    50% {
        box-shadow:
            inset 0 1px 2px rgba(0, 0, 0, 0.04),
            0 0 0 5px rgba(220, 38, 38, 0.1),
            0 0 20px rgba(220, 38, 38, 0.08);
    }
}

