        :root {
            --cemcrete-charcoal: #2B2A28;
            --cemcrete-stone: #6B6560;
            --cemcrete-sand: #E8E4DF;
            --cemcrete-red: #ED1C24;
            --cemcrete-accent: #ED1C24;
            --cemcrete-accent-hover: #C8161D;
            --cemcrete-accent-muted: rgba(237, 28, 36, 0.14);
            --cemcrete-pool: #5B8A9A;
            --cemcrete-success: #4A7C59;
            --cemcrete-danger: #B54A4A;
            --cemcrete-danger-muted: rgba(181, 74, 74, 0.12);
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 14px;
            --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
            --transition: 0.18s ease;
        }

        [data-theme="dark"] {
            --bg-page: #141312;
            --bg-surface: #1C1B19;
            --card-bg: #1C1B19;
            --bg-elevated: #262422;
            --bg-input: #1F1E1C;
            --bg-hover: #302E2B;
            --text-primary: #F2EFEA;
            --text-secondary: #A8A29E;
            --text-muted: #78716C;
            --border: #3A3835;
            --border-subtle: #2A2826;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
            --shadow-md: 0 4px 20px rgba(0,0,0,0.45);
            --shadow-lg: 0 12px 40px rgba(0,0,0,0.55);
            --nav-bg: #1C1B19;
            --tabs-bg: #141312;
            --accent-text: #FF6B70;
            --tag-product-bg: rgba(237, 28, 36, 0.18);
            --tag-product-text: #FF6B70;
            --tag-surface-bg: rgba(91, 138, 154, 0.18);
            --tag-surface-text: #8CB4C4;
            --pill-bg: rgba(91, 138, 154, 0.2);
            --pill-text: #8CB4C4;
            --login-gradient: linear-gradient(145deg, #1C1B19 0%, #141312 50%, #0F0E0D 100%);
            --logo-filter: brightness(0) invert(1);
            --scrollbar-track: transparent;
            --scrollbar-thumb: rgba(120, 113, 108, 0.45);
            --scrollbar-thumb-hover: rgba(168, 162, 158, 0.75);
        }

        [data-theme="light"] {
            --bg-page: #F5F3F0;
            --bg-surface: #FFFFFF;
            --card-bg: #FFFFFF;
            --bg-elevated: #F0EDE8;
            --bg-input: #FAFAF8;
            --bg-hover: #E8E4DF;
            --text-primary: #2B2A28;
            --text-secondary: #6B6560;
            --text-muted: #9C958E;
            --border: #DDD8D2;
            --border-subtle: #ECEAE6;
            --shadow-sm: 0 1px 3px rgba(43,42,40,0.06);
            --shadow-md: 0 4px 16px rgba(43,42,40,0.08);
            --shadow-lg: 0 12px 32px rgba(43,42,40,0.12);
            --nav-bg: #2B2A28;
            --tabs-bg: #3D3B38;
            --accent-text: #C8161D;
            --tag-product-bg: #FDE8E9;
            --tag-product-text: #C8161D;
            --tag-surface-bg: #E8F0F3;
            --tag-surface-text: #3D6673;
            --pill-bg: #E8F0F3;
            --pill-text: #3D6673;
            --login-gradient: linear-gradient(145deg, #2B2A28 0%, #3D3B38 100%);
            --logo-filter: none;
            --scrollbar-track: transparent;
            --scrollbar-thumb: rgba(156, 149, 142, 0.45);
            --scrollbar-thumb-hover: rgba(107, 101, 96, 0.65);
        }

        * {
            box-sizing: border-box;
            scrollbar-width: thin;
            scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
        }
        *::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        *::-webkit-scrollbar-track {
            background: var(--scrollbar-track);
        }
        *::-webkit-scrollbar-thumb {
            background-color: var(--scrollbar-thumb);
            border-radius: 999px;
            border: 2px solid transparent;
            background-clip: padding-box;
        }
        *::-webkit-scrollbar-thumb:hover {
            background-color: var(--scrollbar-thumb-hover);
        }
        *::-webkit-scrollbar-corner {
            background: transparent;
        }
        html { color-scheme: dark light; }
        body {
            font-family: var(--font);
            background-color: var(--bg-page);
            margin: 0; padding: 0;
            color: var(--text-primary);
            overflow-x: hidden;
            transition: background-color var(--transition), color var(--transition);
            line-height: 1.5;
        }

        /* LOGIN */
        #loginOverlay {
            position: fixed; inset: 0;
            background: var(--login-gradient);
            display: flex; align-items: center; justify-content: center;
            z-index: 99999; padding: 24px;
        }
        .login-card {
            background: var(--bg-surface);
            padding: 48px 40px;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            width: 100%; max-width: 420px;
            border: 1px solid var(--border);
        }
        .login-brand { text-align: center; margin-bottom: 32px; }
        .login-logo-img { height: 36px; margin-bottom: 16px; filter: var(--logo-filter); }
        .login-sub {
            font-size: 12px; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.12em;
            font-weight: 600; display: block;
        }
        .form-label {
            font-size: 12px; font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 6px; display: block;
        }
        .login-input {
            width: 100%; padding: 12px 14px; margin-bottom: 16px;
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            font-size: 14px; font-family: var(--font);
            outline: none; background: var(--bg-input);
            color: var(--text-primary); transition: var(--transition);
        }
        .login-input:focus {
            border-color: var(--cemcrete-accent);
            box-shadow: 0 0 0 3px var(--cemcrete-accent-muted);
        }
        .login-btn {
            width: 100%; padding: 13px;
            background: var(--cemcrete-accent); color: #fff;
            border: none; border-radius: var(--radius-sm);
            font-size: 14px; font-weight: 600; font-family: var(--font);
            cursor: pointer; transition: var(--transition);
            letter-spacing: 0.02em;
        }
        .login-btn:hover { background: var(--cemcrete-accent-hover); }
        .login-error { color: var(--cemcrete-danger); font-size: 13px; margin-top: 16px; display: none; text-align: center; }

        /* HEADER */
        .brand-navbar {
            background: var(--nav-bg);
            color: #fff;
            padding: 14px 32px;
            display: flex; justify-content: space-between; align-items: center;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .logo-container { display: flex; align-items: center; gap: 16px; }
        .brand-logo { height: 28px; filter: brightness(0) invert(1); }
        .logo-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.15); }
        .logo-sub {
            font-size: 12px; color: rgba(255,255,255,0.55);
            letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
        }
        .user-profile-badge { display: flex; align-items: center; gap: 12px; }
        .user-greeting { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); }
        .header-btn {
            background: rgba(255,255,255,0.08);
            color: rgba(255,255,255,0.9);
            border: 1px solid rgba(255,255,255,0.12);
            padding: 7px 14px; border-radius: var(--radius-sm);
            font-size: 12px; font-weight: 600; font-family: var(--font);
            cursor: pointer; transition: var(--transition);
        }
        .header-btn:hover { background: rgba(255,255,255,0.14); }
        .logout-btn:hover { background: var(--cemcrete-danger); border-color: var(--cemcrete-danger); color: #fff; }

        /* ADMIN EDIT / VIEW MODE */
        .admin-mode-bar {
            display: flex; align-items: center; gap: 12px;
            padding: 6px 12px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: var(--radius-sm);
        }
        .admin-mode-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.75); white-space: nowrap; }
        .admin-mode-toggle { background: rgba(255,255,255,0.12); }
        body.admin-edit-mode .admin-mode-bar { border-color: var(--cemcrete-accent); background: rgba(232, 93, 117, 0.15); }
        body.admin-edit-mode .admin-mode-label { color: #fff; }

        /* PRODUCTS TOOLBAR */
        .products-toolbar {
            display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
            margin-bottom: 16px;
        }
        .products-toolbar input[type="text"] { flex: 1; min-width: 200px; }

        /* LEARNING CENTER */
        .learning-layout {
            display: grid; grid-template-columns: minmax(260px, 320px) 1fr;
            gap: 20px; align-items: start;
        }
        .learning-sidebar { padding: 16px; }
        .learning-sidebar-header {
            display: flex; justify-content: space-between; align-items: center;
            gap: 10px; margin-bottom: 12px;
        }
        .learning-module-list {
            display: flex; flex-direction: column; gap: 6px;
            max-height: calc(100vh - 280px); overflow-y: auto;
        }
        .learning-module-item {
            text-align: left; width: 100%;
            padding: 12px 14px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm);
            cursor: pointer; transition: var(--transition);
            font-family: var(--font);
        }
        .learning-module-item:hover { border-color: var(--cemcrete-accent); }
        .learning-module-item.active {
            border-color: var(--cemcrete-accent);
            background: var(--cemcrete-accent-muted);
        }
        .learning-module-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
        .learning-module-item-meta { font-size: 11px; color: var(--text-muted); }
        .learning-content { min-height: 420px; padding: 24px; }
        .learning-empty { text-align: center; padding: 80px 24px; color: var(--text-muted); }
        .learning-empty h4 { margin: 0 0 8px; color: var(--text-secondary); }
        .learning-article-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            gap: 16px; margin-bottom: 20px;
            padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle);
        }
        .learning-article-header h3 { margin: 8px 0 6px; font-size: 22px; }
        .learning-summary { margin: 0; color: var(--text-secondary); font-size: 14px; }
        .learning-body {
            font-size: 14px; line-height: 1.65; color: var(--text-primary);
            white-space: pre-wrap;
        }
        .learning-resource-link { display: inline-block; margin-top: 20px; font-weight: 600; }

        .cia-news-feed { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
        .cia-news-card {
            border: 1px solid var(--border-subtle);
            border-radius: 10px;
            padding: 18px 20px;
            background: var(--surface-raised);
        }
        .cia-news-card.pinned { border-left: 4px solid var(--cemcrete-accent); }
        .cia-news-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 10px;
        }
        .cia-news-card-header h4 { margin: 0; font-size: 17px; color: var(--text-primary); }
        .cia-news-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
        .cia-news-body { font-size: 14px; line-height: 1.6; color: var(--text-secondary); white-space: pre-wrap; }
        .cia-news-actions { display: flex; gap: 8px; flex-shrink: 0; }
        .cia-pin-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--cemcrete-accent);
            margin-bottom: 6px;
        }

        /* ADMIN */
        .admin-only-btn { display: none !important; }
        body.admin-enabled.admin-edit-mode .admin-only-btn { display: inline-block !important; }
        body.admin-enabled.admin-edit-mode .btn-primary.admin-only-btn { display: flex !important; }
        body.admin-enabled.admin-edit-mode .learning-article-actions.admin-only-btn { display: flex !important; }
        .learning-admin-only { display: none !important; }
        body.learning-admin-enabled .learning-admin-only { display: inline-block !important; }
        body.learning-admin-enabled .btn-primary.learning-admin-only { display: flex !important; }
        body.learning-admin-enabled .learning-article-actions.learning-admin-only { display: flex !important; }
        body.admin-enabled.admin-edit-mode .product-card .card-actions-top.admin-only-btn { display: flex !important; }
        .template-edit-btn { display: none !important; }
        body.templates-edit-enabled .template-edit-btn { display: inline-block !important; }
        body.templates-edit-enabled .btn-primary.template-edit-btn { display: flex !important; }
        .admin-only-section { display: none; }
        body.admin-enabled .admin-only-section { display: block; }

        /* TABS */
        .app-tabs {
            background: var(--tabs-bg);
            display: flex; flex: 1; width: 100%; min-width: 0;
            padding: 0 32px; gap: 2px;
            overflow-x: auto; white-space: nowrap;
            border-bottom: 1px solid var(--border);
        }
        .tab-btn {
            background: transparent; color: rgba(255,255,255,0.5);
            border: none; padding: 14px 18px;
            font-size: 13px; font-weight: 500; font-family: var(--font);
            cursor: pointer; transition: var(--transition);
            border-bottom: 2px solid transparent; display: none;
        }
        .tab-btn:hover { color: rgba(255,255,255,0.9); }
        .tab-btn.active {
            color: #fff;
            border-bottom-color: var(--cemcrete-accent);
            font-weight: 600;
        }
        .tab-btn.admin-tab { color: var(--cemcrete-accent); opacity: 0.8; }
        .tab-btn.admin-tab.active { opacity: 1; }
        .tab-panel { display: none; }
        .tab-panel.active { display: block; }

        /* PANEL INTRO */
        .panel-intro {
            max-width: 1400px; margin: 0 auto;
            padding: 28px 32px 0;
        }
        .panel-intro h2 {
            margin: 0 0 6px; font-size: 20px; font-weight: 700;
            color: var(--text-primary); letter-spacing: -0.02em;
        }
        .panel-intro p {
            margin: 0; font-size: 14px; color: var(--text-secondary); max-width: 640px;
        }

        /* TOOLBAR */
        .toolbar-wrapper {
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-subtle);
            padding: 16px 32px; margin-bottom: 0;
        }
        .product-filter-banner {
            max-width: 1400px; margin: 0 auto 12px;
            display: flex; align-items: center; gap: 12px;
            padding: 8px 14px; font-size: 13px;
            background: var(--cemcrete-accent-muted);
            border: 1px solid var(--cemcrete-accent);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
        }
        header {
            max-width: 1400px; margin: 0 auto;
            display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
        }
        #searchBar, #contractorSearch, #retailerSearch, #leadSearch, #staffSearch, #productSearch {
            flex: 2; min-width: 200px;
            padding: 10px 14px; font-size: 13px; font-family: var(--font);
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            outline: none; transition: var(--transition);
            background: var(--bg-input); color: var(--text-primary);
        }
        #searchBar:focus, #contractorSearch:focus, #retailerSearch:focus, #leadSearch:focus, #staffSearch:focus, #productSearch:focus {
            border-color: var(--cemcrete-accent);
            box-shadow: 0 0 0 3px var(--cemcrete-accent-muted);
        }
        .lead-status {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
        }
        .lead-status-new { background: #dcfce7; color: #166534; }
        .lead-status-follow-up { background: #ffedd5; color: #9a3412; }
        .lead-status-quoted { background: #dbeafe; color: #1e40af; }
        .lead-status-completed { background: #f4f4f5; color: #52525b; }
        body[data-theme="dark"] .lead-status-new { background: #14532d; color: #bbf7d0; }
        body[data-theme="dark"] .lead-status-follow-up { background: #7c2d12; color: #fed7aa; }
        body[data-theme="dark"] .lead-status-quoted { background: #1e3a8a; color: #bfdbfe; }
        body[data-theme="dark"] .lead-status-completed { background: #3f3f46; color: #e4e4e7; }
        .lead-follow-badge {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
            margin-top: 4px; text-transform: uppercase; letter-spacing: 0.02em;
        }
        .lead-follow-overdue { background: #fee2e2; color: #991b1b; }
        .lead-follow-due-today { background: #fef3c7; color: #92400e; }
        .lead-follow-due-now { background: #ffedd5; color: #9a3412; animation: lead-pulse 1.5s ease-in-out infinite; }
        .lead-follow-upcoming { background: #e0e7ff; color: #3730a3; }
        body[data-theme="dark"] .lead-follow-overdue { background: #7f1d1d; color: #fecaca; }
        body[data-theme="dark"] .lead-follow-due-today { background: #78350f; color: #fde68a; }
        body[data-theme="dark"] .lead-follow-due-now { background: #7c2d12; color: #fed7aa; }
        body[data-theme="dark"] .lead-follow-upcoming { background: #312e81; color: #c7d2fe; }
        @keyframes lead-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
        .lead-due-banner {
            margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
            background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; font-size: 13px;
        }
        body[data-theme="dark"] .lead-due-banner {
            background: #431407; border-color: #9a3412; color: #fed7aa;
        }
        .lead-action-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
        .lead-outlook-btn { font-size: 11px; }
        tr.lead-row-overdue { background: rgba(254, 226, 226, 0.35); }
        tr.lead-row-due-today { background: rgba(254, 243, 199, 0.35); }
        body[data-theme="dark"] tr.lead-row-overdue { background: rgba(127, 29, 29, 0.25); }
        body[data-theme="dark"] tr.lead-row-due-today { background: rgba(120, 53, 15, 0.25); }
        .filter-select {
            flex: 1; min-width: 150px;
            padding: 10px 12px; font-size: 13px; font-family: var(--font);
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            background: var(--bg-input); color: var(--text-primary);
            cursor: pointer; outline: none; transition: var(--transition);
            color-scheme: light dark;
        }
        [data-theme="dark"] .filter-select { color-scheme: dark; }
        [data-theme="light"] .filter-select { color-scheme: light; }
        .filter-select option {
            background-color: var(--bg-surface);
            color: var(--text-primary);
        }
        .filter-select:focus {
            border-color: var(--cemcrete-accent);
            box-shadow: 0 0 0 3px var(--cemcrete-accent-muted);
        }
        .btn-primary {
            background: var(--cemcrete-accent); color: #fff;
            border: none; padding: 10px 18px;
            border-radius: var(--radius-sm);
            font-size: 13px; font-weight: 600; font-family: var(--font);
            cursor: pointer; display: flex; align-items: center;
            justify-content: center; gap: 6px;
            transition: var(--transition); white-space: nowrap;
        }
        .btn-primary:hover { background: var(--cemcrete-accent-hover); }
        .btn-primary.btn-danger { background: var(--cemcrete-danger); }
        .btn-primary.btn-danger:hover { background: #9A3F3F; }
        .btn-primary.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
        .btn-primary.btn-secondary:hover { background: var(--bg-hover); }
        .btn-sm { padding: 7px 14px; font-size: 12px; }

        /* AI WORKSPACE */
        .ai-panel-container { max-width: 1400px; margin: 0 auto; padding: 24px 32px; }
        .ai-card {
            background: var(--bg-surface);
            border-radius: var(--radius-md);
            padding: 24px; box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-subtle);
            border-left: 4px solid var(--cemcrete-accent);
        }
        .ai-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 16px; border-bottom: 1px solid var(--border-subtle);
            padding-bottom: 12px; flex-wrap: wrap; gap: 10px;
        }
        .ai-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0; }
        .ai-subtitle { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; font-weight: 400; }
        .settings-toggle-btn {
            background: var(--bg-elevated); border: 1px solid var(--border);
            color: var(--text-secondary); padding: 7px 12px;
            border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
            font-family: var(--font); cursor: pointer; transition: var(--transition);
        }
        .settings-toggle-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
        .ai-body-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
        .ai-interactive-side { display: flex; flex-direction: column; gap: 10px; }
        .ai-memory-side {
            display: flex; flex-direction: column; gap: 10px;
            background: var(--bg-elevated); padding: 16px;
            border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
        }
        #aiScratchpad {
            width: 100%; height: 100px; padding: 12px;
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            font-size: 13px; font-family: var(--font); resize: none;
            outline: none; background: var(--bg-input); color: var(--text-primary);
            transition: var(--transition);
        }
        #aiScratchpad:focus {
            border-color: var(--cemcrete-accent);
            box-shadow: 0 0 0 3px var(--cemcrete-accent-muted);
        }
        .ai-control-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
        .ai-btn {
            padding: 10px 16px; border: none; border-radius: var(--radius-sm);
            font-size: 12px; font-weight: 600; font-family: var(--font);
            cursor: pointer; transition: var(--transition);
            flex: 1; min-width: 110px;
        }
        .btn-chatgpt { background: #10a37f; color: #fff; }
        .btn-chatgpt:hover { background: #0e8c6d; }
        .btn-gemini { background: var(--cemcrete-pool); color: #fff; }
        .btn-gemini:hover { background: #4A7583; }
        .sub-panel-title {
            font-size: 10px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 8px;
        }
        .history-list { max-height: 100px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
        .history-item {
            background: var(--bg-surface); border: 1px solid var(--border-subtle);
            padding: 8px 10px; border-radius: var(--radius-sm);
            font-size: 11px; cursor: pointer;
            text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
            color: var(--text-secondary); transition: var(--transition);
        }
        .history-item:hover { border-color: var(--cemcrete-accent); color: var(--text-primary); }
        .ai-footnote { font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-subtle); padding-top: 8px; margin-top: 4px; }

        /* CRETEBOT CHAT */
        .cretebot-panel-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
        .cretebot-hero { display: flex; align-items: center; gap: 16px; }
        .cretebot-mascot-lg { width: 64px; height: 64px; flex-shrink: 0; }
        .cretebot-mascot-sm { width: 32px; height: 32px; flex-shrink: 0; }
        .cretebot-mascot-welcome { width: 48px; height: 48px; flex-shrink: 0; }
        .cretebot-mascot-thinking { animation: cretebot-pulse 1.2s ease-in-out infinite; }
        @keyframes cretebot-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.75; transform: scale(0.96); } }
        .cretebot-tab-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
        .cretebot-tab-card { padding: 20px; }
        .cretebot-sidebar { padding: 16px; position: sticky; top: 12px; }
        .cretebot-quick-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
        .cretebot-prompt-chip {
            padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
            background: var(--bg-surface); border: 1px solid var(--border-subtle);
            border-radius: 999px; color: var(--text-secondary); font-family: var(--font);
        }
        .cretebot-prompt-chip:hover { border-color: var(--cemcrete-accent); color: var(--accent-text); background: var(--cemcrete-accent-muted); }
        .cretebot-thread-full { min-height: 320px; max-height: 50vh; }
        .cretebot-history-full { max-height: 240px; }
        .cretebot-welcome { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
        .cretebot-welcome p { margin: 8px 0 0; }
        .cretebot-setup-hint { color: var(--cemcrete-accent); font-size: 12px; }
        .cretebot-msg { margin-bottom: 12px; }
        .cretebot-msg-row { display: flex; gap: 10px; align-items: flex-start; }
        .cretebot-msg-content { flex: 1; min-width: 0; }
        .cretebot-msg-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px; }
        .cretebot-msg-body {
            font-size: 13px; line-height: 1.6; color: var(--text-primary);
            background: var(--bg-surface); border: 1px solid var(--border-subtle);
            padding: 10px 12px; border-radius: var(--radius-sm);
        }
        .cretebot-msg-assistant .cretebot-msg-body { border-left: 3px solid var(--cemcrete-accent); }
        .cretebot-msg-user .cretebot-msg-body { background: var(--cemcrete-accent-muted); }
        .cretebot-typing { font-style: italic; color: var(--text-secondary); }
        .cretebot-status { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; min-height: 16px; }
        .btn-cretebot { background: var(--cemcrete-accent); color: #fff; flex: 1.2; }
        .btn-cretebot:hover { background: var(--cemcrete-accent-hover); }
        .btn-cretebot:disabled { opacity: 0.6; cursor: wait; }
        #aiScratchpad { height: 88px; }
        .lms-sub-panel { display: none; }
        .lms-sub-panel.active { display: block; }
        @media (max-width: 900px) {
            .cretebot-tab-layout { grid-template-columns: 1fr; }
        }

        /* legacy cretebot in templates removed — kept thread styles above */
        .cretebot-thread {
            overflow-y: auto;
            background: var(--bg-elevated); border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px;
        }

        /* CARDS & GRID */
        .container { max-width: 1400px; margin: 0 auto; padding: 24px 32px 40px; }
        .category-block { margin-bottom: 32px; }
        .category-title {
            font-size: 13px; font-weight: 700; color: var(--text-secondary);
            border-left: 3px solid var(--cemcrete-accent);
            padding-left: 12px; margin-bottom: 16px;
            text-transform: uppercase; letter-spacing: 0.06em;
        }
        .grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
        .products-grid { grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 24px; }
        .product-card {
            padding: 28px 28px 24px;
            border-top-width: 4px;
        }
        .product-card h3 {
            font-size: 22px; font-weight: 700; margin-bottom: 10px;
            padding-right: 120px; line-height: 1.25;
        }
        .product-card .assigned-person { font-size: 15px; margin-bottom: 4px; }
        .product-card .product-target { font-size: 14px; margin-bottom: 14px; }
        .product-card .tag { font-size: 11px; padding: 5px 10px; }
        .product-card .product-desc {
            background: var(--bg-elevated); border: 1px solid var(--border-subtle);
            padding: 18px 20px; border-radius: var(--radius-sm);
            font-size: 15px; color: var(--text-primary);
            white-space: pre-wrap; line-height: 1.75;
            margin-bottom: 16px; max-height: none; overflow: visible;
        }
        .product-card .card-actions-top { gap: 4px; }
        .product-card .card-actions-top .mini-action-btn {
            font-size: 13px; padding: 6px 10px;
            background: var(--bg-elevated); border: 1px solid var(--border-subtle);
        }
        .card {
            background: var(--bg-surface);
            border-radius: var(--radius-md);
            padding: 20px; box-shadow: var(--shadow-sm);
            display: flex; flex-direction: column;
            border: 1px solid var(--border-subtle);
            border-top: 3px solid var(--cemcrete-stone);
            position: relative; transition: var(--transition);
        }
        .card:hover { box-shadow: var(--shadow-md); border-color: var(--border); }
        .card h3 {
            margin: 0 0 6px; font-size: 15px; color: var(--text-primary);
            font-weight: 600; letter-spacing: -0.01em; padding-right: 56px;
        }
        .card .assigned-person { font-size: 13px; color: var(--text-secondary); font-weight: 500; margin-bottom: 2px; }
        .card .product-target { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
        .card-actions-top { position: absolute; top: 14px; right: 14px; display: flex; gap: 2px; }
        .mini-action-btn {
            background: none; border: none; cursor: pointer;
            font-size: 12px; color: var(--text-muted);
            padding: 4px 6px; border-radius: var(--radius-sm); font-family: var(--font);
        }
        .mini-action-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
        .mini-action-btn.del:hover { color: var(--cemcrete-danger); background: var(--cemcrete-danger-muted); }
        .tag-container { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
        .tag {
            font-size: 9px; background: var(--bg-elevated);
            color: var(--text-secondary); padding: 3px 7px;
            border-radius: 4px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.04em;
            border: 1px solid var(--border-subtle);
        }
        .tag.tag-product { background: var(--tag-product-bg); color: var(--tag-product-text); border-color: transparent; }
        .tag.tag-surface { background: var(--tag-surface-bg); color: var(--tag-surface-text); border-color: transparent; }
        .sub-tag { background: var(--bg-elevated); color: var(--text-muted); }
        .preview {
            background: var(--bg-elevated); border: 1px solid var(--border-subtle);
            padding: 12px; border-radius: var(--radius-sm);
            font-size: 13px; color: var(--text-secondary);
            white-space: pre-wrap; height: 120px; overflow-y: auto;
            margin-bottom: 16px; line-height: 1.6; outline: none;
        }
        .button-group { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
        .copy-btn {
            background: var(--cemcrete-charcoal); color: #fff;
            border: none; padding: 10px; border-radius: var(--radius-sm);
            font-size: 13px; font-weight: 600; font-family: var(--font);
            cursor: pointer; flex: 2; min-width: 130px; transition: var(--transition);
        }
        [data-theme="dark"] .copy-btn { background: var(--bg-hover); border: 1px solid var(--border); }
        .copy-btn:hover { background: var(--cemcrete-accent); border-color: var(--cemcrete-accent); }
        .copy-btn.copied { background: var(--cemcrete-success); border-color: var(--cemcrete-success); }
        .edit-btn {
            background: var(--bg-elevated); color: var(--text-primary);
            border: 1px solid var(--border); padding: 10px;
            border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
            font-family: var(--font); cursor: pointer; flex: 1; min-width: 90px;
            transition: var(--transition);
        }
        .edit-btn:hover { background: var(--bg-hover); }
        .edit-btn.editing { background: var(--cemcrete-accent-muted); color: var(--accent-text); border-color: var(--cemcrete-accent); }

        /* OVERVIEW */
        .overview-wrapper {
            max-width: 1400px; margin: 0 auto;
            padding: 24px 32px 40px;
            display: grid; grid-template-columns: 2fr 1fr; gap: 24px;
        }
        .overview-card {
            background: var(--bg-surface);
            border-radius: var(--radius-md);
            padding: 24px; box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-subtle);
            overflow: hidden;
        }
        .overview-card p { color: var(--text-secondary); font-size: 13px; }
        .overview-card p em { color: var(--accent-text); font-weight: 600; font-style: normal; }
        .overview-header-row {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 20px; border-bottom: 1px solid var(--border-subtle);
            padding-bottom: 14px; flex-wrap: wrap; gap: 10px;
        }
        .overview-title { font-size: 15px; font-weight: 600; margin: 0; color: var(--text-primary); }
        .data-table-container { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
        .data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; min-width: 560px; }
        .data-table th {
            background: var(--bg-elevated); padding: 11px 12px;
            font-weight: 600; color: var(--text-secondary);
            border-bottom: 1px solid var(--border); font-size: 11px;
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); }
        .data-table tr:hover td { background: var(--bg-elevated); }
        .pill-badge {
            display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600;
            background: var(--pill-bg); color: var(--pill-text); border-radius: 4px;
        }
        .inventory-list { display: flex; flex-direction: column; gap: 8px; }
        .inventory-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 14px; background: var(--bg-elevated);
            border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
            font-size: 13px; color: var(--text-secondary);
        }
        .inventory-item span { font-weight: 700; color: var(--accent-text); font-size: 16px; }
        .province-group-title {
            font-size: 14px; font-weight: 700; color: var(--text-primary);
            margin: 24px 0 10px; padding-bottom: 8px;
            border-bottom: 2px solid var(--cemcrete-accent);
        }
        .city-group-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 14px 0 8px 0; text-transform: uppercase; letter-spacing: 0.04em; }
        .retailer-table-wrapper {
            margin-left: 0; margin-bottom: 16px;
            background: var(--bg-surface); border-radius: var(--radius-sm);
            border: 1px solid var(--border-subtle); overflow-x: auto;
        }
        #retailerDynamicGroupContainer .data-table {
            table-layout: fixed;
            width: 100%;
            min-width: 0;
        }
        #retailerDynamicGroupContainer .data-table th:nth-child(1),
        #retailerDynamicGroupContainer .data-table td:nth-child(1) { width: 18%; word-wrap: break-word; }
        #retailerDynamicGroupContainer .data-table th:nth-child(2),
        #retailerDynamicGroupContainer .data-table td:nth-child(2) { width: 16%; word-wrap: break-word; }
        #retailerDynamicGroupContainer .data-table th:nth-child(3),
        #retailerDynamicGroupContainer .data-table td:nth-child(3) { width: 34%; word-wrap: break-word; }
        #retailerDynamicGroupContainer .data-table th:nth-child(4),
        #retailerDynamicGroupContainer .data-table td:nth-child(4) { width: 16%; }
        #retailerDynamicGroupContainer .data-table th:nth-child(5),
        #retailerDynamicGroupContainer .data-table td:nth-child(5) { width: 16%; }
        #retailerDynamicGroupContainer .retailer-city-row td.city-group-title {
            margin: 0;
            padding: 12px 12px 6px;
            background: var(--bg-elevated);
            border-bottom: none;
            font-size: 12px;
        }
        .empty-state {
            text-align: center; color: var(--text-muted);
            padding: 48px 24px; background: var(--bg-surface);
            border-radius: var(--radius-md); border: 1px dashed var(--border);
            font-size: 14px;
        }
        .card-danger { border-color: var(--cemcrete-danger-muted) !important; }
        .card-danger .overview-title { color: var(--cemcrete-danger); }
        .card-danger p { color: var(--text-secondary); }
        .stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }

        /* SETTINGS */
        .settings-layout { max-width: 900px; }
        .settings-login-section .login-input {
            width: 100%; max-width: 420px;
            padding: 10px 14px; font-size: 14px; font-family: var(--font);
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            background: var(--bg-input); color: var(--text-primary);
            margin-bottom: 12px;
        }
        .settings-login-section .login-input:focus {
            border-color: var(--cemcrete-accent);
            box-shadow: 0 0 0 3px var(--cemcrete-accent-muted);
            outline: none;
        }
        .settings-login-section .form-label {
            display: block; font-size: 12px; font-weight: 600;
            color: var(--text-secondary); margin-bottom: 6px;
        }
        .settings-login-section .login-btn {
            width: auto; min-width: 140px; padding: 10px 24px;
        }
        .settings-account-row {
            display: flex; align-items: center; justify-content: space-between;
            gap: 16px; flex-wrap: wrap;
        }
        .settings-account-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
        .settings-account-name { font-size: 20px; font-weight: 700; color: var(--text-primary); }
        .settings-theme-row {
            display: flex; align-items: center; justify-content: space-between;
            gap: 12px; flex-wrap: wrap;
            padding: 12px 14px; background: var(--bg-elevated);
            border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
        }
        .settings-theme-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
        .file-upload-input {
            width: 100%; padding: 24px 12px;
            background: var(--bg-elevated); border: 2px dashed var(--border);
            border-radius: var(--radius-md); cursor: pointer;
            text-align: center; font-size: 13px; font-weight: 500;
            color: var(--text-secondary); transition: var(--transition);
            outline: none; margin-bottom: 8px; font-family: var(--font);
        }
        .file-upload-input:hover { border-color: var(--cemcrete-accent); color: var(--accent-text); }
        .import-instructions {
            background: var(--cemcrete-accent-muted);
            border: 1px solid var(--border-subtle);
            padding: 14px; border-radius: var(--radius-sm);
            font-size: 12px; color: var(--text-secondary); line-height: 1.55;
        }
        .import-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: flex-start; }
        .field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
        .field-hint { font-size: 11px; color: var(--text-muted); margin: 4px 0 0; }
        .action-row { display: flex; gap: 10px; flex-wrap: wrap; }
        .section-gap { margin-top: 24px; }

        /* MODALS */
        .modal-overlay {
            display: none;
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
            align-items: center; justify-content: center;
            z-index: 1000; opacity: 0; pointer-events: none;
            transition: var(--transition); padding: 16px;
        }
        .modal-overlay.active { display: flex; opacity: 1; pointer-events: auto; }
        .modal-card {
            background: var(--bg-surface); width: 600px; max-width: 100%;
            border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
            padding: 24px; border: 1px solid var(--border);
            border-top: 3px solid var(--cemcrete-accent);
            transform: translateY(12px); transition: var(--transition);
            max-height: 90vh; overflow-y: auto;
            pointer-events: auto;
            position: relative;
            z-index: 1;
        }
        .modal-overlay.active .modal-card { transform: translateY(0); }
        .modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
        .modal-header h4 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; }
        .modal-window-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
        .modal-minimize-btn, .modal-close-x {
            background: var(--bg-elevated); border: 1px solid var(--border-subtle);
            font-size: 18px; font-weight: 700; color: var(--text-primary);
            cursor: pointer; padding: 4px 10px; line-height: 1; border-radius: 6px;
            min-width: 36px; min-height: 36px;
        }
        .modal-minimize-btn:hover, .modal-close-x:hover { color: var(--accent-text); background: var(--cemcrete-accent-muted); border-color: var(--cemcrete-accent); }
        .modal-close-x { font-size: 20px; }
        .app-window-bar {
            display: none; align-items: center; justify-content: space-between;
            padding: 6px 12px; background: #1a1918; border-bottom: 1px solid var(--border);
            color: #F2EFEA; position: sticky; top: 0; z-index: 10002;
        }
        .app-window-title { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
        .app-window-controls { display: flex; gap: 6px; }
        .app-window-btn {
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
            color: #F2EFEA; border-radius: 6px; min-width: 36px; min-height: 32px;
            font-size: 16px; font-weight: 700; cursor: pointer; line-height: 1;
        }
        .app-window-btn:hover { background: rgba(232, 93, 117, 0.25); border-color: var(--cemcrete-accent); }
        .app-window-btn-close { font-size: 16px; line-height: 1; }
        .minimized-modals-dock {
            display: none; position: fixed; bottom: 16px; right: 16px; z-index: 10001;
            flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px));
        }
        .minimized-modals-dock.active { display: flex; }
        .minimized-modal-chip {
            display: flex; align-items: center; justify-content: space-between; gap: 12px;
            padding: 10px 14px; border-radius: var(--radius-sm);
            border: 1px solid var(--border); background: var(--bg-surface);
            box-shadow: var(--shadow-lg); color: var(--text-primary);
            font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
        }
        .minimized-modal-chip:hover { border-color: var(--cemcrete-accent); }
        .minimized-modal-chip .chip-restore {
            font-size: 11px; font-weight: 700; color: var(--accent-text);
            background: var(--cemcrete-accent-muted); padding: 4px 8px; border-radius: 999px;
        }
        .form-group { margin-bottom: 14px; }
        .form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
        .form-control {
            width: 100%; padding: 10px 12px;
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            font-size: 13px; font-family: var(--font);
            outline: none; background: var(--bg-input); color: var(--text-primary);
            transition: var(--transition);
        }
        .form-control:focus { border-color: var(--cemcrete-accent); box-shadow: 0 0 0 3px var(--cemcrete-accent-muted); }
        textarea.form-control { resize: vertical; min-height: 80px; }
        .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
        .modal-footer button { flex: 1; min-width: 110px; padding: 10px 18px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); border: none; cursor: pointer; font-family: var(--font); }

        /* MULTI-SELECT */
        .multi-select-wrapper { position: relative; user-select: none; }
        .multi-select-header {
            width: 100%; padding: 10px 12px;
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            background: var(--bg-input); font-size: 13px;
            color: var(--text-muted); cursor: pointer;
            display: flex; justify-content: space-between; align-items: center;
            transition: var(--transition);
        }
        .multi-select-header:hover { border-color: var(--cemcrete-accent); }
        .multi-select-wrapper.open .multi-select-header {
            border-color: var(--cemcrete-accent);
            box-shadow: 0 0 0 3px var(--cemcrete-accent-muted);
        }
        .multi-select-list {
            display: none; position: absolute; top: 100%; left: 0; right: 0;
            background: var(--bg-surface); border: 1px solid var(--border);
            border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
            z-index: 10000; margin-top: 4px; padding: 4px;
            max-height: 200px; overflow-y: auto;
        }
        .multi-select-wrapper.open .multi-select-list { display: flex; flex-direction: column; gap: 2px; }
        .multi-select-list label {
            display: flex !important; align-items: center; gap: 8px;
            margin: 0 !important; padding: 8px 10px; cursor: pointer;
            font-weight: 500 !important; border-radius: 4px;
            color: var(--text-primary) !important; font-size: 13px !important;
            transition: background var(--transition);
        }
        .multi-select-list label:hover { background: var(--bg-elevated); }

        /* MISC */
        .text-link { color: var(--accent-text); text-decoration: none; }
        .text-link:hover { text-decoration: underline; }
        .badge-admin { background: var(--cemcrete-accent-muted); color: var(--accent-text); padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
        .badge-user { background: var(--bg-elevated); color: var(--text-secondary); padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; border: 1px solid var(--border-subtle); }
        .specialty-badge { background: var(--pill-bg); color: var(--pill-text); padding: 3px 8px; border-radius: 4px; font-size: 12px; }

        @media (max-width: 900px) {
            .overview-wrapper, .ai-body-grid, .import-grid, .form-grid-2, .stat-grid, .learning-layout { grid-template-columns: 1fr; }
        }
        @media (max-width: 768px) {
            body {
                padding-top: env(safe-area-inset-top);
                padding-bottom: env(safe-area-inset-bottom);
            }
            .brand-navbar { flex-direction: column; padding: 14px 16px; gap: 12px; }
            .logo-divider { display: none; }
            .logo-sub { font-size: 12px; }
            .brand-logo { height: 28px; }
            .user-profile-badge { width: 100%; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 12px; flex-wrap: wrap; gap: 8px; }
            .user-greeting { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
            .tab-btn { flex: 0 0 auto; padding: 14px 16px; font-size: 12px; min-height: 44px; }
            .toolbar-wrapper, .panel-intro { padding-left: 12px; padding-right: 12px; }
            .container, .ai-panel-container, .overview-wrapper { padding-left: 12px; padding-right: 12px; padding-bottom: 24px; }
            .grid-layout, .products-grid { grid-template-columns: 1fr; }
            .panel-intro h2 { font-size: 20px; }
            .panel-intro p { font-size: 13px; }
            .overview-header-row { flex-direction: column; align-items: stretch !important; gap: 10px; }
            .data-table-container {
                overflow-x: auto; -webkit-overflow-scrolling: touch;
                margin: 0 -4px; padding-bottom: 4px;
            }
            .data-table { min-width: 640px; font-size: 12px; }
            .data-table th, .data-table td { padding: 10px 8px; }
            .mini-action-btn, .header-btn, .login-btn, .btn-primary, .copy-btn, .edit-btn {
                min-height: 44px;
            }
            #searchBar, #contractorSearch, #retailerSearch, #leadSearch, #staffSearch, #productSearch,
            .filter-select, .btn-primary, .login-input {
                flex: 1 1 100%; width: 100%; font-size: 16px;
            }
            header { gap: 8px; }
            .toolbar-wrapper { padding-top: 12px; padding-bottom: 12px; }
            .modal-overlay { align-items: flex-end; padding: 0; }
            .modal-card {
                width: 100%; max-width: 100%; max-height: 92vh;
                border-radius: var(--radius-lg) var(--radius-lg) 0 0;
                overflow-y: auto;
            }
            .card { padding: 16px; }
            .retailer-table-wrapper, .city-group-title { margin-left: 0; }
            .mobile-install-banner { flex-direction: column; align-items: stretch; gap: 10px; }
            .mobile-install-actions { justify-content: stretch; }
            .mobile-install-actions .btn-primary, .mobile-install-actions .header-btn { flex: 1; justify-content: center; }
        }
        @media (max-width: 480px) {
            .logo-sub { display: none; }
            .login-card { padding: 32px 24px; }
        }

        .hub-update-banner {
            display: none;
            position: sticky; top: 0; z-index: 10000;
            align-items: center; justify-content: space-between; gap: 12px;
            padding: 10px 14px;
            background: linear-gradient(90deg, #4a3f2f 0%, #2B2A28 100%);
            border-bottom: 1px solid var(--cemcrete-accent);
            color: #F2EFEA;
        }
        .hub-update-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
        .hub-update-text strong { font-size: 13px; color: var(--cemcrete-accent); }
        .hub-update-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

        .mobile-install-banner {
            display: none;
            position: sticky; top: 0; z-index: 9999;
            align-items: center; justify-content: space-between; gap: 12px;
            padding: 10px 14px;
            background: linear-gradient(90deg, #2B2A28 0%, #3D3B38 100%);
            border-bottom: 1px solid var(--border);
            color: #F2EFEA;
        }
        .mobile-install-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
        .mobile-install-text strong { font-size: 13px; }
        .mobile-install-actions { display: flex; gap: 8px; align-items: center; }

        /* LMS */
        .lms-login-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
        .lms-login-tab {
            flex: 1; padding: 10px 12px; border: 1px solid var(--border-subtle);
            background: var(--bg-surface); color: var(--text-secondary);
            border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
        }
        .lms-login-tab.active { background: var(--cemcrete-accent-muted); color: var(--accent-text); border-color: var(--cemcrete-accent); }
        body.student-mode .admin-only { display: none !important; }
        body.student-mode .student-only-tab { display: block !important; }
        .lms-lesson-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
        .lms-lesson-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
        .lms-enroll-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
        .lms-video-wrap { margin: 16px 0; border-radius: var(--radius-md); overflow: hidden; background: #000; }
        .lms-video-embed, .lms-video-player { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
        .lms-chat-box { max-height: 320px; overflow-y: auto; padding: 12px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin-bottom: 12px; }
        .lms-chat-msg { padding: 8px 10px; margin-bottom: 8px; border-radius: var(--radius-sm); background: var(--bg-surface); }
        .lms-chat-msg.lms-chat-student { border-left: 3px solid var(--cemcrete-accent); }
        .lms-chat-msg.lms-chat-instructor { border-left: 3px solid #6b8e23; }
        .lms-chat-time { font-size: 11px; color: var(--text-secondary); margin-left: 8px; }
        .lms-chat-input-row { display: flex; gap: 8px; }
        .lms-chat-input-row input { flex: 1; }

        /* CRM — Sales pipeline */
        .crm-sub-tabs {
            display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
            padding: 0 24px 16px; border-bottom: 1px solid var(--border-subtle);
        }
        .crm-sub-tab {
            padding: 8px 14px; border: 1px solid var(--border-subtle);
            background: var(--bg-surface); color: var(--text-secondary);
            border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
        }
        .crm-sub-tab.active { background: var(--cemcrete-accent-muted); color: var(--accent-text); border-color: var(--cemcrete-accent); }
        .crm-sub-tab-actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        .crm-sub-tab-actions .crm-my-records-toggle { margin-left: 0; }
        .crm-my-records-toggle { margin-left: auto; font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; cursor: pointer; }
        .crm-sub-panel { display: none; padding-top: 20px; }
        .crm-sub-panel.active { display: block; }
        .crm-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
        .crm-stat-card {
            padding: 16px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 4px;
        }
        .crm-stat-card.crm-stat-alert { border-color: var(--cemcrete-danger); background: var(--cemcrete-danger-muted); }
        .crm-stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); }
        .crm-stat-label { font-size: 12px; color: var(--text-secondary); }
        .crm-dashboard-recent h4 { margin: 0 0 12px; font-size: 14px; }
        .crm-rep-performance { margin-bottom: 24px; }
        .crm-rep-table { overflow-x: auto; }
        .crm-rep-table table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 960px; }
        .crm-rep-table th, .crm-rep-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
        .crm-rep-table th:first-child, .crm-rep-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-surface); z-index: 1; }
        .crm-rep-table th { color: var(--text-secondary); font-weight: 600; font-size: 11px; }
        .crm-rep-row-team td { font-weight: 700; background: var(--bg-elevated); }
        .crm-rep-row-team td:first-child { background: var(--bg-elevated); }
        .crm-rep-row-me td { background: var(--cemcrete-accent-muted); }
        .crm-rep-row-me td:first-child { background: var(--cemcrete-accent-muted); font-weight: 600; }
        .crm-metrics-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
        .crm-metrics-filter-row .filter-select { min-width: 180px; }
        .crm-monthly-metrics { margin-bottom: 24px; }
        .crm-metrics-note { font-size: 13px; color: var(--text-secondary); margin: 0 0 16px; }
        .crm-metrics-scope { font-size: 12px; color: var(--text-muted); }
        .crm-metrics-chart-wrap { position: relative; height: 280px; margin-bottom: 16px; }
        .crm-metrics-table { overflow-x: auto; }
        .crm-metrics-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
        .crm-metrics-table th, .crm-metrics-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border-subtle); }
        .crm-metrics-table th:first-child, .crm-metrics-table td:first-child { text-align: left; }
        .crm-metrics-table th { color: var(--text-secondary); font-weight: 600; }
        .crm-metrics-table tr.crm-metrics-current td { font-weight: 600; background: var(--cemcrete-accent-muted); }
        .crm-pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; min-height: 320px; }
        .crm-pipeline-col { flex: 0 0 220px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); display: flex; flex-direction: column; max-height: 70vh; }
        .crm-pipeline-col-header { padding: 10px 12px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }
        .crm-pipeline-cards { padding: 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
        .crm-deal-card {
            padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.15s;
        }
        .crm-deal-card:hover { border-color: var(--cemcrete-accent); }
        .crm-deal-card-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
        .crm-deal-card-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
        .crm-deal-card-footer { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
        .crm-deal-card-actions { display: flex; flex-wrap: wrap; gap: 4px; }
        .crm-clients-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
        .crm-clients-sidebar { display: flex; flex-direction: column; gap: 10px; max-height: 75vh; }
        .crm-client-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; flex: 1; }
        .crm-client-row {
            display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
            padding: 10px 12px; text-align: left; background: var(--bg-surface); border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm); cursor: pointer; width: 100%;
        }
        .crm-client-row:hover, .crm-client-row.active { border-color: var(--cemcrete-accent); background: var(--cemcrete-accent-muted); }
        .crm-client-row-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
        .crm-client-detail-panel { min-height: 400px; }
        .crm-client-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
        .crm-activity-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
        .crm-activity-item { padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
        .crm-activity-item p { margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; }
        .crm-activity-meta { font-size: 11px; color: var(--text-secondary); margin-left: 8px; }
        .crm-lead-cards { display: none; }
        @media (max-width: 768px) {
            .crm-sub-tabs { padding: 0 12px 12px; }
            .crm-my-records-toggle { margin-left: 0; width: 100%; }
            .crm-clients-layout { grid-template-columns: 1fr; }
            .crm-pipeline-col { flex: 0 0 180px; }
            .crm-lead-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
            .crm-lead-cards .data-table-container { display: none; }
            #crmPanelLeads .data-table-container { display: none; }
        }

        /* PRODUCTS — sub-tabs & calculators */
        .products-sub-panel { display: none; padding-top: 20px; }
        .products-sub-panel.active { display: block; }
        .calc-category-block { margin-bottom: 28px; }
        .calc-category-title {
            font-size: 15px; font-weight: 700; color: var(--text-primary);
            margin: 0 0 14px; letter-spacing: 0.04em; text-transform: uppercase;
        }
        .calc-tile-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 14px;
        }
        .calc-tile {
            display: flex; flex-direction: column; align-items: center; gap: 10px;
            padding: 14px 10px; border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md); background: var(--bg-surface);
            cursor: pointer; transition: var(--transition); font-family: var(--font);
            text-align: center; min-height: 160px;
        }
        .calc-tile:hover { border-color: var(--cemcrete-accent); background: var(--cemcrete-accent-muted); }
        .calc-tile-img-wrap {
            width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
            border: 2px solid var(--border-subtle); background: #fff; flex-shrink: 0;
        }
        .calc-tile-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
        .calc-tile-label {
            font-size: 11px; font-weight: 600; color: var(--text-secondary);
            line-height: 1.3; text-transform: uppercase; letter-spacing: 0.03em;
        }
        .calc-viewer-toolbar {
            display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
            margin-bottom: 4px;
        }
        .calc-viewer-iframe {
            width: 100%; min-height: 720px; height: calc(100vh - 280px);
            border: 1px solid var(--border); border-radius: var(--radius-md);
            background: #fff;
        }
        @media (max-width: 768px) {
            .calc-tile-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
            .calc-viewer-iframe { min-height: 520px; height: 70vh; }
        }

        /* OPERATIONS sub-panels */
        .operations-sub-panel { display: none; padding-top: 20px; }
        .operations-sub-panel.active { display: block; }

        /* CIA sub-panels */
        .cia-sub-panel { display: none; padding-top: 20px; }
        .cia-sub-panel.active { display: block; }

        /* Document browser */
        .doc-browser { display: grid; grid-template-columns: 220px 1fr; gap: 16px; min-height: 480px; }
        .doc-sidebar { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border-subtle); padding-right: 12px; max-height: 70vh; overflow-y: auto; }
        .doc-folder-item {
            text-align: left; padding: 8px 10px; border: none; background: transparent;
            color: var(--text-secondary); font-size: 13px; cursor: pointer; border-radius: var(--radius-sm);
            font-family: var(--font);
        }
        .doc-folder-item:hover, .doc-folder-item.active { background: var(--bg-elevated); color: var(--text-primary); }
        .doc-file-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow-y: auto; }
        .doc-file-row {
            display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm); background: var(--bg-surface); cursor: pointer; text-align: left; width: 100%;
            font-family: var(--font); transition: var(--transition);
        }
        .doc-file-row:hover { border-color: var(--cemcrete-accent); }
        .doc-file-name { font-weight: 600; font-size: 14px; color: var(--text-primary); display: block; }
        .doc-file-meta { font-size: 11px; color: var(--text-muted); }
        .doc-file-size { font-size: 12px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
        .doc-viewer-iframe { width: 100%; min-height: 640px; height: calc(100vh - 320px); border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; margin-top: 12px; }
        .doc-viewer-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

        /* Price list */
        .price-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
        .price-list-card {
            display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md); background: var(--bg-surface); cursor: pointer; text-align: left;
            font-family: var(--font); transition: var(--transition);
        }
        .price-list-card:hover { border-color: var(--cemcrete-accent); }
        .price-list-card-icon { font-size: 28px; }
        .price-list-card-title { font-weight: 700; font-size: 15px; color: var(--text-primary); }
        .price-list-card-meta { font-size: 12px; color: var(--text-muted); }

        /* Featured projects */
        .featured-projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
        .featured-project-card {
            border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden;
            background: var(--bg-surface); display: flex; flex-direction: column;
        }
        .featured-project-img { width: 100%; height: 180px; object-fit: cover; display: block; }
        .featured-project-img-placeholder {
            display: flex; align-items: center; justify-content: center; background: var(--bg-elevated);
            font-size: 48px; height: 180px;
        }
        .featured-project-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
        .featured-project-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
        .featured-project-header h4 { margin: 0; font-size: 16px; }
        .featured-project-summary { font-size: 13px; color: var(--text-secondary); margin: 0; }
        .featured-project-actions { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 8px; }

        @media (max-width: 768px) {
            .doc-browser { grid-template-columns: 1fr; }
            .doc-sidebar { border-right: none; border-bottom: 1px solid var(--border-subtle); padding-bottom: 12px; max-height: 200px; }
        }

        /* To Do list */
        .todo-panel-layout { display: flex; flex-direction: column; gap: 16px; }
        .todo-toolbar { display: flex; align-items: center; gap: 12px; padding: 16px; }
        .todo-add-card .form-group { margin-bottom: 12px; }
        .todo-list { display: flex; flex-direction: column; gap: 10px; }
        .todo-row {
            display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between;
            padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
            background: var(--bg-surface);
        }
        .todo-row-main { flex: 1; min-width: 200px; }
        .todo-row-title { font-weight: 600; font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
        .todo-row-notes { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; margin-bottom: 6px; }
        .todo-row-meta { font-size: 12px; color: var(--text-muted); }
        .todo-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
        .todo-status-select { min-width: 120px; padding: 8px; }
        .todo-status-badge {
            display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px;
            font-weight: 600; text-transform: capitalize;
        }
        .todo-status-pending { background: #fef3c7; color: #92400e; }
        .todo-status-done { background: #dbeafe; color: #1e40af; }
        .todo-status-completed { background: #dcfce7; color: #166534; }
        body[data-theme="dark"] .todo-status-pending { background: #78350f; color: #fde68a; }
        body[data-theme="dark"] .todo-status-done { background: #1e3a8a; color: #bfdbfe; }
        body[data-theme="dark"] .todo-status-completed { background: #14532d; color: #bbf7d0; }
        .todo-source-tag {
            display: inline-block; margin-right: 6px; padding: 2px 6px; border-radius: 4px;
            font-size: 10px; font-weight: 700; background: var(--bg-elevated); color: var(--text-muted);
        }
        .todo-due { font-style: italic; }

        #formTemplateBody { white-space: pre-wrap; }

        /* Specifications Database workbook */
        .spec-edit-notice {
            font-size: 13px;
            color: var(--text-secondary);
            margin-top: 6px;
        }
        .spec-save-status {
            font-size: 12px;
            color: var(--text-muted);
            min-width: 72px;
        }
        .spec-save-status.spec-save-error { color: var(--cemcrete-danger); }
        .spec-workbook-wrap {
            overflow: auto;
            max-height: calc(100vh - 260px);
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--card-bg);
            padding: 0;
        }
        .spec-workbook-zoom-layer {
            display: inline-block;
            min-width: 100%;
            transform-origin: top left;
        }
        .spec-zoom-controls {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 6px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-input);
        }
        .spec-zoom-controls .spec-zoom-btn {
            min-width: 28px;
            padding: 4px 8px;
            font-size: 16px;
            line-height: 1;
        }
        .spec-zoom-controls .spec-zoom-reset {
            min-width: 44px;
            font-size: 11px;
        }
        .spec-zoom-label {
            font-size: 11px;
            color: var(--text-muted);
            min-width: 36px;
            text-align: center;
        }
        #specSearchBar {
            flex: 2;
            min-width: 200px;
            padding: 10px 14px;
            font-size: 13px;
            font-family: var(--font);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            outline: none;
            background: var(--bg-input);
            color: var(--text-primary);
        }
        #specSearchBar:focus {
            border-color: var(--cemcrete-accent);
        }
        .spec-workbook-grid {
            border-collapse: separate;
            border-spacing: 0;
            width: max-content;
            min-width: 100%;
            font-size: 12px;
        }
        .spec-workbook-grid th,
        .spec-workbook-grid td {
            border-right: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            padding: 4px 8px;
            min-width: 88px;
            max-width: 280px;
            vertical-align: top;
            white-space: pre-wrap;
            word-break: break-word;
            background: var(--card-bg);
        }
        .spec-workbook-grid thead th {
            position: sticky;
            top: 0;
            z-index: 3;
            background: var(--bg-elevated);
            font-weight: 700;
            text-align: center;
        }
        .spec-workbook-grid .spec-gutter {
            position: sticky;
            left: 0;
            z-index: 2;
            min-width: 42px;
            max-width: 42px;
            text-align: center;
            background: var(--bg-elevated);
            color: var(--text-muted);
            font-weight: 600;
        }
        .spec-workbook-grid thead th.spec-gutter { z-index: 4; }
        .spec-workbook-grid tbody tr:nth-child(even) td:not(.spec-gutter) {
            background: var(--bg-subtle, rgba(0,0,0,0.02));
        }
        .spec-workbook-grid td[contenteditable="true"]:focus,
        .spec-workbook-grid td.spec-cell-active {
            outline: 2px solid var(--cemcrete-accent);
            outline-offset: -2px;
            background: var(--cemcrete-accent-muted);
        }
        .spec-workbook-grid td.spec-cell-dropdown {
            padding: 0;
            vertical-align: middle;
        }
        .spec-workbook-grid .spec-cell-select {
            width: 100%;
            min-width: 84px;
            max-width: 276px;
            border: none;
            background: var(--bg-input);
            font: inherit;
            font-size: 12px;
            padding: 4px 6px;
            color: var(--text-primary);
            cursor: pointer;
            appearance: auto;
            color-scheme: light dark;
        }
        [data-theme="dark"] .spec-workbook-grid .spec-cell-select { color-scheme: dark; }
        [data-theme="light"] .spec-workbook-grid .spec-cell-select { color-scheme: light; }
        .spec-workbook-grid .spec-cell-select option {
            background-color: var(--bg-surface);
            color: var(--text-primary);
        }
        .spec-workbook-grid .spec-cell-select:focus {
            outline: none;
        }
        .spec-workbook-grid td.spec-cell-active .spec-cell-select {
            background: var(--cemcrete-accent-muted);
        }
        .spec-workbook-grid .spec-cell-select:disabled {
            opacity: 1;
            cursor: default;
            color: var(--text-primary);
            -webkit-text-fill-color: var(--text-primary);
        }
        .spec-workbook-grid td.spec-cell-multi { position: relative; }
        .spec-multi-select { position: relative; width: 100%; min-width: 120px; }
        .spec-multi-trigger {
            width: 100%;
            border: none;
            background: var(--bg-input);
            font: inherit;
            font-size: 12px;
            padding: 4px 6px;
            text-align: left;
            color: var(--text-primary);
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .spec-multi-trigger:disabled { cursor: default; opacity: 1; }
        .spec-multi-list {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            z-index: 20;
            min-width: 160px;
            max-width: 240px;
            padding: 6px 8px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-surface);
            box-shadow: 0 8px 24px rgba(0,0,0,0.18);
        }
        .spec-multi-select.open .spec-multi-list { display: block; }
        .spec-multi-option {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 2px;
            font-size: 12px;
            cursor: pointer;
            white-space: nowrap;
        }
        .spec-multi-option input { margin: 0; }
        .spec-workbook-grid tr.spec-row-hidden { display: none; }

        .panel-notice {
            margin: 0 0 16px;
            padding: 12px 14px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-elevated);
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.5;
        }
        .panel-notice a { color: var(--cemcrete-accent); }

        .spec-sub-panel { display: none; padding-top: 0; }
        .spec-sub-panel.active { display: block; }

        .offline-banner {
            background: #78350f;
            color: #fde68a;
            text-align: center;
            padding: 8px 16px;
            font-size: 13px;
        }

        .app-tabs-wrap {
            display: flex;
            align-items: stretch;
            gap: 0;
            width: 100%;
            border-bottom: 1px solid var(--border);
            background: var(--tabs-bg);
        }
        .mobile-nav-toggle {
            display: none;
            margin: 8px 0 8px 12px;
            padding: 10px 14px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--card-bg);
            color: var(--text-primary);
            font-weight: 600;
            cursor: pointer;
        }
        .mobile-nav-drawer {
            position: fixed;
            inset: 0;
            z-index: 1200;
            pointer-events: none;
        }
        .mobile-nav-drawer.open { pointer-events: auto; }
        .mobile-nav-backdrop {
            position: absolute;
            inset: 0;
            z-index: 1;
            background: rgba(0, 0, 0, 0.55);
            opacity: 0;
            transition: opacity 0.2s ease;
        }
        .mobile-nav-drawer.open .mobile-nav-backdrop { opacity: 1; }
        .mobile-nav-panel {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 2;
            width: min(320px, 88vw);
            height: 100%;
            background: var(--card-bg);
            border-right: 1px solid var(--border);
            box-shadow: var(--shadow-lg);
            transform: translateX(-100%);
            transition: transform 0.2s ease;
            display: flex;
            flex-direction: column;
        }
        .mobile-nav-drawer.open .mobile-nav-panel { transform: translateX(0); }
        .mobile-nav-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            border-bottom: 1px solid var(--border);
        }
        .mobile-nav-links {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 12px;
            overflow-y: auto;
        }
        .mobile-nav-link {
            text-align: left;
            padding: 12px 14px;
            border-radius: 8px;
            border: 1px solid transparent;
            background: transparent;
            color: var(--text-primary);
            font-size: 15px;
            cursor: pointer;
        }
        .mobile-nav-link:hover { background: var(--bg-elevated); }

        .resource-picker-list {
            max-height: 360px;
            overflow-y: auto;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 8px;
        }
        .resource-picker-row {
            display: grid;
            grid-template-columns: auto 1fr auto;
            gap: 10px;
            align-items: center;
            padding: 8px;
            border-radius: 6px;
            cursor: pointer;
        }
        .resource-picker-row:hover { background: var(--bg-elevated); }
        .resource-picker-name { font-size: 13px; font-weight: 500; }
        .resource-picker-meta { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

        .crm-lead-card {
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 14px;
            background: var(--card-bg);
            margin-bottom: 12px;
        }
        .crm-lead-card-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        .crm-lead-card-meta {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }
        .lead-card-overdue { border-color: var(--cemcrete-danger); }
        .lead-card-due-today { border-color: #f59e0b; }

        .form-grid-3 {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 12px;
        }

        @media (max-width: 768px) {
            .mobile-nav-toggle { display: inline-flex; align-items: center; }
            .app-tabs { display: none; }
            .app-tabs-wrap { border-bottom: 1px solid var(--border); }
            .form-grid-3, .settings-pin-grid { grid-template-columns: 1fr; }
        }