/* True Designs v2 - Main Stylesheet (Phase 1-3) */
/* ============================================================ */

:root {
    --primary: #C41E3A;
    --primary-dark: #9B1830;
    --primary-light: #E8354F;
    --bg-body: #F8F8F9;
    --bg-card: #FFFFFF;
    --bg-hover: #F3F4F6;
    --bg-surface: #FAFAFA;
    --border: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0F0F0F;
        --bg-card: #1A1A1A;
        --bg-hover: #252525;
        --bg-surface: #1F1F1F;
        --border: #2E2E2E;
        --text-primary: #F3F4F6;
        --text-secondary: #9CA3AF;
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    }
}

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

html, body { height: 100%; font-family: var(--font); background: var(--bg-body); color: var(--text-primary); font-size: 15px; -webkit-font-smoothing: antialiased; }

.hidden { display: none !important; }

/* ── App Shell ── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.main-wrapper > .wa-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 50; }
.main-content { flex: 1; overflow-y: auto; padding: 24px; transition: margin-right 0.25s ease; }
.main-wrapper:has(.wa-panel.wa-open) .main-content { margin-right: 320px; }

/* ── Sidebar ── */
.sidebar { width: 250px; background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; z-index: 100; }
.sidebar-header { padding: 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { background: var(--primary); color: #fff; font-weight: 800; font-size: 1.1rem; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.logo-text { font-weight: 700; font-size: 1rem; }
.sidebar-close-btn { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-size: 0.88rem; font-weight: 500; transition: all 0.15s; }
.sidebar-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-nav-item.active { background: var(--primary); color: #fff; }
.sidebar-nav-item.active svg { stroke: #fff; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-user-info { display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.sidebar-user-details { display: flex; flex-direction: column; }
.sidebar-user-name { font-weight: 600; font-size: 0.82rem; }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-secondary); text-transform: capitalize; }
.sidebar-logout-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 6px; }
.sidebar-logout-btn:hover { background: var(--bg-hover); color: var(--primary); }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; display: none; }
.sidebar-overlay.visible { display: block; }

/* ── Topbar ── */
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.topbar-menu-btn { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 4px; }
.topbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn { position: relative; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 8px; }
.topbar-btn:hover { background: var(--bg-hover); }
.cart-badge { position: absolute; top: -4px; right: -4px; background: var(--primary); color: #fff; font-size: 0.65rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* ── Auth Screen ── */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-body); padding: 20px; }
.auth-container { width: 100%; max-width: 400px; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 40px 32px; box-shadow: var(--shadow-md); text-align: center; }
.auth-logo { margin-bottom: 16px; display: flex; justify-content: center; }
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 0.9rem; }
.auth-links { margin-top: 16px; display: flex; justify-content: center; gap: 20px; font-size: 0.82rem; }
.auth-links a { color: var(--primary); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.form-input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); font-family: var(--font); font-size: 0.88rem; transition: border-color 0.15s; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(196,30,58,0.12); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
@media (max-width: 640px) { .form-row { flex-direction: column; } }

