/* ============================================================================
   BuildVision AI v2 — Procore-Inspired Light Theme
   Professional construction SaaS aesthetic — white/orange/charcoal
   ============================================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #F47E20;
    --primary-hover: #E06D10;
    --primary-light: #FFF3E8;
    --primary-dim: rgba(244, 126, 32, 0.1);
    --primary-glow: rgba(244, 126, 32, 0.25);
    --secondary: #2D2D2D;
    --accent: #1B6AC9;
    --accent-light: #E8F0FE;
    --accent-dim: rgba(27, 106, 201, 0.1);
    --james-purple: #7c3aed;
    --james-dim: rgba(124, 58, 237, 0.08);
    --james-light: #F3EEFF;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F6F7;
    --bg-tertiary: #EBEDF0;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-dark: #2D2D2D;
    --bg-dark-secondary: #3D3D3D;

    --text-primary: #2D2D2D;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-dim: #BBBBBB;
    --text-on-dark: #FFFFFF;
    --text-on-dark-secondary: rgba(255, 255, 255, 0.7);

    --border: #E0E0E0;
    --border-light: #EEEEEE;
    --border-accent: rgba(244, 126, 32, 0.3);

    --success: #28A745;
    --success-dim: rgba(40, 167, 69, 0.08);
    --warning: #F5A623;
    --warning-dim: rgba(245, 166, 35, 0.08);
    --danger: #DC3545;
    --error: #DC3545;
    --error-dim: rgba(220, 53, 69, 0.08);
    --info: #1B6AC9;

    --radius: 8px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --header-h: 56px;
    --sub-bar-h: 0px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CCC;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #AAA;
}

/* ---------- App Layout ---------- */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* ---------- Header (Dark Top Bar — Procore style) ---------- */
.header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-dark);
    border-bottom: none;
    flex-shrink: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    color: var(--text-on-dark);
    text-decoration: none;
}
.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}
.logo span.text-accent {
    color: var(--primary);
}
.version-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(244, 126, 32, 0.2);
    border: 1px solid rgba(244, 126, 32, 0.3);
    border-radius: 8px;
    color: var(--primary);
    letter-spacing: 0.03em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-on-dark-secondary);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-on-dark);
}
.nav-btn.active {
    background: rgba(244, 126, 32, 0.2);
    color: var(--primary);
}

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

/* Powered by AI Badge */
.powered-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(244, 126, 32, 0.15);
    border: 1px solid rgba(244, 126, 32, 0.25);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.02em;
}
.powered-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.tier-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(244, 126, 32, 0.15);
    border: 1px solid rgba(244, 126, 32, 0.25);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}
.tier-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-on-dark-secondary);
}
.connection-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
    transition: background var(--transition), box-shadow var(--transition);
}
.connection-status.connected .dot {
    background: var(--success);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

/* Sign Out button in header */
.sign-out-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-on-dark-secondary);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.sign-out-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-on-dark);
    border-color: rgba(255,255,255,0.3);
}

/* ---------- Main 3-Panel Layout ---------- */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - var(--header-h));
}

/* ---------- Left Panel — Project Info (was right) ---------- */
.panel-left {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

/* ---------- Center Panel — Canvas ---------- */
.panel-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    min-width: 0;
}

/* ---------- Right Panel — James Chat (was left) ---------- */
.panel-right {
    width: 350px;
    min-width: 350px;
    max-width: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
}

/* ---------- Panel Sections (Project Info) ---------- */
.panel-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}
.panel-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Code Summary Card */
.code-summary-card {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--accent-light);
    border: 1px solid rgba(27, 106, 201, 0.2);
    border-radius: var(--radius-md);
    animation: fade-in 0.3s ease;
}
.code-summary-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.code-summary-icon {
    font-size: 14px;
}
.code-summary-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}
.code-summary-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.code-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.code-summary-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.code-summary-value {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}
.code-summary-notes {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-light);
}
.code-summary-note {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 2px 0;
    line-height: 1.4;
}
.code-summary-note::before {
    content: '→ ';
    color: var(--primary);
}

/* Form inputs */
.form-group {
    margin-bottom: 10px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-input, .form-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    transition: all var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.form-select {
    appearance: none;
    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='%23999999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Code compliance checklist */
.checklist {
    list-style: none;
}
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.checklist-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}
.checklist-icon.pass { color: var(--success); }
.checklist-icon.fail { color: var(--error); }
.checklist-icon.warning { color: var(--warning); }
.checklist-icon.pending { color: var(--text-dim); }
.checklist-content {
    flex: 1;
    min-width: 0;
}
.checklist-content span {
    display: block;
    line-height: 1.4;
}
.checklist-citation {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 2px;
}
.checklist-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    font-style: italic;
}

/* Materials palette */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.material-chip {
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.material-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.material-chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Quick action buttons */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---------- Chat (Right Panel) ---------- */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-primary);
}
.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.chat-header h3 .james-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}
.chat-clear-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-ui);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.chat-clear-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

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

