:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-color: #0f172a;
    --bg-light: #1e293b;
    --bg-lighter: #334155;
    --text-color: #e2e8f0;
    --text-muted: #b8c5d3;
    --border-color: #334155;
    --success-color: #10b981;
    --error-color: #ef4444;
}

/* ============================================================================
   Light Mode Overrides
   ============================================================================ */

body.light {
    --bg-color: #f8fafc;
    --bg-light: #f1f5f9;
    --bg-lighter: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #3f4f63;
    --border-color: #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    color: var(--text-color);
}

/* Light mode code blocks / pre */
body.light pre,
body.light code {
    background: #e2e8f0;
    color: #334155;
}

/* Light mode scrollbars */
body.light ::-webkit-scrollbar-track {
    background: #f1f5f9;
}
body.light ::-webkit-scrollbar-thumb {
    background: #94a3b8;
}
body.light ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Light mode: reduce heavy dark shadows */
body.light .modal-content,
body.light .dropdown-menu,
body.light .card,
body.light .chat-container {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Light mode: markdown content inside chat */
body.light .message-content a {
    color: #4f46e5;
}
body.light .message-content blockquote {
    border-left-color: #cbd5e1;
    color: #475569;
}
body.light .message-content table th {
    background: #e2e8f0;
}
body.light .message-content table td {
    border-color: #cbd5e1;
}

/* Light mode: ensure inputs/selects are readable */
body.light input,
body.light textarea,
body.light select {
    color: #1e293b;
}

/* Light mode: fix nav active colors that clash on light backgrounds */
body.light .nav-item.nav-chat.active {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}
body.light .nav-item.nav-deployments.active {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}
body.light .nav-item.nav-secrets.active {
    background: rgba(251, 191, 36, 0.12);
    color: #92400e;
}
body.light .cloud-status.disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}
body.light .provider-pill {
    color: #4338ca;
}
body.light .status-success { color: #047857; }
body.light .status-warning { color: #b45309; }
body.light .status-error { color: #dc2626; }
body.light .monitor-status.pending { color: #b45309; }
body.light .monitor-status.running { color: #1d4ed8; }
body.light .monitor-status.success { color: #047857; }
body.light .monitor-status.failed { color: #dc2626; }
body.light .function-result-header { color: #be185d; }
body.light .secret-key { color: #4338ca; }
body.light .cloud-panel {
    background: rgba(241, 245, 249, 0.8);
}
body.light .hero-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
body.light .upload-menu {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}
body.light .project-dropdown {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
body.light .user-dropdown {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Smooth theme transition */
body {
    transition: background 0.3s ease, color 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto',
        'Helvetica Neue', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a1a2e 100%);
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 20px;
}

.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-color);
    cursor: pointer;
    min-width: 200px;
}

.user-trigger svg {
    transition: transform 0.2s ease;
}

.user-trigger.open svg {
    transform: rotate(180deg);
}

.user-trigger img,
.dropdown-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
}

.user-handle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.provider-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: capitalize;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 240px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.6);
    padding: 16px;
    z-index: 10;
}

.dropdown-header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    padding: 6px 0;
    border-radius: 8px;
}

.dropdown-links a:hover {
    color: var(--primary-color);
}

.logo h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.logo .stream {
    font-weight: 300;
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid transparent;
    background: var(--bg-lighter);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25);
}

.btn.primary:hover {
    transform: translateY(-2px);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color);
}

.btn.secondary:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.btn.ghost {
    border-color: var(--border-color);
    background: transparent;
}

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

.landing-body {
    min-height: 100vh;
}

.container.landing {
    padding-top: 40px;
}

.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 40px 0;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    align-items: center;
}

.hero span {
    color: var(--primary-color);
}

.hero p {
    color: var(--text-muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    color: var(--text-muted);
}

.login-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.login-options .btn {
    flex: 1;
    min-width: 200px;
}

.hero-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.5);
}

.hero-card ul {
    list-style: none;
    margin-top: 12px;
    color: var(--text-color);
    line-height: 1.8;
}

.card-title {
    font-weight: 600;
    color: var(--text-muted);
}

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