/* ── Buttons ── */
.btn { padding: 10px 18px; border-radius: 8px; font-family: var(--font); font-size: 0.85rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost { background: none; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: var(--bg-card); border-radius: 16px; box-shadow: var(--shadow-md); width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px 12px; }
.modal-header h2 { font-size: 1.15rem; font-weight: 700; }
.modal-body { padding: 0 24px 16px; }
.modal-footer { padding: 12px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: 0.85rem; transform: translateX(120%); transition: transform 0.3s ease; }
.toast-show { transform: translateX(0); }
.toast-icon { font-size: 1.1rem; }
.toast-success { border-left: 3px solid #10B981; }
.toast-error { border-left: 3px solid #EF4444; }
.toast-warning { border-left: 3px solid #F59E0B; }
.toast-info { border-left: 3px solid #3B82F6; }
/* Clear the floating chat dock (56px @ bottom:22px, desktop only) so toasts aren't hidden behind it */
@media (min-width: 1024px) { .toast-container { bottom: 92px; } }

/* ── Status Badge ── */
.status-badge { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; text-transform: capitalize; }

/* ── Page States ── */
.page-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-secondary); gap: 12px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.page-empty h2 { color: var(--text-primary); margin-bottom: 8px; }
.empty-icon { margin-bottom: 12px; opacity: 0.5; display: flex; justify-content: center; }

/* ── Dashboard ── */
.dashboard { max-width: 900px; }
.dashboard h1 { font-size: 1.5rem; margin-bottom: 24px; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.dash-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: all 0.15s; display: flex; flex-direction: column; gap: 4px; }
.dash-stat:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.dash-stat-num { font-size: 1.3rem; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; max-width: 100%; }
.dash-stat-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Catalog ── */
.catalog-filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.product-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; transition: all 0.15s; }
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.product-name { font-weight: 700; font-size: 0.95rem; }
.product-category { font-size: 0.78rem; color: var(--text-secondary); }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-top: 4px; }
.product-unit { font-size: 0.72rem; color: var(--text-secondary); }

/* ── Cart ── */
.cart-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.cart-item-info { display: flex; flex-direction: column; gap: 2px; }
.cart-item-actions { display: flex; align-items: center; gap: 8px; }
.cart-qty { font-weight: 700; min-width: 24px; text-align: center; }
.cart-item-total { font-weight: 600; min-width: 80px; text-align: right; }
.cart-total { font-size: 1.2rem; text-align: right; margin-bottom: 16px; }

/* ── Page Header ── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; transition: left 0.25s ease; z-index: 100; }
    .sidebar.open { left: 0; }
    .sidebar-close-btn { display: block; }
    .topbar-menu-btn { display: block; }
    .main-content { padding: 16px; }
    .topbar { padding: 10px 16px; }
}

/* ================================================================
   PHASE 3: PROJECTS MODULE STYLES
   ================================================================ */

.proj-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.proj-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.proj-stat-num { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); display: block; white-space: nowrap; overflow: hidden; max-width: 100%; }
.proj-stat-num.proj-stat-warn { color: #EF4444; }
.proj-stat-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

.proj-filters { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.proj-filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proj-view-toggle { display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.proj-view-btn { background: none; border: none; padding: 7px 12px; cursor: pointer; color: var(--text-secondary); display: flex; align-items: center; transition: all 0.15s; }
.proj-view-btn.active { background: var(--primary); color: #fff; }
.proj-view-btn:hover:not(.active) { background: var(--bg-hover); }

.proj-list { display: flex; flex-direction: column; gap: 6px; }
/* On wider screens, flow the card lists into a responsive grid instead of one
   full-width column (better use of desktop space on Invoices/Quotes/Payments/Expenses). */
@media (min-width: 900px) {
    .proj-list:not(#projListContainer) { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; align-items: start; }
}
.proj-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.15s; gap: 16px; }
.proj-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.proj-card-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.proj-number { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-hover); padding: 3px 8px; border-radius: 5px; white-space: nowrap; font-family: var(--font-mono); }
.proj-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proj-title { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-customer { font-size: 0.82rem; color: var(--text-secondary); }
.proj-card-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.proj-stage-badge { font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.proj-priority-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.proj-due { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; }
.proj-due[data-due-target] { font-weight: 600; padding: 2px 9px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; }
.proj-due.due-ok { background: rgba(16,185,129,.14); color: #10B981; }
.proj-due.due-soon { background: rgba(245,158,11,.16); color: #F59E0B; }
.proj-due.due-today { background: rgba(249,115,22,.18); color: #F97316; }
.proj-due.due-overdue { background: rgba(239,68,68,.18); color: #EF4444; }
.proj-due.due-done { background: rgba(148,163,184,.15); color: var(--text-secondary); }
.proj-due-banner { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; margin: 12px 0; border: 1px solid transparent; }
.proj-due-banner .cd-time { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.proj-due-banner .cd-sub { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; opacity: .85; }
.proj-due-banner.due-ok { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); color: #10B981; }
.proj-due-banner.due-soon { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); color: #F59E0B; }
.proj-due-banner.due-today { background: rgba(249,115,22,.12); border-color: rgba(249,115,22,.4); color: #F97316; }
.proj-due-banner.due-overdue { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #EF4444; }
.proj-due-banner.due-done { background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.3); color: var(--text-secondary); }
@keyframes dueBeat { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.proj-due.due-overdue, .proj-due-banner.due-overdue .cd-time { animation: dueBeat 1.7s ease-in-out infinite; }
@keyframes prBump { 0% { box-shadow: inset 0 0 0 2px rgba(239,68,68,.55); background: rgba(239,68,68,.12); } 100% { box-shadow: none; background: transparent; } }
.proj-card.priority-bumped, .proj-board-card.priority-bumped { animation: prBump 3s ease-out; }
.proj-overdue { color: #EF4444 !important; font-weight: 600; }
.proj-assignee { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }

.proj-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; min-height: 400px; }
.proj-board-col { min-width: 240px; max-width: 280px; flex-shrink: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; }
.proj-board-col-header { padding: 12px 14px; font-weight: 600; font-size: 0.82rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid; }
.proj-board-count { background: var(--bg-hover); padding: 2px 8px; border-radius: 10px; font-size: 0.72rem; color: var(--text-secondary); }
.proj-board-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; max-height: 60vh; }
.proj-board-empty { padding: 20px; text-align: center; color: var(--text-secondary); font-size: 0.82rem; }
.proj-board-card { padding: 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.proj-board-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.08); }
.proj-board-card.proj-board-overdue { border-left: 3px solid #EF4444; }
.proj-board-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.proj-board-card-title { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-board-card-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; }

.proj-detail-topbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.proj-detail-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.proj-detail-title { font-size: 1.5rem; font-weight: 700; margin: 4px 0 8px; }
.proj-detail-meta { display: flex; gap: 20px; font-size: 0.85rem; color: var(--text-secondary); flex-wrap: wrap; }
.proj-detail-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.proj-priority-badge { font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.proj-overdue-badge { font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: #EF444420; color: #EF4444; }

.proj-progress { display: flex; gap: 0; margin-bottom: 24px; overflow-x: auto; padding: 8px 0; }
.proj-progress-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 80px; position: relative; }
.proj-progress-step::before { content: ''; position: absolute; top: 8px; left: -50%; right: 50%; height: 2px; background: var(--border); }
.proj-progress-step:first-child::before { display: none; }
.proj-progress-step.completed::before, .proj-progress-step.current::before { background: var(--primary); }
.proj-progress-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-card); position: relative; z-index: 1; transition: all 0.2s; }
.proj-progress-step.completed .proj-progress-dot { border-color: transparent; }
.proj-progress-step.current .proj-progress-dot { border-color: transparent; box-shadow: 0 0 0 3px rgba(196,30,58,0.25); transform: scale(1.2); }
.proj-progress-label { font-size: 0.65rem; color: var(--text-secondary); text-align: center; white-space: nowrap; }
.proj-progress-step.current .proj-progress-label { color: var(--primary); font-weight: 600; }

.proj-stage-actions { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.proj-stage-current { font-weight: 700; font-size: 1rem; }
.proj-stage-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.proj-detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .proj-detail-grid { grid-template-columns: 1fr; } }
.proj-detail-main { display: flex; flex-direction: column; gap: 24px; }
.proj-detail-sidebar { display: flex; flex-direction: column; gap: 16px; }

.proj-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.proj-section h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
.proj-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.proj-section-header h3 { margin-bottom: 0; }
.proj-empty-note { color: var(--text-secondary); font-size: 0.85rem; font-style: italic; }
.proj-description { line-height: 1.6; color: var(--text-primary); }

.proj-file-group { margin-bottom: 16px; }
.proj-file-group:last-child { margin-bottom: 0; }
.proj-file-group h4 { font-size: 0.82rem; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.proj-file-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.proj-file-card:last-child { margin-bottom: 0; }
.proj-file-icon { font-size: 1.4rem; flex-shrink: 0; }
.proj-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.proj-file-name { font-weight: 600; font-size: 0.85rem; color: var(--primary); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-file-name:hover { text-decoration: underline; }
.proj-file-meta { font-size: 0.72rem; color: var(--text-secondary); }
.proj-proof-card { border-left: 3px solid #F59E0B; }
.proj-proof-status { font-size: 0.78rem; font-weight: 600; }
.proj-proof-feedback { font-size: 0.78rem; font-style: italic; color: var(--text-secondary); }
.proj-proof-actions { display: flex; gap: 6px; flex-shrink: 0; }

.proj-info-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.proj-info-card h4 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); margin-bottom: 12px; }
.proj-info-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.proj-info-row:last-child { border-bottom: none; }
.proj-info-row span:first-child { color: var(--text-secondary); }
.proj-info-row a { color: var(--primary); text-decoration: none; font-weight: 600; }
.proj-info-row a:hover { text-decoration: underline; }

.proj-timeline { position: relative; padding-left: 24px; }
.proj-timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.proj-timeline-item { position: relative; padding-bottom: 16px; }
.proj-timeline-item:last-child { padding-bottom: 0; }
.proj-timeline-dot { position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border); }
.proj-timeline-content { display: flex; flex-direction: column; gap: 2px; }
.proj-timeline-action { font-weight: 600; font-size: 0.85rem; }
.proj-timeline-who { font-size: 0.78rem; color: var(--text-secondary); }
.proj-timeline-note { font-size: 0.78rem; font-style: italic; color: var(--text-secondary); }
.proj-timeline-when { font-size: 0.72rem; color: var(--text-secondary); opacity: 0.7; }

.proj-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.proj-table th { text-align: left; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.proj-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.proj-table-total td { border-top: 2px solid var(--border); border-bottom: none; }
.proj-cost-compare { margin-top: 10px; font-size: 0.85rem; color: var(--text-secondary); }

@media (max-width: 640px) {
    .proj-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .proj-card-meta { flex-wrap: wrap; }
    .proj-detail-header { flex-direction: column; }
    .proj-filters { flex-direction: column; }
    .proj-filter-group { width: 100%; }
    .proj-filter-group .form-input { max-width: none !important; flex: 1; }
    .proj-stage-actions { flex-direction: column; align-items: flex-start; }
    .proj-progress-label { font-size: 0.55rem; }
    .proj-board { gap: 10px; }
    .proj-board-col { min-width: 200px; }
}

/* ================================================================
   PHASE 4: USERS & SETTINGS STYLES
   ================================================================ */

/* ── User Cards ── */
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.user-avatar-lg {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.5rem; flex-shrink: 0;
}
.user-inactive { opacity: 0.55; }
.user-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.user-info-item {
    display: flex; flex-direction: column; gap: 2px;
}
.user-info-item label {
    font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.user-info-item span { font-size: 0.9rem; color: var(--text-primary); }
@media (max-width: 640px) { .user-info-grid { grid-template-columns: 1fr; } }

/* ── Settings ── */
.settings-page { max-width: 900px; }
.settings-tabs {
    display: flex; gap: 4px; margin-bottom: 24px;
    border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.settings-tab {
    padding: 10px 18px; border: none; background: none;
    font-family: var(--font); font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: all 0.15s;
}
.settings-tab:hover { color: var(--text-primary); }
.settings-tab.active {
    color: var(--primary); border-bottom-color: var(--primary);
}
.settings-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -14px 0 22px; }
.settings-subtab {
    padding: 6px 14px; border: none; background: var(--bg-hover);
    font-family: var(--font); font-size: 0.82rem; font-weight: 600;
    color: var(--text-secondary); cursor: pointer; border-radius: 16px; transition: all 0.15s;
}
.settings-subtab:hover { color: var(--text-primary); }
.settings-subtab.active { background: var(--primary); color: #fff; }

/* ================================================================
   PHASE 5: INVENTORY STYLES
   ================================================================ */

.inv-alert {
    padding: 12px 18px; border-radius: 10px; margin-bottom: 20px;
    background: #EF444415; border: 1px solid #EF444440; color: #EF4444;
    font-size: 0.85rem;
}
.inv-low { border-left: 3px solid #EF4444 !important; }
.inv-qty-display { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.inv-qty { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.inv-qty-low { color: #EF4444 !important; }
.inv-unit { font-size: 0.72rem; color: var(--text-secondary); text-transform: capitalize; }
.inv-qty-hero {
    display: flex; flex-direction: column; align-items: center;
    padding: 16px 24px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px;
}
.inv-qty-big { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); line-height: 1; }

/* ================================================================
   PHASE 7: REPORTS & ANALYTICS STYLES
   ================================================================ */

.rpt-overview-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.rpt-big-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; display: flex; flex-direction: column; gap: 4px;
}
.rpt-big-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.rpt-big-num { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; white-space: nowrap; max-width: 100%; overflow: hidden; }
.rpt-big-sub { font-size: 0.82rem; color: var(--text-secondary); }
.rpt-big-change { font-size: 0.82rem; font-weight: 600; }
.rpt-up { color: #10B981; }
.rpt-down { color: #EF4444; }

.rpt-section-row { display: flex; gap: 20px; margin-bottom: 24px; }
@media (max-width: 800px) { .rpt-section-row { flex-direction: column; } }

/* Bar Chart */
.rpt-chart { min-height: 200px; }
.rpt-bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; }
.rpt-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.rpt-bar-value { font-size: 0.68rem; color: var(--text-secondary); white-space: nowrap; }
.rpt-bar-track { flex: 1; width: 100%; max-width: 48px; background: var(--bg-hover); border-radius: 4px 4px 0 0; position: relative; display: flex; align-items: flex-end; }
.rpt-bar-track .rpt-bar-fill { width: 100%; border-radius: 4px 4px 0 0; transition: height 0.4s ease; min-height: 2px; }
.rpt-bar-label { font-size: 0.68rem; color: var(--text-secondary); white-space: nowrap; }

/* Horizontal bars */
.rpt-breakdown { display: flex; flex-direction: column; gap: 12px; }
.rpt-breakdown-row { display: flex; flex-direction: column; gap: 4px; }
.rpt-breakdown-label { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.rpt-breakdown-value { font-size: 0.82rem; color: var(--text-secondary); }
.rpt-bar { height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.rpt-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* ================================================================
   WHATSAPP PANEL — DOCKED SIDEBAR
   ================================================================ */

.wa-panel {
    width: 0; height: 100vh; overflow: hidden;
    background: var(--bg-card); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: width 0.25s ease;
}
.wa-panel.wa-open { width: 320px; }
.wa-panel-loading { display: flex; align-items: center; justify-content: center; height: 200px; }

.wa-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    background: #075E54; color: #fff; flex-shrink: 0;
}
.wa-header strong { font-size: 0.95rem; }
.wa-icon-btn {
    background: rgba(255,255,255,0.15); border: none; color: #fff;
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.wa-icon-btn:hover { background: rgba(255,255,255,0.25); }

.wa-popout-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 12px 16px; padding: 10px; border-radius: 8px;
    background: #25D366; color: #fff; border: none;
    font-weight: 600; font-size: 0.85rem; cursor: pointer;
    font-family: var(--font); transition: background 0.15s;
}
.wa-popout-btn:hover { background: #1DA851; }

.wa-section-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-secondary);
    padding: 12px 16px 6px;
}

.wa-templates {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px;
}
.wa-tmpl-btn {
    padding: 6px 10px; border-radius: 16px; font-size: 0.75rem;
    background: var(--bg-hover); border: 1px solid var(--border);
    color: var(--text-primary); cursor: pointer; font-family: var(--font);
    transition: all 0.15s; white-space: nowrap;
}
.wa-tmpl-btn:hover { border-color: #25D366; color: #25D366; }

.wa-search {
    margin: 0 16px 8px; padding: 8px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-surface);
    color: var(--text-primary); font-family: var(--font); font-size: 0.82rem;
    width: calc(100% - 32px);
}
.wa-search:focus { outline: none; border-color: #25D366; }

.wa-contacts { flex: 1; overflow-y: auto; }
.wa-contact {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; cursor: pointer; transition: background 0.1s;
}
.wa-contact:hover { background: var(--bg-hover); }
.wa-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: #25D366;
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.wa-contact-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wa-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-phone { font-size: 0.75rem; color: var(--text-secondary); }

@media (max-width: 768px) {
    .wa-panel { position: fixed; top: 0; right: -100%; width: 100%; z-index: 150; transition: right 0.25s ease; }
    .wa-panel.wa-open { right: 0; width: 100%; }
}

/* Product card images */
.product-card-img { width: 100%; height: 160px; border-radius: 8px 8px 0 0; overflow: hidden; cursor: pointer; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-noimg { font-size: 2.5rem; opacity: 0.4; }
.product-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.product-card .product-card-body { padding: 12px 12px 0; }

/* Project team avatars */
.proj-team-avatars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.proj-team-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-hover); border-radius: 16px; padding: 4px 10px 4px 4px; font-size: 0.8rem; }
.proj-team-chip .av { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }

/* ── Reports & tabs: mobile-friendly ── */
.settings-tabs { flex-wrap: wrap; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
    .rpt-overview-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
    .rpt-big-card { padding: 14px; }
    .rpt-big-num { font-size: 1.4rem; }
    .rpt-bars { overflow-x: auto; padding-bottom: 6px; }
    .rpt-bar-col { min-width: 44px; }
    .rpt-bar-value { font-size: 0.6rem; }
    .settings-tab { padding: 10px 14px; }
}

/* ── Invoice / quote line editor (cleaner, faster entry) ── */
.inv-line{border:1px solid var(--border);border-radius:10px;padding:12px;margin-bottom:10px}
.inv-line-top{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.inv-line-item{flex:1;font-weight:600}
.inv-line-x{background:transparent;border:none;color:var(--text-secondary);font-size:1rem;cursor:pointer;padding:6px 10px;border-radius:6px;line-height:1}
.inv-line-x:hover{background:rgba(239,68,68,.15);color:#EF4444}
.inv-line-desc{margin-bottom:8px;font-size:.9rem}
.inv-line-nums{display:grid;grid-template-columns:1fr 1fr 1fr 1.3fr;gap:8px}
.inv-num{display:flex;flex-direction:column;gap:3px;font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:var(--text-secondary)}
.inv-num .form-input{text-transform:none;font-size:.95rem}
.inv-totals{display:inline-block;min-width:240px}
.inv-tot-row{display:flex;justify-content:space-between;gap:24px;padding:3px 0;color:var(--text-secondary);font-size:.9rem}
.inv-tot-row span:last-child{color:var(--text-primary,#fff);font-weight:600}
.inv-tot-grand{border-top:1px solid var(--border);margin-top:6px;padding-top:8px;font-size:1.15rem}
.inv-tot-grand span:last-child{font-weight:800}
@media(max-width:640px){.inv-line-nums{grid-template-columns:1fr 1fr}}

/* ── Public splash (pre-auth landing + catalog) ── */
#authScreen:has(.splash),
#authScreen:has(.landing-page){display:block;align-items:stretch;justify-content:flex-start;padding:0;overflow-y:auto;overflow-x:hidden;background:transparent}
.splash{width:100%;max-width:1160px;margin:0 auto;padding:0 20px 70px;text-align:left}
.splash-nav{position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0;margin-bottom:8px;background:rgba(10,10,14,.6);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.splash-brand{display:flex;align-items:center;gap:12px}
.splash-logo{font-size:1.2rem;width:46px;height:46px;display:flex;align-items:center;justify-content:center}
.splash-name{font-size:1.2rem;font-weight:800;line-height:1.05}
.splash-tag{font-size:.78rem;color:var(--text-secondary)}

/* hero */
.splash-hero{position:relative;overflow:hidden;border:1px solid var(--border);border-radius:24px;background:linear-gradient(135deg,var(--bg-hover,rgba(255,255,255,.05)),var(--bg-surface,rgba(255,255,255,.01)));margin:6px 0 34px}
.splash-hero::before{content:"";position:absolute;inset:0;background:radial-gradient(680px 340px at 86% -22%,var(--primary,#6366f1),transparent 68%);opacity:.22;pointer-events:none}
.splash-hero::after{content:"";position:absolute;left:-10%;bottom:-40%;width:50%;height:120%;background:radial-gradient(closest-side,var(--primary,#6366f1),transparent);opacity:.08;pointer-events:none}
.splash-hero-inner{position:relative;padding:60px 40px;max-width:720px}
.splash-eyebrow{display:inline-block;font-size:.74rem;letter-spacing:.14em;text-transform:uppercase;color:var(--primary,#9b9bff);font-weight:700;margin-bottom:14px}
.splash-hero h1{font-size:2.7rem;line-height:1.08;margin:0 0 16px;font-weight:800;letter-spacing:-.01em}
.splash-hero p{font-size:1.05rem;color:var(--text-secondary);margin:0 0 18px;max-width:580px;line-height:1.55}
.splash-tags{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 24px}
.splash-pill{font-size:.78rem;font-weight:600;padding:6px 12px;border:1px solid var(--border);border-radius:999px;background:rgba(255,255,255,.04);color:var(--text-secondary)}
.splash-hero-cta{display:flex;gap:10px;flex-wrap:wrap}

/* sections */
.splash-section{margin-top:50px}
.splash-section>h2{font-size:1.6rem;margin:0 0 4px;letter-spacing:-.01em}
.splash-section .sec-sub{color:var(--text-secondary);margin:0 0 20px}

/* shop-by-category tiles */
.cat-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.cat-tile{display:flex;flex-direction:column;text-align:left;padding:0;border:1px solid var(--border);border-radius:16px;overflow:hidden;background:var(--bg-surface,rgba(255,255,255,.02));cursor:pointer;transition:transform .15s,border-color .15s,box-shadow .15s}
.cat-tile:hover{transform:translateY(-3px);border-color:var(--primary,#6366f1);box-shadow:0 10px 30px rgba(0,0,0,.25)}
.cat-tile-img{height:120px;background:var(--bg-hover,rgba(255,255,255,.03));display:flex;align-items:center;justify-content:center;overflow:hidden}
.cat-tile-img img{width:100%;height:100%;object-fit:cover}
.cat-tile-ph{font-size:2.4rem;opacity:.6}
.cat-tile-body{padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.cat-tile-name{font-weight:700}
.cat-tile-count{font-size:.78rem;color:var(--text-secondary)}

/* why-us feature cards */
.splash-features{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.splash-feature{border:1px solid var(--border);border-radius:16px;padding:22px;background:var(--bg-surface,rgba(255,255,255,.02))}
.splash-feature .fi{font-size:1.8rem;line-height:1}
.splash-feature h3{margin:12px 0 5px;font-size:1.02rem}
.splash-feature p{margin:0;color:var(--text-secondary);font-size:.88rem;line-height:1.45}

/* catalog filters */
.splash-filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}
.splash-filters .form-input{max-width:280px}

/* about story */
.about-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:22px}
.about-item h3{margin:0 0 6px;font-size:1.05rem;color:var(--primary,#9b9bff)}
.about-item p{margin:0;color:var(--text-secondary);line-height:1.55}

/* testimonials */
.testi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.testi{border:1px solid var(--border);border-radius:16px;padding:20px;background:var(--bg-surface,rgba(255,255,255,.02))}
.testi-stars{color:#f5b301;letter-spacing:2px;margin-bottom:8px}
.testi-quote{margin:0 0 12px;line-height:1.5;font-style:italic}
.testi-by{font-size:.85rem;color:var(--text-secondary);font-weight:600}

/* client logos */
.client-logos{display:flex;flex-wrap:wrap;gap:24px;align-items:center}
.client-logos img{height:42px;width:auto;object-fit:contain;filter:grayscale(1) brightness(1.6);opacity:.7;transition:filter .2s,opacity .2s}
.client-logos img:hover{filter:none;opacity:1}

/* closing CTA + contact */
.splash-cta{text-align:center;border:1px solid var(--border);border-radius:20px;padding:42px 24px;margin-top:50px;background:linear-gradient(135deg,var(--bg-hover,rgba(255,255,255,.04)),var(--bg-surface,rgba(255,255,255,.01)))}
.splash-cta h2{margin:0 0 6px;font-size:1.5rem}
.splash-cta p{color:var(--text-secondary);margin:0 auto 18px;max-width:520px}
.splash-contact{margin-top:50px;border-top:1px solid var(--border);padding-top:28px}
.splash-contact-grid{display:flex;flex-wrap:wrap;gap:30px;margin-bottom:16px}
.splash-contact-grid>div{display:flex;flex-direction:column;gap:2px}
.ct-label{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--text-secondary)}
.splash-contact a{color:var(--primary,#9b9bff);text-decoration:none;font-weight:600}
.splash-social{display:flex;gap:18px;margin-bottom:14px}
.splash-social a{color:var(--text-secondary);text-decoration:none;font-size:.88rem;font-weight:600}
.splash-social a:hover{color:var(--primary,#9b9bff)}
.splash-foot{color:var(--text-secondary);font-size:.8rem}

/* product detail (public) */
.pd-gallery{margin-bottom:14px}
.pd-main{width:100%;max-height:340px;object-fit:contain;border:1px solid var(--border);border-radius:14px;background:var(--bg-surface,rgba(0,0,0,.2));cursor:zoom-in}
.pd-thumbs{display:flex;gap:8px;overflow-x:auto;margin-top:8px;padding-bottom:4px}
.pd-thumb{height:62px;width:62px;flex:0 0 auto;object-fit:cover;border-radius:8px;border:1px solid var(--border);cursor:pointer;opacity:.55;transition:opacity .15s}
.pd-thumb.active,.pd-thumb:hover{opacity:1;border-color:var(--primary,#6366f1)}
.pd-noimg{text-align:center;font-size:3rem;padding:24px}
.pd-cat{color:var(--text-secondary);margin:0 0 6px;font-size:.85rem}
.pd-desc{margin:0 0 12px;line-height:1.5}
.pd-options{margin-top:6px}
.pd-opts-label{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--text-secondary);margin-bottom:6px}
.pd-price-box{margin-top:14px;padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--bg-surface,rgba(255,255,255,.02))}
.pd-price-box>span{font-size:.8rem;color:var(--text-secondary)}
.pd-price{font-size:1.7rem;font-weight:800;line-height:1.1;margin:2px 0}
.pd-unit{font-size:.8rem;color:var(--text-secondary)}
.pd-turn{margin-top:10px;color:var(--text-secondary);font-size:.85rem}
.pd-note{margin-top:10px;font-size:.85rem;color:var(--text-secondary)}

@media(max-width:640px){
    .splash-hero-inner{padding:42px 22px}
    .splash-hero h1{font-size:1.9rem}
    .splash-section>h2{font-size:1.35rem}
}

/* ── Searchable customer combobox (invoice/quote form) ── */
.cust-combo{position:relative}
.cust-results{position:absolute;top:100%;left:0;right:0;z-index:30;margin-top:4px;max-height:240px;overflow-y:auto;background:var(--bg-surface,#1a1a1f);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.35)}
.cust-result{padding:9px 12px;cursor:pointer;font-size:.92rem}
.cust-result:hover{background:var(--bg-hover,rgba(255,255,255,.06))}
.cust-num{color:var(--text-secondary);font-size:.82rem}
.cust-add{border-top:1px solid var(--border);color:var(--primary,#9b9bff);font-weight:600}

/* ── Read-only product options (clerk view) ── */
.prod-opts-ro{display:flex;flex-direction:column;gap:8px}
.opt-ro-group{font-size:.9rem}
.opt-ro-choices{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}
.opt-ro-choices span{font-size:.8rem;padding:3px 8px;border:1px solid var(--border);border-radius:999px;color:var(--text-secondary)}

/* ── PWA install button + iOS hint ── */
.td-install-btn{position:fixed;right:16px;bottom:16px;z-index:1500;background:var(--primary,#C41E3A);color:#fff;border:none;border-radius:999px;padding:11px 18px;font-weight:700;font-size:.9rem;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.45)}
.td-install-btn:hover{filter:brightness(1.08)}
.td-ios-hint{position:fixed;left:12px;right:12px;bottom:12px;z-index:1500;display:flex;align-items:center;gap:12px;justify-content:space-between;background:#15151b;border:1px solid var(--border);border-radius:12px;padding:12px 14px;box-shadow:0 8px 24px rgba(0,0,0,.45);font-size:.88rem}
.td-ios-hint button{background:transparent;border:none;color:var(--text-secondary);font-size:1rem;cursor:pointer;padding:4px 8px;flex:0 0 auto}
@media(min-width:560px){.td-ios-hint{left:auto;right:16px;max-width:360px}}

/* ── Real logo images (splash nav + sidebar) ── */
.splash-logo-img{height:48px;width:auto;display:block}
.sidebar-logo-img{height:30px;width:auto;display:block}

/* ── Dashboard "your takings today" till panel ── */
.till-panel{margin-top:24px;border:1px solid var(--border);border-radius:14px;padding:18px;max-width:420px;background:var(--bg-surface,rgba(255,255,255,.02))}
.till-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.till-head h3{margin:0;font-size:1.05rem}
.till-count{font-size:.8rem;color:var(--text-secondary)}
.till-rows{display:flex;flex-direction:column;gap:6px}
.till-row{display:flex;justify-content:space-between;font-size:.92rem;color:var(--text-secondary)}
.till-row span:last-child{color:var(--text-primary,#fff);font-weight:600}
.till-total{border-top:1px solid var(--border);margin-top:6px;padding-top:8px;font-size:1.05rem}
.till-total span:last-child{font-weight:800}
.till-empty{color:var(--text-secondary);font-size:.9rem;margin:0}

/* ── Customer dashboard recent list ── */
.dash-recent{margin-top:28px;max-width:560px}
.dash-recent h3{font-size:1.05rem;margin:0 0 10px}
.dash-recent-list{display:flex;flex-direction:column;gap:8px}
.dash-recent-row{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--border);border-radius:10px;padding:12px 14px;background:var(--bg-surface,rgba(255,255,255,.02))}
.dr-num{font-weight:600}
.dr-date{font-size:.78rem;color:var(--text-secondary)}
.dr-amt{font-weight:700}
.dr-status{font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;font-weight:700}

/* ── Inter-branch settlement report ── */
.rep-settle-controls{display:flex;gap:18px;margin-bottom:16px;flex-wrap:wrap;align-items:center}
.rep-settle-controls input{margin-left:6px}
.rep-settle-note{color:var(--text-secondary);font-size:.88rem;margin:0 0 14px;max-width:660px;line-height:1.5}
.rep-table{width:100%;border-collapse:collapse;font-size:.92rem;max-width:660px}
.rep-table th,.rep-table td{padding:10px 12px;border-bottom:1px solid var(--border);text-align:left}
.rep-table th{color:var(--text-secondary);font-size:.76rem;text-transform:uppercase;letter-spacing:.04em}
.rep-table td:last-child{font-weight:700}

/* ── Project work-items checklist ── */
.wi-count{font-size:.8rem;color:var(--text-secondary)}
.wi-list{display:flex;flex-direction:column;gap:6px}
.work-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;cursor:pointer;background:var(--bg-surface,rgba(255,255,255,.02))}
.work-item input{width:18px;height:18px;flex:0 0 auto;cursor:pointer;accent-color:var(--primary,#C41E3A)}
.work-item.done{border-color:rgba(16,185,129,.4)}
.work-item.done .wi-desc{text-decoration:line-through;color:var(--text-secondary)}
.wi-qty{font-weight:700;color:var(--text-secondary);font-size:.85rem;white-space:nowrap}
.wi-desc{flex:1}
.wi-by{font-size:.74rem;color:#10B981;font-weight:600;white-space:nowrap}

/* ── Print mode picker ── */
.print-modes{display:flex;flex-direction:column;gap:10px}
.print-mode{display:flex;align-items:center;gap:14px;width:100%;text-align:left;padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--bg-surface,rgba(255,255,255,.02));color:inherit;cursor:pointer;transition:border-color .15s,background .15s}
.print-mode:hover{border-color:var(--primary,#C41E3A);background:rgba(196,30,58,.06)}
.print-mode .pm-ico{font-size:24px;flex:0 0 auto}
.print-mode .pm-txt{display:flex;flex-direction:column}
.print-mode .pm-txt strong{font-size:.96rem}
.print-mode .pm-txt small{color:var(--text-secondary);font-size:.78rem}

/* ── Banner slide manager (Settings) ── */
.banner-admin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.banner-admin-item{position:relative;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--bg-surface,rgba(255,255,255,.02))}
.banner-admin-item.inactive{opacity:.55}
.banner-admin-thumb{height:90px;background-size:cover;background-position:center;background-color:#222}
.banner-admin-hidden{position:absolute;top:8px;left:8px;background:rgba(0,0,0,.7);color:#fff;font-size:.7rem;padding:2px 8px;border-radius:20px}
.banner-admin-actions{display:flex;gap:2px;padding:6px;flex-wrap:wrap;justify-content:center}

/* ── "Our Clients" ticker ── */
.lp-clients{background:#f3f4f6;padding:2.75rem 2rem}
.lp-clients-head{text-align:center;color:#6b7280;font-size:.8rem;text-transform:uppercase;letter-spacing:2px;font-weight:600;margin:0 0 1.5rem}
.lp-marquee{overflow:hidden;position:relative;-webkit-mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent)}
.lp-marquee-track{display:flex;align-items:center;gap:3.5rem;width:max-content;animation:lp-marquee-scroll 40s linear infinite}
.lp-marquee:hover .lp-marquee-track{animation-play-state:paused}
.lp-client-logo{height:46px;width:auto;max-width:180px;object-fit:contain;opacity:.85;transition:opacity .2s,transform .2s}
.lp-client-logo:hover{opacity:1;transform:scale(1.05)}
@keyframes lp-marquee-scroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@media (prefers-reduced-motion:reduce){.lp-marquee-track{animation:none;flex-wrap:wrap;justify-content:center;width:auto;gap:2rem 3.5rem}}
@media (max-width:768px){.lp-client-logo{height:34px;max-width:130px}.lp-marquee-track{gap:2.5rem}}
.client-admin-thumb{height:80px;display:flex;align-items:center;justify-content:center;background:#f3f4f6;padding:12px}
.client-admin-thumb img{max-height:100%;max-width:100%;object-fit:contain}

/* ── Notifications (broadcasts) ── */
.notif-badge{position:absolute;top:-4px;right:-4px;background:var(--primary);color:#fff;font-size:.65rem;font-weight:700;min-width:18px;height:18px;padding:0 4px;border-radius:9px;display:flex;align-items:center;justify-content:center}
.notif-panel{position:fixed;top:60px;right:16px;width:340px;max-width:calc(100vw - 24px);max-height:70vh;background:var(--bg-surface,#1a1a1a);border:1px solid var(--border);border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.4);z-index:1000;display:none}
.notif-head{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border);font-weight:700}
.notif-close{background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:1rem}
.notif-list{overflow-y:auto;max-height:calc(70vh - 50px)}
.notif-item{padding:12px 14px;border-bottom:1px solid var(--border)}
.notif-item.unread{background:rgba(220,38,38,.06)}
.notif-item-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.notif-tag{font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:2px 8px;border-radius:20px}
.notif-tag.news{background:rgba(59,130,246,.15);color:#60a5fa}
.notif-tag.deal{background:rgba(220,38,38,.15);color:#f87171}
.notif-date{font-size:.7rem;color:var(--text-secondary)}
.notif-title{font-weight:700;font-size:.92rem;margin-bottom:2px}
.notif-body{font-size:.85rem;color:var(--text-secondary);white-space:pre-wrap;line-height:1.45}
.notif-cta{display:inline-block;margin-top:8px;font-size:.82rem;font-weight:600;color:var(--primary);text-decoration:none}
.notif-empty{padding:28px 14px;text-align:center;color:var(--text-secondary)}
.bc-row{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--border)}
.bc-row.inactive{opacity:.55}
@media (max-width:520px){.notif-panel{top:54px;right:8px;left:8px;width:auto}}

/* ── Client My Invoices ── */
.client-due-banner{background:rgba(220,38,38,.08);border:1px solid rgba(220,38,38,.25);border-radius:10px;padding:12px 14px;margin-bottom:14px;font-size:.92rem;color:var(--text-primary,#e5e7eb)}
.client-due-banner strong{color:#dc2626}

/* ── Cart payment options ── */
.pay-method-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:6px}
.pay-opt{display:flex;flex-direction:column;gap:2px;padding:10px 30px 10px 12px;border:1px solid var(--border);border-radius:10px;cursor:pointer;position:relative}
.pay-opt:has(input:checked){border-color:var(--primary);background:rgba(220,38,38,.06)}
.pay-opt input{position:absolute;top:10px;right:10px}
.pay-opt span{font-weight:600;font-size:.9rem}
.pay-opt small{color:var(--text-secondary);font-size:.75rem}
.cart-bank-wrap{margin-top:10px}
.cart-bank-card{border:1px solid var(--border);border-radius:10px;padding:12px 14px;background:var(--bg-surface,rgba(255,255,255,.02))}
.cart-bank-title{font-weight:700;margin-bottom:8px}
.cart-bank-row{display:flex;justify-content:space-between;gap:12px;padding:3px 0;font-size:.9rem}
.cart-bank-row span{color:var(--text-secondary)}
.cart-bank-note{margin-top:8px;font-size:.8rem;color:var(--text-secondary)}
.cart-bank-empty{border:1px dashed var(--border);border-radius:10px;padding:12px;font-size:.85rem;color:var(--text-secondary)}
@media (max-width:520px){.pay-method-grid{grid-template-columns:1fr}}

/* notification type tags */
.notif-tag.order{background:rgba(16,185,129,.15);color:#34d399}
.notif-tag.assignment{background:rgba(245,158,11,.15);color:#fbbf24}
.notif-tag.note{background:rgba(59,130,246,.18);color:#60a5fa}
/* Blue badge = a notification directed at YOU (note, assignment, your order).
   Red (default) = general announcements / deals. */
.notif-badge.personal{background:#3B82F6}
.notif-item.personal{border-left:3px solid #3B82F6;padding-left:9px}
/* Staff activity (audit trail) */
.activity-list{display:flex;flex-direction:column}
.activity-row{display:grid;grid-template-columns:155px 1fr 1.4fr;gap:10px;padding:8px 6px;border-bottom:1px solid var(--border);font-size:.85rem;align-items:baseline}
.activity-row.ooh{background:rgba(245,158,11,.06)}
.activity-when{color:var(--text-secondary);white-space:nowrap}
.activity-who{font-weight:600}
.activity-what .muted{font-weight:400}
.ooh-tag{display:inline-block;background:rgba(245,158,11,.18);color:#f59e0b;font-size:.65rem;font-weight:700;padding:1px 6px;border-radius:10px;margin-left:4px}
@media (max-width:640px){.activity-row{grid-template-columns:1fr;gap:2px;padding:10px 6px}}

/* auth confirm-email screen */
.auth-confirm{text-align:center}
.auth-confirm-icon{font-size:40px;margin-bottom:2px}

/* Staff: attach customer in cart */
.cart-customer{max-width:500px;margin-bottom:16px;border:1px solid var(--border);border-radius:10px;padding:12px 14px;background:rgba(220,38,38,.04)}
.cart-customer>label{font-weight:600;display:block;margin-bottom:6px}
.cart-cust-hint{font-size:.78rem;color:var(--text-secondary);margin:6px 0 0}
.cart-cust-picked{display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:600}
.cart-cust-results{margin-top:4px}
.cart-cust-opt{padding:8px 10px;border:1px solid var(--border);border-top:none;cursor:pointer;font-size:.88rem}
.cart-cust-opt:first-child{border-top:1px solid var(--border);border-radius:6px 6px 0 0}
.cart-cust-opt:last-child{border-radius:0 0 6px 6px}
.cart-cust-opt:hover{background:rgba(220,38,38,.06)}
.cart-cust-none,.cart-cust-none:hover{cursor:default;color:var(--text-secondary);background:transparent}

/* Product option choice reordering */
.opt-drag{cursor:grab;user-select:none;color:var(--text-secondary);font-size:1.05rem;padding:0 2px;margin-bottom:9px;line-height:1}
.opt-drag:active{cursor:grabbing}
.opt-choice-row.opt-drop{outline:2px dashed var(--primary);outline-offset:2px;border-radius:6px}
.opt-move{display:flex;flex-direction:column;margin-bottom:6px}
.opt-move button{padding:0 6px;min-height:0;line-height:1.15;font-size:.7rem}
.opt-move button:disabled{opacity:.3;cursor:default}

/* ── Client portal: Membership & FAQ ── */
.mb-hero { display:flex; align-items:center; gap:16px; padding:18px 20px; border-radius:14px; background:var(--bg-hover); border:1px solid var(--border); margin-bottom:18px; }
.mb-hero-active { background:linear-gradient(135deg, rgba(212,21,55,0.14), rgba(212,21,55,0.04)); border-color:rgba(212,21,55,0.35); }
.mb-hero-badge { font-size:2.4rem; line-height:1; color:var(--primary); }
.mb-hero-label { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-secondary); }
.mb-hero-name { font-size:1.5rem; font-weight:800; margin:2px 0; }
.mb-hero-disc { color:var(--text-secondary); font-size:.92rem; }
.mb-perks { list-style:none; padding:0; margin:6px 0 0; display:flex; flex-direction:column; gap:6px; }
.mb-perks li { position:relative; padding-left:22px; font-size:.92rem; }
.mb-perks li::before { content:"✓"; position:absolute; left:0; color:var(--primary); font-weight:800; }
.mb-deals { display:flex; flex-direction:column; gap:6px; }
.mb-deal-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:var(--bg-hover); }
.mb-deal-name { font-weight:600; }
.mb-deal-pct { color:var(--primary); font-weight:700; white-space:nowrap; }
.mb-deal-price { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.mb-deal-was { color:var(--text-secondary); text-decoration:line-through; font-size:.86rem; }
.mb-deal-now { font-weight:700; font-size:1.02rem; white-space:nowrap; }
.mb-deal-wrap { border:1px solid var(--border); border-radius:10px; background:var(--bg-hover); overflow:hidden; }
.mb-deal-wrap .mb-deal-row { border:none; border-radius:0; background:transparent; }
.mb-deal-clickable { cursor:pointer; }
.mb-deal-clickable:hover { background:var(--bg-surface); }
.mb-deal-chev { color:var(--primary); font-size:.8rem; }
.mb-deal-opts { padding:4px 14px 12px; border-top:1px dashed var(--border); }
.mb-opt-grp { font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; color:var(--text-secondary); margin:10px 0 4px; }
.mb-opt-row { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:4px 0; }
.mb-deals { gap:8px; }
.mb-ladder { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.mb-tier { border:1px solid var(--border); border-radius:12px; padding:14px; background:var(--bg-hover); }
.mb-tier-cur { border-color:var(--primary); box-shadow:0 0 0 1px var(--primary) inset; }
.mb-tier-top { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.mb-tier-name { font-weight:700; font-size:1.05rem; }
.mb-tier-disc { color:var(--primary); font-weight:700; font-size:.9rem; }
.mb-tier-meta { color:var(--text-secondary); font-size:.82rem; margin:2px 0 8px; }
.mb-tier-tag { margin-top:10px; font-size:.78rem; font-weight:600; color:var(--text-secondary); }
.mb-tier-tag-cur { color:var(--primary); }
.mb-badge { display:inline-block; margin-top:4px; background:rgba(212,21,55,0.14); color:var(--primary); border:1px solid rgba(212,21,55,0.3); border-radius:12px; padding:1px 8px; font-size:.72rem; font-weight:700; }

.faq-list { display:flex; flex-direction:column; gap:8px; }
.faq-item { border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.faq-q { width:100%; text-align:left; background:var(--bg-hover); border:none; color:var(--text-primary); font-family:var(--font); font-size:.95rem; font-weight:600; padding:14px 16px; cursor:pointer; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.faq-caret { transition:transform .15s; color:var(--text-secondary); }
.faq-item.open .faq-caret { transform:rotate(180deg); }
.faq-a { max-height:0; overflow:hidden; padding:0 16px; color:var(--text-secondary); font-size:.92rem; line-height:1.5; transition:all .18s ease; }
.faq-item.open .faq-a { max-height:600px; padding:12px 16px 16px; }

/* ── Live chat ─────────────────────────────────────────── */
.chat-page { max-width: 820px; }
.chat-window { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 380px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); overflow: hidden; }
.chat-note { padding: 8px 14px; font-size: .8rem; color: var(--text-secondary); background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { margin: auto; color: var(--text-secondary); font-size: .9rem; }
.chat-row { display: flex; }
.chat-row.chat-mine { justify-content: flex-end; }
.chat-bubble { max-width: 76%; padding: 8px 12px; border-radius: 14px; background: var(--bg-hover); border: 1px solid var(--border); }
.chat-row.chat-mine .chat-bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.chat-sender { font-size: .72rem; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.chat-text { font-size: .92rem; line-height: 1.45; word-break: break-word; }
.chat-time { font-size: .66rem; opacity: .7; margin-top: 3px; text-align: right; }
.chat-composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.chat-input { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: var(--font); font-size: .92rem; background: var(--bg-card); color: var(--text-primary); max-height: 140px; }
.chat-send { align-self: flex-end; }
/* staff inbox */
.chat-newrow { display: flex; gap: 8px; margin-bottom: 12px; }
.chat-newrow select { flex: 1; }
.chat-inbox { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chat-inbox-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.chat-inbox-row:last-child { border-bottom: 0; }
.chat-inbox-row:hover { background: var(--bg-hover); }
.chat-inbox-row.chat-unread { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.chat-inbox-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.chat-inbox-main { flex: 1; min-width: 0; }
.chat-inbox-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-inbox-name { font-weight: 600; }
.chat-inbox-time { font-size: .72rem; color: var(--text-secondary); white-space: nowrap; }
.chat-inbox-preview { font-size: .82rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: 0 0 9px; }
.chat-thread-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chat-thread-name { font-weight: 700; }

/* chat v2: searchable picker, channels, DMs */
.chat-search { position: relative; margin-bottom: 12px; }
.chat-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); overflow: hidden; max-height: 320px; overflow-y: auto; }
.chat-result { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: .9rem; }
.chat-result:last-child { border-bottom: 0; }
.chat-result:hover { background: var(--bg-hover); }
.chat-result-sub { color: var(--text-secondary); font-size: .8rem; }
.chat-result-empty { color: var(--text-secondary); cursor: default; }
.chat-channels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chat-channel { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: .85rem; font-weight: 600; cursor: pointer; }
.chat-channel:hover { background: var(--bg-hover); }
.chat-channel.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chat-dm-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.chat-dm-row:last-child { border-bottom: 0; }
.chat-dm-row:hover { background: var(--bg-hover); }

/* chat unread nav badge */
.sidebar-nav-item { position: relative; }
.nav-badge { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg-card); }

/* chat unread highlights: tabs, channel pills, dm rows */
.settings-subtab { position: relative; }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; margin-left: 7px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-size: .66rem; font-weight: 800; vertical-align: middle; }
.settings-subtab.active .tab-badge { background: #fff; color: var(--primary); }
.chat-channel { position: relative; }
.chat-mini-badge { display: inline-flex; align-items: center; justify-content: center; margin-left: 7px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-size: .66rem; font-weight: 800; }
.chat-channel.active .chat-mini-badge { background: #fff; color: var(--primary); }
.chat-dm-row { position: relative; }
.chat-dm-row .chat-dot { margin-left: auto; }

/* ── Desktop chat dock (optional pop-out, collapsible) ───────────────── */
.td-chat-dock { position: fixed; right: 22px; bottom: 22px; z-index: 950; }
.tcd-launch { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; box-shadow: var(--shadow-md); display: flex; align-items: center; justify-content: center; position: relative; transition: filter .15s, transform .15s; }
.tcd-launch:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tcd-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: var(--primary); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--primary); }
.tcd-panel { position: absolute; right: 0; bottom: 0; width: 380px; height: 560px; max-height: 80vh; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 55px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden; }
.tcd-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--primary); color: #fff; flex: 0 0 auto; }
.tcd-title { font-weight: 800; font-size: 15px; }
.tcd-actions { display: flex; gap: 5px; }
.tcd-ico { background: rgba(255,255,255,.18); border: none; color: #fff; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.tcd-ico:hover { background: rgba(255,255,255,.32); }
.tcd-body { flex: 1; min-height: 0; overflow: hidden; padding: 12px 14px; display: flex; flex-direction: column; }
.tcd-body > #chatBody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tcd-tabs { flex: 0 0 auto; }
/* compact, panel-fitted thread + lists */
.tcd-body .chat-window { height: auto; flex: 1; min-height: 0; border: 0; border-radius: 0; background: transparent; }
.tcd-body .chat-messages { padding: 8px 2px; }
.tcd-body .chat-composer { padding: 8px 0 2px; background: transparent; }
.tcd-body .chat-thread-head { flex: 0 0 auto; }
.tcd-body .chat-search { flex: 0 0 auto; }
.tcd-body .chat-inbox { flex: 1; min-height: 0; overflow-y: auto; }
.tcd-body .chat-channels { flex: 0 0 auto; }
.tcd-body #chatChanBody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dock-toggle-btn { white-space: nowrap; }
@media (max-width: 1023px) { .td-chat-dock { display: none !important; } .dock-toggle-btn { display: none !important; } }

/* ── Chat attachments ──────────────────────────────────────────────── */
.chat-composer { align-items: flex-end; }
.chat-attach-btn { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding: 8px; border-radius: 8px; display: flex; align-items: center; flex: 0 0 auto; }
.chat-attach-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.chat-attach-chips { flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
.chat-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px 4px 10px; font-size: 12px; max-width: 220px; }
.chat-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-chip-size { color: var(--text-secondary); font-size: 11px; flex: 0 0 auto; }
.chat-chip-x { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.chat-chip-x:hover { color: #EF4444; }
.chat-atts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.chat-att-img-link { display: inline-block; }
.chat-att-img { max-width: 240px; max-height: 240px; border-radius: 10px; display: block; background: var(--bg-hover); object-fit: cover; }
.chat-att-file { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; max-width: 240px; }
.chat-att-file:hover { background: var(--bg-surface); }
.chat-att-ico { font-size: 18px; flex: 0 0 auto; }
.chat-att-meta { display: flex; flex-direction: column; min-width: 0; }
.chat-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-att-size { font-size: 11px; color: var(--text-secondary); }

/* ── Staff "your assigned work" dashboard ──────────────────────────── */
.dash-section-title { margin: 26px 0 12px; font-size: 1.05rem; }
.dash-jobs { display: flex; flex-direction: column; gap: 8px; }
.dash-job { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: background .12s, border-color .12s; }
.dash-job:hover { background: var(--bg-hover); border-color: var(--primary); }
.dash-job-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-job-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-job-cust { font-size: .82rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-job-meta { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.dash-job-stage { font-size: .76rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.dash-job-due { font-size: .8rem; color: var(--text-secondary); white-space: nowrap; }
.dash-job-due.overdue { color: #EF4444; font-weight: 600; }

/* ── Project notes (internal + client-facing) ──────────────────────── */
.proj-notes-tabs { display: flex; gap: 6px; margin: 4px 0 8px; }
.proj-notes { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.proj-note { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-surface); }
.proj-note.is-internal { border-left: 3px solid #F59E0B; }
.proj-note.is-external { border-left: 3px solid var(--primary); }
.proj-note-head { display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; color: var(--text-secondary); margin-bottom: 3px; }
.proj-note-author { font-weight: 600; color: var(--text-primary); }
.proj-note-body { font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.proj-note-compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.proj-note-compose textarea { flex: 1; }

/* ── Reports / performance filters ─────────────────────────────────── */
.rep-filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.rep-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-preset { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.rep-preset:hover { background: var(--bg-hover); }
.rep-preset.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.rep-daterange { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.rep-daterange input { margin-left: 5px; }
.rep-rolefilter select { min-width: 150px; text-transform: capitalize; }
.rpt-big-sub { display: block; font-size: .72rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Projects status segment ───────────────────────────────────────── */
.proj-status-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.proj-status-seg .pss-btn { border: none; background: transparent; color: var(--text-secondary); padding: 7px 16px; cursor: pointer; font-size: 13px; font-weight: 600; }
.proj-status-seg .pss-btn:not(:last-child) { border-right: 1px solid var(--border); }
.proj-status-seg .pss-btn:hover { background: var(--bg-hover); }
.proj-status-seg .pss-btn.active { background: var(--primary); color: #fff; }

/* ── Customer tier-count chips ──────────────────────────────────────── */
.cust-tier-counts { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.cust-tier-chip { background:var(--bg-card); border:1px solid var(--border); color:var(--text-secondary); border-radius:999px; padding:5px 12px; font-size:12px; cursor:pointer; }
.cust-tier-chip:hover { background:var(--bg-hover); border-color:var(--primary); }
.cust-tier-chip strong { color:var(--text-primary); }
.cust-tier-chip-muted strong { color:var(--text-secondary); }

/* Products / Customers / Staff: responsive multi-column grid on wider screens (single column on mobile) */
.prod-grid, .cust-grid, .user-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 880px)  { .prod-grid, .cust-grid, .user-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .prod-grid, .cust-grid, .user-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prod-grid .page-empty, .cust-grid .page-empty, .user-grid .page-empty,
.cust-grid .proj-empty-note, .user-grid .proj-empty-note { grid-column: 1 / -1; }

/* ── Dashboard analytics ── */
.dash-analytics{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:16px;margin-top:22px}
.dash-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px;min-width:0}
.dash-card.dash-card-wide{grid-column:1 / -1}
@media(min-width:900px){.dash-card.dash-card-wide{grid-column:span 2}}
.dash-card h3{margin:0 0 2px;font-size:.98rem;color:var(--text-primary)}
.dash-card .dash-card-sub{color:var(--text-secondary);font-size:.78rem;margin-bottom:14px}
.dash-delta{font-size:.7rem;font-weight:700;padding:1px 6px;border-radius:6px;vertical-align:middle}
.dash-delta.up{color:#10B981;background:rgba(16,185,129,.14)}
.dash-delta.down{color:#EF4444;background:rgba(239,68,68,.14)}
.dash-donut-wrap{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.dash-legend{display:flex;flex-direction:column;gap:7px;flex:1;min-width:130px}
.dash-legend-row{display:flex;align-items:center;justify-content:space-between;font-size:.8rem;gap:10px}
.dash-legend-row .ll,.dash-top-row .ll,.dash-hbar-row .ll{display:flex;align-items:center;gap:7px;min-width:0}
.dash-dot{width:10px;height:10px;border-radius:3px;flex-shrink:0;display:inline-block}
.dash-hbar{display:flex;flex-direction:column;gap:11px}
.dash-hbar-row .hb-top{display:flex;justify-content:space-between;align-items:center;font-size:.8rem;margin-bottom:4px;gap:10px}
.dash-hbar-track{height:8px;background:var(--bg-hover);border-radius:5px;overflow:hidden}
.dash-hbar-fill{height:100%;border-radius:5px;transition:width .3s ease}
.dash-top-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid var(--border);font-size:.85rem;gap:10px}
.dash-top-row:last-child{border-bottom:none}
.dash-rank{width:18px;color:var(--text-secondary);font-weight:700;text-align:center}
.till-panel.till-flush{background:transparent;border:none;padding:0;margin:0}

/* ── ID Card system ── */
.id-tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.id-tpl-card{cursor:pointer;padding:0;overflow:hidden;transition:transform .08s,border-color .12s}
.id-tpl-card:hover{border-color:var(--primary)}
.id-tpl-card:active{transform:scale(.99)}
.id-tpl-thumb{aspect-ratio:1.585/1;background:var(--bg-hover);display:grid;place-items:center;overflow:hidden}
.id-tpl-thumb img{width:100%;height:100%;object-fit:cover}
.id-tpl-thumb span{color:var(--text-secondary);font-size:.85rem}
.id-tpl-meta{padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.id-edit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:16px}
.id-row{display:flex;gap:10px;flex-wrap:wrap}
.id-row .form-group{flex:1;min-width:90px}
.id-bg-row{display:flex;gap:14px;flex-wrap:wrap}
.id-bg-slot{flex:1;min-width:150px;display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.id-bg-slot>span{font-size:.78rem;font-weight:700;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px}
.id-bg-prev{width:100%;aspect-ratio:1.585/1;background:var(--bg-hover);border:1px solid var(--border);border-radius:10px;display:grid;place-items:center;overflow:hidden}
.id-bg-prev img{width:100%;height:100%;object-fit:contain}
.id-bg-prev em{color:var(--text-secondary);font-size:.8rem}
.id-field-list{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.id-field-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;background:var(--bg-hover);border:1px solid var(--border);border-radius:10px}
.id-field-acts{display:flex;gap:2px;flex-shrink:0}
.id-check{display:flex;align-items:center;gap:8px;margin:8px 0;font-size:.9rem}
.id-check input{width:auto}
.id-combo{position:relative}
.id-combo-list{position:absolute;left:0;right:0;top:100%;z-index:40;background:var(--bg-card);border:1px solid var(--border);border-radius:10px;margin-top:4px;max-height:260px;overflow:auto;box-shadow:var(--shadow-md)}
.id-combo-item{padding:10px 12px;cursor:pointer}
.id-combo-item:hover{background:var(--bg-hover)}
.id-combo-empty{padding:10px 12px;color:var(--text-secondary);font-size:.82rem}

/* ── ID layout designer ── */
.idd-topbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.idd-side-toggle{display:inline-flex;border:1px solid var(--border);border-radius:10px;overflow:hidden}
.idd-side-toggle button{padding:8px 16px;background:var(--bg-card);border:none;color:var(--text-secondary);font-weight:700;cursor:pointer}
.idd-side-toggle button.on{background:var(--primary);color:#fff}
.idd-main{display:grid;grid-template-columns:1fr;gap:16px}
@media(min-width:920px){.idd-main{grid-template-columns:1fr 330px;align-items:start}}
.idd-canvas-area{display:flex;justify-content:center}
.idd-canvas{position:relative;width:100%;max-width:660px;aspect-ratio:var(--card-ar,1.585);background:var(--bg-hover) center/100% 100% no-repeat;border:1px solid var(--border);border-radius:8px;container-type:size;overflow:hidden;touch-action:none;user-select:none}
.idd-canvas.no-art{display:grid;place-items:center}
.idd-el{position:absolute;cursor:move;box-sizing:border-box;border:1px dashed transparent}
.idd-el:hover{border-color:rgba(14,165,164,.55)}
.idd-el.sel{border:1.5px solid var(--primary);box-shadow:0 0 0 2px rgba(14,165,164,.25)}
.idd-el-inner{width:100%;height:100%;display:flex;overflow:hidden;pointer-events:none}
.idd-el-handle{position:absolute;right:-8px;bottom:-8px;width:15px;height:15px;background:var(--primary);border:2px solid #fff;border-radius:50%;cursor:nwse-resize;touch-action:none}
.idd-el:not(.sel) .idd-el-handle{display:none}
.idd-txt{width:100%;line-height:1.04;overflow:hidden;white-space:pre-wrap;word-break:break-word}
.idd-photo{width:100%;height:100%;display:grid;place-items:center;background:rgba(255,255,255,.55);color:#000;box-sizing:border-box;overflow:hidden}
.idd-sig{width:100%;height:100%;display:flex;align-items:flex-end;justify-content:center;border-bottom:1.5px solid rgba(0,0,0,.55);color:rgba(0,0,0,.6)}
.idd-code,.idd-qr{width:100%;height:100%;display:grid;place-items:center;background:rgba(255,255,255,.7);color:#000}
.idd-side{display:flex;flex-direction:column;gap:14px}
.idd-pal-chip{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 11px;margin-bottom:7px;background:var(--bg-hover);border:1px solid var(--border);border-radius:9px;cursor:pointer}
.idd-pal-chip:hover{border-color:var(--primary)}
.idd-pal-chip.placed{opacity:.7;cursor:pointer}
.idd-prop-row{display:flex;gap:8px}
.idd-prop-row .form-group{flex:1;margin-bottom:8px}
#iddProps input[type=color]{height:38px;padding:3px}
.id-format-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}
.id-format-row .muted{font-size:.78rem;text-transform:uppercase;letter-spacing:.5px}

/* ── ID records + capture ── */
.id-rec-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border);cursor:pointer}
.id-rec-row:last-child{border-bottom:none}
.id-rec-thumb{width:46px;height:46px;border-radius:8px;background:var(--bg-hover) center/cover no-repeat;display:grid;place-items:center;font-size:1.3rem;flex-shrink:0}
.id-rec-info{flex:1;min-width:0;display:flex;flex-direction:column}
.id-rec-info .muted{font-size:.8rem}
.id-cap{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.id-cap-prev{width:96px;aspect-ratio:.78;background:var(--bg-hover);border:1px solid var(--border);border-radius:8px;display:grid;place-items:center;font-size:1.8rem;overflow:hidden;flex-shrink:0}
.id-cap-prev img{width:100%;height:100%;object-fit:cover}
.id-cap-btns{display:flex;gap:8px;flex-wrap:wrap}
.id-sig-wrap{display:flex;flex-direction:column;gap:8px}
.id-sig-pad{width:100%;max-width:420px;background:#fff;border:1px solid var(--border);border-radius:8px;touch-action:none;cursor:crosshair}
.id-cam{display:flex;justify-content:center;background:#000;border-radius:10px;overflow:hidden}
.id-cam video{width:100%;max-height:60vh}
.id-crop-frame{margin:0 auto;border-radius:8px;overflow:hidden;border:1px solid var(--border);background:#0008;touch-action:none}
.id-crop-frame canvas{display:block;cursor:grab}
.id-preview{display:flex;gap:12px;flex-wrap:wrap;justify-content:center;margin:6px 0 4px}
.id-preview img{max-width:100%;width:340px;height:auto;border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow-md)}
.id-batch-opts{display:flex;flex-direction:column;gap:10px;margin:10px 0}
.id-batch-opts .btn{justify-content:flex-start}

/* Quote sub-tabs + customer-generated markers */
.quote-subtabs { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.qst-pill { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border, rgba(148,163,184,.25)); background: transparent; color: var(--text-secondary); font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.qst-pill:hover { color: var(--text-primary, #fff); }
.qst-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.qst-count { background: rgba(255,255,255,.25); border-radius: 10px; padding: 0 6px; font-size: .72rem; margin-left: 4px; }
.self-quote-badge { display: inline-block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 6px; border-radius: 6px; background: rgba(196,30,58,.16); color: var(--primary); margin-left: 7px; vertical-align: middle; }
.proj-note-snippet { display: block; font-size: .75rem; color: var(--text-secondary); font-style: italic; margin-top: 2px; }

/* Paid-online "new" pulse — pulses until staff acknowledges */
@keyframes tdOnlinePulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); } 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.td-online-pulse { animation: tdOnlinePulse 1.4s ease-in-out infinite; }

/* ── PWA install bar + iOS instructions ─────────────────────────── */
.td-install-bar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 4000;
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-card, #16161a); border: 1px solid var(--border, #2a2a30);
    border-radius: 14px; padding: 12px 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    animation: tdInstallUp .28s ease;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
@keyframes tdInstallUp { from { transform: translateY(120%); opacity: 0; } to { transform: none; opacity: 1; } }
.td-install-icon { font-size: 1.6rem; line-height: 1; }
.td-install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-install-text strong { font-size: .95rem; color: var(--text-primary, #fff); }
.td-install-text span { font-size: .78rem; color: var(--text-secondary, #9ca3af); }
.td-install-cta {
    flex: 0 0 auto; background: var(--primary, #E11D48); color: #fff; border: none;
    border-radius: 9px; padding: 10px 16px; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.td-install-cta:active { transform: scale(.97); }
.td-install-x { flex: 0 0 auto; background: transparent; border: none; color: var(--text-secondary, #9ca3af); font-size: 1rem; cursor: pointer; padding: 6px; }
@media (min-width: 620px) { .td-install-bar { left: auto; right: 20px; bottom: 20px; max-width: 420px; } }

.td-ios-modal {
    position: fixed; inset: 0; z-index: 4100; background: rgba(0,0,0,.6);
    display: flex; align-items: flex-end; justify-content: center; padding: 0;
    animation: tdFadeIn .2s ease;
}
@keyframes tdFadeIn { from { opacity: 0; } to { opacity: 1; } }
.td-ios-card {
    width: 100%; max-width: 460px; background: var(--bg-card, #16161a);
    border: 1px solid var(--border, #2a2a30); border-bottom: none;
    border-radius: 18px 18px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 50px rgba(0,0,0,.6); animation: tdInstallUp .3s ease;
}
@media (min-width: 620px) { .td-ios-modal { align-items: center; } .td-ios-card { border-radius: 18px; border-bottom: 1px solid var(--border, #2a2a30); margin: 16px; } }
.td-ios-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.td-ios-appicon {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px;
    background: var(--primary, #E11D48); color: #fff; font-weight: 800; font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
}
.td-ios-head h3 { margin: 0; font-size: 1.1rem; color: var(--text-primary, #fff); }
.td-ios-head p { margin: 2px 0 0; font-size: .82rem; color: var(--text-secondary, #9ca3af); }
.td-ios-card ol { margin: 4px 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.td-ios-card li { font-size: .92rem; color: var(--text-primary, #eaeaea); line-height: 1.4; }
.td-ios-card li strong { color: var(--text-primary, #fff); }
.td-ios-glyph { display: inline-flex; vertical-align: middle; color: #0a84ff; margin: 0 2px; }
.td-ios-plus { color: var(--text-secondary, #9ca3af); }
.td-ios-done {
    width: 100%; background: var(--primary, #E11D48); color: #fff; border: none;
    border-radius: 11px; padding: 13px; font-weight: 700; font-size: .95rem; cursor: pointer;
}
.td-ios-done:active { transform: scale(.99); }

/* Install-app button at the top of the sidebar (mobile, hidden once installed) */
.sidebar-install-item {
    width: 100%; background: color-mix(in srgb, var(--primary, #E11D48) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary, #E11D48) 45%, transparent);
    color: var(--primary, #E11D48); font: inherit; font-weight: 700; cursor: pointer;
    text-align: left; margin-bottom: 8px;
}
.sidebar-install-item:hover { background: color-mix(in srgb, var(--primary, #E11D48) 22%, transparent); }
.sidebar-install-item svg { flex: 0 0 auto; }

/* Auto-update prompt (new build available) */
.td-update-bar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 5000;
    display: flex; align-items: center; gap: 12px; justify-content: space-between;
    background: var(--primary, #E11D48); color: #fff;
    border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: .9rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.45); animation: tdInstallUp .28s ease;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.td-update-btn {
    flex: 0 0 auto; background: #fff; color: var(--primary, #E11D48); border: none;
    border-radius: 8px; padding: 8px 16px; font-weight: 800; font-size: .88rem; cursor: pointer;
}
.td-update-btn:active { transform: scale(.97); }
@media (min-width: 620px) { .td-update-bar { left: auto; right: 20px; bottom: 20px; max-width: 420px; } }

/* Single-colour icons: prefer monochrome text presentation for all emoji/symbols */
html, body, button, input, select, textarea, a, span, div, label, small, h1, h2, h3, h4, p {
  font-variant-emoji: text;
}