/* Chat Bubbles */
.msg {
    display: flex;
    flex-direction: column;
    max-width: 92%;
    animation: msg-in 0.3s ease;
}
.msg.james {
    align-self: flex-start;
}
.msg.user {
    align-self: flex-end;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    font-size: 13.5px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.msg.james .msg-bubble {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}
.msg.user .msg-bubble {
    background: var(--primary);
    border: 1px solid var(--primary);
    border-bottom-right-radius: 4px;
    color: #FFFFFF;
}

/* Welcome message */
.msg.james.welcome .msg-bubble {
    background: var(--primary-light);
    border: 1px solid rgba(244, 126, 32, 0.2);
}

/* Error message */
.msg.error .msg-bubble {
    background: var(--error-dim);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--error);
}

.msg-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    padding: 0 4px;
}
.msg.james .msg-label {
    color: var(--primary);
}
.msg.user .msg-label {
    color: var(--text-muted);
    text-align: right;
}

/* Markdown inside bubbles */
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
    margin: 8px 0 4px;
    font-size: 14px;
    color: inherit;
}
.msg-bubble p {
    margin: 4px 0;
}
.msg-bubble ul, .msg-bubble ol {
    padding-left: 18px;
    margin: 4px 0;
}
.msg-bubble code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
}
.msg.user .msg-bubble code {
    background: rgba(255, 255, 255, 0.2);
}
.msg-bubble pre {
    background: var(--secondary);
    color: #f1f5f9;
    padding: 10px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 6px 0;
}
.msg-bubble pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.msg-bubble strong {
    color: inherit;
    font-weight: 700;
}
.msg-bubble a {
    color: var(--accent);
    text-decoration: underline;
}
.msg.user .msg-bubble a {
    color: #FFF;
}
.msg-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 12px;
}
.msg-bubble th, .msg-bubble td {
    padding: 4px 8px;
    border: 1px solid var(--border);
    text-align: left;
}
.msg-bubble th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Thinking animation */
.thinking-indicator {
    display: flex;
    align-items: flex-start;
    max-width: 92%;
    animation: msg-in 0.3s ease;
}
.thinking-bubble {
    padding: 10px 14px;
    background: var(--primary-light);
    border: 1px solid rgba(244, 126, 32, 0.2);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.thinking-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.thinking-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}
.thinking-dots {
    display: flex;
    gap: 4px;
}
.thinking-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: thinking-bounce 1.4s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Tool call cards */
.tool-call-card {
    max-width: 92%;
    padding: 10px 14px;
    background: var(--accent-light);
    border: 1px solid rgba(27, 106, 201, 0.2);
    border-radius: var(--radius-md);
    animation: msg-in 0.3s ease;
}
.tool-call-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}
.tool-call-header .tool-icon {
    font-size: 16px;
}
.tool-call-header .tool-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent-dim);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: auto;
}
.tool-call-args {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.tool-result-card {
    max-width: 92%;
    padding: 10px 14px;
    background: var(--success-dim);
    border: 1px solid rgba(40, 167, 69, 0.25);
    border-radius: var(--radius-md);
    animation: msg-in 0.3s ease;
}
.tool-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
}

/* Chat Input */
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-primary);
}
.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px 6px 6px 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.chat-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 24px;
    line-height: 1.5;
}
.chat-input::placeholder {
    color: var(--text-dim);
}
.chat-send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
    font-size: 16px;
}
.chat-send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.08);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.voice-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
    font-size: 16px;
}
.voice-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------- Tab Bar ---------- */
.tab-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 16px;
    height: 42px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}
.tab-btn.active {
    color: var(--primary);
    background: var(--bg-secondary);
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}
.tab-btn .tab-icon {
    margin-right: 6px;
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.tab-content {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity var(--transition-slow);
}
.tab-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
}
.empty-state-icon {
    font-size: 48px;
    opacity: 0.4;
}
.empty-state-text {
    font-size: 14px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state-hint {
    font-size: 12px;
    color: var(--text-dim);
}

/* SVG Viewer */
#svg-viewer {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
}
#svg-viewer:active {
    cursor: grabbing;
}
#svg-viewer svg {
    max-width: 95%;
    max-height: 95%;
    transition: transform 0.05s linear;
}
#svg-viewer.has-content {
    background: #ffffff;
}
#svg-viewer:not(.has-content) {
    background:
        radial-gradient(circle at 50% 50%, rgba(244, 126, 32, 0.03) 0%, transparent 70%),
        linear-gradient(var(--border-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
    background-color: var(--bg-secondary);
    background-size: 100%, 20px 20px, 20px 20px;
}

/* Zoom Indicator */
.zoom-indicator {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
    box-shadow: var(--shadow-sm);
}
.zoom-indicator.visible {
    opacity: 1;
}

/* Three.js Canvas */
#three-canvas {
    width: 100%;
    height: 100%;
}
#three-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Rendering viewer */
#rendering-viewer {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}
#rendering-viewer img {
    max-width: 95%;
    max-height: 95%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* Plan set viewer */
#planset-viewer {
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

