/* Cities CRM themes: bright (default), midnight, dark. Brand color comes from --brand (Branding page). */

/* ---------- shared: brand color + header pieces ---------- */
body .app-main, body .ce-wrap, body .ce-drawer { --blue: var(--brand); --blue-dk: var(--brand-dk); --blue-lt: var(--brand-lt); }
body a { color: var(--brand); }
.app-top .app-brand b { display: block; letter-spacing: .02em; font-size: 16px; line-height: 1.1; }
.app-top .app-brand small { opacity: .65; font-size: 12px; }
.app-top .more { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.app-search { position: relative; display: flex; align-items: center; }
.app-search svg { position: absolute; left: 12px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; opacity: .55; pointer-events: none; }
.app-search input { width: 300px; height: 40px; border-radius: 999px; border: 0; padding: 0 16px 0 38px; font: 14px inherit; outline: none; }
.app-ic { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.app-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-av { display: inline-flex; align-items: center; gap: 8px; text-decoration: none !important; }
.app-av span { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 13px inherit; background: var(--brand); color: #fff; }
.app-av em { font-style: normal; font-size: 13px; opacity: .75; }
.app-top .more a { text-decoration: none; }
.app-nav a { border-left: 4px solid transparent; }
.app-nav a.on { border-left-color: var(--brand); }

/* ---------- BRIGHT (BankDash-style) ---------- */
body.th-bright, body.th-bright .app-main { background: #f5f7fa; }
body.th-bright .app-top { background: #fff; color: #232323; border-bottom: 1px solid #e6eff5; height: 76px; padding-left: 26px; }
body.th-bright .app-top img { height: 40px; border-radius: 8px; }
body.th-bright .app-top .app-brand b { font-size: 21px; font-weight: 800; color: #343c6a; letter-spacing: -.01em; }
body.th-bright .app-top .app-brand small { color: #718ebf; }
body.th-bright .app-search input { background: #f5f7fa; color: #343c6a; }
body.th-bright .app-search svg { color: #718ebf; }
body.th-bright .app-ic { background: #f5f7fa; color: #718ebf; }
body.th-bright .app-ic:hover { color: var(--brand); }
body.th-bright .app-av em { color: #718ebf; }
body.th-bright .app-nav { top: 76px; width: 230px; background: #fff; border-right: 1px solid #e6eff5; padding-top: 14px; }
body.th-bright .app-nav a { color: #b1b1b1; font-weight: 500; padding: 12px 26px; }
body.th-bright .app-nav a:hover { color: #343c6a; background: transparent; }
body.th-bright .app-nav a.on { color: var(--brand); background: transparent; font-weight: 600; border-left-width: 6px; border-radius: 0 6px 6px 0; }
body.th-bright .app-main { margin-left: 230px; padding: 10px 30px 50px; }
body.th-bright .ce-wrap h1, body.th-bright .ce-h2, body.th-bright .ce-panel h2 { color: #343c6a; }
body.th-bright .ce-panel, body.th-bright .ce-table, body.th-bright .ce-stat, body.th-bright .ce-card-form, body.th-bright .ce-edit, body.th-bright .ce-file, body.th-bright .ce-pcard, body.th-bright .card {
  border: 0; border-radius: 22px; box-shadow: 0 6px 24px rgba(52, 60, 106, .07);
}
body.th-bright .ce-table th { background: #fff; color: #718ebf; font-weight: 600; }
body.th-bright .ce-col { background: #fff; border-radius: 22px; box-shadow: 0 6px 24px rgba(52, 60, 106, .06); }
body.th-bright .ce-card { border: 1px solid #eef2f7; border-radius: 16px; box-shadow: 0 2px 8px rgba(52, 60, 106, .05); }
body.th-bright .ce-btn { border-radius: 50px; }
body.th-bright .ce-subtabs a { border-radius: 50px; border-color: #e6eff5; color: #718ebf; }
body.th-bright .ce-subtabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
body.th-bright .ce-toggle { border-radius: 50px; }
body.th-bright .ce-drawer-panel { border-radius: 24px 0 0 24px; }

/* ---------- MIDNIGHT (refreshed original) ---------- */
body.th-midnight .app-top { background: linear-gradient(90deg, #0e1520, #172131); }
body.th-midnight .app-nav { background: linear-gradient(180deg, #121a24, #0d131c); }
body.th-midnight .app-nav a.on { background: rgba(255, 255, 255, .07); }
body.th-midnight .app-search input { background: rgba(255, 255, 255, .1); color: #fff; }
body.th-midnight .app-search input::placeholder { color: #9fb0bf; }
body.th-midnight .app-ic { color: #c5ced8; }
body.th-midnight .app-av em { color: #c5ced8; }
body.th-midnight .ce-panel, body.th-midnight .ce-table, body.th-midnight .ce-stat, body.th-midnight .ce-card-form, body.th-midnight .ce-edit { border-radius: 16px; box-shadow: 0 2px 10px rgba(18, 26, 36, .05); }
body.th-midnight .ce-subtabs a.on { background: var(--brand); border-color: var(--brand); }

/* ---------- DARK MODE ---------- */
body.th-dark { color-scheme: dark; }
body.th-dark, body.th-dark .app-main { background: #0f141b; color: #dbe3ec; }
body.th-dark .app-top { background: #151c25; border-bottom: 1px solid #232d3a; }
body.th-dark .app-nav { background: #151c25; border-right: 1px solid #232d3a; }
body.th-dark .app-nav a { color: #7f8fa3; }
body.th-dark .app-nav a.on, body.th-dark .app-nav a:hover { color: #fff; background: #1d2632; }
body.th-dark .app-search input { background: #1d2632; color: #dbe3ec; }
body.th-dark .app-ic { color: #9fb0bf; }
body.th-dark .app-av em { color: #9fb0bf; }
body.th-dark .ce-wrap, body.th-dark .ce-drawer { --ink: #dbe3ec; --navy: #f2f6fa; --muted: #8b9bb0; --line: #263142; --bg: #1a222d; color: #dbe3ec; }
body.th-dark .ce-panel, body.th-dark .ce-table, body.th-dark .ce-stat, body.th-dark .ce-card-form, body.th-dark .ce-edit, body.th-dark .ce-file, body.th-dark .ce-pcard,
body.th-dark .ce-card, body.th-dark .ce-col, body.th-dark .ce-drawer-panel, body.th-dark .ce-sec, body.th-dark .notice, body.th-dark .ce-cal-d, body.th-dark .ce-cal-h, body.th-dark .ce-upg, body.th-dark .hm-kpi {
  background: #161e28 !important; border-color: #263142 !important; color: #dbe3ec;
}
body.th-dark .ce-col { background: #121922 !important; }
body.th-dark .ce-table th { background: #1a222d; color: #8b9bb0; }
body.th-dark .ce-table td { border-color: #263142; }
body.th-dark input, body.th-dark select, body.th-dark textarea { background: #0f141b !important; color: #dbe3ec !important; border-color: #2c3848 !important; }
body.th-dark .ce-btn.ce-ghost, body.th-dark .ce-subtabs a, body.th-dark .ce-toggle a, body.th-dark .ce-toggle button { background: #161e28 !important; border-color: #2c3848 !important; color: #c5d3e2 !important; }
body.th-dark .ce-subtabs a.on, body.th-dark .ce-toggle .on { background: var(--brand) !important; color: #fff !important; }
body.th-dark .ce-muted, body.th-dark small { color: #8b9bb0; }
body.th-dark .ce-wrap h1, body.th-dark .ce-panel h2, body.th-dark .ce-h2, body.th-dark h3, body.th-dark strong, body.th-dark b { color: #f2f6fa; }

/* ---------- Home dashboard ---------- */
.hm-hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.hm-hello h1 { font-size: 28px !important; margin: 0 !important; }
.hm-hello p { margin: 4px 0 0; }
.hm-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.hm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.hm-kpi { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 22px; padding: 18px; box-shadow: 0 6px 24px rgba(52, 60, 106, .07); }
.hm-kpi small { display: block; color: var(--muted); font-size: 13px; }
.hm-kpi b { display: block; font-size: 24px; color: var(--navy); margin: 2px 0; }
.hm-kpi em { font-style: normal; font-size: 12px; color: #16a34a; font-weight: 600; }
.hm-kpi.down em, .hm-kpi.warn em { color: #dc2626; }
.hm-ic { flex: none; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.hm-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k1 .hm-ic { background: #fff5d9; color: #ffbb38; } .k2 .hm-ic { background: var(--brand-lt); color: var(--brand); } .k3 .hm-ic { background: #dcfaf8; color: #16dbcc; } .k4 .hm-ic { background: #ffe0eb; color: #ff82ac; }
.hm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hm-grid .ce-panel { margin: 0; }
.hm-chart { grid-column: span 2; }
.hm-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.hm-h h2 { margin: 0; font-size: 19px; }
.hm-bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; height: 220px; align-items: end; }
.hm-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.hm-bar i { width: 60%; max-width: 34px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--brand), var(--brand-lt)); min-height: 3px; }
.hm-bar:last-child i { background: var(--brand); }
.hm-bar small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.hm-v { font-size: 11px; font-weight: 700; color: var(--navy); }
.hm-attn a { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink) !important; }
.hm-attn a:last-child { border: 0; }
.hm-attn a b { min-width: 44px; height: 44px; border-radius: 14px; background: var(--brand-lt); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.hm-attn small { display: block; color: var(--muted); }
.hm-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; }
.hm-row div { flex: 1; min-width: 0; }
.hm-row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-row small { color: var(--muted); }
.hm-dot { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.hm-dot.pay { background: #dcfaf8; color: #16a34a; } .hm-dot.cal { background: var(--brand-lt); color: var(--brand); }
.hm-row .pos { color: #16a34a; white-space: nowrap; }
.hm-stage { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; margin: 9px 0; font-size: 13px; }
.hm-stage i { height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.hm-stage i b { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.hm-stage em { font-style: normal; font-weight: 600; }
body.th-dark .hm-stage i { background: #263142; }

/* ---------- Branding page ---------- */
.ce-brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.ce-brand-logo { height: 110px; border: 2px dashed var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; background: #fff; }
.ce-brand-logo img { max-height: 90px; max-width: 90%; }
.ce-color { flex-direction: row !important; align-items: center; gap: 12px !important; }
.ce-color input { width: 64px !important; height: 44px !important; padding: 2px !important; }
.ce-themes { display: grid; gap: 12px; }
.ce-theme { display: grid !important; grid-template-columns: 24px 140px 1fr; grid-template-rows: auto auto; gap: 2px 14px !important; align-items: center; border: 2px solid var(--line); border-radius: 16px; padding: 12px; cursor: pointer; margin: 0 !important; }
.ce-theme:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-lt); }
.ce-theme input { grid-row: span 2; width: 20px; height: 20px; }
.ce-theme strong { color: var(--navy); font-size: 15px; }
.ce-theme small { grid-column: 3; color: var(--muted); font-weight: 400; }
.ce-theme-pv { grid-row: span 2; position: relative; height: 80px; border-radius: 10px; overflow: hidden; display: block; border: 1px solid var(--line); }
.ce-theme-pv i { position: absolute; left: 0; top: 0; bottom: 0; width: 30%; }
.ce-theme-pv b { position: absolute; left: 0; right: 0; top: 0; height: 18%; }
.ce-theme-pv em { position: absolute; height: 26%; width: 28%; top: 30%; border-radius: 6px; }
.ce-theme-pv em + em { left: 66%; }
.ce-theme-pv em:first-of-type { left: 35%; }
.ce-theme-bright .ce-theme-pv { background: #f5f7fa; } .ce-theme-bright i, .ce-theme-bright b { background: #fff; } .ce-theme-bright em { background: var(--brand); }
.ce-theme-midnight .ce-theme-pv { background: #f3f5f7; } .ce-theme-midnight i, .ce-theme-midnight b { background: #121a24; } .ce-theme-midnight em { background: #fff; box-shadow: 0 0 0 1px #dde3e9; }
.ce-theme-dark .ce-theme-pv { background: #0f141b; } .ce-theme-dark i, .ce-theme-dark b { background: #151c25; } .ce-theme-dark em { background: #1d2632; }

@media (max-width: 1100px) { .hm-kpis { grid-template-columns: repeat(2, 1fr); } .hm-grid { grid-template-columns: 1fr 1fr; } .app-search input { width: 200px; } }
@media (max-width: 900px) {
  body.th-bright .app-nav { top: auto; width: 100%; border-right: 0; border-top: 1px solid #e6eff5; padding: 0 0 env(safe-area-inset-bottom); }
  body.th-bright .app-nav a { padding: 9px 0; border-left: 0; }
  body.th-bright .app-nav a.on { border-left: 0; box-shadow: inset 0 3px 0 var(--brand); border-radius: 0; }
  body.th-bright .app-main { margin: 0; padding: 4px 12px 90px; }
  body.th-bright .app-top { height: 64px; padding-left: 14px; }
  .app-search, .app-av em { display: none; }
  .hm-kpis, .hm-grid { grid-template-columns: 1fr; } .hm-chart { grid-column: auto; } .ce-brand-grid { grid-template-columns: 1fr; }
}
body.th-bright .ce-sign-top{top:76px}body.th-bright .ce-banner{top:140px}
html:has(body.th-dark){background:#0f141b}html:has(body.th-bright){background:#f5f7fa}
body.th-bright .ce-toggle .on,body.th-midnight .ce-toggle .on{background:var(--brand);color:#fff}

/* ---------- Notifications bell ---------- */
.app-bell { position: relative; }
.app-bell .app-ic { border: 0; cursor: pointer; position: relative; background: transparent; }
body.th-bright .app-bell .app-ic { background: #f5f7fa; color: #718ebf; }
#ce-bell-n { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e11d2e; color: #fff; font: 700 11px/18px inherit; text-align: center; }
.app-bell-pop { position: absolute; right: 0; top: 50px; width: 380px; max-width: 92vw; max-height: 70vh; overflow: auto; background: #fff; color: #1f2937; border-radius: 18px; box-shadow: 0 18px 50px rgba(15,23,42,.22); z-index: 2000; text-align: left; }
.app-bell-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eef2f7; position: sticky; top: 0; background: #fff; }
.app-bell-h a { color: var(--brand) !important; font-size: 13px; }
#ce-bell-list { padding: 6px; } #ce-bell-list .ce-muted { padding: 12px; margin: 0; }
.app-bell-f { padding: 12px 16px; border-top: 1px solid #eef2f7; } .app-bell-f .ce-btn { width: 100%; }
.ce-note { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none !important; color: inherit !important; }
.ce-note:hover { background: #f5f7fa; }
.ce-note.new { background: var(--brand-lt); }
.ce-note b { display: block; font-size: 14px; line-height: 1.3; }
.ce-note span { display: block; font-size: 13px; color: #4b5563; white-space: pre-line; margin-top: 2px; }
.ce-note small { color: #9ca3af; font-size: 12px; }
.ce-note-list .ce-note { border-bottom: 1px solid var(--line); border-radius: 0; }
body.th-dark .app-bell-pop, body.th-dark .app-bell-h { background: #161e28; color: #dbe3ec; } body.th-dark .ce-note span { color: #9fb0bf; } body.th-dark .ce-note:hover { background: #1d2632; }

/* ---------- Goals ---------- */
.hm-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.hm-goal { background: #fff; border-radius: 22px; padding: 18px 20px; box-shadow: 0 6px 24px rgba(52,60,106,.07); }
.hm-goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hm-goal-top span { color: var(--muted); font-size: 13px; }
.hm-goal-top b { font-size: 22px; color: var(--navy); } .hm-goal-top small { font-size: 13px; color: var(--muted); font-weight: 500; }
.hm-goal-bar { position: relative; height: 12px; border-radius: 8px; background: var(--bg, #eef2f7); margin: 10px 0 8px; }
.hm-goal-bar i { display: block; height: 100%; border-radius: 8px; background: var(--brand); transition: width .6s; }
.hm-goal-bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #111827; opacity: .45; border-radius: 1px; }
.hm-goal.behind .hm-goal-bar i { background: #f59e0b; } .hm-goal.done .hm-goal-bar i, .hm-goal-bar.done i { background: #16a34a; }
.hm-goal-msg { font-size: 13px; color: var(--ink); } .hm-goal-msg b { float: right; }
.hm-goal.behind .hm-goal-msg { color: #b45309; }
.hm-goal-link { align-self: center; font-weight: 600; text-decoration: none; }
.hm-goal-empty { display: block; margin-bottom: 16px; padding: 16px 20px; border-radius: 22px; border: 2px dashed var(--brand); background: var(--brand-lt); text-decoration: none !important; }
.hm-goal-empty b { display: block; color: var(--brand); font-size: 16px; } .hm-goal-empty span { color: var(--ink); font-size: 14px; }
.ce-goal-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; } .ce-goal-grid .ce-panel { margin: 0 0 16px; }
.ce-goal-reps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ce-table tr.ce-me td { background: var(--brand-lt); }
.ce-check { display: flex !important; flex-direction: row !important; gap: 8px; align-items: flex-start; margin: 8px 0; font-weight: 500 !important; }
body.th-dark .hm-goal { background: #161e28; } body.th-dark .hm-goal-bar { background: #263142; } body.th-dark .hm-goal-bar em { background: #fff; }
@media (max-width: 900px) { .ce-goal-grid { grid-template-columns: 1fr; } .app-bell-pop { position: fixed; left: 4vw; right: 4vw; top: 70px; width: auto; } }
.app-top .app-bell-pop b,.app-top .app-bell-pop strong{letter-spacing:normal;font-size:14px;color:inherit}.app-top .app-bell-pop strong{font-size:15px}

/* ---------- Open jobs pool + Hand off jobs ---------- */
.ce-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 10px 0 22px; }
.ce-pool-card { background: #fff; border: 1px solid #e6eaf0; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 24px rgba(52, 60, 106, .06); }
.ce-pool-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ce-pool-h h3 { margin: 0; font-size: 17px; } .ce-pool-h p { margin: 2px 0 0; color: #6b7686; font-size: 14px; }
.ce-pool-v { font-size: 18px; color: #1f8a4c; white-space: nowrap; }
.ce-pool-m { display: flex; flex-wrap: wrap; gap: 6px; }
.ce-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--brand-lt, #eef0ff); color: var(--brand, #2d3cf0); font-size: 12px; font-weight: 600; }
.ce-pill-soft { background: #f1f3f6; color: #4b5563; }
.ce-pool-t { margin: 0; font-size: 13px; }
.ce-pool-f { display: flex; gap: 8px; margin-top: auto; }
.ce-pool-f select { flex: 1; min-width: 0; height: 42px; border: 1px solid #d5dbe3; border-radius: 10px; padding: 0 10px; font: inherit; }
.ce-pool-f .ce-btn { flex: none; } .ce-pool-f .ce-btn:only-child { width: 100%; justify-content: center; }
.ce-pool-set { max-width: 520px; }
.ce-handoff { margin-top: 18px; } .ce-handoff fieldset { border: 0; padding: 0; margin: 4px 0 8px; display: grid; gap: 6px; } .ce-handoff legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.ce-ho-split { display: grid; gap: 6px; padding: 10px 12px; background: #f6f8fb; border-radius: 12px; margin-bottom: 8px; }
body.th-dark .ce-pool-card { background: #161e28; border-color: #263142; } body.th-dark .ce-pill-soft { background: #1d2632; color: #c3cdd9; } body.th-dark .ce-ho-split { background: #1d2632; }
.ce-handoff .ce-check, .ce-pool-set .ce-check { display: flex !important; align-items: center; gap: 10px; font-weight: 500; }
.ce-handoff .ce-check input { width: 18px !important; height: 18px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; flex: none; accent-color: var(--brand); }
.ce-pool-f:not(:has(select)) .ce-btn { flex: 1; justify-content: center; }

/* ---------- Integrations ---------- */
.ce-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-top: 12px; }
.ce-app { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid #e6eaf0; border-radius: 18px; padding: 18px; text-decoration: none !important; color: inherit !important; transition: box-shadow .15s, border-color .15s; position: relative; }
.ce-app:hover { border-color: var(--brand); box-shadow: 0 8px 28px rgba(52, 60, 106, .1); }
.ce-app > div { flex: 1; min-width: 0; } .ce-app p { margin: 4px 0 6px; color: #5d6878; font-size: 14px; line-height: 1.45; } .ce-app small { color: #8a94a6; font-size: 12px; }
.ce-app-h { display: flex; align-items: center; gap: 8px; } .ce-app-h b { font-size: 16px; color: #1f2937; }
.ce-app-go { position: absolute; right: 16px; bottom: 14px; font-weight: 700; font-size: 13px; color: var(--brand); }
.ce-app-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--c); color: #fff; font: 800 15px/1 Inter, sans-serif; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.ce-app-ic[style*="#ffe01b"] { color: #241c15; }
.ce-on { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #15803d; } .ce-on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.ce-app-hero { display: flex; gap: 16px; align-items: center; margin: 4px 0 16px; } .ce-app-hero .ce-app-ic { width: 60px; height: 60px; font-size: 19px; border-radius: 18px; } .ce-app-hero h1 { margin: 0; display: flex; align-items: center; gap: 10px; } .ce-app-hero p { margin: 4px 0 0; }
.ce-app-body { max-width: 860px; } .ce-app-body h3 { margin: 18px 0 8px; } .ce-app-body h3:first-child { margin-top: 0; } .ce-app-body ol { padding-left: 20px; } .ce-app-body li { margin: 6px 0; }
.ce-copy { display: flex; gap: 8px; margin: 8px 0 14px; } .ce-copy input { flex: 1; min-width: 0; font: 13px ui-monospace, Menlo, monospace; padding: 10px 12px; border: 1px solid #d5dbe3; border-radius: 10px; background: #f8fafc; }
.ce-inline { display: inline-block; margin: 6px 6px 0 0; }
.ce-cal-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 14px; } .ce-cal-how > div { background: #f6f8fb; border-radius: 14px; padding: 14px; } .ce-cal-how p { margin: 8px 0 0; }
.ce-qb-btn { background: #2ca01c !important; border-color: #2ca01c !important; }
body.th-dark .ce-app { background: #161e28; border-color: #263142; } body.th-dark .ce-app-h b { color: #e5e7eb; } body.th-dark .ce-cal-how > div, body.th-dark .ce-copy input { background: #1d2632; color: #dbe3ec; border-color: #263142; }

/* ---------- Messages ---------- */
.ce-inbox { display: grid; grid-template-columns: 220px 340px 1fr; background: #fff; border: 1px solid #e6eaf0; border-radius: 20px; overflow: hidden; height: calc(100vh - 150px); min-height: 520px; }
.ce-ib-boxes { padding: 18px 12px; border-right: 1px solid #eef1f5; display: flex; flex-direction: column; gap: 2px; } .ce-ib-boxes h1 { font-size: 22px; margin: 0 8px 12px; }
.ce-ib-boxes a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; color: #374151 !important; text-decoration: none !important; font-weight: 500; }
.ce-ib-boxes a.on { background: var(--brand-lt); color: var(--brand) !important; font-weight: 700; }
.ce-ib-boxes a b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #e11d2e; color: #fff; font-size: 12px; text-align: center; } .ce-ib-boxes a b.req { background: #f59e0b; }
.ce-ib-tip { font-size: 12px; margin: auto 8px 0; }
.ce-ib-list { border-right: 1px solid #eef1f5; overflow-y: auto; }
.ce-ib-row { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #f2f4f7; text-decoration: none !important; color: inherit !important; }
.ce-ib-row:hover { background: #f8fafc; } .ce-ib-row.on { background: var(--brand-lt); }
.ce-ib-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e8ecf3; color: #334155; font-weight: 700; }
.ce-ib-row.unread .ce-ib-av { background: var(--brand); color: #fff; }
.ce-ib-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ce-ib-txt b { font-size: 14px; color: #111827; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ce-ib-row.unread .ce-ib-txt b { font-weight: 800; }
.ce-ib-txt small { color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; } .ce-ib-row time { font-size: 12px; color: #9ca3af; align-self: flex-start; }
.ce-ib-new { font-style: normal; font-size: 11px; background: #fef3c7; color: #92400e; padding: 1px 7px; border-radius: 999px; margin-left: 4px; } .ce-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e11d2e; margin-left: 4px; vertical-align: middle; }
.ce-ib-empty { padding: 22px; text-align: center; }
.ce-ib-thread { display: flex; flex-direction: column; min-width: 0; background: #f8fafc; }
.ce-ib-none { margin: auto; text-align: center; color: #6b7280; } .ce-ib-none svg { width: 56px; height: 56px; fill: none; stroke: #c7cfdb; stroke-width: 1.6; } .ce-ib-none b { display: block; color: #111827; margin-top: 8px; }
.ce-ib-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; background: #fff; border-bottom: 1px solid #eef1f5; } .ce-ib-h b { display: block; } .ce-ib-h small { color: #6b7280; }
.ce-ib-acts { display: flex; gap: 6px; flex-wrap: wrap; } .ce-ib-acts form { margin: 0; } .ce-ib-acts .ce-btn { padding: 7px 12px; font-size: 13px; }
.ce-ib-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ce-bub { max-width: 72%; align-self: flex-start; } .ce-bub > div { background: #fff; border: 1px solid #e6eaf0; padding: 10px 14px; border-radius: 16px 16px 16px 4px; white-space: normal; word-wrap: break-word; }
.ce-bub.me { align-self: flex-end; } .ce-bub.me > div { background: var(--brand); color: #fff; border-color: var(--brand); border-radius: 16px 16px 4px 16px; } .ce-bub.me > div a { color: #fff; }
.ce-bub.fail > div { background: #fef2f2; color: #991b1b; border-color: #fecaca; } .ce-bub small { display: block; font-size: 11px; color: #9ca3af; margin: 3px 6px 0; } .ce-bub.me small { text-align: right; }
.ce-bub img { max-width: 220px; border-radius: 10px; display: block; margin-top: 6px; }
.ce-ib-reply { padding: 12px 14px; background: #fff; border-top: 1px solid #eef1f5; display: flex; flex-direction: column; gap: 8px; }
form.ce-ib-reply:not(:has(.ce-ib-send)) { flex-direction: row; align-items: flex-end; }
.ce-ib-opts { display: flex; gap: 8px; flex-wrap: wrap; } .ce-ib-opts select, .ce-ib-opts input { height: 36px; border: 1px solid #d5dbe3; border-radius: 10px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; } .ce-ib-opts input { flex: 1; min-width: 160px; }
.ce-ib-send { display: flex; gap: 8px; align-items: flex-end; }
.ce-ib-reply textarea { flex: 1; resize: vertical; min-height: 44px; border: 1px solid #d5dbe3; border-radius: 12px; padding: 10px 12px; font: inherit; }
@media (max-width: 1100px) { .ce-inbox { grid-template-columns: 180px 280px 1fr; } }
@media (max-width: 900px) {
  .ce-inbox { grid-template-columns: 1fr; height: auto; min-height: 0; } .ce-ib-boxes { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid #eef1f5; padding: 10px; } .ce-ib-boxes h1, .ce-ib-tip { display: none; } .ce-ib-boxes a { white-space: nowrap; gap: 6px; }
  .ce-ib-list { border-right: 0; max-height: 46vh; } .ce-ib-thread { min-height: 60vh; } .ce-bub { max-width: 88%; }
  .ce-inbox:has(.ce-ib-h) .ce-ib-list { display: none; }
}
body.th-dark .ce-inbox, body.th-dark .ce-ib-h, body.th-dark .ce-ib-reply { background: #161e28; border-color: #263142; } body.th-dark .ce-ib-thread { background: #0f141b; } body.th-dark .ce-bub > div { background: #1d2632; border-color: #263142; color: #dbe3ec; } body.th-dark .ce-ib-txt b, body.th-dark .ce-ib-none b { color: #e5e7eb; } body.th-dark .ce-ib-row:hover { background: #1d2632; }

/* ---------- Reports ---------- */
.ce-rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ce-rep-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: #fff; border: 1px solid #e6eaf0; border-radius: 16px; text-decoration: none !important; color: inherit !important; }
.ce-rep-card:hover { border-color: var(--brand); box-shadow: 0 8px 24px rgba(52, 60, 106, .08); } .ce-rep-card b { color: #111827; } .ce-rep-card span { color: #6b7280; font-size: 14px; }
.ce-rep-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; } .ce-rep-range select, .ce-rep-range input { height: 40px; border: 1px solid #d5dbe3; border-radius: 10px; padding: 0 10px; font: inherit; background: #fff; }
.ce-rep-chart { display: grid; gap: 8px; margin-bottom: 14px; }
.ce-rep-bar { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 110px; gap: 12px; align-items: center; font-size: 14px; } .ce-rep-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-rep-bar i { height: 22px; background: #f1f4f9; border-radius: 6px; overflow: hidden; display: block; } .ce-rep-bar b { display: block; height: 100%; background: var(--brand); border-radius: 6px; } .ce-rep-bar em { font-style: normal; font-weight: 700; text-align: right; }
.ce-rep-table { overflow-x: auto; } .ce-rep-total td { font-weight: 800; border-top: 2px solid #e6eaf0; }
@media (max-width: 700px) { .ce-rep-bar { grid-template-columns: 1fr 90px; } .ce-rep-bar i { grid-column: 1 / -1; grid-row: 2; } }
body.th-dark .ce-rep-card { background: #161e28; border-color: #263142; } body.th-dark .ce-rep-card b { color: #e5e7eb; } body.th-dark .ce-rep-bar i { background: #1d2632; }

/* ---------- Jobs map ---------- */
.ce-jmap { display: grid; grid-template-columns: 280px 1fr; gap: 0; background: #fff; border: 1px solid #e6eaf0; border-radius: 20px; overflow: hidden; height: calc(100vh - 160px); min-height: 520px; }
.ce-jmap-side { padding: 18px; border-right: 1px solid #eef1f5; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ce-jmap-side label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; } .ce-jmap-side select { height: 40px; border: 1px solid #d5dbe3; border-radius: 10px; padding: 0 10px; font: inherit; }
.ce-jmap-side h3 { margin: 8px 0 0; font-size: 14px; }
.ce-jmap-legend label { display: flex !important; align-items: center; gap: 8px; font-weight: 500; } .ce-jmap-legend i { width: 14px; height: 14px; border-radius: 50%; flex: none; } .ce-jmap-legend small { color: #9ca3af; margin-left: auto; }
.ce-jmap-find { background: #f6f8fb; border-radius: 14px; padding: 12px; } .ce-jmap-find p { margin: 0 0 8px; } .ce-jmap-find small { display: block; margin-top: 6px; }
.ce-jmap-tip { font-size: 12px; margin-top: auto; }
#ce-jmap { min-height: 100%; } .ce-pin { background: none; border: 0; }
@media (max-width: 900px) { .ce-jmap { grid-template-columns: 1fr; height: auto; } .ce-jmap-side { border-right: 0; border-bottom: 1px solid #eef1f5; } #ce-jmap { height: 65vh; } }
.ce-inbox { height: min(820px, calc(100vh - 190px)); }
.ce-inbox-wrap:has(.notice) .ce-inbox { height: min(820px, calc(100vh - 260px)); }
.ce-ib-thread { min-height: 0; } .ce-ib-msgs { min-height: 0; }
