/* === Typography (GIT-934 UX slice) ============================== */
/* Aeonik = canonical Gitrevio sans (matches gitrevio-website).      */
/* EB Garamond from Google Fonts handles serif headings + body prose */
/* in skill outputs / report previews — the "magazine" feel.         */

@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap");

@font-face {
    font-family: "Aeonik";
    src: url("/fonts/aeonik-regular.woff2") format("woff2"),
         url("/fonts/aeonik-regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Aeonik Mono";
    src: url("/fonts/aeonikmono-regular.woff2") format("woff2"),
         url("/fonts/aeonikmono-regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-sans: "Aeonik", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
    --font-mono: "Aeonik Mono", ui-monospace, "Monaco", "Courier New", monospace;

    /* Palette: neutral parchment + ink with a single brand accent.
     * Replaces the prior #667eea→#764ba2 purple gradient that was
     * applied to body, primary buttons and title text — visually
     * loud and out of step with the website's restrained typography.
     * The accent here is a deeper, less-saturated indigo (#4a5fb8)
     * that pairs better with EB Garamond. */
    --color-bg: #f7f5f0;          /* parchment */
    --color-surface: #ffffff;
    --color-ink: #1a1a1a;
    --color-ink-soft: #4a4a4a;
    --color-ink-muted: #7a7a7a;
    --color-border: #e2dfd8;
    --color-accent: #4a5fb8;       /* deep indigo brand */
    --color-accent-hover: #3b4d99;
    --color-accent-soft: #eef0fa;
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-ink);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Skill output / report preview / long-form prose blocks adopt the
 * serif by default. Components that render inline elements in their
 * own font (.code, .chip, .badge) override locally below. */
.prose,
.report-preview,
.skill-output,
.markdown-body,
.message-content > p,
.message-content > ul,
.message-content > ol,
.message-content > blockquote {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    line-height: 1.65;
}

.app {
    width: 100%;
    height: 100%;
}

/* Auth Screen */
.auth-screen {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.auth-box .app-title {
    color: var(--color-ink);
    margin-bottom: 10px;
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.auth-box .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.auth-form {
    width: 100%;
}

.auth-form h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: left;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.primary-button {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.primary-button:hover:not(:disabled) {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-switch {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-switch a {
    color: var(--color-accent);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: left;
}

/* Main Layout with Sidebar */
.main-layout {
    width: 100vw;
    height: 100vh;
    display: flex;
    background: white;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 16px;
}

.new-chat-button {
    width: 100%;
    padding: 10px 16px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.new-chat-button:hover {
    transform: translateY(-2px);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-list-item {
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-list-item:hover {
    background: #e9ecef;
}

.chat-list-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 3px solid var(--color-accent);
}

.chat-title {
    color: #333;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-timestamp {
    color: #999;
    font-size: 12px;
}

.empty-state {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.sidebar-footer {
    border-top: 1px solid #e0e0e0;
    padding: 16px;
}

.user-info {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.user-name {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.user-email {
    color: #666;
    font-size: 12px;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background: #e9ecef;
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--color-accent);
    font-weight: 600;
}

.menu-item.logout {
    color: #dc3545;
}

.menu-item.logout:hover {
    background: #fff5f5;
}

/* Chat Screen */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-left {
    flex: 1;
}

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

.chat-header h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 0;
}

.archive-button {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.archive-button:hover {
    background: #f0f0f0;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.status-indicator.connected {
    background: #4caf50;
    box-shadow: 0 0 8px #4caf50;
}

.status-indicator.disconnected {
    background: #f44336;
}

.status-text {
    color: #666;
    font-size: 14px;
}

.empty-chat-state {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 16px;
    padding: 40px;
    text-align: center;
}

/* Reports Dashboard */
.reports-dashboard {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    /* Use auto for row sizing to accommodate variable heights */
    grid-auto-rows: auto;
    gap: 20px;
    overflow-y: auto;
    /* Align items to start for better visual flow with varying heights */
    align-items: start;
}

.report-dashboard-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    /* Keep overflow hidden to maintain rounded corners */
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Minimum height for empty/loading states, but allow content to determine actual height */
    min-height: 300px;
    height: auto;
}

.report-dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.report-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.report-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-icon:hover {
    background: rgba(0,0,0,0.05);
}

.report-card-body {
    padding: 0;
    /* Ensure minimum visible height for loading/empty states only */
    min-height: 250px;
    /* Allow natural content sizing like chat messages */
    display: block;
    /* Ensure body doesn't constrain grid height */
    height: auto;
}

/* Make AG Grid tables size based on content - same as chat styling */
.report-card-body .ag-theme-alpine {
    width: 100% !important;
    border-radius: 0;
    /* Override any inline height styles set by JS - let domLayout: 'autoHeight' work */
    height: auto !important;
    overflow: visible !important;
    box-sizing: border-box;
}

/* Fix AG Grid viewport height to match content */
.report-card-body .ag-theme-alpine .ag-root,
.report-card-body .ag-theme-alpine .ag-root-wrapper {
    overflow: visible !important;
    height: auto !important;
}

.report-card-body .ag-theme-alpine .ag-center-cols-viewport {
    overflow: visible !important;
    height: auto !important;
}

.report-card-body .ag-theme-alpine .ag-body-viewport {
    overflow: visible !important;
    height: auto !important;
}

.report-card-body .js-component-container {
    width: 100%;
    /* Remove padding to let visualization fill the space */
    padding: 0;
    margin: 0;
    /* Let content determine height naturally */
    box-sizing: border-box;
}

/* AG Charts sizing in report cards */
.report-card-body .ag-chart-wrapper,
.report-card-body canvas {
    max-width: 100%;
}

/* Default height for charts if not specified */
.report-card-body .ag-chart-wrapper {
    min-height: 300px;
}

/* Loading, error, and empty states in report cards need explicit height */
.report-card-body .loading-state,
.report-card-body .error-state,
.report-card-body .empty-state {
    min-height: 250px !important;
    height: auto !important;  /* Override the global height: 100% rule */
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px 20px;
    width: 100%;
    box-sizing: border-box;
}

.view-toggle {
    display: flex;
    gap: 8px;
    margin: 0 20px;
}

.toggle-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.toggle-btn:hover:not(.active) {
    background: #f0f0f0;
}

/* Reports List */
.reports-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.report-list-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.report-list-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
}

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

.report-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.report-item-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.report-category {
    color: var(--color-accent);
    font-weight: 500;
}

.report-last-run {
    color: #999;
}

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

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
}

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

.message.system {
    background: #f5f5f5;
    color: #666;
    align-self: center;
    text-align: center;
    font-style: italic;
    max-width: 60%;
}

.message.user-message {
    background: var(--color-accent);
    color: white;
    align-self: flex-end;
    max-width: 70%;
}

.message.ai-message {
    background: #f8f9fa;
    color: #333;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
    width: calc(100% - 40px);
    max-width: none;
}

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

.user {
    font-weight: 600;
    font-size: 14px;
}

.timestamp {
    font-size: 11px;
    opacity: 0.7;
}

.message-content {
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.streaming-indicator {
    color: #4caf50;
    font-size: 18px;
    animation: pulse 1s infinite;
    margin-left: 8px;
}

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

/* Markdown styling in AI messages */
.message-content.markdown {
    line-height: 1.6;
}

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

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

.message-content.markdown code {
    background: #e8e8e8;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.message.ai-message .message-content.markdown code {
    background: #e0e0e0;
}

.message-content.markdown pre {
    background: #2d2d2d;
    color: #f8f8f8;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content.markdown pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.message-content.markdown strong {
    font-weight: 600;
}

.message-content.markdown em {
    font-style: italic;
}

.message-content.markdown ul, .message-content.markdown ol {
    margin: 10px 0;
    padding-left: 24px;
}

.message-content.markdown li {
    margin: 4px 0;
}

/* Content type badge */
.content-type-badge {
    font-size: 12px;
    margin-left: 8px;
    padding: 2px 8px;
    background: #4caf50;
    color: white;
    border-radius: 10px;
}

/* JavaScript component container */
.js-component-container {
    background: white;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
    width: 100%;
}

.message.ai-message .message-content.javascript-content {
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.message.ai-message .message-content {
    display: flex;
    flex-direction: column;
}

/* AG Grid theme customization for chat */
.js-component-container .ag-theme-alpine {
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.js-component-container .ag-theme-alpine .ag-root-wrapper {
    border-radius: 6px;
}

.js-component-container .ag-theme-alpine .ag-header {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

/* Error display for failed JS execution */
.error {
    color: #f44336;
    background: #ffebee;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #f44336;
}

/* Placeholder for buffered content */
.placeholder {
    color: #999;
    font-style: italic;
    padding: 8px 0;
}

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex: 0 0 auto;
    max-height: 45vh;
    overflow-y: visible;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    min-height: 44px;
    max-height: calc(40vh - 60px);
    resize: none;
    overflow-y: auto;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.message-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.message-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.send-button {
    padding: 12px 32px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.messages::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover,
.chat-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===============================================
   Report Editor Styles
   =============================================== */

.report-editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: white;
}

.report-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    min-height: 70px;
}

.report-editor-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-editor-header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.report-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.report-status.draft {
    background: #fff4e6;
    color: #e67e00;
}

.report-status.active {
    background: #e6f7e6;
    color: #2e7d32;
}

.report-status.archived {
    background: #f5f5f5;
    color: #666;
}

.report-editor-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-primary, .btn-secondary, .btn-small {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

.btn-secondary:hover:not(:disabled) {
    background: #f8f9ff;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    background: #f5f5f5;
    color: #666;
}

.btn-small:hover {
    background: #e0e0e0;
}

.report-editor-split {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.report-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.preview-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.preview-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.empty-preview-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 14px;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #f8f9fa;
}

.placeholder-content {
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.placeholder-text {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.placeholder-hint {
    font-size: 14px;
    color: #666;
}

.report-chat-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
    background: white;
}

.report-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.report-chat-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.report-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Remove padding as messages-list and input have their own spacing */
}

/* Messages list within report editor */
.report-chat-content .messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Input area within report editor */
.report-chat-content .input-area {
    border-top: 1px solid #e0e0e0;
    background: white;
}

.loading-state, .error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 16px;
    color: #666;
}

.error-state {
    color: #d32f2f;
}

/* Signup Wizard Styles */
.auth-box.signup-box {
    min-width: 500px;
    max-width: 600px;
}

.signup-wizard {
    text-align: left;
}

.signup-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.signup-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.signup-step.active {
    opacity: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.signup-step.active .step-number {
    background: var(--color-accent);
    color: white;
}

.step-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: #e0e0e0;
    margin: 0 8px;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.step-connector.active {
    background: var(--color-accent);
}

.signup-form {
    width: 100%;
}

.signup-form h2 {
    color: #333;
    margin-bottom: 8px;
    font-size: 24px;
}

.form-description {
    color: #666;
    margin-bottom: 24px;
    font-size: 14px;
}

.form-description strong {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

.form-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #d32f2f;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .primary-button,
.form-actions .secondary-button {
    flex: 1;
}

.secondary-button {
    width: 100%;
    padding: 12px 16px;
    background: white;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-button:hover {
    background: #f8f9ff;
}

/* Provisioning Status */
.provisioning-status {
    text-align: center;
    padding: 40px 20px;
}

.status-running {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.status-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    color: white;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-failed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f44336;
    color: white;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-pending {
    padding: 20px;
    color: #666;
}

/* Onboarding Wizard Styles */
.onboarding-screen {
    background: var(--color-accent);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.onboarding-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 100%;
    padding: 40px;
}

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

.onboarding-header h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.skip-link {
    color: #888;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.skip-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.onboarding-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 4px;
}

.onboarding-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.onboarding-step.active {
    opacity: 1;
}

.onboarding-content {
    text-align: center;
    padding: 20px 0;
}

.onboarding-content h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 16px;
}

.onboarding-content > p {
    color: #666;
    font-size: 16px;
    margin-bottom: 32px;
}

.welcome-icon,
.complete-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.welcome-text {
    color: #666;
    font-size: 16px;
    margin-bottom: 32px;
}

.welcome-steps,
.next-steps-list {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 32px;
}

.step-preview,
.next-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9ff;
    border-radius: 8px;
    margin-bottom: 8px;
}

.preview-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.step-bullet {
    color: var(--color-accent);
    font-weight: bold;
}

/* Datasource Grid */
.datasource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.datasource-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    transition: all 0.2s;
}

.datasource-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.ds-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ds-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--color-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.ds-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ds-fields {
    margin-bottom: 16px;
}

.ds-fields .form-group {
    margin-bottom: 12px;
}

.ds-fields label {
    font-size: 13px;
}

.required {
    color: #d32f2f;
    margin-left: 4px;
}

/* Repo List */
.repo-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 24px;
}

.repo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

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

.repo-item:hover {
    background: #f8f9ff;
}

.repo-item.selected {
    background: #e8edff;
}

.repo-checkbox {
    font-size: 18px;
    color: var(--color-accent);
}

.repo-name {
    color: #333;
}

/* Sync Status */
.sync-status {
    padding: 40px 20px;
}

.sync-pending {
    padding: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
}

.empty-state p {
    margin-bottom: 16px;
}

/* =========================================
   Team Settings
   ========================================= */

.team-settings-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f8f9fa;
}

.team-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.team-settings-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.back-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.back-link:hover {
    text-decoration: underline;
}

.team-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.team-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
}

/* Invite Form */
.invite-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.form-row .form-input {
    flex: 1;
    margin-bottom: 0;
}

.form-select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-row .primary-button {
    width: auto;
    white-space: nowrap;
}

/* Team Members List */
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-weight: 500;
    color: #333;
}

.member-email {
    font-size: 14px;
    color: #666;
}

.member-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.member-role {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.member-role.admin {
    background: #e8edff;
    color: var(--color-accent);
}

.member-role.user {
    background: #f0f0f0;
    color: #666;
}

.member-last-login {
    font-size: 12px;
    color: #888;
}

/* Invitations List */
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invitation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff8f0;
    border-radius: 8px;
    border: 1px solid #ffe0b0;
}

.invitation-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invitation-email {
    font-weight: 500;
    color: #333;
}

.invitation-role {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.invitation-role.admin {
    background: #e8edff;
    color: var(--color-accent);
}

.invitation-role.user {
    background: #f0f0f0;
    color: #666;
}

.invitation-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.invitation-expires {
    font-size: 12px;
    color: #888;
}

.btn-danger {
    background: #fff0f0;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

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

/* Success/Error Messages */
.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* =========================================
   Accept Invitation Screen
   ========================================= */

.accept-invite-screen {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 400px;
    max-width: 450px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.accept-invite-box .app-title {
    color: #333;
    margin-bottom: 30px;
    font-size: 32px;
    background: var(--color-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.accept-invite-form {
    text-align: left;
}

.accept-invite-form h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 22px;
}

.invite-details {
    color: #666;
    margin-bottom: 24px;
    font-size: 15px;
}

.role-badge {
    display: inline-block;
    background: #e8edff;
    color: var(--color-accent);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.btn-link {
    color: var(--color-accent);
    text-decoration: none;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

/* =========================================
   Settings View
   ========================================= */

.settings-content {
    padding: 30px;
    max-width: 800px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.settings-section p {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.settings-section .btn-primary,
.settings-section .btn-secondary {
    width: auto;
}