/* Progress bar */
.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-tertiary);
    z-index: 10;
    opacity: 0;
    transition: opacity var(--transition);
}
.progress-bar-container.active {
    opacity: 1;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 0 3px 3px 0;
    width: 0%;
    transition: width 0.3s ease;
}
.progress-bar.indeterminate {
    width: 30%;
    animation: progress-slide 1.5s infinite ease-in-out;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-secondary {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-dim);
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-block {
    width: 100%;
}
.btn-icon {
    font-size: 14px;
}

/* ---------- Subscription Bar (hidden by default, keep for compat) ---------- */
.sub-bar {
    display: none;
}

/* ---------- Glass Card (not used in light theme but keep for compat) ---------- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ---------- Download links / Plan set cards ---------- */
.download-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.download-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.download-card-icon {
    font-size: 24px;
}
.download-card-info {
    flex: 1;
}
.download-card-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.download-card-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================================================
   LANDING PAGE
   ============================================================================ */
.landing-page {
    overflow-y: auto;
    height: 100vh;
    background: var(--bg-primary);
}

/* Landing Header */
.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 64px;
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 100;
}
.landing-header .logo {
    color: var(--text-on-dark);
}
.landing-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
.landing-nav a {
    color: var(--text-on-dark-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}
.landing-nav a:hover {
    color: var(--text-on-dark);
}
.landing-cta-btn {
    padding: 8px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.landing-cta-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 520px;
    padding: 60px 40px;
    background: linear-gradient(135deg, #2D2D2D 0%, #3D3D3D 50%, #4A4A4A 100%);
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(244, 126, 32, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(27, 106, 201, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}
.hero-text {
    flex: 1;
}
.hero-text h1 {
    font-size: 48px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -1px;
}
.hero-text h1 span {
    color: var(--primary);
}
.hero-text p {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 520px;
}
.hero-cta {
    display: flex;
    align-items: center;
    gap: 16px;
}
.hero-cta .btn-primary {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius);
}
.hero-cta .btn-secondary {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    background: transparent;
}
.hero-cta .btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}
.hero-visual {
    flex: 1;
    max-width: 500px;
    height: 360px;
    background: linear-gradient(135deg, rgba(244,126,32,0.1), rgba(27,106,201,0.1));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.hero-visual-inner {
    text-align: center;
    color: rgba(255,255,255,0.5);
}
.hero-visual-inner .hero-icon {
    font-size: 80px;
    margin-bottom: 16px;
    display: block;
}
.hero-visual-inner p {
    font-size: 14px;
}

/* Features Section */
.features-section {
    padding: 80px 40px;
    background: var(--bg-secondary);
}
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.section-header p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
}
.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Pricing Section */
.pricing-section {
    padding: 80px 40px;
    background: var(--bg-primary);
}
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    position: relative;
}
.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}
.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 8px 32px var(--primary-glow);
}
.pricing-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 20px;
}
.pricing-tier-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.pricing-price {
    font-size: 40px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
.pricing-price span {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
}
.pricing-period {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.pricing-features {
    list-style: none;
    flex: 1;
    margin-bottom: 24px;
}
.pricing-features li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.pricing-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
}
.pricing-card .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}
.pricing-note {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Footer */
.landing-footer {
    padding: 40px;
    background: var(--bg-dark);
    color: var(--text-on-dark-secondary);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-on-dark);
}
.footer-links {
    display: flex;
    gap: 24px;
}
.footer-links a {
    color: var(--text-on-dark-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition);
}
.footer-links a:hover {
    color: var(--text-on-dark);
}
.footer-copy {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

/* Signup Modal */
.signup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.signup-overlay.active {
    display: flex;
}
.signup-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: modal-in 0.3s ease;
}
.signup-modal h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.signup-modal .signup-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.signup-field {
    margin-bottom: 16px;
}
.signup-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.signup-field input, .signup-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    outline: none;
    transition: all var(--transition);
}
.signup-field input:focus, .signup-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.signup-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 8px;
}
.signup-submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.signup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    transition: all var(--transition);
}
.signup-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ---------- Animations ---------- */
@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes thinking-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes progress-slide {
    0% { margin-left: 0; }
    50% { margin-left: 70%; }
    100% { margin-left: 0; }
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}



/* =============================================================================
   MOBILE RESPONSIVE — v2.7
   Breakpoints: 768px (tablet), 480px (phone)
   ============================================================================= */

/* --- Hamburger Menu Button (hidden on desktop) --- */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-on-dark);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    z-index: 10002;
}
.hamburger-btn:hover {
    color: var(--primary);
}

/* --- Mobile Nav Overlay --- */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}
.mobile-nav-overlay.active {
    display: block;
}

/* --- Mobile Sidebar Navigation --- */
.nav-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 10001;
    flex-direction: column;
    padding: 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    overflow-y: auto;
}
.nav-mobile.open {
    left: 0;
}
.nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav-mobile-close {
    background: none;
    border: none;
    color: var(--text-on-dark-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}
.nav-mobile-close:hover {
    color: var(--text-on-dark);
}
.nav-mobile .nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-mobile .nav-btn:hover {
    background: rgba(255,255,255,0.08);
}
.nav-mobile .nav-btn.active {
    background: rgba(244, 126, 32, 0.15);
    border-left: 3px solid var(--primary);
}
.nav-mobile-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}
.nav-mobile-footer .tier-badge {
    margin-bottom: 12px;
}
.nav-mobile-footer .sign-out-btn {
    width: 100%;
    text-align: center;
    padding: 10px;
}

