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

:root {
  --bg:           #0b1120;
  --surface:      #111827;
  --surface2:     #1a2235;
  --card:         #1e2d42;
  --card-hover:   #243348;
  --border:       #2a3a52;
  --border-light: #334155;
  --primary:      #10b981;
  --primary-dark: #059669;
  --primary-dim:  rgba(16,185,129,.12);
  --accent:       #3b82f6;
  --accent-dim:   rgba(59,130,246,.12);
  --danger:       #ef4444;
  --gold:         #f59e0b;
  --text:         #f0f4f8;
  --text-muted:   #8fa3be;
  --text-faint:   #4a6080;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 4px 20px rgba(0,0,0,.4);
  --header-h:     56px;
  --sidebar-w:    300px;
}

html, body { height: 100%; font-family: 'Inter', system-ui, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Views ─────────────────────────────────────────────────────────────────── */
.view { min-height: 100vh; }

/* ── Login ─────────────────────────────────────────────────────────────────── */
.view-login { display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(ellipse at 60% 20%, rgba(16,185,129,.08) 0%, transparent 60%), radial-gradient(ellipse at 20% 80%, rgba(59,130,246,.06) 0%, transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px 36px; box-shadow: var(--shadow); }
.brand { text-align: center; margin-bottom: 32px; }
.brand-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.brand-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.brand-tagline { font-size: 13px; color: var(--text-muted); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.reset-hint { font-size: 13px; color: var(--text-muted); text-align: center; }
.auth-error { margin-top: 8px; padding: 10px 14px; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); border-radius: var(--radius-sm); color: #fca5a5; font-size: 13px; }
.auth-success { margin-top: 8px; padding: 10px 14px; background: var(--primary-dim); border: 1px solid rgba(16,185,129,.3); border-radius: var(--radius-sm); color: #6ee7b7; font-size: 13px; }

/* ── Fields ────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.req { color: var(--danger); }
.field-input { width: 100%; padding: 8px 11px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; outline: none; transition: border-color .15s; }
.field-input:focus { border-color: var(--primary); }
.field-input::placeholder { color: var(--text-faint); }
.field-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238fa3be' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
input[type="file"].field-input { padding: 6px 11px; }
.pw-wrap { position: relative; }
.pw-wrap .field-input { padding-right: 40px; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); padding: 4px; opacity: .6; }
.pw-toggle:hover { opacity: 1; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-add { background: var(--primary-dim); color: var(--primary); border: 1px solid rgba(16,185,129,.25); }
.btn-add:hover { background: var(--primary); color: #fff; }
.btn-icon { background: none; border: none; color: var(--text-muted); padding: 6px; border-radius: var(--radius-sm); transition: all .15s; }
.btn-icon:hover { color: var(--text); background: var(--surface2); }
.link-btn { background: none; border: none; color: var(--text-muted); font-size: 13px; text-align: left; padding: 0; cursor: pointer; }
.link-btn:hover { color: var(--primary); }
.btn-spinner { display: inline-flex; align-items: center; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden-btn { display: none !important; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.header { position: sticky; top: 0; z-index: 100; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); gap: 12px; }
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-home-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: var(--radius); color: var(--text); transition: background .15s; flex-shrink: 0; }
.header-home-btn:hover { background: var(--surface2); }
.header-title { font-size: 16px; font-weight: 700; }

/* Global header search */
.header-search-wrap { flex: 1; max-width: 340px; position: relative; display: flex; align-items: center; }
.header-search-icon { position: absolute; left: 11px; color: var(--text-muted); pointer-events: none; flex-shrink: 0; }
.header-search-input { width: 100%; padding: 7px 14px 7px 34px; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; font-size: 13px; color: var(--text); outline: none; transition: border-color .15s; }
.header-search-input::placeholder { color: var(--text-faint); }
.header-search-input:focus { border-color: var(--primary); background: var(--card); }

/* Header nav icon shortcuts */
.header-nav-icons { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.header-nav-icon-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 12px; border: none; background: transparent; color: var(--text-muted); border-radius: var(--radius); cursor: pointer; font-size: 10px; font-weight: 600; transition: all .15s; position: relative; white-space: nowrap; }
.header-nav-icon-btn:hover { color: var(--text); background: var(--surface2); }
.header-nav-icon-btn.active { color: var(--primary); background: rgba(16,185,129,.08); }
.header-nav-icon-btn .header-badge { top: 2px; right: 6px; }

.header-right { display: flex; align-items: center; gap: 12px; }
.header-undo-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; }
.header-undo-btn:hover { background: var(--card); color: var(--text); border-color: var(--primary); }
.header-db { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.header-support-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px 10px; border-radius: 8px; transition: color .15s, background .15s; }
.header-support-btn:hover { color: var(--text); background: var(--surface2); }
.header-support-btn span { font-size: 10px; font-weight: 600; }
.header-user { font-size: 12px; color: var(--text-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Header inbox wrap / badge */
.header-inbox-wrap { position: relative; }
.header-badge { position: absolute; top: -3px; right: -5px; min-width: 16px; height: 16px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 0 3px; display: inline-flex; align-items: center; justify-content: center; }
.notif-badge { position: absolute; top: 2px; right: 4px; background: #ef4444; color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; pointer-events: none; }
.claimed-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; position: absolute; top: 2px; right: 2px; border: 1px solid var(--surface); }

/* ── App Layout ────────────────────────────────────────────────────────────── */
.app-body { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: calc(100vh - var(--header-h)); }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.main-content { overflow-y: auto; padding: 20px 24px; background: var(--bg); }

/* ── Hamburger (hidden on desktop) ─────────────────────────────────────────── */
.btn-hamburger { display: none; background: none; border: none; color: var(--text-muted); padding: 6px; border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0; }
.btn-hamburger:hover { color: var(--text); background: var(--surface2); }

/* ── Sidebar overlay (mobile) ───────────────────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 149; background: rgba(0,0,0,.5); }
.sidebar-overlay.active { display: block; }

/* ── Mobile sidebar extras ──────────────────────────────────────────────────── */
.mobile-sidebar-extras { display: none; flex-direction: column; gap: 2px; padding: 0 0 8px; }
.mobile-extra-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 10px 8px; border-radius: var(--radius-sm); cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.mobile-extra-btn:hover { background: var(--surface2); color: var(--text); }
.mobile-extra-danger { color: #f87171 !important; }
.mobile-extra-danger:hover { background: rgba(239,68,68,.08) !important; }

/* ── Mobile bottom nav ──────────────────────────────────────────────────────── */
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 120; background: var(--surface); border-top: 1px solid var(--border); padding: 4px 0 max(4px, env(safe-area-inset-bottom)); }
.mobile-bnav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; border: none; background: none; color: var(--text-muted); font-size: 10px; font-weight: 600; padding: 6px 4px; cursor: pointer; position: relative; transition: color .15s; }
.mobile-bnav-btn.active { color: var(--primary); }
.mobile-bnav-badge { position: absolute; top: 2px; right: calc(50% - 18px); background: var(--danger); color: #fff; font-size: 9px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 3px; pointer-events: none; }

/* ── Main Nav ─────────────────────────────────────────────────────────────── */
.main-nav { display: flex; gap: 4px; background: var(--surface2); border-radius: var(--radius); padding: 4px; }
.main-nav-top { margin-bottom: 0; }
.sidebar-section-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.main-nav-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 4px; border-radius: 7px; font-size: 11px; font-weight: 600; border: none; background: transparent; color: var(--text-muted); transition: all .15s; white-space: nowrap; position: relative; }
.main-nav-btn:hover { color: var(--text); }
.main-nav-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 4px; margin-left: 2px; }

/* ── Sub-Nav (Search / Favorites) ──────────────────────────────────────────── */
.sub-nav { display: flex; gap: 4px; align-items: center; }
.sub-btn { flex: 1; padding: 6px 8px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; background: transparent; color: var(--text-muted); transition: all .15s; }
.sub-btn:hover { color: var(--text); }
.sub-btn.active { background: var(--primary-dim); color: var(--primary); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 3px; margin-left: 2px; }

/* ── Message tab buttons ────────────────────────────────────────────────────── */
.msg-tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: var(--radius-sm); padding: 3px; }
.msg-tab { flex: 1; padding: 5px 6px; border-radius: 4px; border: none; font-size: 11px; font-weight: 600; background: transparent; color: var(--text-muted); transition: all .15s; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.msg-tab:hover { color: var(--text); }
.msg-tab.active { background: var(--card); color: var(--primary); }
.msg-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; border-radius: 8px; padding: 0 3px; line-height: 1; }

/* ── Search type toggle ────────────────────────────────────────────────────── */
.search-type-toggle { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface2); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.stype-btn { padding: 6px; border-radius: 4px; border: none; font-size: 12px; font-weight: 600; background: transparent; color: var(--text-muted); transition: all .15s; }
.stype-btn:hover { color: var(--text); }
.stype-btn.active { background: var(--card); color: var(--primary); }

/* ── Autocomplete ──────────────────────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-list { position: absolute; z-index: 200; top: calc(100% + 4px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); max-height: 200px; overflow-y: auto; }
.autocomplete-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; cursor: pointer; transition: background .1s; }
.autocomplete-item:hover { background: var(--card-hover); }
.ac-city { font-weight: 500; font-size: 13px; }
.ac-state { font-size: 11px; color: var(--text-muted); }

/* ── Filter divider ────────────────────────────────────────────────────────── */
.filter-divider { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; }
.filter-divider span { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.filter-divider::before, .filter-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Rating filter grid ────────────────────────────────────────────────────── */
.rating-filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* ── Search actions ────────────────────────────────────────────────────────── */
.search-actions { display: flex; gap: 8px; margin-top: 14px; }
.search-actions .btn-primary { flex: 1; }
.search-error { padding: 8px 12px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); border-radius: var(--radius-sm); color: #fca5a5; font-size: 12px; }

/* ── Job sidebar actions ───────────────────────────────────────────────────── */
.job-sidebar-actions { display: flex; gap: 8px; flex-direction: column; }
.job-sidebar-actions .btn { justify-content: center; }
.panel-hint { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: calc(100vh - var(--header-h) - 80px); gap: 12px; padding: 40px 20px; }
.empty-icon { margin-bottom: 8px; }
.empty-title { font-size: 22px; font-weight: 700; }
.empty-desc { font-size: 14px; color: var(--text-muted); max-width: 400px; line-height: 1.6; }
.empty-stat { font-size: 13px; color: var(--primary); font-weight: 600; }

/* ── Results header ────────────────────────────────────────────────────────── */
.results-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.results-meta { font-size: 13px; color: var(--text-muted); }
.results-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── View Toggle ───────────────────────────────────────────────────────────── */
.view-toggle { display: flex; background: var(--surface2); border-radius: 6px; padding: 2px; gap: 2px; }
.view-btn { width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 5px; border: none; background: transparent; color: var(--text-muted); transition: all .15s; }
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ── Card Grid ─────────────────────────────────────────────────────────────── */
.contractor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px 0 8px; flex-wrap: wrap; }
.pagination-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.pagination-btn:hover:not(:disabled) { background: var(--card); color: var(--text); border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.35; cursor: default; }
.pagination-info { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.5; }
.pagination-info strong { color: var(--text); }

/* ── Contractor Card ───────────────────────────────────────────────────────── */
.result-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 10px; }
.result-card:hover { border-color: var(--border-light); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title-block { flex: 1; min-width: 0; }
.result-business { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.result-category { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }
.card-actions { display: flex; gap: 3px; flex-shrink: 0; }
.card-btn { width: 27px; height: 27px; display: flex; align-items: center; justify-content: center; border-radius: 5px; border: none; background: var(--surface2); color: var(--text-muted); transition: all .15s; }
.card-btn:hover { background: var(--surface); color: var(--text); }
.card-btn.starred { color: var(--gold); }
.card-btn.has-note { color: var(--accent); }
.card-btn.has-svc { color: var(--primary); }
.card-btn.has-ins { color: #34d399; }
.card-btn.trash-btn:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.card-btn.msg-btn.can-msg { color: var(--accent); }
.card-btn.msg-btn.inactive-msg { opacity: .35; cursor: default; }

/* Active on Hub badge */
.active-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; background: rgba(59,130,246,.15); color: var(--accent); border: 1px solid rgba(59,130,246,.25); border-radius: 10px; font-size: 10px; font-weight: 600; white-space: nowrap; }

/* Service chips */
.service-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.service-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; background: var(--surface2); border-radius: 20px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.top-chip { background: var(--primary-dim); color: var(--primary); }
.chip-star { font-size: 9px; }

/* Card details */
.result-details { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.result-detail { display: flex; flex-direction: column; gap: 1px; }
.result-detail-label { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.result-detail-val { font-size: 12px; color: var(--text-muted); }
.result-detail-val a { color: var(--accent); }
.result-detail-val a:hover { color: var(--primary); }
.result-detail.full { grid-column: 1/-1; }

/* Insurance badge on card */
.card-ins-badge { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.25); border-radius: var(--radius-sm); }
.ins-shield { color: #34d399; flex-shrink: 0; }
.ins-badge-text { font-size: 11px; font-weight: 600; color: #34d399; }
.ins-badge-exp { font-size: 10px; color: var(--text-muted); margin-left: 2px; }
.ins-badge-expired { color: #fca5a5 !important; border-color: rgba(239,68,68,.25) !important; background: rgba(239,68,68,.06) !important; }
.ins-badge-expired .ins-shield { color: #fca5a5 !important; }
.ins-badge-expired .ins-badge-text { color: #fca5a5 !important; }

/* Card footer – rating + actions */
.card-footer { border-top: 1px solid var(--border); padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-rating-btn { display: flex; align-items: center; gap: 6px; background: none; border: none; padding: 4px 6px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 12px; cursor: pointer; transition: background .15s; }
.card-rating-btn:hover { background: var(--surface2); }
.card-rating-btn.rated { color: var(--gold); }
.cr-stars { display: flex; gap: 1px; font-size: 13px; }
.cr-score { font-weight: 700; font-size: 12px; }

/* Badges */
.custom-badge { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 4px; background: var(--accent-dim); color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* Delete confirm */
.delete-confirm { display: none; align-items: center; gap: 8px; padding: 8px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); border-radius: var(--radius-sm); }
.delete-confirm-msg { font-size: 12px; color: var(--text-muted); flex: 1; }
.confirm-btn { padding: 4px 10px; border-radius: 4px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.confirm-yes { background: var(--danger); color: #fff; }
.confirm-no { background: var(--surface2); color: var(--text-muted); }
.no-results { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; line-height: 1.7; grid-column: 1/-1; }

/* ── LIST VIEW ─────────────────────────────────────────────────────────────── */
.list-view-wrap { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.list-header { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 110px 80px 90px 130px; align-items: center; gap: 12px; padding: 8px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.list-header-cell { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }

.list-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 110px 80px 90px 130px; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--border); transition: background .1s; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--card-hover); }
.lr-business { min-width: 0; }
.lr-biz-name { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-category { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-location, .lr-phone, .lr-top-svc { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-phone a { color: var(--accent); }
.lr-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.lr-stars { display: flex; gap: 1px; font-size: 12px; }
.lr-score { font-weight: 700; color: var(--gold); font-size: 11px; }
.lr-ins { display: flex; align-items: center; }
.lr-ins-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; color: #34d399; background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.25); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.lr-ins-badge.expired { color: #fca5a5; background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.2); }
.lr-active { display: flex; align-items: center; }
.lr-actions { display: flex; gap: 3px; }
.lr-actions .card-btn { width: 24px; height: 24px; }

/* ── Job Cards ─────────────────────────────────────────────────────────────── */
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.job-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.job-card:hover { border-color: var(--border-light); box-shadow: 0 4px 16px rgba(0,0,0,.3); }

.job-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.job-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.job-company { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.job-type-badge { flex-shrink: 0; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.jt-subcontract { background: var(--primary-dim); color: var(--primary); }
.jt-full-time    { background: var(--accent-dim); color: var(--accent); }
.jt-part-time    { background: rgba(168,85,247,.12); color: #c084fc; }
.jt-one-time     { background: rgba(245,158,11,.12); color: var(--gold); }
.jt-seasonal     { background: rgba(251,146,60,.12); color: #fb923c; }

.job-trades { display: flex; flex-wrap: wrap; gap: 4px; }
.trade-chip { display: inline-flex; padding: 2px 8px; background: var(--surface2); border-radius: 20px; font-size: 11px; color: var(--text-muted); font-weight: 500; }

.job-details { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.job-detail { display: flex; flex-direction: column; gap: 1px; }
.job-detail-label { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.job-detail-val { font-size: 12px; color: var(--text-muted); }
.job-detail-val a { color: var(--accent); }
.job-detail.full { grid-column: 1/-1; }

.job-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.job-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; gap: 8px; }
.job-posted { font-size: 11px; color: var(--text-faint); }
.job-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.job-owner-actions { display: flex; gap: 4px; }

/* Job expiry badge */
.job-expiry-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; background: rgba(16,185,129,.12); color: var(--primary);
  border: 1px solid rgba(16,185,129,.25); letter-spacing: .02em; }
.job-expiry-badge.warn { background: rgba(245,158,11,.12); color: #f59e0b; border-color: rgba(245,158,11,.3); }

/* Job files section */
.job-files-section { margin-top: 8px; }
.job-files-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 4px; }
.job-files-list { display: flex; flex-direction: column; gap: 3px; }
.job-file-row { display: flex; align-items: center; gap: 7px; text-decoration: none;
  color: var(--primary); font-size: 12px; font-weight: 500; padding: 4px 6px;
  border-radius: 6px; transition: background .15s; }
.job-file-row:hover { background: rgba(16,185,129,.08); }
.job-file-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Highlight pulse when jumping to a job from a notification */
@keyframes jobCardPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  60%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.job-card-highlight { animation: jobCardPulse .6s ease-out 2; }

/* Post job — "Posting As" profile tile */
.pj-profile-tile { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pj-profile-tile-avatar { width: 36px; height: 36px; border-radius: 50%;
  background: rgba(16,185,129,.15); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.pj-profile-tile-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pj-profile-tile-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Post job file dropzone */
.pj-file-drop { display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 14px 16px;
  cursor: pointer; color: var(--text-muted); font-size: 13px; transition: border-color .15s, background .15s; }
.pj-file-drop:hover, .pj-file-drop.drag-over { border-color: var(--primary); background: rgba(16,185,129,.05); color: var(--text); }
.pj-file-link { color: var(--primary); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pj-file-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pj-file-entry { display: flex; flex-direction: column; gap: 4px; }
.pj-file-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 20px; border: 1px solid var(--border); background: var(--surface2);
  font-size: 11px; font-weight: 500; color: var(--text-muted); align-self: flex-start; }
.pj-chip-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pj-chip-name[href] { color: var(--primary); text-decoration: none; }
.pj-chip-name[href]:hover { text-decoration: underline; }
.pj-chip-remove { background: none; border: none; cursor: pointer; color: var(--text-faint);
  font-size: 15px; line-height: 1; padding: 0 0 0 2px; transition: color .15s; }
.pj-chip-remove:hover { color: var(--danger); }
.pj-chip-saved { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.06); }
.pj-file-desc-input { font-size: 11px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  outline: none; transition: border-color .15s; width: 100%; max-width: 320px; }
.pj-file-desc-input:focus { border-color: var(--primary); }
.pj-file-desc-input::placeholder { color: var(--text-faint); }

/* ── Insurance upload modal ─────────────────────────────────────────────────── */
.ins-current-info { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.25); border-radius: var(--radius-sm); margin-bottom: 4px; }
.ins-current-text { font-size: 12px; color: #6ee7b7; line-height: 1.5; }
.ins-current-text a { color: #34d399; font-weight: 600; }
.upload-progress-bar { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.upload-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; width: 0%; }
.upload-status { font-size: 12px; color: var(--text-muted); }

/* ── Modals ────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.modal-overlay-top { z-index: 1100; } /* sub-modals (Note, Rate, Services) always on top */
/* W-9 and other child modals open on top of the profile modal */
#w9Overlay { z-index: 1050; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 480px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow); overflow: hidden; }
.modal-lg { max-width: 600px; }
.modal-xl { max-width: 680px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); gap: 12px; flex-shrink: 0; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.modal-close { background: none; border: none; color: var(--text-muted); padding: 4px; border-radius: 4px; transition: all .15s; }
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

/* Services list */
.svc-list { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow-y: auto; }
.svc-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface2); transition: background .1s; }
.svc-item:hover { background: var(--card); }
.svc-check { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.svc-label { flex: 1; font-size: 12px; cursor: pointer; }
.svc-top-btn { background: none; border: none; font-size: 13px; padding: 2px 4px; cursor: pointer; color: var(--text-faint); border-radius: 4px; transition: color .15s; }
.svc-top-btn:hover { color: var(--gold); }
.svc-top-btn.top-active { color: var(--gold); }
.custom-input-row { display: flex; gap: 8px; }
.custom-input-row .field-input { flex: 1; }

/* Rating rows */
#ratingRows { display: flex; flex-direction: column; gap: 14px; }
.rating-row { display: flex; flex-direction: column; gap: 6px; }
.rating-row-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.rating-stars { display: flex; gap: 6px; }
.rating-star { font-size: 24px; cursor: pointer; color: var(--text-faint); transition: color .1s, transform .1s; user-select: none; }
.rating-star:hover { transform: scale(1.1); }
.rating-star.filled { color: var(--gold); }
.rating-overall { text-align: center; padding: 12px; background: var(--surface2); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); }
.rating-overall-score { font-size: 24px; font-weight: 700; color: var(--gold); }

/* Notes */
.note-textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 10px 12px; font-size: 13px; line-height: 1.6; outline: none; resize: vertical; min-height: 110px; font-family: inherit; transition: border-color .15s; }
.note-textarea:focus { border-color: var(--primary); }
.note-textarea::placeholder { color: var(--text-faint); }

/* Form grid */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Apply modal attachment rows ────────────────────────────────────────────── */
.apply-attach-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; background: var(--surface2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.apply-attach-label { display: flex; align-items: flex-start; gap: 10px; flex: 1; cursor: pointer; }
.apply-w9-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* ── W-9 modal styles ───────────────────────────────────────────────────────── */
.w9-classification { display: flex; flex-direction: column; gap: 4px; }
.w9-radio { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; cursor: pointer; }
.w9-radio input[type="radio"] { accent-color: var(--primary); width: 14px; height: 14px; }
.w9-cert-text { background: var(--surface2); border-radius: var(--radius-sm); padding: 12px; font-size: 11px; color: var(--text-muted); line-height: 1.7; }
.w9-cert-text ol { padding-left: 16px; }
.w9-cert-text li { margin-bottom: 6px; }
.w9-official-link { text-align: center; padding: 8px; background: rgba(59,130,246,.08); border-radius: var(--radius-sm); border: 1px solid rgba(59,130,246,.2); }

/* ── Profile modal styles ───────────────────────────────────────────────────── */
.prof-status-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12px; }
.prof-status-row.success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.2); color: #6ee7b7; }
.prof-status-row.info { background: var(--accent-dim); border: 1px solid rgba(59,130,246,.2); color: var(--accent); }

/* ── Claim modal styles ─────────────────────────────────────────────────────── */
.claim-result-card { padding: 12px; background: var(--surface2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.claim-result-card .claim-biz { font-weight: 700; font-size: 13px; }
.claim-result-card .claim-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.claim-error { padding: 8px 12px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); border-radius: var(--radius-sm); color: #fca5a5; font-size: 12px; }

/* ── Inbox / Messages sidebar ───────────────────────────────────────────────── */
.inbox-list { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.inbox-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background .1s; position: relative; }
.inbox-item:hover { background: var(--surface2); }
.inbox-item.active { background: var(--surface2); border-left: 2px solid var(--primary); padding-left: 6px; }
.inbox-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; position: relative; }
.inbox-unread-dot { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; background: var(--primary); border-radius: 50%; border: 2px solid var(--surface); }
.inbox-body { flex: 1; min-width: 0; }
.inbox-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-preview { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.inbox-time { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.inbox-type-icon { font-size: 10px; background: var(--accent-dim); color: var(--accent); padding: 1px 5px; border-radius: 4px; font-weight: 600; }
.inbox-empty { text-align: center; padding: 20px 12px; color: var(--text-faint); font-size: 12px; }

/* ── Messages main / thread ─────────────────────────────────────────────────── */
#messagesMain { display: flex; flex-direction: row; height: 100%; overflow: hidden; }
.msg-center-area { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
#msgThreadView { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.thread-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 12px; }
.thread-meta { min-width: 0; }
.thread-name { font-size: 14px; font-weight: 700; color: var(--text); }
.thread-company { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.thread-controls { display: flex; gap: 4px; flex-shrink: 0; }
.thread-back-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); padding: 5px 7px; border-radius: var(--radius-sm); display: flex; align-items: center; cursor: pointer; transition: all .15s; }
.thread-back-btn:hover { color: var(--text); background: var(--card); }

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

.thread-compose { flex-shrink: 0; border-top: 1px solid var(--border); background: var(--surface); padding: 10px 14px; }
.thread-attach-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.thread-input-row { display: flex; align-items: flex-end; gap: 8px; }
.thread-textarea { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 8px 12px; font-size: 13px; line-height: 1.5; outline: none; resize: none; min-height: 60px; max-height: 120px; font-family: inherit; transition: border-color .15s; }
.thread-textarea:focus { border-color: var(--primary); }
.thread-textarea::placeholder { color: var(--text-faint); }
.attach-file-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: all .15s; flex-shrink: 0; }
.attach-file-btn:hover { color: var(--text); background: var(--card); }

/* ── Message bubbles ────────────────────────────────────────────────────────── */
.msg-bubble-wrap { display: flex; flex-direction: column; gap: 3px; max-width: 75%; }
.msg-bubble-wrap.own { align-self: flex-end; align-items: flex-end; }
.msg-bubble-wrap.other { align-self: flex-start; align-items: flex-start; }
.msg-sender-name { font-size: 10px; color: var(--text-faint); font-weight: 600; padding: 0 4px; }
.msg-bubble { padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; word-wrap: break-word; }
.msg-bubble.own { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble.other { background: var(--card); color: var(--text); border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.msg-time { font-size: 10px; color: var(--text-faint); padding: 0 4px; display: flex; align-items: center; gap: 6px; }
.msg-delete-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 1px 3px; border-radius: 3px; transition: color .15s; }
.msg-delete-btn:hover { color: var(--danger); }
.msg-attach-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; color: var(--accent); text-decoration: none; }
.msg-attach-chip:hover { border-color: var(--accent); }

/* Application message card */
.msg-app-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; max-width: 400px; }
.msg-app-card-header { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.msg-app-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.msg-app-card-company { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.msg-app-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-bottom: 10px; }
.msg-app-field-label { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.msg-app-field-val { font-size: 12px; color: var(--text-muted); }
.msg-app-notes { font-size: 12px; color: var(--text-muted); line-height: 1.6; padding-top: 8px; border-top: 1px solid var(--border); }

.msg-danger-btn:hover { color: var(--danger) !important; }

/* ── Attach preview chip ─────────────────────────────────────────────────────── */
.attach-preview-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; color: var(--text-muted); }
.attach-preview-chip button { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 0 2px; font-size: 12px; line-height: 1; }
.attach-preview-chip button:hover { color: var(--danger); }

/* ── Block / Report confirmations ────────────────────────────────────────────── */
.thread-inline-msg { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; margin: 8px 16px; text-align: center; }
.thread-inline-msg.success { background: rgba(16,185,129,.1); color: var(--primary); border: 1px solid rgba(16,185,129,.2); }
.thread-inline-msg.warning { background: rgba(239,68,68,.08); color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .list-header, .list-row { grid-template-columns: 2fr 1fr 1fr 110px 80px 90px 130px; }
  .list-header-cell:nth-child(4), .lr-phone { display: none; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .list-header, .list-row { grid-template-columns: 2fr 1fr 100px 70px 90px 110px; }
  .list-header-cell:nth-child(4), .list-header-cell:nth-child(5), .lr-phone, .lr-top-svc { display: none; }
}

/* ── Mobile breakpoint ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 280px; --mobile-bnav-h: 60px; }

  /* Header */
  .btn-hamburger { display: flex; }
  .header-search-wrap { flex: 1; max-width: none; }
  .header-nav-icons { display: none; }
  .header-right > .header-undo-btn,
  .header-right > .header-support-btn:not(#btnProfileSettings2):not(#btnNotifBell),
  .header-right > .header-db,
  .header-right > .header-active-users { display: none !important; }
  .header-right { gap: 4px; }
  .header-title { display: none; }

  /* Sidebar: slide-in drawer */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 150;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform .25s ease;
    height: auto;
    max-height: none;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }
  .sidebar.open { transform: translateX(0); }

  /* App body: single column, account for bottom nav */
  .app-body { grid-template-columns: 1fr; height: calc(100vh - var(--header-h) - var(--mobile-bnav-h)); }
  .main-content { padding: 16px; }
  .main-content-messages { padding: 0 !important; }

  /* Bottom nav visible */
  .mobile-bottom-nav { display: flex; }

  /* Mobile sidebar extras visible */
  .mobile-sidebar-extras { display: flex; }

  /* Cards */
  .contractor-grid { grid-template-columns: 1fr; }
  .job-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .result-details { grid-template-columns: 1fr 1fr; }

  /* List view: simplify columns */
  .list-header, .list-row { grid-template-columns: 2fr 1fr 80px 80px; }
  .list-header-cell:nth-child(3), .list-header-cell:nth-child(4),
  .list-header-cell:nth-child(5), .lr-location, .lr-phone, .lr-top-svc { display: none; }

  /* Messages: hide context panel, thread takes full width */
  .msg-context-panel { display: none !important; }
  #messagesMain { flex-direction: column; }

  /* Notifications panel full-width */
  .notif-panel { width: 100%; left: 0; border-left: none; }

  /* Modals full-screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-width: 100%; max-height: 92vh; }
  .modal-lg, .modal-xl { max-width: 100%; }

  /* Results header stacking */
  .results-header { flex-direction: column; align-items: flex-start; }
  .results-actions { width: 100%; justify-content: space-between; }

  /* Pagination */
  .pagination-bar { gap: 6px; }

  /* Header DB count hidden */
  .header-db { display: none; }

  /* Ideas/Roadmap */
  .ideas-roadmap-outer { padding: 16px 12px; }
  .roadmap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .rating-filter-grid { grid-template-columns: 1fr; }
  .msg-bubble-wrap { max-width: 90%; }
  .header-search-wrap { max-width: 160px; }
  .job-details { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .gs-main-wrap { padding: 0 8px; }
  .thread-header { padding: 10px 12px; }
  .modal-header { padding: 16px 16px 12px; }
  .modal-body { padding: 14px 16px; }
  .modal-footer { padding: 10px 16px; }
}

/* ── Service filter multi-checkbox (sidebar) ────────────────────────────────── */
.filter-match-hint { font-size: 10px; color: var(--text-faint); font-weight: 400; text-transform: none; letter-spacing: 0; }
.svc-filter-item { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 4px; transition: background .1s; cursor: pointer; }
.svc-filter-item:hover { background: var(--card); }
.svc-filter-item input[type="checkbox"] { width: 13px; height: 13px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.svc-filter-item label { font-size: 12px; color: var(--text-muted); cursor: pointer; user-select: none; line-height: 1.3; }
.svc-filter-item input:checked + label { color: var(--primary); font-weight: 600; }

/* ── Tooltip for truncated business names ───────────────────────────────────── */
.biz-tooltip { position: relative; }
.biz-tooltip::after {
  content: attr(data-full);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #1a2840;
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
  max-width: 280px;
  min-width: 120px;
  z-index: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
  line-height: 1.4;
}
.biz-tooltip:hover::after { opacity: 1; transform: translateY(0); }

/* ── Active user badge ──────────────────────────────────────────────────────── */
.active-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 4px; background: rgba(59,130,246,.12); color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; margin-left: 4px; }
.active-badge svg { flex-shrink: 0; }
.active-badge-sm { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 3px; background: rgba(59,130,246,.12); color: var(--accent); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* ── Detail modal ───────────────────────────────────────────────────────────── */
.modal-xl { max-width: 860px; }
.detail-biz-name { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.3; word-break: break-word; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.detail-category { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.detail-section { display: flex; flex-direction: column; gap: 6px; }
.detail-section-title { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.detail-field { display: flex; flex-direction: column; gap: 2px; }
.detail-field.full { grid-column: 1/-1; }
.detail-field-label { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.detail-field-val { font-size: 13px; color: var(--text); word-break: break-all; }
.detail-field-val a { color: var(--accent); word-break: break-all; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.detail-note-preview { font-size: 12px; color: var(--text-muted); line-height: 1.6; background: var(--surface2); border-radius: var(--radius-sm); padding: 8px 10px; border-left: 2px solid var(--border-light); }

.detail-footer { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.detail-action-btn { gap: 5px; }
.detail-hide-btn:hover { color: var(--danger) !important; border-color: rgba(239,68,68,.3) !important; }

/* ── Compose message ────────────────────────────────────────────────────────── */
.compose-attach-row { margin-top: 4px; }
.msg-gate-notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); border-radius: var(--radius-sm); font-size: 13px; color: #fca5a5; line-height: 1.5; }

/* ── Toast notification ─────────────────────────────────────────────────────── */
#toastNotif { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--card); border: 1px solid var(--border-light); color: var(--text); padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); z-index: 2000; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
#toastNotif.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Service filter dropdown ────────────────────────────────────────────────── */
.svc-dropdown-wrap { position: relative; }
.svc-dropdown-btn { display: flex !important; align-items: center; justify-content: space-between; cursor: pointer; text-align: left; color: var(--text-muted); }
.svc-dropdown-btn.open { border-color: var(--primary); color: var(--text); }
.svc-dropdown-btn svg { flex-shrink: 0; transition: transform .2s; color: var(--text-faint); }
.svc-dropdown-btn.open svg { transform: rotate(180deg); color: var(--primary); }
.svc-dropdown-btn #svcDropdownLabel { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
/* Flyout panel — fixed, opens to the right of the sidebar */
.svc-dropdown-panel { display: none; position: fixed; z-index: 500; background: var(--card); border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.25); width: 220px; max-height: 360px; flex-direction: column; }
.svc-dropdown-panel.open { display: flex; }
.svc-filter-items { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.svc-filter-footer { flex-shrink: 0; padding: 8px; border-top: 1px solid var(--border); background: var(--card); border-radius: 0 0 var(--radius) var(--radius); }
.svc-filter-done-btn { width: 100%; padding: 8px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.svc-filter-done-btn:hover { background: var(--primary-dark); }

/* ── Export confirm button ──────────────────────────────────────────────────── */
.btn-confirm-export { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }

/* ── Welcome / Claim Modal ──────────────────────────────────────────────────── */
.welcome-brand { display: flex; align-items: center; gap: 14px; }
.welcome-title { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.welcome-sub   { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.welcome-match-card { background: var(--surface2); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.welcome-match-biz  { font-size: 16px; font-weight: 700; color: var(--text); }
.welcome-match-meta { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.welcome-match-tag  { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: var(--primary-dim); color: var(--primary); border-radius: 20px; font-size: 11px; font-weight: 600; }

.welcome-matches-header { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.welcome-match-select   { display: flex; flex-direction: column; gap: 6px; }
.welcome-match-option   { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface2); border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.welcome-match-option:hover            { background: var(--card); border-color: var(--border-light); }
.welcome-match-option.selected         { border-color: var(--primary); background: var(--primary-dim); }
.welcome-match-option input[type=radio]{ accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; }
.welcome-match-option-info { flex: 1; min-width: 0; }
.welcome-match-option-biz  { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.welcome-match-option-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.welcome-features { display: flex; flex-direction: column; gap: 8px; }
.welcome-feature  { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.welcome-feature svg { flex-shrink: 0; color: var(--primary); }

.welcome-divider { border: none; border-top: 1px solid var(--border); margin: 2px 0; }

.welcome-no-match-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.welcome-option-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.welcome-option-card:hover { border-color: var(--border-light); background: var(--card); }
.welcome-option-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.welcome-option-title { font-size: 13px; font-weight: 700; color: var(--text); }
.welcome-option-desc  { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.welcome-claim-row { display: flex; gap: 8px; }
.welcome-claim-row .field-input { flex: 1; }

@media (max-width: 480px) {
  .welcome-no-match-options { grid-template-columns: 1fr; }
}

/* ── Admin Header Button ────────────────────────────────────────────────────── */
.admin-header-btn { background: rgba(245,158,11,.12); color: var(--gold); border: 1px solid rgba(245,158,11,.3); gap: 5px; }
.admin-header-btn:hover { background: rgba(245,158,11,.22); }

/* ── Admin Panel Modal ──────────────────────────────────────────────────────── */
.modal-admin { max-width: 800px; max-height: 92vh; }
.admin-stats-row { display: flex; gap: 12px; padding: 12px 20px; background: var(--surface2); border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
.admin-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 60px; }
.admin-stat-num { font-size: 22px; font-weight: 800; line-height: 1; }
.admin-stat-label { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.admin-stat.pending .admin-stat-num { color: var(--gold); }
.admin-stat.approved .admin-stat-num { color: var(--primary); }
.admin-stat.rejected .admin-stat-num { color: var(--danger); }
.admin-stat.total .admin-stat-num { color: var(--text); }

.admin-filter-bar { display: flex; align-items: center; gap: 4px; padding: 10px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.admin-filter-btn { padding: 5px 12px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; background: transparent; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.admin-filter-btn:hover { background: var(--surface2); color: var(--text); }
.admin-filter-btn.active { background: var(--card); color: var(--text); }

.admin-body { gap: 10px; max-height: none; padding: 16px 20px; }
.admin-loading { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }

/* Application card */
.app-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s; }
.app-card:hover { border-color: var(--border-light); }
.app-card.status-pending  { border-left: 3px solid var(--gold); }
.app-card.status-approved { border-left: 3px solid var(--primary); }
.app-card.status-rejected { border-left: 3px solid var(--danger); opacity: .8; }

.app-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.app-biz-name { font-size: 15px; font-weight: 700; color: var(--text); }
.app-person   { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.app-status-badge { flex-shrink: 0; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.app-status-badge.pending  { background: rgba(245,158,11,.12); color: var(--gold); }
.app-status-badge.approved { background: var(--primary-dim); color: var(--primary); }
.app-status-badge.rejected { background: rgba(239,68,68,.1); color: #fca5a5; }

.app-contact-row { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface2); border-radius: var(--radius-sm); }
.app-contact-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.app-contact-item svg { flex-shrink: 0; color: var(--text-faint); }
.app-contact-item a { color: var(--accent); font-weight: 600; }
.app-contact-item a:hover { color: var(--primary); }

.app-details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
.app-detail { display: flex; flex-direction: column; gap: 2px; }
.app-detail-label { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.app-detail-val { font-size: 12px; color: var(--text-muted); }

.app-notes { font-size: 12px; color: var(--text-muted); line-height: 1.6; background: var(--surface2); border-radius: var(--radius-sm); padding: 8px 10px; border-left: 2px solid var(--border-light); }

.app-review-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-review-note-input { flex: 1; min-width: 160px; padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 12px; outline: none; transition: border-color .15s; font-family: inherit; }
.app-review-note-input:focus { border-color: var(--primary); }
.app-review-row-meta { font-size: 11px; color: var(--text-faint); }

.app-submitted { font-size: 11px; color: var(--text-faint); text-align: right; }

@media (max-width: 600px) {
  .app-details-grid { grid-template-columns: 1fr 1fr; }
  .modal-admin { max-width: 100%; }
}

/* ── Messages Sidebar ───────────────────────────────────────────────────────── */
.msg-tabs { display: flex; gap: 4px; padding: 0 0 8px; }
.msg-tab { background: none; border: none; font-size: 12px; font-weight: 600; color: var(--text-faint); padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; }
.msg-tab:hover { color: var(--text-muted); background: var(--surface2); }
.msg-tab.active { color: var(--text); background: var(--card); }

.inbox-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.inbox-empty { font-size: 12px; color: var(--text-faint); text-align: center; padding: 24px 8px; line-height: 1.6; }

.inbox-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; border: 1px solid transparent; }
.inbox-item:hover { background: var(--surface2); }
.inbox-item.active { background: var(--card); border-color: var(--border); }
.inbox-item.archived { opacity: .55; }
.inbox-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-dim); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.inbox-content { flex: 1; min-width: 0; }
.inbox-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-preview { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.inbox-time { font-size: 10px; color: var(--text-faint); }
.inbox-unread { min-width: 18px; height: 18px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; }
.inbox-archived-tag { font-size: 9px; color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ── Messages Main / Thread ─────────────────────────────────────────────────── */
#msgEmptyState { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.thread-header { display: flex; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); gap: 10px; flex-shrink: 0; }
.thread-back-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); transition: all .15s; }
.thread-back-btn:hover { color: var(--text); background: var(--surface2); }
.thread-meta { flex: 1; min-width: 0; }
.thread-name { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-company { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.thread-controls { display: flex; align-items: center; gap: 4px; }
.msg-danger-btn { color: var(--text-faint) !important; }
.msg-danger-btn:hover { color: var(--danger) !important; background: rgba(239,68,68,.08) !important; }

.thread-messages-wrap { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.thread-loading, .thread-no-msgs { text-align: center; color: var(--text-faint); font-size: 13px; padding: 32px; }

.thread-msg { display: flex; flex-direction: column; max-width: 72%; }
.thread-msg.sent { align-self: flex-end; align-items: flex-end; }
.thread-msg.received { align-self: flex-start; align-items: flex-start; }
.thread-msg-bubble { padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.thread-msg.sent     .thread-msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.thread-msg.received .thread-msg-bubble { background: var(--card); color: var(--text); border-bottom-left-radius: 4px; }
.thread-msg-time { font-size: 10px; color: var(--text-faint); margin-top: 3px; padding: 0 4px; }

.msg-attachments { margin-top: 6px; display: flex; flex-direction: column; flex-wrap: wrap; gap: 6px; }
.msg-attach-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: rgba(255,255,255,.85); background: rgba(0,0,0,.2); border-radius: 4px; padding: 3px 7px; }
.thread-msg.received .msg-attach-link { color: var(--accent); background: var(--accent-dim); }
.msg-img-link { display: block; }
.msg-inline-img { display: block; max-width: 260px; max-height: 220px; width: auto; height: auto;
  border-radius: 10px; cursor: zoom-in; object-fit: contain;
  border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.15); }
.thread-msg.received .msg-inline-img { border-color: var(--border); }

.thread-attach-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px; background: var(--surface2); border-top: 1px solid var(--border); }
.attach-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); background: var(--card); border-radius: 4px; padding: 3px 8px; }

.thread-compose { display: flex; flex-direction: column; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.thread-input-row { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; }
.thread-textarea { flex: 1; resize: none; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; padding: 8px 10px; outline: none; transition: border-color .15s; max-height: 120px; font-family: inherit; line-height: 1.5; }
.thread-textarea:focus { border-color: var(--primary); }
.attach-file-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--text-faint); cursor: pointer; transition: all .15s; flex-shrink: 0; }
.attach-file-btn:hover { color: var(--primary); background: var(--primary-dim); }

/* ── Job sub-nav tabs ───────────────────────────────────────────────────────── */
.job-sub-nav { display: flex; gap: 4px; padding: 10px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.job-sub-tab { flex: 1; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
  transition: background .12s, color .12s; display: flex; align-items: center; justify-content: center; gap: 5px; }
.job-sub-tab:hover { background: var(--surface2); color: var(--text); }
.job-sub-tab.active { background: var(--surface2); color: var(--text); }
.my-listings-badge { display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; }

/* ── Review Applications Modal ──────────────────────────────────────────────── */
.ra-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px;
  border-bottom: 1px solid var(--border); gap: 8px; }
.ra-count { font-size: 12px; color: var(--text-muted); }
.ra-table-wrap { overflow-x: auto; }
.ra-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ra-table th { padding: 8px 14px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--border);
  background: var(--surface); white-space: nowrap; }
.ra-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted);
  vertical-align: middle; white-space: nowrap; }
.ra-table-row:hover td { background: var(--surface2); }
.ra-td-name { font-weight: 600; color: var(--text) !important; }
.ra-td-date { color: var(--text-faint) !important; font-size: 11px; }
.ra-td-check { text-align: center; color: var(--text-faint) !important; }
.ra-td-check.ra-has { color: var(--primary) !important; }

/* keep old list styles for back-compat (still used in detail "back" button area) */
.review-apps-list { display: flex; flex-direction: column; }
.review-app-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); transition: background .1s; }
.review-app-row:hover { background: var(--surface2); }
.review-app-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-dim,rgba(16,185,129,.15));
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0; }
.review-app-info { flex: 1; min-width: 0; }
.review-app-name { font-size: 13px; font-weight: 600; color: var(--text); }
.review-app-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-app-meta { text-align: right; flex-shrink: 0; }
.review-app-date { font-size: 11px; color: var(--text-faint); }

/* ── Review detail view ─────────────────────────────────────────────────────── */
.review-detail-wrap { padding: 0 0 20px; }
.review-detail-topbar { padding: 12px 20px 0; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.review-detail-header { display: flex; align-items: center; gap: 14px; padding: 20px 20px 16px; }
.review-detail-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-dim,rgba(16,185,129,.15));
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0; }
.review-detail-name    { font-size: 17px; font-weight: 700; color: var(--text); }
.review-detail-name-link { background: none; border: none; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: rgba(99,102,241,.4); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
.review-detail-name-link:hover { color: var(--primary); text-decoration-color: var(--primary); }
.review-detail-company { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.review-detail-section { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.rdi-section-title { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 10px; }
.rdi-row { display: flex; gap: 12px; align-items: baseline; margin-bottom: 7px; font-size: 13px; }
.rdi-label { width: 130px; flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.review-avail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.avail-tag { padding: 4px 10px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted); font-weight: 600; }
.review-message { font-size: 13px; color: var(--text); line-height: 1.6; white-space: pre-wrap;
  background: var(--surface2); border-radius: var(--radius-sm); padding: 10px 12px; }

/* ── Apply to Job Modal ─────────────────────────────────────────────────────── */
.apply-attach-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; }
.apply-attach-label { flex: 1; cursor: pointer; }
.apply-w9-btns { flex-shrink: 0; }

/* ── Apply modal — Availability ─────────────────────────────────────────────── */
.apply-avail-wrap { margin: 4px 0 6px; }
.apply-avail-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.apply-avail-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.avail-day-chip { display: inline-flex; align-items: center; gap: 0; padding: 6px 14px;
  border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface2);
  transition: background .12s, border-color .12s, color .12s; user-select: none; }
.avail-day-chip input[type=checkbox] { display: none; }
.avail-day-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.apply-avail-hours { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.avail-hours-row { display: flex; align-items: center; gap: 8px; }
.avail-hours-label { width: 34px; font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.avail-hours-sep { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.avail-hours-select { flex: 1; max-width: 130px; height: 34px; padding: 0 8px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: 12px; cursor: pointer; }

/* ── W-9 Modal ──────────────────────────────────────────────────────────────── */
.w9-classification { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.w9-radio { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 5px 8px; border-radius: var(--radius-sm); transition: background .12s; }
.w9-radio:hover { background: var(--surface2); }
.w9-radio input { accent-color: var(--primary); flex-shrink: 0; }
.w9-cert-text { background: var(--surface2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 11px; color: var(--text-muted); line-height: 1.7; }
.w9-cert-text ol { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* Steps guide */
.w9-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--surface2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.w9-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex: 1; min-width: 140px; }
.w9-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.w9-step-arrow { font-size: 16px; color: var(--text-faint); flex-shrink: 0; }
.w9-irs-link { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; text-decoration: none; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); flex-shrink: 0; }
.w9-irs-link:hover { background: rgba(99,102,241,.08); }

/* Drop zone */
.w9-dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.w9-dropzone:hover { border-color: var(--primary); background: rgba(16,185,129,.03); }
.w9-dropzone.drag-over { border-color: var(--primary); background: rgba(16,185,129,.07); border-style: solid; }
.w9-dropzone.has-file { border-color: var(--primary); border-style: solid; background: rgba(16,185,129,.04); }
.w9-drop-label { font-size: 13px; font-weight: 600; color: var(--text); margin: 0; }
.w9-drop-or { font-size: 12px; color: var(--text-faint); margin: 0; }
.w9-drop-hint { font-size: 11px; color: var(--text-faint); margin: 2px 0 0; }
.w9-drop-filename { font-size: 12px; color: var(--primary); font-weight: 600; margin: 0; }

/* URL result panel */
.w9-url-result { background: rgba(16,185,129,.06); border: 1px solid rgba(16,185,129,.25); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.w9-url-success { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }

/* Option 1 / Option 2 layout */
.w9-option-block { display: flex; flex-direction: column; gap: 10px; }
.w9-option-header { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.w9-option-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.w9-option-title { font-size: 13px; font-weight: 600; color: var(--text); }
.w9-or-divider { display: flex; align-items: center; margin: 16px 0; color: var(--text-faint); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.w9-or-divider::before, .w9-or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.w9-or-divider span { padding: 0 12px; }

/* ── Insured Active Badge (contractor cards) ─────────────────────────────────── */
.ins-active-badge { display: inline-flex; align-items: center; gap: 3px; background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.3); border-radius: 4px; font-size: 10px; font-weight: 600; padding: 1px 5px; margin-left: 5px; vertical-align: middle; white-space: nowrap; }

/* ── Profile Insurance Banner ────────────────────────────────────────────────── */
.prof-ins-active-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.2); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted); }

/* ── Active Users Presence Indicator ────────────────────────────────────────── */
.header-active-users { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2); border-radius: 20px; padding: 2px 9px; }
.active-presence-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: presence-pulse 2s infinite; flex-shrink: 0; }
@keyframes presence-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); } 50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); } }

/* ── Sub-Contract Declared Service Chip (on cards) ──────────────────────────── */
.sub-declared-chip { background: rgba(99,102,241,.12) !important; color: #a5b4fc !important; border: 1px solid rgba(99,102,241,.25) !important; }

/* ── Sub-Contract Badge (contractor cards) ───────────────────────────────────── */
.sub-avail-badge { display: inline-flex; align-items: center; gap: 3px; background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); border-radius: 4px; font-size: 10px; font-weight: 600; padding: 1px 5px; margin-left: 5px; vertical-align: middle; white-space: nowrap; }

/* ── Sub-Contract Profile Section ────────────────────────────────────────────── */
.prof-sub-check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; padding: 2px 0; }
.prof-sub-check-label input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.prof-sub-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; }

/* Sub-contract prominent toggle card */
.prof-sub-toggle-card { margin-top: 10px; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface2); transition: border-color .2s, background .2s; }
.prof-sub-toggle-card.is-active { border-color: rgba(16,185,129,.5); background: rgba(16,185,129,.06); }
.prof-sub-toggle-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.prof-sub-toggle-label input[type=checkbox] { accent-color: var(--primary); width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.prof-sub-toggle-content { display: flex; flex-direction: column; gap: 3px; }
.prof-sub-toggle-title { font-size: 13px; font-weight: 700; color: var(--text); }
.prof-sub-toggle-card.is-active .prof-sub-toggle-title { color: #34d399; }
.prof-sub-toggle-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.prof-sub-toggle-divider { height: 1px; background: var(--border); margin: 14px 0 0; }
.prof-sub-svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; }
.prof-sub-svc-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); transition: background .12s; }
.prof-sub-svc-item:hover { background: var(--surface2); }
.prof-sub-svc-item input[type=checkbox] { accent-color: var(--primary); flex-shrink: 0; }

/* ── Profile & Settings Modal ──────────────────────────────────────────────── */
.prof-status-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--primary-dim); border: 1px solid rgba(16,185,129,.2); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted); }

/* ── Claim Profile Modal ────────────────────────────────────────────────────── */
.claim-result-card { background: var(--surface2); border: 2px solid var(--primary); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 4px; }
.claim-result-biz   { font-size: 14px; font-weight: 700; color: var(--text); }
.claim-result-meta  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.claim-result-email { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.claim-result-error { padding: 8px 12px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); border-radius: var(--radius-sm); color: #fca5a5; font-size: 12px; margin-top: 4px; }

/* ── Messages main panel layout ─────────────────────────────────────────────── */
.main-content-messages { padding: 0 !important; overflow: hidden !important; }
#messagesMain .empty-state { padding: 40px 24px; }

/* ── Conversation Context Panel (right) — same width as left sidebar ─────────── */
.msg-context-panel { width: var(--sidebar-w); flex-shrink: 0; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; overflow-y: auto; }
.ctx-section { padding: 16px 14px 10px; }
.ctx-section-title { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--text-faint); text-transform: uppercase; margin-bottom: 10px; }
.ctx-participants { display: flex; flex-direction: column; gap: 6px; }
.ctx-participant { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm); }
.ctx-participant-link { background: none; border: none; cursor: pointer; width: 100%; text-align: left; transition: background .12s; }
.ctx-participant-link:hover { background: var(--surface2); }
.ctx-avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.ctx-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ctx-participant-info { min-width: 0; flex: 1; }
.ctx-participant-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-you-tag { font-size: 10px; color: var(--text-faint); font-weight: 400; }
.ctx-participant-biz { font-size: 10px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-divider { height: 1px; background: var(--border); margin: 0 14px; }
.ctx-actions { display: flex; flex-direction: column; gap: 2px; }
.ctx-action-btn { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-muted); width: 100%; text-align: left; transition: background .12s, color .12s; }
.ctx-action-btn:hover { background: var(--surface2); color: var(--text); }
.ctx-action-btn svg { flex-shrink: 0; }
.ctx-action-danger { color: #f87171 !important; }
.ctx-action-danger:hover { background: rgba(239,68,68,.1) !important; }
.ctx-footer { padding: 12px 14px 16px; margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctx-footer-sep { color: var(--text-faint); font-size: 12px; }
.ctx-link-btn { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--text-muted); text-decoration: underline; padding: 0; }
.ctx-link-btn:hover { color: var(--text); }
.ctx-link-danger { color: #f87171 !important; }
.ctx-link-danger:hover { color: #fca5a5 !important; }

/* Thread header with labeled group controls */
.thread-hdr-btn { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 5px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); cursor: pointer; white-space: nowrap; }
.thread-hdr-btn:hover { color: var(--text); background: var(--surface); }
.thread-hdr-btn.msg-danger-btn:hover { color: #f87171; border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.07); }

/* ── Profile Avatar ──────────────────────────────────────────────────────────── */
.prof-avatar-section { display: flex; align-items: center; gap: 18px; padding: 16px 0 14px; }
.prof-avatar-wrap { position: relative; cursor: pointer; flex-shrink: 0; }
.prof-avatar-circle { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); overflow: hidden; display: flex; align-items: center; justify-content: center; border: 3px solid var(--border); transition: border-color .15s; }
.prof-avatar-wrap:hover .prof-avatar-circle { border-color: var(--primary); }
.prof-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.prof-avatar-initials { font-size: 28px; font-weight: 700; color: #fff; }
.prof-avatar-overlay { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; opacity: 0; transition: opacity .15s; color: #fff; font-size: 10px; font-weight: 600; }
.prof-avatar-wrap:hover .prof-avatar-overlay { opacity: 1; }
.prof-avatar-meta { flex: 1; }
.prof-avatar-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.prof-avatar-hint { font-size: 11px; color: var(--text-faint); }
.prof-remove-photo-btn { background: none; border: none; cursor: pointer; font-size: 11px; color: var(--text-muted); text-decoration: underline; padding: 0; margin-top: 5px; display: block; }
.prof-remove-photo-btn:hover { color: #f87171; }

/* ── Profile Certification Upload Rows ───────────────────────────────────────── */
.prof-cert-row { margin-top: 8px; }
.prof-cert-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; padding: 6px 10px; background: var(--surface2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.prof-cert-status svg { flex-shrink: 0; }
.prof-cert-remove { background: none; border: none; cursor: pointer; font-size: 11px; color: var(--text-faint); text-decoration: underline; padding: 0; }
.prof-cert-remove:hover { color: #f87171; }

/* ── Header Avatar Circle ────────────────────────────────────────────────────── */
.header-avatar-btn { background: none; border: none; cursor: pointer; padding: 2px; border-radius: 50%; transition: box-shadow .15s; }
.header-avatar-btn:hover { box-shadow: 0 0 0 3px rgba(16,185,129,.3); }
.hdr-avatar-circle { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hdr-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.hdr-avatar-initials { font-size: 11px; font-weight: 700; color: #fff; }

/* ── Settings Modal ──────────────────────────────────────────────────────────── */
.settings-modal-body { gap: 0; padding: 0; }
.settings-section { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-section-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px;
}
.settings-toggle-list { display: flex; flex-direction: column; gap: 0; }
.settings-toggle-row {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.settings-toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-toggle-row:first-child { padding-top: 0; }
.settings-toggle-info { flex: 1; min-width: 0; }
.settings-toggle-label { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.settings-toggle-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* Toggle switch */
.settings-toggle-wrap { position: relative; flex-shrink: 0; width: 42px; height: 24px; }
.settings-chk { opacity: 0; width: 0; height: 0; position: absolute; }
.settings-slider {
  position: absolute; inset: 0; border-radius: 24px;
  background: var(--border-light); cursor: pointer;
  transition: background .2s;
}
.settings-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  left: 3px; top: 3px; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.settings-chk:checked + .settings-slider { background: var(--primary); }
.settings-chk:checked + .settings-slider::before { transform: translateX(18px); }

@media (max-width: 960px) {
  .msg-context-panel { display: none !important; }
}
@media (max-width: 700px) {
  .w9-classification { grid-template-columns: 1fr; }
  .w9-steps { flex-direction: column; align-items: flex-start; }
  .w9-step-arrow { display: none; }
  .w9-irs-link { margin-left: 0; width: 100%; text-align: center; }
  .w9-url-row { flex-direction: column; align-items: stretch; }
  .thread-msg { max-width: 90%; }
  .prof-avatar-section { flex-direction: column; align-items: flex-start; }
}


/* ── Group Chat ──────────────────────────────────────────────────────────────── */

/* Group avatar in sidebar — teal ring to distinguish from DMs */
.group-avatar { background: rgba(6,182,212,.15); color: #67e8f9; border: 1px solid rgba(6,182,212,.3); }

/* Section label in group panel */
.group-section-label { padding: 6px 12px 4px; font-size: 10px; font-weight: 700; color: var(--text-faint);
  letter-spacing: .08em; text-transform: uppercase; }

/* Invite card */
.group-invite-card { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--border); background: rgba(99,102,241,.05); }
.group-invite-icon { width: 30px; height: 30px; border-radius: 50%; background: rgba(99,102,241,.15);
  color: #a5b4fc; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.group-invite-info { flex: 1; min-width: 0; }
.group-invite-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.group-invite-from { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.group-invite-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Group message bubbles */
.group-msg { max-width: 78% !important; }
.group-msg-sender { font-size: 10px; font-weight: 700; letter-spacing: .03em; margin-bottom: 3px;
  text-transform: uppercase; padding-left: 2px; }
.group-bubble { border: 1px solid transparent; }

/* Members panel (slides in below thread header) */
#groupMembersPanel { display: none; background: var(--surface-2); border-bottom: 1px solid var(--border);
  padding: 10px 16px; flex-direction: column; gap: 8px; }
.group-members-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.group-member-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 12px; border: 1px solid transparent; font-size: 11px; font-weight: 600; }
.group-add-member-btn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 12px; border: 1px dashed var(--border); background: none; color: var(--text-muted);
  font-size: 11px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s; }
.group-add-member-btn:hover { border-color: var(--primary); color: var(--primary); }
.group-add-member-search { width: 100%; }

/* New Group modal — member search results */
.group-member-result { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  cursor: pointer; border-bottom: 1px solid var(--border); transition: background .15s; }
.group-member-result:last-child { border-bottom: none; }
.group-member-result:hover { background: var(--surface2); }
.group-result-avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(99,102,241,.15);
  color: #a5b4fc; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* Selected member chips */
.group-selected-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 10px;
  border-radius: 12px; font-size: 11px; font-weight: 600; }
.group-chip-remove { background: none; border: none; cursor: pointer; color: inherit; opacity: .7;
  font-size: 14px; line-height: 1; padding: 0 0 0 2px; transition: opacity .15s; }
.group-chip-remove:hover { opacity: 1; }

/* ── Coverage Amount Slider ──────────────────────────────────────────────────── */
.coverage-slider-wrap { display: flex; flex-direction: column; gap: 4px; }
.coverage-amount-display { font-size: 15px; font-weight: 700; color: var(--primary);
  text-align: center; letter-spacing: .01em; }
.coverage-slider { width: 100%; accent-color: var(--primary); cursor: pointer; height: 4px; }
.coverage-labels { display: flex; justify-content: space-between; margin-top: 2px; }
.coverage-labels span { font-size: 9px; color: var(--text-faint); font-weight: 600; }

/* Contractor profile typeahead */
.contractor-typeahead-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .15s; }
.contractor-typeahead-item:last-child { border-bottom: none; }
.contractor-typeahead-item:hover { background: var(--surface3, rgba(255,255,255,.06)); }
.contractor-typeahead-name { font-size: 13px; font-weight: 600; color: var(--text); }
.contractor-typeahead-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* Contractor profile locked tile */
.contractor-profile-tile { display: flex; align-items: center; gap: 6px; }
.contractor-profile-tile-btn { flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: rgba(16,185,129,.08); border: 1.5px solid rgba(16,185,129,.45); border-radius: var(--radius); cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600; text-align: left; transition: background .15s, border-color .15s; }
.contractor-profile-tile-btn:hover { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.7); }
.contractor-profile-tile-btn svg:first-child { color: #10b981; flex-shrink: 0; }
.contractor-profile-tile-btn span { flex: 1; }
.contractor-profile-tile-arrow { color: var(--text-muted); flex-shrink: 0; }
.contractor-profile-tile-clear { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted); cursor: pointer; flex-shrink: 0; transition: background .15s, color .15s; }
.contractor-profile-tile-clear:hover { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.4); color: #f87171; }

/* ══════════════════════════════════════════════════════════════
   ADMIN / AGENCY DASHBOARD — Light theme
   ══════════════════════════════════════════════════════════════ */

.view-admin {
  background: #f4f5f7;
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.admin-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid #f0f0f0;
}
.admin-brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}
.admin-brand-badge {
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16,185,129,.1);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 3px;
  display: inline-block;
}
.admin-nav-links {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  text-align: left;
  transition: background .15s, color .15s;
}
.admin-nav-btn:hover { background: #f3f4f6; color: #111827; }
.admin-nav-btn.is-active { background: rgba(16,185,129,.1); color: #059669; font-weight: 600; }
.admin-nav-btn svg { flex-shrink: 0; }

.admin-sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid #f0f0f0;
}
.admin-signout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #9ca3af;
  transition: background .15s, color .15s;
}
.admin-signout-btn:hover { background: #fef2f2; color: #ef4444; }

/* ── Content area ───────────────────────────────────────────── */
.admin-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
.admin-panel {
  padding: 32px 36px;
  max-width: 1200px;
}

/* ── Page header ────────────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.admin-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.admin-refresh-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}
.admin-refresh-btn:hover { background: #f9fafb; color: #111827; }
.admin-refresh-btn.spinning svg { animation: spin 1s linear infinite; }

/* ── Section titles ─────────────────────────────────────────── */
.admin-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 6px;
}
.admin-section-hint {
  font-size: 13px;
  color: #9ca3af;
  margin: 0 0 20px;
}

/* ── Notice banner ──────────────────────────────────────────── */
.admin-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.admin-notice-link {
  background: none;
  border: none;
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
  font-size: 13px;
}

/* ── Metrics grid ───────────────────────────────────────────── */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.admin-metric-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-metric-icon {
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.admin-metric-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.admin-metric-value {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

/* ── Charts row ─────────────────────────────────────────────── */
.admin-charts-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.admin-chart-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}
.admin-chart-lg { flex: 2; }
.admin-chart-sm { flex: 1; }
.admin-chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px;
}
.admin-chart-sub {
  font-size: 12px;
  color: #9ca3af;
  margin: 0 0 16px;
}

/* ── API Keys list ──────────────────────────────────────────── */
.api-keys-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.api-key-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  padding: 16px 20px;
}
.api-key-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.api-key-info { flex: 1; min-width: 0; }
.api-key-name { font-size: 14px; font-weight: 600; color: #111827; }
.api-key-desc { font-size: 12px; color: #9ca3af; margin-top: 1px; }
.api-key-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}
.api-key-badge.connected { background: rgba(16,185,129,.12); color: #059669; }
.api-key-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.api-key-input {
  width: 220px;
  font-size: 12px !important;
  padding: 7px 10px !important;
}

@media (max-width: 900px) {
  .admin-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-charts-row { flex-direction: column; }
  .admin-sidebar { width: 200px; }
  .api-key-row { flex-wrap: wrap; }
  .api-key-input { width: 160px; }
}
@media (max-width: 640px) {
  .admin-metrics-grid { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-panel { padding: 20px 16px; }
}

/* ── Getting Started ─────────────────────────────────────────────────────── */

/* Sidebar step list */
.gs-step-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px;
}
.gs-step-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  color: var(--text);
}
.gs-step-btn:hover  { background: var(--surface2); }
.gs-step-btn.active { background: rgba(16,185,129,.12); }
.gs-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all .2s;
}
.gs-step-btn.active .gs-step-dot  { border-color: #10b981; background: #10b981; color: #fff; }
.gs-step-btn.done   .gs-step-dot  { border-color: #10b981; background: #10b981; }
.gs-step-btn.done   .gs-step-dot::after { content: '✓'; color: #fff; font-size: 11px; }
.gs-step-info { flex: 1; min-width: 0; }
.gs-step-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.gs-step-sub  { font-size: 11px;   color: var(--text-muted); margin-top: 1px; }
.gs-step-btn.active .gs-step-name { color: #10b981; }

/* Main content */
.gs-main-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 28px;
}
.gs-progress-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 4px;
  margin-bottom: 32px;
  overflow: hidden;
}
.gs-progress-fill {
  height: 100%;
  background: #10b981;
  border-radius: 4px;
  transition: width .4s ease;
}

/* Step content */
.gs-step-content {}
.gs-step-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.gs-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gs-icon-profile { background: rgba(16,185,129,.12); color: #10b981; }
.gs-icon-explore  { background: rgba(59,130,246,.12);  color: #3b82f6; }
.gs-icon-support  { background: rgba(245,158,11,.12);  color: #f59e0b; }
.gs-step-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
}
.gs-step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Video placeholder */
.gs-video-wrap { margin-bottom: 24px; }
.gs-video-placeholder {
  background: var(--surface2);
  border: 2px dashed var(--border);
  border-radius: 12px;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}
.gs-video-label { font-size: 14px; font-weight: 600; color: var(--text); }
.gs-video-sub   { font-size: 12px; color: var(--text-muted); }

/* Profile checklist */
.gs-checklist-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 24px;
}
.gs-checklist-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.gs-checklist { display: flex; flex-direction: column; gap: 8px; }
.gs-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}
.gs-check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gs-check-icon.done    { background: rgba(16,185,129,.15); color: #10b981; }
.gs-check-icon.pending { background: var(--surface);  border: 1.5px solid var(--border); color: transparent; }
.gs-check-label { color: var(--text); }
.gs-check-label.pending { color: var(--text-muted); }
.gs-checklist-congrats {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 14px;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3);
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  color: #10b981;
}

/* Feature cards */
.gs-feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.gs-feature-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gs-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(16,185,129,.1);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gs-feature-name { font-size: 14px; font-weight: 700; color: var(--text); }
.gs-feature-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; flex: 1; }
.gs-feature-btn {
  align-self: flex-start;
  margin-top: 4px;
  background: none;
  border: none;
  color: #10b981;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.gs-feature-btn:hover { text-decoration: underline; }

/* Support form */
.gs-support-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.gs-support-form-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gs-support-form-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.gs-my-tickets {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.gs-my-tickets-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.gs-ticket-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.gs-ticket-item:last-child { border-bottom: none; }
.gs-ticket-clickable { cursor: pointer; border-radius: var(--radius-sm); transition: background .12s; padding: 10px 6px; margin: 0 -6px; }
.gs-ticket-clickable:hover { background: var(--surface2); }
.gs-ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gs-ticket-chevron { flex-shrink: 0; color: var(--text-faint); transition: transform .2s; }
.gs-ticket-subject { font-size: 13px; font-weight: 600; color: var(--text); }
.gs-ticket-meta    { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.gs-ticket-status-open     { color: #f59e0b; font-weight: 600; }
.gs-ticket-status-resolved { color: #10b981; font-weight: 600; }
.gs-ticket-detail { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.gs-ticket-detail-section { background: var(--surface2); border-radius: var(--radius-sm); padding: 10px 12px; }
.gs-ticket-detail-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.gs-ticket-detail-body { font-size: 13px; color: var(--text); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.gs-ticket-admin-note { border: 1px solid rgba(16,185,129,.25); background: rgba(16,185,129,.06); }
.gs-ticket-admin-note .gs-ticket-detail-label { color: #10b981; }
.gs-tickets-empty { font-size: 13px; color: var(--text-muted); }

/* Step actions */
.gs-step-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

@media (max-width: 900px) {
  .gs-feature-cards { grid-template-columns: 1fr; }
  .gs-support-wrap  { grid-template-columns: 1fr; }
}

/* Admin nav badge */
.admin-nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ── Admin: Support Tickets Panel ────────────────────────────────────────── */
.admin-support-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.admin-support-filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all .15s;
}
.admin-support-filter-btn.is-active {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  font-weight: 600;
}
.admin-tickets-list { display: flex; flex-direction: column; gap: 12px; }
.admin-ticket-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  transition: box-shadow .15s;
}
.admin-ticket-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.admin-ticket-card.is-resolved { opacity: .65; }
.admin-ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-ticket-subject {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.admin-ticket-badges { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-ticket-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.admin-ticket-status.open     { background: rgba(245,158,11,.12); color: #d97706; }
.admin-ticket-status.resolved { background: rgba(16,185,129,.12); color: #059669; }
.admin-ticket-user  { font-size: 12.5px; color: #6b7280; margin-bottom: 8px; }
.admin-ticket-msg   { font-size: 13px;   color: #374151; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.admin-ticket-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}
.admin-ticket-note { font-size: 12.5px; color: #374151; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 8px 12px; margin-top: 8px; line-height: 1.5; }
.admin-ticket-note strong { color: #059669; }
.admin-resolve-form { margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.admin-resolve-textarea { width: 100%; border: 1.5px solid #d1d5db; border-radius: 7px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; resize: vertical; min-height: 60px; outline: none;
  transition: border-color .15s; background: #fff; color: #111827; }
.admin-resolve-textarea:focus { border-color: #10b981; }
.admin-resolve-actions { display: flex; gap: 8px; justify-content: flex-end; }
.admin-ticket-date  { font-size: 11.5px; color: #9ca3af; }
.admin-ticket-resolve-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e5e7eb;
  background: transparent;
  color: #6b7280;
  transition: all .15s;
}
.admin-ticket-resolve-btn:hover           { border-color: #10b981; color: #10b981; }
.admin-ticket-resolve-btn.is-resolved:hover { border-color: #f59e0b; color: #d97706; }
.admin-tickets-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 14px;
}
.ticket-priority {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.priority-urgent { background: rgba(239,68,68,.15);  color: #dc2626; }
.priority-high   { background: rgba(249,115,22,.15); color: #ea580c; }
.priority-normal { background: rgba(59,130,246,.12); color: #2563eb; }
.priority-low    { background: rgba(156,163,175,.15);color: #6b7280; }

/* ── Ideas sidebar sub-nav ───────────────────────────────────────────────── */
.ideas-sub-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px; }
.ideas-sub-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 9px; border: none;
  background: none; color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
  transition: background .15s, color .15s;
}
.ideas-sub-btn:hover { background: var(--surface2); color: var(--text); }
.ideas-sub-btn.active { background: var(--surface2); color: var(--primary); font-weight: 600; }
.ideas-sub-btn svg { flex-shrink: 0; }

/* ── Roadmap full-width outer wrapper ────────────────────────────────────── */
.ideas-roadmap-outer { padding: 32px 28px; }
@media (max-width: 600px) { .ideas-roadmap-outer { padding: 20px 16px; } }

/* ── Ideas search ────────────────────────────────────────────────────────── */
.ideas-search-wrap { margin-bottom: 16px; position: relative; }
.ideas-search-wrap .field-input { padding-left: 36px; }
.ideas-search-wrap::before {
  content: '';
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238fa3be' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
  pointer-events: none;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.ideas-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.ideas-page-btn { padding: 6px 14px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.ideas-page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.ideas-page-btn:disabled { opacity: .4; cursor: default; }
.ideas-page-info { font-size: 13px; color: var(--text-muted); min-width: 80px; text-align: center; }

/* ── Ideas main page header ──────────────────────────────────────────────── */
.ideas-page-header { margin-bottom: 24px; }
.ideas-page-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.ideas-page-sub { font-size: 13.5px; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* ── Submit card ─────────────────────────────────────────────────────────── */
.ideas-submit-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 20px; margin-bottom: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.ideas-submit-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.ideas-desc-input { resize: vertical; min-height: 72px; }
.ideas-submit-error { font-size: 12.5px; color: #dc2626; }
.ideas-submit-btn { align-self: flex-start; }

/* ── Ideas feed cards ────────────────────────────────────────────────────── */
.ideas-feed-list { display: flex; flex-direction: column; gap: 12px; }
.idea-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 13px; padding: 16px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.idea-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(16,185,129,.08); }
.idea-upvote-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 44px; padding: 8px 6px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--surface2);
  color: var(--text-muted); cursor: pointer;
  transition: all .15s; flex-shrink: 0;
}
.idea-upvote-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(16,185,129,.06); }
.idea-upvote-btn.upvoted { border-color: var(--primary); background: rgba(16,185,129,.1); color: var(--primary); }
.idea-upvote-btn:disabled { opacity: .5; cursor: not-allowed; }
.idea-upvote-count { font-size: 13px; font-weight: 700; line-height: 1; }
.idea-card-body { flex: 1; min-width: 0; }
.idea-card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.idea-card-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.idea-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 8px; }
.idea-card-meta { font-size: 11.5px; color: var(--text-muted); }

/* ── Idea status badges ──────────────────────────────────────────────────── */
.idea-status-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; flex-shrink: 0;
}
.idea-status-pending       { background: rgba(156,163,175,.15); color: #6b7280; }
.idea-status-consideration { background: rgba(245,158,11,.12);  color: #d97706; }
.idea-status-will-build    { background: rgba(59,130,246,.12);  color: #2563eb; }
.idea-status-complete      { background: rgba(16,185,129,.12);  color: #059669; }

/* ── Roadmap grid ────────────────────────────────────────────────────────── */
.roadmap-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .roadmap-grid { grid-template-columns: 1fr; } }
.roadmap-col {
  background: var(--surface2); border-radius: 13px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.roadmap-col-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.roadmap-col-count {
  margin-left: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); padding: 1px 8px;
}
.roadmap-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.roadmap-dot-consideration { background: #f59e0b; }
.roadmap-dot-will-build    { background: #3b82f6; }
.roadmap-dot-complete      { background: #10b981; }
.roadmap-items { display: flex; flex-direction: column; gap: 8px; }
.roadmap-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.roadmap-card:hover { box-shadow: 0 2px 12px rgba(16,185,129,.1); border-color: var(--primary); }
.roadmap-card-votes {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  white-space: nowrap; padding-top: 1px; flex-shrink: 0;
}
.roadmap-card-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.roadmap-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 16px 0; }
.idea-card.highlight { animation: idea-highlight 1.8s ease; }
@keyframes idea-highlight { 0%,100% { border-color: var(--border); } 20%,60% { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,185,129,.18); } }

/* ── Admin Ideas ─────────────────────────────────────────────────────────── */
.admin-ticket-body { font-size: 13px; color: #374151; line-height: 1.5; margin-bottom: 8px; }
.admin-ticket-meta { font-size: 12px; color: #6b7280; }
.admin-ticket-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.idea-upvote-display {
  font-size: 12px; font-weight: 700; color: #6b7280;
  padding: 4px 10px; background: #f3f4f6;
  border: 1px solid #e5e7eb; border-radius: 20px; white-space: nowrap;
}
.idea-status-select { font-size: 12px !important; padding: 5px 8px !important; width: 165px !important; color: #111827 !important; background: #fff !important; border-color: #d1d5db !important; }
.idea-status-save-btn { padding: 5px 12px; font-size: 12px; font-weight: 600; background: #10b981; color: #fff; border: none; border-radius: 6px; cursor: pointer; transition: background .15s; white-space: nowrap; }
.idea-status-save-btn:hover { background: #059669; }

/* ── Admin: Videos Panel ─────────────────────────────────────────────────── */
.admin-video-list { display: flex; flex-direction: column; gap: 0; }
.admin-video-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.admin-video-row:last-child { border-bottom: none; }
.admin-video-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface2, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6b7280);
  flex-shrink: 0;
  margin-top: 2px;
}
.admin-video-info { flex: 1; min-width: 0; }
.admin-video-name { font-size: 14px; font-weight: 600; color: var(--text, #111827); margin-bottom: 3px; }
.admin-video-desc { font-size: 12.5px; color: var(--text-muted, #6b7280); line-height: 1.5; }
.admin-video-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.admin-video-input {
  width: 280px;
  font-size: 13px !important;
  padding: 8px 12px !important;
}
.admin-video-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(156,163,175,.15);
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-video-badge.admin-video-badge-set {
  background: rgba(16,185,129,.13);
  color: #059669;
}
.admin-video-preview-btn {
  cursor: pointer;
  border: none;
  transition: background .15s, color .15s, transform .1s;
}
.admin-video-preview-btn:hover {
  background: var(--primary, #10b981);
  color: #fff;
  transform: scale(1.08);
}
.admin-video-preview-btn:active { transform: scale(.97); }
.admin-code {
  background: var(--surface2, #f3f4f6);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 12px;
}

/* ── Video Modal ──────────────────────────────────────────────────────────── */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}
.video-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  overflow: hidden;
}
.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.video-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.video-modal-body { padding: 0; }
.video-modal-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 24px;
  color: #9ca3af;
  text-align: center;
}
.video-modal-placeholder-text { font-size: 15px; font-weight: 600; color: #374151; }
.video-modal-placeholder-sub  { font-size: 13px; color: #9ca3af; }
.video-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  color: #9ca3af;
}
.video-modal-loading-text { font-size: 14px; color: #6b7280; }
.video-modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 32px;
  text-align: center;
  color: #9ca3af;
}
.video-modal-error-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-top: 4px;
}
.video-modal-error-sub {
  font-size: 13px;
  color: #6b7280;
  max-width: 380px;
  line-height: 1.6;
}
.video-modal-support-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.video-modal-iframe-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.video-modal-iframe-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── Getting Started: inline iframe video ─────────────────────────────────── */
.gs-video-iframe-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 24px;
}
.gs-video-iframe-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.gs-video-placeholder-btn {
  width: 100%;
  cursor: pointer;
  border: 2px dashed var(--border, #e5e7eb);
  background: var(--surface, #f9fafb);
  transition: border-color .15s, background .15s;
}
.gs-video-placeholder-btn:hover {
  border-color: var(--primary, #10b981);
  background: rgba(16,185,129,.04);
}

/* ── Admin: API Settings Panel ──────────────────────────────────────────────── */
.api-settings-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 24px; }
.api-settings-tab { display: flex; align-items: center; gap: 7px; padding: 9px 16px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; border-radius: 6px 6px 0 0; transition: color .15s, background .15s; }
.api-settings-tab:hover { background: #f9fafb; color: #374151; }
.api-settings-tab.is-active { color: #10b981; border-bottom-color: #10b981; }

.api-tab-content { animation: fadeInUp .15s ease; }
.api-tab-hint { font-size: 13px; color: #6b7280; margin-bottom: 20px; line-height: 1.55; }

/* Webhook rows */
.webhook-list { display: flex; flex-direction: column; gap: 0; border: 1.5px solid #e5e7eb; border-radius: 10px; overflow: hidden; margin-bottom: 28px; }
.webhook-row { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; border-bottom: 1px solid #f3f4f6; background: #fff; }
.webhook-row:last-child { border-bottom: none; }
.webhook-info { flex: 1; min-width: 0; }
.webhook-name { font-size: 13px; font-weight: 700; color: #111827; margin-bottom: 2px; }
.webhook-desc { font-size: 12px; color: #9ca3af; line-height: 1.4; }
.webhook-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.webhook-input { width: 300px; font-size: 12px; }
.whk-status { font-size: 11px; font-weight: 700; white-space: nowrap; }

/* Payload preview */
.webhook-payload-preview { background: #f8fafc; border: 1.5px solid #e5e7eb; border-radius: 8px; padding: 14px 16px; }
.webhook-payload-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; margin-bottom: 10px; }
.webhook-payload-code { font-size: 12px; font-family: 'Menlo','Monaco','Courier New',monospace; color: #374151; line-height: 1.65; margin: 0; white-space: pre; overflow-x: auto; }

/* Firebase user management */
.fb-user-search-row { display: flex; gap: 8px; max-width: 460px; margin-bottom: 14px; }
.fb-searching { font-size: 13px; color: #9ca3af; padding: 10px 0; }
.fb-no-result  { font-size: 13px; color: #9ca3af; padding: 10px 0; }

.fb-user-card { border: 1.5px solid #e5e7eb; border-radius: 10px; overflow: hidden; max-width: 600px; margin-bottom: 20px; }
.fb-user-card-header { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: #fff; }
.fb-user-avatar { width: 42px; height: 42px; border-radius: 50%; background: #d1fae5; color: #10b981;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.fb-user-card-info { flex: 1; min-width: 0; }
.fb-user-card-email { font-size: 14px; font-weight: 700; color: #111827; }
.fb-user-card-meta  { font-size: 11.5px; color: #6b7280; margin-top: 2px; }
.fb-user-card-meta code { background: #f3f4f6; border-radius: 4px; padding: 1px 5px; font-size: 11px; }
.fb-user-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; flex-shrink: 0; }
.fb-status-active    { background: #d1fae5; color: #065f46; }
.fb-status-suspended { background: #fee2e2; color: #991b1b; }
.fb-user-card-footer { display: flex; gap: 8px; padding: 12px 18px; background: #f9fafb; border-top: 1px solid #f3f4f6; flex-wrap: wrap; }

.fb-section-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid #f3f4f6; }
.fb-create-form { max-width: 600px; }

/* ── Admin: Database Update Panel ───────────────────────────────────────────── */
.dbu-layout { display: flex; flex-direction: column; gap: 24px; max-width: 860px; }
.dbu-section-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; margin-bottom: 8px; }
.dbu-hint { font-size: 12px; color: #9ca3af; margin-bottom: 10px; line-height: 1.5; }
.dbu-hint code { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 1px 5px; font-size: 11px; }
.dbu-textarea { width: 100%; min-height: 160px; padding: 12px; font-family: 'Menlo', 'Monaco', monospace; font-size: 12px; line-height: 1.6; border: 1px solid #d1d5db; border-radius: 8px; background: #f9fafb; color: #111827; resize: vertical; outline: none; transition: border-color .15s; }
.dbu-textarea:focus { border-color: #10b981; background: #fff; }
.dbu-actions { display: flex; gap: 10px; margin-top: 12px; }
.dbu-btn-preview { padding: 9px 20px; background: #f1f5f9; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; font-weight: 600; color: #374151; cursor: pointer; transition: background .15s; }
.dbu-btn-preview:hover { background: #e2e8f0; }
.dbu-btn-write { padding: 9px 20px; background: #10b981; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; transition: background .15s, opacity .15s; }
.dbu-btn-write:hover:not(:disabled) { background: #059669; }
.dbu-btn-write:disabled { opacity: .45; cursor: not-allowed; }
.dbu-count-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; background: #10b981; color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; vertical-align: middle; }
.dbu-preview-list { display: flex; flex-direction: column; gap: 4px; }
.dbu-preview-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; flex-wrap: wrap; }
.dbu-preview-reg { font-size: 11px; font-weight: 700; color: #6b7280; font-family: monospace; flex-shrink: 0; width: 72px; }
.dbu-preview-biz { font-size: 12px; font-weight: 600; color: #111827; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbu-preview-svcs { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.dbu-chip { display: inline-block; padding: 2px 8px; background: #e0f2fe; color: #0369a1; border-radius: 10px; font-size: 11px; font-weight: 600; }
.dbu-chip-top { background: #fef3c7; color: #92400e; }
.dbu-log { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-family: 'Menlo', 'Monaco', monospace; max-height: 320px; overflow-y: auto; padding: 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; }
.dbu-log-ok  { color: #059669; }
.dbu-log-err { color: #dc2626; }
.dbu-log-summary { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; color: #374151; font-weight: 700; font-family: inherit; font-size: 13px; }
.dbu-file-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dbu-file-label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: #f1f5f9; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; font-weight: 600; color: #374151; cursor: pointer; transition: background .15s; white-space: nowrap; }
.dbu-file-label:hover { background: #e2e8f0; }
.dbu-file-name { font-size: 12px; color: #9ca3af; }

/* ── Admin: User Accounts Panel ──────────────────────────────────────────── */
.admin-users-count {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  align-self: flex-end;
}
.admin-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 9px;
  padding: 9px 14px;
  margin-bottom: 24px;
  max-width: 420px;
}
.admin-search-wrap svg { color: #9ca3af; flex-shrink: 0; }
.admin-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #111827;
  width: 100%;
}
.admin-search-input::placeholder { color: #9ca3af; }

.admin-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* User Card */
.admin-user-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, border-color .15s;
}
.admin-user-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: #d1d5db;
}
.admin-user-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-user-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.admin-user-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-user-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}
.admin-user-card-biz {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.admin-user-card-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: #374151;
}
.admin-user-card-detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
}
.admin-user-card-detail-row svg { flex-shrink: 0; color: #9ca3af; }
.admin-user-card-detail-row span { color: #374151; }
.admin-user-card-dates {
  display: flex;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
  font-size: 11.5px;
  color: #9ca3af;
}
.admin-user-card-dates strong { color: #6b7280; }
.admin-user-card-footer {
  padding-top: 4px;
}
.admin-switch-btn {
  width: 100%;
  padding: 9px 0;
  border-radius: 8px;
  border: 1.5px solid #10b981;
  background: transparent;
  color: #10b981;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, color .15s;
}
.admin-switch-btn:hover {
  background: #10b981;
  color: #fff;
}

/* Admin User Detail Modal — force light theme (overrides dark CSS vars) */
#adminUserDetailModal.modal-overlay { background: rgba(0,0,0,.5); }
#adminUserDetailModal .modal {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #111827;
  width: 520px;
  max-width: 95vw;
}
#adminUserDetailModal .modal-header { border-bottom-color: #f3f4f6; }
#adminUserDetailModal .modal-close { color: #9ca3af; }
#adminUserDetailModal .modal-close:hover { background: #f3f4f6; color: #374151; }
#adminUserDetailModal .modal-footer { border-top-color: #f3f4f6; }
.admin-user-detail-modal {
  width: 520px;
  max-width: 95vw;
}
.admin-user-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}
.admin-user-detail-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.admin-user-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-user-detail-name {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}
.admin-user-detail-uid {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
  font-family: monospace;
}
.admin-user-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 24px 8px;
}
.aud-section {
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
}
.aud-section:last-child { border-bottom: none; }
.aud-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin-bottom: 10px;
}
.aud-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0;
}
.aud-label {
  font-size: 13px;
  color: #6b7280;
  min-width: 140px;
  flex-shrink: 0;
}
.aud-value {
  font-size: 13px;
  color: #111827;
  font-weight: 500;
  word-break: break-all;
}
.aud-value a {
  color: #10b981;
  text-decoration: none;
  font-weight: 600;
}
.aud-value a:hover { text-decoration: underline; }
.aud-empty { color: #d1d5db; font-weight: 400; }

.admin-users-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 14px;
}
.admin-users-empty svg { margin-bottom: 12px; opacity: .4; }

@media (max-width: 900px) {
  .admin-users-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .admin-users-grid { grid-template-columns: 1fr; }
  .admin-user-detail-modal { width: 95vw; }
}

/* ── Admin: User View Panel ──────────────────────────────────────────────────── */
.auv-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
}
.auv-back-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.auv-admin-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 20px;
  padding: 4px 12px;
}

.auv-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.auv-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.auv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.auv-name {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}
.auv-email {
  font-size: 13px;
  color: #6b7280;
  margin-top: 3px;
}
.auv-meta-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.auv-meta-item {
  font-size: 12px;
  color: #9ca3af;
}
.auv-meta-item strong { color: #6b7280; }

.auv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.auv-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
}
.auv-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin-bottom: 14px;
}
.auv-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #f9fafb;
}
.auv-row:last-child { border-bottom: none; }
.auv-label {
  font-size: 12.5px;
  color: #9ca3af;
  min-width: 120px;
  flex-shrink: 0;
}
.auv-val {
  font-size: 13px;
  color: #111827;
  font-weight: 500;
  word-break: break-word;
}
.auv-val a { color: #10b981; text-decoration: none; font-weight: 600; }
.auv-val a:hover { text-decoration: underline; }
.auv-val.muted { color: #d1d5db; font-weight: 400; }

@media (max-width: 900px) { .auv-grid { grid-template-columns: 1fr; } }

/* Danger zone (suspend) */
.auv-danger-zone {
  margin-top: 24px;
  border: 1.5px solid #fee2e2;
  border-radius: 14px;
  padding: 20px 24px;
  background: #fff5f5;
}
.auv-danger-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #ef4444;
  margin-bottom: 12px;
}
.auv-suspend-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1.5px solid #ef4444;
  background: transparent;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auv-suspend-btn:hover { background: #ef4444; color: #fff; }
.auv-suspend-btn.is-suspended {
  border-color: #10b981;
  color: #10b981;
}
.auv-suspend-btn.is-suspended:hover { background: #10b981; color: #fff; }
.auv-danger-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Plan Tiers panel ────────────────────────────────────────────────────────── */
.pt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.pt-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  transition: box-shadow .15s;
}
.pt-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.08); }
.pt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f3f4f6;
}
.pt-tier-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.pt-tier-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.pt-tier-name-input {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff;
  outline: none;
  display: none;
}
.pt-tier-name-input:focus { border-color: #6366f1; }
.pt-edit-btn {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background .12s, color .12s;
}
.pt-edit-btn:hover { background: #f3f4f6; color: #374151; }
.pt-default-badge {
  font-size: 10px;
  font-weight: 700;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pt-features-list {
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pt-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f9fafb;
}
.pt-feature-row:last-child { border-bottom: none; }
.pt-feature-info { display: flex; align-items: center; gap: 8px; }
.pt-feature-icon { font-size: 14px; line-height: 1; }
.pt-feature-label { font-size: 13px; color: #374151; font-weight: 500; }

.pt-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: #fff;
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all .15s;
}
.pt-add-btn:hover { border-color: #6366f1; color: #6366f1; background: rgba(99,102,241,.04); }

/* ── Payment gating toggle (reused for tier feature switches) ────────────────── */
/* ── Payment gating toggle (admin settings) ─────────────────────────────────── */
.pg-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.pg-toggle-info { flex: 1; }
.pg-toggle-label { font-size: 14px; font-weight: 600; color: #111827; margin-bottom: 4px; }
.pg-toggle-hint  { font-size: 12.5px; color: #6b7280; line-height: 1.5; }
.pg-plan-row { padding: 0 4px 4px; }

/* Toggle switch */
.pg-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.pg-switch input { opacity: 0; width: 0; height: 0; }
.pg-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #d1d5db; border-radius: 24px; transition: background .2s;
}
.pg-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.pg-switch input:checked + .pg-slider { background: #6366f1; }
.pg-switch input:checked + .pg-slider::before { transform: translateX(20px); }

/* Stripe pills on user cards */
.stripe-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.stripe-active   { background: rgba(16,185,129,.12); color: #059669; }
.stripe-trial    { background: rgba(59,130,246,.12);  color: #2563eb; }
.stripe-pastdue  { background: rgba(239,68,68,.12);   color: #dc2626; }
.stripe-canceled { background: rgba(107,114,128,.12); color: #6b7280; }
.stripe-none     { background: rgba(156,163,175,.1);  color: #9ca3af; }

/* Suspended state on card */
.admin-user-card.is-suspended { border-color: #fca5a5; background: #fff5f5; }
.susp-badge {
  font-size: 10px;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Suspend button on card */
.admin-user-card-footer {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}
.admin-suspend-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: transparent;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.admin-suspend-btn:hover { border-color: #ef4444; color: #ef4444; }
.admin-suspend-btn.is-suspended {
  border-color: #10b981;
  color: #10b981;
}
.admin-suspend-btn.is-suspended:hover { background: #10b981; color: #fff; }
.admin-switch-btn { flex: 2; }

/* ── Notification Panel ──────────────────────────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: 300px;
  max-height: calc(100vh - var(--header-h));
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 4px 20px rgba(0,0,0,.3);
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.notif-panel-title { font-size: 14px; font-weight: 700; color: var(--text); }
.notif-clear-btn { background: none; border: none; font-size: 12px; color: var(--primary); cursor: pointer; font-weight: 600; padding: 0; }
.notif-clear-btn:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(16,185,129,.05); }
.notif-item.unread:hover { background: rgba(16,185,129,.1); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.notif-dot.read { background: transparent; }
.notif-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; line-height: 1.35; }
.notif-item-body { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.notif-empty { padding: 40px 16px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ── Group file attachments ─────────────────────────────────────────────────── */
.group-attach-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; flex-shrink: 0; transition: all .15s; }
.group-attach-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-dim); }

.group-attach-preview-wrap { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 14px 4px; }
.group-attach-preview { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); max-width: 100%; }
.group-attach-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.group-attach-icon { color: var(--danger); flex-shrink: 0; }
.group-attach-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.group-attach-name { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-attach-size { font-size: 10px; color: var(--text-muted); }
.group-attach-remove { background: none; border: none; color: var(--text-faint); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; }
.group-attach-remove:hover { color: var(--danger); }

.group-upload-progress { display: flex; align-items: center; gap: 10px; padding: 6px 14px; }
.group-upload-bar { flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.group-upload-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .2s; }
.group-upload-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Group message file rendering */
.group-file-attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.group-file-img-wrap { position: relative; display: inline-block; }
.group-file-img { max-width: 220px; max-height: 180px; border-radius: 8px; display: block; cursor: pointer; object-fit: cover; border: 1px solid rgba(255,255,255,.1); }
.group-file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; text-decoration: none; color: inherit; max-width: 220px; }
.group-file-chip-name { font-size: 11px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-file-chip-size { font-size: 10px; opacity: .7; white-space: nowrap; }
.group-file-pin-btn { background: none; border: none; cursor: pointer; padding: 3px; border-radius: 3px; opacity: .55; color: inherit; transition: opacity .15s; flex-shrink: 0; }
.group-file-pin-btn:hover { opacity: 1; }
.group-file-pin-btn.pinned { opacity: 1; color: var(--gold); }

/* Pinned files in context panel */
.ctx-pinned-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ctx-pinned-empty { font-size: 12px; color: var(--text-faint); padding: 4px 0; }
.ctx-pinned-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.ctx-pinned-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.ctx-pinned-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: rgba(239,68,68,.1); border-radius: 4px; color: var(--danger); flex-shrink: 0; }
.ctx-pinned-info { flex: 1; min-width: 0; }
.ctx-pinned-name { font-size: 11px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-pinned-meta { font-size: 10px; color: var(--text-faint); margin-top: 1px; }
.ctx-pinned-actions { display: flex; gap: 3px; flex-shrink: 0; }
.ctx-pinned-open { color: var(--accent); }
.ctx-pinned-unpin { color: var(--text-faint); }
.ctx-pinned-open:hover { color: var(--primary); }
.ctx-pinned-unpin:hover { color: var(--danger); }

/* ── Theme Toggle Button ─────────────────────────────────────────────────────── */
.btn-theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  transition: background .15s, color .15s, border-color .15s;
}
.btn-theme-toggle:hover { background: var(--card); color: var(--text); border-color: var(--border-light); }

/* ── Light Mode ──────────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #f4f5f7;
  --surface:      #ffffff;
  --surface2:     #f1f5f9;
  --card:         #ffffff;
  --card-hover:   #f8fafc;
  --border:       #e5e7eb;
  --border-light: #d1d5db;
  --primary:      #059669;
  --primary-dark: #047857;
  --primary-dim:  rgba(5,150,105,.10);
  --accent:       #2563eb;
  --accent-dim:   rgba(37,99,235,.10);
  --danger:       #dc2626;
  --gold:         #d97706;
  --text:         #111827;
  --text-muted:   #6b7280;
  --text-faint:   #9ca3af;
  --shadow:       0 4px 20px rgba(0,0,0,.08);
}

/* Light mode — specific overrides for hardcoded values */
[data-theme="light"] .biz-tooltip::after {
  background: #1e293b;
  color: #f1f5f9;
}
[data-theme="light"] .result-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
[data-theme="light"] .notif-panel {
  box-shadow: -4px 4px 20px rgba(0,0,0,.12);
}
[data-theme="light"] .auth-error { background: rgba(220,38,38,.08); color: #b91c1c; }
[data-theme="light"] .auth-success { color: #065f46; }
[data-theme="light"] .mobile-extra-danger { color: #dc2626 !important; }
[data-theme="light"] .mobile-extra-danger:hover { background: rgba(220,38,38,.08) !important; }
[data-theme="light"] .ctx-pinned-icon { background: rgba(220,38,38,.08); }
[data-theme="light"] .group-file-chip { background: rgba(220,38,38,.08); }
[data-theme="light"] .sidebar-overlay { background: rgba(0,0,0,.35); }
[data-theme="light"] .admin-panel { background: #f4f5f7; }
[data-theme="light"] .admin-card { background: #ffffff; border-color: #e5e7eb; }
[data-theme="light"] .view-login {
  background: radial-gradient(ellipse at 60% 20%, rgba(5,150,105,.07) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(37,99,235,.05) 0%, transparent 50%),
              #f4f5f7;
}

/* ── Apply Member Modal — service chips ────────────────────────────────────── */
.am-service-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.am-service-chip {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.am-service-chip:hover { border-color: var(--primary); color: var(--text); }
.am-service-chip.selected { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Admin app card — service tags ─────────────────────────────────────────── */
.app-other-services { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.app-service-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary-dim); color: var(--primary); border: 1px solid var(--primary);
}

/* ── Member User Applications cards (admin panel) ──────────────────────────── */
.mua-card {
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 12px;
  transition: box-shadow .15s;
}
.mua-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }

.mua-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.mua-biz-name { font-size: 15px; font-weight: 700; color: #111827; }
.mua-person   { font-size: 13px; color: #6b7280; margin-top: 3px; }

.mua-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mua-status-pending  { background: rgba(245,158,11,.12); color: #d97706; }
.mua-status-approved { background: rgba(16,185,129,.12);  color: #059669; }
.mua-status-rejected { background: rgba(239,68,68,.1);    color: #dc2626; }

.mua-contact-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 14px;
}
.mua-contact-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; }

.mua-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
  margin-bottom: 12px;
}
.mua-detail-label { font-size: 10.5px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.mua-detail-val   { font-size: 13px; color: #374151; }

.mua-notes {
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
  border-left: 3px solid #d1d5db;
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.mua-service-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  margin: 2px 2px 0 0;
}

.mua-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}
.mua-submitted { font-size: 11.5px; color: #9ca3af; }

.mua-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.mua-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.mua-btn-approve { background: #10b981; color: #fff; border-color: #10b981; }
.mua-btn-approve:hover { background: #059669; border-color: #059669; }
.mua-btn-reject  { background: transparent; color: #dc2626; border-color: #fca5a5; }
.mua-btn-reject:hover  { background: rgba(239,68,68,.08); border-color: #dc2626; }
.mua-btn-reopen  { background: transparent; color: #6b7280; border-color: #e5e7eb; }
.mua-btn-reopen:hover  { border-color: #9ca3af; color: #374151; }
.mua-btn-delete  { background: transparent; color: #9ca3af; border-color: #e5e7eb; }
.mua-btn-delete:hover  { color: #dc2626; border-color: #fca5a5; }

/* ── Light-theme stat row overrides for Apps & Temp panels ─────────────────── */
#adminAppsPanel .admin-stats-row,
#adminTempUsersPanel .admin-stats-row {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 16px;
}
#adminAppsPanel .admin-stat-label,
#adminTempUsersPanel .admin-stat-label { color: #9ca3af; }
#adminAppsPanel .admin-stat.total .admin-stat-num,
#adminTempUsersPanel .admin-stat.total .admin-stat-num    { color: #111827; }
#adminAppsPanel .admin-stat.pending .admin-stat-num,
#adminTempUsersPanel .admin-stat.pending .admin-stat-num  { color: #d97706; }
#adminAppsPanel .admin-stat.approved .admin-stat-num,
#adminTempUsersPanel .admin-stat.approved .admin-stat-num { color: #059669; }
#adminAppsPanel .admin-stat.rejected .admin-stat-num,
#adminTempUsersPanel .admin-stat.rejected .admin-stat-num { color: #dc2626; }

/* ── Pagination controls ─────────────────────────────────────────────────────── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 20px 4px;
}
.admin-page-btn {
  padding: 6px 16px;
  border-radius: 7px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.admin-page-btn:hover:not(:disabled) { background: #f3f4f6; border-color: #9ca3af; }
.admin-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.admin-page-info { font-size: 13px; color: #6b7280; }

#adminAppsBody { display: flex; flex-direction: column; padding: 20px; }

/* ── Temp Member Badges (profile cards & list rows) ─────────────────────────── */
.temp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(239,68,68,.12);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,.3);
  letter-spacing: .03em;
}
.temp-badge-sm {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(239,68,68,.12);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,.25);
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Temp Users Panel — status badges ───────────────────────────────────────── */
.temp-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.temp-status-active    { background: rgba(245,158,11,.12); color: #d97706; }
.temp-status-expired   { background: rgba(239,68,68,.1);   color: #dc2626; }
.temp-status-converted { background: rgba(16,185,129,.12); color: #059669; }

/* ── Temp Users Panel — progress bar ────────────────────────────────────────── */
.temp-progress-wrap {
  height: 6px;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}
.temp-progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width .3s;
}
.temp-progress-label {
  font-size: 11.5px;
  color: #9ca3af;
  margin-bottom: 12px;
}

#adminTempBody { display: flex; flex-direction: column; padding: 20px; }

/* ── Insurance verification status badges (own profile card) ───────────────── */
.ins-verif-badge-verified  { background: rgba(16,185,129,.15) !important; color: #10b981 !important; border-color: rgba(16,185,129,.35) !important; }
.ins-verif-badge-pending   { background: rgba(245,158,11,.12) !important; color: #f59e0b !important; border-color: rgba(245,158,11,.35) !important; }
.ins-verif-badge-release   { background: rgba(6,182,212,.12)  !important; color: #06b6d4 !important; border-color: rgba(6,182,212,.35)  !important; }
.ins-verif-badge-release:hover { opacity: .85; }

/* ── Insurance Verification Modal ──────────────────────────────────────────── */
.ins-steps-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}
.ins-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.ins-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all .2s;
}
.ins-step-dot.ins-step-active {
  background: #06b6d4;
  border-color: #06b6d4;
  color: #000;
}
.ins-step-dot.ins-step-done {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.ins-step-label {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}
.ins-step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 20px;
}
.ins-step-hint {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.ins-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 4px;
}
.ins-upload-zone:hover, .ins-upload-zone.ins-drag-over {
  border-color: #06b6d4;
  background: rgba(6,182,212,.05);
}
.ins-upload-zone.ins-file-selected {
  border-color: #10b981;
  background: rgba(16,185,129,.05);
}
.ins-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.ins-divider::before, .ins-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.ins-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) { .ins-form-grid { grid-template-columns: 1fr; } }
.ins-release-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  max-height: 260px;
  overflow-y: auto;
}
.ins-release-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ins-release-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
}
.ins-release-text p { margin: 0 0 10px; }
.ins-release-text ul { margin: 0 0 10px; padding-left: 18px; }
.ins-release-text li { margin-bottom: 4px; }
.ins-agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ins-agree-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.ins-error {
  color: #ef4444;
  font-size: 12.5px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(239,68,68,.08);
  border-radius: 6px;
}

/* ── Admin Insurance Releases Table ────────────────────────────────────────── */
.rel-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.rel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
.rel-table th {
  background: #f9fafb;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.rel-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
  vertical-align: top;
}
.rel-table tr:last-child td { border-bottom: none; }
.rel-table tr:hover td { background: #f9fafb; }
.rel-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rel-badge-verified  { background: #d1fae5; color: #065f46; }
.rel-badge-pending   { background: #fef3c7; color: #92400e; }
.rel-badge-expired   { background: #fee2e2; color: #991b1b; }
.rel-badge-incomplete { background: #f3f4f6; color: #6b7280; }