.feature-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.about h4 {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.about ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.about li {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.about li div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.about li strong {
    color: var(--text-color);
    font-size: 1.1rem;
}

.about li p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

.about li span {
    flex-shrink: 0; /* Prevent number circle from shrinking */
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-bottom: 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.message-content {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 12px;
    line-height: 1.6;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-content {
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.message-content li {
    margin-bottom: 5px;
}

.message-content code {
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: var(--bg-color);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.function-result {
    margin-top: 10px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.9em;
}

.function-summary {
    margin: 8px 0;
    color: var(--text-color);
}

.function-preview {
    list-style: disc;
    margin-left: 20px;
    color: var(--text-muted);
    line-height: 1.5;
}

.function-preview li {
    margin-bottom: 4px;
}

.function-raw {
    margin-top: 10px;
}

.function-raw summary {
    cursor: pointer;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.function-raw pre {
    max-height: 300px;
    overflow-y: auto;
}

.function-result-header {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.loading-indicator {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    background: var(--bg-lighter);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 80px;
}

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

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

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

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

.quick-actions {
    padding: 0 30px 24px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.quick-actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quick-actions-label {
    margin-bottom: 0;
}

.quick-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-action-btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.quick-action-btn:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.quick-action-btn:active {
    transform: translateY(0);
}

.quick-action-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-close:hover {
    background: var(--bg-lighter);
    color: var(--text-color);
}

.chat-input-container {
    padding: 20px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    position: relative;
}

#chat-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.attach-btn {
    padding: 10px 12px;
    background: var(--bg-lighter);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.attach-btn:active {
    transform: scale(0.95);
}

.upload-menu {
    position: absolute;
    bottom: 80px;
    left: 20px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    min-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.upload-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.upload-menu-item:hover {
    background: var(--bg-light);
}

.upload-menu-item .icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.menu-item-title {
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 2px;
}

.menu-item-desc {
    font-size: 0.9em;
    color: var(--text-muted);
    line-height: 1.3;
}

#user-input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-lighter);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#user-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#send-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

#send-btn:active {
    transform: translateY(0);
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--secondary-color);
}

/* Mock Chat Styles */
.mock-chat {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    font-size: 0.95rem;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.mock-header {
    background: var(--bg-lighter);
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.mock-messages {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mock-message {
    max-width: 90%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.mock-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.mock-message.assistant {
    align-self: flex-start;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.mock-message p {
    margin-bottom: 8px;
}

.mock-message p:last-child {
    margin-bottom: 0;
}

.mock-success {
    margin-top: 12px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    color: var(--success-color);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mock-success a {
    color: var(--success-color);
    text-decoration: underline;
    word-break: break-all;
}

/* Feature Icons */
.feature-card .icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bg-lighter);
}

/* Dashboard Layout */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

.sidebar {
    background: var(--bg-light);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.sidebar-header {
    margin-bottom: 30px;
}

.logo.small h1 {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cloud-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 12px 12px;
    margin: 12px 0;
}

.cloud-panel summary {
    cursor: pointer;
    padding: 12px 0;
    font-weight: 600;
    color: var(--text-color);
    list-style: none;
}

.cloud-panel summary::-webkit-details-marker {
    display: none;
}

.cloud-panel summary::after {
    content: "▾";
    float: right;
    transition: transform 0.2s ease;
}

.cloud-panel[open] summary::after {
    transform: rotate(180deg);
}

.cloud-panel-body {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.cloud-connection {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cloud-name {
    font-size: 1rem;
    font-weight: 600;
    margin-right: 6px;
}

.cloud-status {
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cloud-status.disconnected {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.cloud-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn.tiny {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 999px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background: var(--bg-lighter);
    color: var(--text-color);
}

.nav-item.nav-chat.active {
    background: rgba(99, 102, 241, 0.2);
    color: #eef0ff;
    border-left: 3px solid var(--primary-color);
}

.nav-item.nav-deployments.active {
    background: rgba(16, 185, 129, 0.15);
    color: #e0fbef;
    border-left: 3px solid var(--success-color);
}

.nav-item.nav-secrets.active {
    background: rgba(251, 191, 36, 0.15);
    color: #fef3c7;
    border-left: 3px solid #fbbf24;
}

.nav-item .icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    position: relative;
    min-width: 0;
    min-height: 0;
}

.tab-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px 10px;
    border-bottom: 1px solid var(--border-color);
}

.tab-hero h2 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.tab-subhead {
    color: var(--text-muted);
    max-width: 420px;
}

.tab-pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(236, 72, 153, 0.15);
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Adjust Chat Container for Dashboard */
.main-content .chat-container {
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    background: transparent;
}

.main-content .chat-messages {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.main-content .chat-input-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

/* Sidebar User Menu Overrides */
.sidebar .user-trigger {
    width: 100%;
    justify-content: flex-start;
    border: none;
    background: transparent;
    padding: 8px;
}

.sidebar .user-trigger:hover {
    background: var(--bg-lighter);
}

.sidebar .user-dropdown {
    bottom: 100%;
    top: auto;
    left: 0;
    width: 100%;
    margin-bottom: 10px;
}

/* Tab Content */
.tab-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-content[hidden] {
    display: none !important;
}

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

.content-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

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

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.settings-section {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

/* Deployments Grid */
.deployments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.deployment-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.deployment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.deployment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.deployment-title h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.deployment-id {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: monospace;
}

.deployment-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.status-success { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.status-warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-error { background: rgba(239, 68, 68, 0.2); color: var(--error-color); }
.status-neutral { background: var(--bg-lighter); color: var(--text-muted); }

.deployment-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.detail-item .value {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.deployment-actions .btn {
    flex: 1;
    justify-content: center;
}

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

.status-indicator {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
    animation: pulse 1.5s infinite;
}

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

/* Secrets List */
.secrets-container {
    max-width: 800px;
    margin: 0 auto;
}

.secret-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

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

.secret-key {
    font-family: monospace;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
}

.secret-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: monospace;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal[hidden] {
    display: none !important;
}

.modal-content {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    padding: 25px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content.large {
    max-width: 800px;
    width: 90%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.logs-container {
    flex: 1;
    background: #1e1e1e;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
    position: relative;
    border: 1px solid var(--border-color);
}

.logs-output {
    margin: 0;
    padding: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: #e0e0e0;
    white-space: pre-wrap;
    overflow-y: auto;
    height: 100%;
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* Billing Styles */
.billing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.summary-card h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.big-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

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

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

.data-table .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.data-table .badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

/* Access & Security Styles */
.access-section {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

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

.section-desc {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 1rem;
}

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

.key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.key-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.key-name {
    font-weight: 500;
    color: var(--text-color);
}

.key-preview {
    font-family: 'Fira Code', monospace;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.key-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn.icon-only {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn.icon-only:hover {
    background: var(--bg-lighter);
    color: var(--text-color);
}

.btn.icon-only.danger:hover {
    border-color: var(--error-color);
    color: var(--error-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Project Selector Styles */
.project-selector-container {
    position: relative;
    margin-top: 20px;
    width: 100%;
}

.project-selector-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.project-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.project-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.project-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 8px;
}

.project-list {
    max-height: 200px;
    overflow-y: auto;
}

.project-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    font-size: 0.95rem;
}

.project-item:hover {
    background: var(--bg-lighter);
}

.project-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.dropdown-item.create-project {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
}

.dropdown-item.create-project:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Build Monitor Styles */
.build-monitor {
    margin-top: 12px;
    background: #1e1e1e;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-lighter);
    border-bottom: 1px solid var(--border-color);
}

.monitor-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.monitor-status {
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.monitor-status.pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.monitor-status.running { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.monitor-status.success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.monitor-status.failed { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.monitor-logs {
    padding: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Build Monitor Steps */
.build-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    background: var(--bg-lighter);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.build-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-light);
    transition: all 0.2s ease;
}

.build-step.active {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.build-step.completed {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.build-step.failed {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.step-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
    font-size: 12px;
    color: var(--text-muted);
}

.build-step.active .step-icon {
    background: var(--primary-color);
    color: white;
    animation: pulse 2s infinite;
}

.build-step.completed .step-icon {
    background: var(--success-color);
    color: white;
}

.build-step.failed .step-icon {
    background: var(--error-color);
    color: white;
}

.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step-title {
    font-weight: 600;
    font-size: 0.95rem;
}

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Thinking Indicator */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

/* ============================================================================
   Focus-visible for keyboard accessibility
   ============================================================================ */

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================================================
   Responsive: collapse sidebar on smaller screens
   ============================================================================ */

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

    .sidebar {
        display: none;
    }

    .main-content .chat-messages,
    .main-content .chat-input-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .tab-hero {
        padding: 20px 16px 10px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .content-body {
        padding: 16px;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .deployments-grid {
        grid-template-columns: 1fr;
    }

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