/* ═══════ TABLET — max-width: 768px ═══════ */
@media (max-width: 768px) {
    /* Show hamburger, hide desktop nav */
    .hamburger-btn {
        display: block;
    }
    .nav-mobile {
        display: flex;
    }
    .nav {
        display: none !important;
    }
    .powered-badge, .tier-badge, .connection-status {
        display: none;
    }
    .header {
        padding: 0 12px;
        height: 50px;
    }
    .header-right {
        gap: 8px;
    }
    .logo {
        font-size: 16px;
        gap: 8px;
    }
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .version-badge {
        display: none;
    }

    /* James AI 3-column → vertical stack */
    .main-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 50px);
    }
    .panel-left {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 200px;
        overflow-y: auto;
    }
    .panel-center {
        height: 300px;
        min-height: 300px;
    }
    .panel-right {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        border-left: none;
        border-top: 1px solid var(--border);
        height: auto;
        min-height: 300px;
        max-height: 50vh;
    }

    /* Touch-friendly tap targets */
    .nav-btn, .btn, button {
        min-height: 44px;
        min-width: 44px;
    }
    .form-input, .form-select {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom */
    }

    /* View containers */
    .view-container {
        padding: 1rem;
        height: calc(100vh - 50px);
    }

    /* Landing page responsive */
    .hero-section {
        padding: 30px 16px;
        min-height: 350px;
    }
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-text h1 {
        font-size: 28px;
        line-height: 1.2;
    }
    .hero-text p {
        font-size: 14px;
    }
    .hero-ctas {
        justify-content: center;
        flex-wrap: wrap;
    }
    .hero-visual {
        display: none;
    }
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    .pricing-grid {
        grid-template-columns: 1fr !important;
        max-width: 100%;
    }
    .landing-header {
        padding: 0 12px;
    }
    .landing-nav {
        display: none;
    }
    .landing-cta-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Finishes grid */
    .finishes-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════ PHONE — max-width: 480px ═══════ */
@media (max-width: 480px) {
    .header {
        padding: 0 8px;
        height: 48px;
    }
    .logo {
        font-size: 14px;
        gap: 6px;
    }
    .logo-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .sign-out-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* View containers tighter padding */
    .view-container {
        padding: 0.75rem;
    }

    /* Panel sections */
    .panel-section {
        padding: 12px;
    }
    .panel-left {
        max-height: 150px;
    }
    .panel-center {
        height: 250px;
        min-height: 250px;
    }

    /* Hero even smaller */
    .hero-section {
        padding: 24px 12px;
        min-height: 300px;
    }
    .hero-text h1 {
        font-size: 24px;
    }
    .hero-text p {
        font-size: 13px;
    }

    /* Form row single column */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Materials grid 2 cols on phone */
    .materials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Chat input area */
    .chat-input-row {
        padding: 8px;
    }
    .chat-input-row textarea {
        font-size: 16px;
    }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.text-accent { color: var(--primary); }
.text-purple { color: var(--james-purple); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: var(--font-mono); }


/* ============================================================================
   AUTH INTEGRATION STYLES
   ============================================================================ */

/* --- Auth Toggle (Signup <-> Login) --- */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}
.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-switch a:hover {
    text-decoration: underline;
}

/* --- Auth Error Messages --- */
.auth-error {
    color: var(--error);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-height: 18px;
    margin: 8px 0;
}

/* --- Discount Code Input --- */
.discount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.discount-input-wrapper input {
    width: 100%;
    padding-right: 40px;
}
.discount-status {
    position: absolute;
    right: 12px;
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}
.discount-status.checking {
    animation: spin 1s linear infinite;
}
.discount-message {
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
    transition: all var(--transition);
}
.discount-message.valid {
    color: var(--success);
    font-weight: 600;
}
.discount-message.invalid {
    color: var(--error);
    font-weight: 500;
}

/* --- User Avatar --- */
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.user-avatar:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* --- Tier Badge Colors --- */
.tier-badge.tier-free .dot {
    background: var(--text-muted);
}
.tier-badge.tier-professional .dot {
    background: var(--accent);
}
.tier-badge.tier-professional {
    background: var(--accent-dim);
    border-color: rgba(27, 106, 201, 0.2);
}
.tier-badge.tier-professional #tier-display {
    color: var(--accent);
}
.tier-badge.tier-enterprise .dot {
    background: #D4A017;
}
.tier-badge.tier-enterprise {
    background: rgba(212, 160, 23, 0.1);
    border-color: rgba(212, 160, 23, 0.25);
}
.tier-badge.tier-enterprise #tier-display {
    color: #B8860B;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius);
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-success {
    border-left-color: var(--success);
}
.toast-error {
    border-left-color: var(--error);
}
.toast-warning {
    border-left-color: var(--warning);
}
.toast-info {
    border-left-color: var(--primary);
}
.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}
.toast-text {
    flex: 1;
}

/* --- Disabled submit button --- */
.signup-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================
   BuildVision v2 - Additional Styles
   ============================================= */

/* Start Design Button */
.panel-left-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}
.btn-start-design {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(244, 126, 32, 0.3);
}
.btn-start-design:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(244, 126, 32, 0.4);
}

/* File Upload in Chat */
.chat-attach-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    color: var(--text-secondary);
}
.chat-attach-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}
.file-preview-container {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-light);
}
.file-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-preview-item .file-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-preview-item .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    font-size: 24px;
}

/* Tier Gating */
.nav-btn .lock-icon {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
}
.tier-locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.upgrade-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 0.2s;
}
.upgrade-modal-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    text-align: center;
}
.upgrade-modal-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}
.upgrade-modal-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.upgrade-tiers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
}
.upgrade-tier-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}
.upgrade-tier-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upgrade-tier-option.recommended {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upgrade-tier-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}
.upgrade-tier-price {
    color: var(--primary);
    font-weight: 600;
}
.upgrade-tier-features {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* =============================================================================
   DARK MODE TOGGLE SWITCH
   ============================================================================= */
.dm-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.dm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.dm-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}
.dm-slider:before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.dm-switch input:checked + .dm-slider {
    background: var(--primary, #4f6ef7);
}
.dm-switch input:checked + .dm-slider:before {
    transform: translateX(22px);
}

/* =============================================================================
   DARK MODE THEME
   ============================================================================= */
/* ============= DARK MODE ============= */
body.dark-mode {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}
body.dark-mode .landing-page { background: #1a1a2e !important; color: #e0e0e0 !important; }
body.dark-mode .header { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .nav-sidebar { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .nav-btn { color: #b0b0b0 !important; }
body.dark-mode .nav-btn:hover, body.dark-mode .nav-btn.active { background: #2a2a4a !important; color: #f97316 !important; }
body.dark-mode .panel-left, body.dark-mode .panel-right { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .panel-center { background: #1a1a2e !important; }
body.dark-mode .panel-section { border-color: #2a2a4a !important; }
body.dark-mode .panel-section-title { color: #f0f0f0 !important; }
body.dark-mode .form-input, body.dark-mode .form-select { background: #2a2a4a !important; border-color: #3a3a5a !important; color: #e0e0e0 !important; }
body.dark-mode .form-label { color: #c0c0c0 !important; }
body.dark-mode .dash-card, body.dark-mode .view-container { background: #16213e !important; color: #e0e0e0 !important; }
body.dark-mode .dash-welcome { background: linear-gradient(135deg, #1a1a3e, #16213e) !important; color: #fff !important; }
body.dark-mode .dash-grid { background: transparent !important; }
body.dark-mode .dash-card-header { border-color: #2a2a4a !important; }
body.dark-mode .chat-messages { background: #1a1a2e !important; }
body.dark-mode .msg-bubble { background: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .msg.james .msg-bubble { background: #1e3a5f !important; }
body.dark-mode .chat-input-area { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .chat-input { background: #2a2a4a !important; color: #e0e0e0 !important; border-color: #3a3a5a !important; }
body.dark-mode .tab-bar { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .tab-btn { color: #b0b0b0 !important; }
body.dark-mode .tab-btn.active { color: #f97316 !important; border-color: #f97316 !important; }
body.dark-mode .canvas-container { background: #1a1a2e !important; }
body.dark-mode .empty-state { color: #888 !important; }
body.dark-mode .btn-start-design { background: linear-gradient(135deg, #f97316, #ea580c) !important; }
body.dark-mode .material-chip { background: #2a2a4a !important; color: #c0c0c0 !important; border-color: #3a3a5a !important; }
body.dark-mode .material-chip.active { background: #f97316 !important; color: #fff !important; }
body.dark-mode .checklist-item { border-color: #2a2a4a !important; }
body.dark-mode .projects-card { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .modal-content, body.dark-mode .contract-editor { background: #16213e !important; color: #e0e0e0 !important; border-color: #2a2a4a !important; }
body.dark-mode .contract-card { background: #1e2a3e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .admin-dashboard { background: #1a1a2e !important; color: #e0e0e0 !important; }
body.dark-mode .admin-stat-card { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .admin-tab-btn { color: #b0b0b0 !important; }
body.dark-mode .admin-tab-btn.active { color: #f97316 !important; border-color: #f97316 !important; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4 { color: #f0f0f0 !important; }
body.dark-mode a { color: #60a5fa !important; }
body.dark-mode .landing-hero { background: linear-gradient(135deg, #1a1a3e 0%, #16213e 100%) !important; }
body.dark-mode .feature-card { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .pricing-card { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .landing-footer { background: #0f0f1e !important; color: #888 !important; }
body.dark-mode .signup-panel { background: #16213e !important; color: #e0e0e0 !important; }
body.dark-mode .settings-inline-grid .form-group { background: transparent !important; }
body.dark-mode .propwalk-section, body.dark-mode .propwalk-room-item { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .usign-section { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .app-container { background: #1a1a2e !important; }
body.dark-mode .hero-section { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important; }
body.dark-mode .hero-visual-inner { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .landing-header { background: #1a1a2e !important; color: #e0e0e0 !important; }
body.dark-mode .landing-nav a { color: #c0c0d0 !important; }
body.dark-mode .btn-secondary { background: #1a1a2e !important; border-color: #2a2a4a !important; color: #c0c0d0 !important; }
body.dark-mode .btn-ghost { color: #c0c0d0 !important; }
body.dark-mode .chat-msg-assistant { background: #16213e !important; color: #e0e0e0 !important; }
body.dark-mode .chat-input-bar { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .contract-editor-sidebar { background: #16213e !important; border-color: #2a2a4a !important; }
body.dark-mode .contract-document { background: #1e1e38 !important; color: #e0e0e0 !important; }
body.dark-mode .contract-filter-btn { background: #1a1a2e !important; border-color: #2a2a4a !important; color: #a0a0b8 !important; }
body.dark-mode .contract-filter-btn.active { background: rgba(79,110,247,0.15) !important; border-color: var(--primary, #4f6ef7) !important; color: #e0e0e0 !important; }
body.dark-mode .login-modal { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .code-summary-card { background: #1a1a2e !important; border-color: #2a2a4a !important; }
body.dark-mode .dash-action-btn { background: #1a1a2e !important; border-color: #2a2a4a !important; color: #c0c0d0 !important; }
body.dark-mode .dash-action-btn:hover { border-color: var(--primary, #4f6ef7) !important; }
body.dark-mode .project-card { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .upgrade-tier { background: #1a1a2e !important; border-color: #2a2a4a !important; }
body.dark-mode .contracts-state-selector { background: linear-gradient(135deg, #1a1a3e 0%, #16213e 100%) !important; border-color: #2a2a4a !important; }
body.dark-mode .state-notice-body { background: #1a1a3e !important; color: #d0d0e0 !important; }
body.dark-mode .payment-card { background: #1e2a3e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .banking-section { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }
body.dark-mode .admin-tab { background: #1a1a2e !important; color: #b0b0b0 !important; border-color: #2a2a4a !important; }
body.dark-mode .admin-tab.active { background: rgba(79,110,247,0.15) !important; color: #e0e0e0 !important; }
body.dark-mode .admin-card { background: #16213e !important; border-color: #2a2a4a !important; color: #e0e0e0 !important; }

/* =============================================================================
   CONTRACTS STATE SELECTOR
   ============================================================================= */
.contracts-state-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border-radius: 10px;
    border: 1px solid rgba(79, 110, 247, 0.15);
}
.contracts-state-selector .form-label {
    margin: 0;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.85rem;
}
.contracts-state-selector .form-select {
    max-width: 340px;
}
body.dark-mode .contracts-state-selector {
    background: linear-gradient(135deg, #1a1a3e 0%, #16213e 100%);
    border-color: #2a2a4a;
}

/* =============================================================================
   CONTRACT STATE NOTICE
   ============================================================================= */
.contract-state-notice {
    margin-bottom: 20px;
    border-radius: 10px;
    border: 2px solid rgba(79, 110, 247, 0.3);
    overflow: hidden;
}
.state-notice-header {
    background: linear-gradient(135deg, #4f6ef7 0%, #3a5bd9 100%);
    color: #fff;
    font-weight: 700;
    padding: 12px 18px;
    font-size: 0.95rem;
}
.state-notice-body {
    padding: 16px 18px;
    background: #f0f4ff;
    font-size: 0.88rem;
    line-height: 1.65;
}
.state-notice-body p {
    margin: 0 0 10px 0;
}
.state-notice-body p:last-child {
    margin-bottom: 0;
}
body.dark-mode .state-notice-body {
    background: #1a1a3e;
    color: #d0d0e0;
}

/* =============================================================================
   FINISHES GRID (James AI Left Panel)
   ============================================================================= */
.finishes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.finishes-grid .form-group-sm {
    margin-bottom: 0;
}
.finishes-grid .form-group-sm .form-label {
    font-size: 0.72rem;
    margin-bottom: 2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #6b7280);
}
.finishes-grid .form-group-sm .form-select {
    font-size: 0.78rem;
    padding: 4px 8px;
    height: 30px;
}


/* ======================================================================
   BUG 4-5 FIX: Blue theme for ALL widgets/cards in dark mode
   Match the contract widget blue styling
   ====================================================================== */
body.dark-mode .dash-stat {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%) !important;
    border-color: #2a3a5a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .dash-stat-value {
    color: #60a5fa !important;
}
body.dark-mode .dash-stat-label {
    color: #94a3b8 !important;
}

/* Project detail info cards - blue theme */
body.dark-mode .project-info-grid div {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%) !important;
    border-color: #2a3a5a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .project-info-grid div strong {
    color: #60a5fa !important;
}

/* Project overview grid */
body.dark-mode .project-overview-grid {
    background: transparent !important;
}

/* Dashboard cards - blue theme */
body.dark-mode .dash-card {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%) !important;
    border-color: #2a3a5a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .dash-card-header {
    border-color: #2a3a5a !important;
    color: #f0f0f0 !important;
}
body.dark-mode .dash-card h3, body.dark-mode .dash-card h4 {
    color: #f0f0f0 !important;
}

/* Dashboard project cards */
body.dark-mode .dash-project-card {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%) !important;
    border-color: #2a3a5a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .dash-project-card:hover {
    background: linear-gradient(135deg, #243352 0%, #1a2845 100%) !important;
    border-color: #3a4a6a !important;
}

/* Project detail panel */
body.dark-mode .project-detail-header {
    background: transparent !important;
    color: #f0f0f0 !important;
}
body.dark-mode .project-detail-tabs {
    border-color: #2a3a5a !important;
}
body.dark-mode .proj-tab-btn {
    color: #94a3b8 !important;
    background: transparent !important;
}
body.dark-mode .proj-tab-btn.active {
    color: #60a5fa !important;
    border-color: #60a5fa !important;
    background: rgba(96, 165, 250, 0.1) !important;
}
body.dark-mode .proj-tab-content {
    background: transparent !important;
    color: #e0e0e0 !important;
}

/* Plan cards in project detail tabs */
body.dark-mode .plan-card {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%) !important;
    border-color: #2a3a5a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .plan-card:hover {
    background: linear-gradient(135deg, #243352 0%, #1a2845 100%) !important;
}

/* Project cards in projects list */
body.dark-mode .project-card {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%) !important;
    border-color: #2a3a5a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .project-card:hover {
    background: linear-gradient(135deg, #243352 0%, #1a2845 100%) !important;
}

/* View containers - blue theme */
body.dark-mode .view-container {
    background: linear-gradient(135deg, #1a1a3e 0%, #16213e 100%) !important;
    color: #e0e0e0 !important;
}

/* Settings cards */
body.dark-mode .settings-section {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%) !important;
    border-color: #2a3a5a !important;
}

/* Empty states */
body.dark-mode .empty-state-mini {
    color: #64748b !important;
}

/* ======================================================================
   BUG 6 FIX: Floor plan editor/viewer stays WHITE in dark mode
   Architectural plans are drawn on white paper
   ====================================================================== */
body.dark-mode .canvas-container {
    background: #ffffff !important;
}
body.dark-mode #svg-viewer {
    background: #ffffff !important;
}
body.dark-mode .viewer-panel {
    background: #ffffff !important;
}
body.dark-mode #floorplan-empty-state {
    background: #ffffff !important;
    color: #666 !important;
}
body.dark-mode #floorplan-empty-state .empty-state-icon {
    color: #999 !important;
}
body.dark-mode #floorplan-empty-state .empty-state-text {
    color: #666 !important;
}
body.dark-mode #floorplan-empty-state .empty-state-hint {
    color: #888 !important;
}

/* =============================================================================
   v7.5 FIX: Dark mode for dashboard stat boxes, project detail, and info cards
   ============================================================================= */
body.dark-mode .dash-stat {
    background: linear-gradient(135deg, #16213e, #1a2744) !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .dash-stat-value {
    color: #f97316 !important;
}
body.dark-mode .dash-stat-label {
    color: #a0a0c0 !important;
}
body.dark-mode .dash-welcome {
    background: linear-gradient(135deg, #1a1a3e, #16213e) !important;
    color: #fff !important;
}
body.dark-mode .dash-card {
    background: linear-gradient(135deg, #16213e, #1a2744) !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .dash-card-header {
    background: rgba(26, 26, 62, 0.5) !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}
body.dark-mode .dash-card-header h3 {
    color: #f0f0f0 !important;
}
body.dark-mode .dash-card-body {
    color: #d0d0e0 !important;
}
body.dark-mode .dash-grid {
    background: transparent !important;
}

/* Project detail info cards */
body.dark-mode .project-info-grid div {
    background: linear-gradient(135deg, #16213e, #1a2744) !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}
body.dark-mode .project-info-grid div strong {
    color: #f97316 !important;
}
body.dark-mode .project-detail-header {
    background: #16213e !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}
body.dark-mode .project-detail-tabs {
    background: #16213e !important;
    border-color: #2a2a4a !important;
}
body.dark-mode .proj-tab-btn {
    color: #b0b0b0 !important;
    background: transparent !important;
}
body.dark-mode .proj-tab-btn.active {
    color: #f97316 !important;
    border-color: #f97316 !important;
}
body.dark-mode .project-detail-content {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}
body.dark-mode .project-overview-grid {
    background: transparent !important;
}

/* Dashboard project cards inside dash-card-body */
body.dark-mode .dash-project-card {
    background: #1e2a4a !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}
body.dark-mode .dash-project-card:hover {
    background: #253352 !important;
}

/* Admin stat cards enhancement */
body.dark-mode .admin-stat-card {
    background: linear-gradient(135deg, #16213e, #1a2744) !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .admin-stat-value {
    color: #f0f0f0 !important;
}
body.dark-mode .admin-stat-label {
    color: #a0a0c0 !important;
}
body.dark-mode .admin-stat-icon {
    opacity: 0.8 !important;
}

/* =============================================================================
   v7.5 FIX: Mobile responsive for user dashboard and all view containers
   ============================================================================= */

/* ═══════ MOBILE 768px — User Dashboard Views ═══════ */
@media (max-width: 768px) {
    /* Ensure all view containers scroll and display properly */
    .view-container {
        padding: 0.75rem !important;
        height: auto !important;
        min-height: calc(100vh - 50px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Dashboard welcome banner */
    .dash-welcome {
        padding: 1.25rem !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
    }
    .dash-welcome h1 {
        font-size: 1.2rem !important;
    }
    .dash-welcome p {
        font-size: 0.85rem !important;
        max-width: 100% !important;
    }

    /* Dashboard stat boxes */
    .dash-stats {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    .dash-stat {
        min-width: 80px !important;
        padding: 0.75rem 0.75rem !important;
        flex: 1 1 calc(33% - 0.5rem) !important;
    }
    .dash-stat-value {
        font-size: 1.4rem !important;
    }
    .dash-stat-label {
        font-size: 0.65rem !important;
    }

    /* Dashboard card grid */
    .dash-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .dash-card,
    .dash-card-wide {
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
    }
    .dash-card-header {
        padding: 0.75rem 1rem !important;
    }
    .dash-card-header h3 {
        font-size: 0.85rem !important;
    }
    .dash-card-body {
        padding: 0.75rem !important;
        overflow-x: auto !important;
    }

    /* Project detail view mobile */
    .project-detail-header {
        padding: 0.75rem !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .project-detail-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        padding: 0 0.5rem !important;
    }
    .proj-tab-btn {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }
    .project-info-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .project-info-grid div {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    /* Plans grid mobile */
    .plans-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .plan-card {
        flex-direction: column !important;
    }
    .plan-card-actions {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* Settings page mobile */
    .settings-page {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .settings-section {
        padding: 1rem !important;
    }

    /* Admin/Owner dashboard mobile */
    .admin-dashboard {
        padding: 0.75rem !important;
    }
    #admin-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        padding-bottom: 8px !important;
    }
    .admin-tab {
        white-space: nowrap !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
    }
    .admin-stat-card {
        padding: 12px !important;
    }
    .admin-stat-value {
        font-size: 22px !important;
    }
    .admin-card {
        padding: 12px !important;
    }

    /* Admin grid layouts to single column on mobile */
    #admin-panel-overview > div:first-child,
    #admin-panel-revenue > div:first-child,
    #admin-panel-usage > div:first-child,
    #admin-panel-seo > div > div,
    #admin-panel-marketing > div > div {
        grid-template-columns: 1fr !important;
    }
    #admin-panel-revenue .admin-card,
    #admin-panel-usage .admin-card {
        grid-column: auto !important;
    }

    /* USign mobile */
    .usign-grid {
        grid-template-columns: 1fr !important;
    }
    .usign-card {
        min-width: 0 !important;
    }

    /* Contracts mobile */
    .contracts-grid {
        grid-template-columns: 1fr !important;
    }
    .contract-card {
        min-width: 0 !important;
    }

    /* PropWalk mobile */
    .propwalk-grid {
        grid-template-columns: 1fr !important;
    }
    .propwalk-card {
        min-width: 0 !important;
    }
}

/* ═══════ PHONE 480px — Even tighter ═══════ */
@media (max-width: 480px) {
    .view-container {
        padding: 0.5rem !important;
    }
    .dash-welcome {
        padding: 1rem !important;
    }
    .dash-welcome h1 {
        font-size: 1.05rem !important;
    }
    .dash-stat {
        min-width: 65px !important;
        padding: 0.5rem !important;
    }
    .dash-stat-value {
        font-size: 1.2rem !important;
    }
    .dash-stat-label {
        font-size: 0.6rem !important;
    }
    .dash-card-body {
        padding: 0.5rem !important;
    }

    /* Project info to single column on phone */
    .project-info-grid {
        grid-template-columns: 1fr !important;
    }

    /* Admin stat grid */
    .admin-stat-card {
        padding: 10px !important;
    }
    .admin-stat-value {
        font-size: 18px !important;
    }
    .admin-stat-label {
        font-size: 11px !important;
    }
}

/* =====================================================================
   DEMO RECORDING SYSTEM — v7.8
   ===================================================================== */
@keyframes pulse-record {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
.project-demo-btn {
    transition: all 0.3s ease;
}
.project-demo-actions {
    animation: fadeIn 0.5s ease-in-out;
}

/* =====================================================================
   MOBILE NAV FIXES — v7.8
   ===================================================================== */
/* Ensure hamburger is always on top and touchable */
@media (max-width: 768px) {
    .hamburger-btn {
        z-index: 10002 !important;
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: rgba(244, 126, 32, 0.3);
        touch-action: manipulation;
    }
    .nav-mobile {
        z-index: 10001 !important;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-nav-overlay {
        z-index: 10000 !important;
    }
    .nav-mobile .nav-btn {
        min-height: 48px;
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: rgba(244, 126, 32, 0.2);
        touch-action: manipulation;
    }
    /* Ensure body doesn't scroll when nav is open */
    body.mobile-nav-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
    }
}
