/* Portal light / dark theme */

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #2a3038;
  cursor: pointer;
  transition: background 160ms ease;
}
.theme-toggle:hover { background: #343b45; }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent, #f05000);
  outline-offset: 2px;
}
.theme-toggle-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle svg {
  width: 12px;
  height: 12px;
  stroke: #1c2124;
  fill: none;
  stroke-width: 2;
}
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
}
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="light"] .theme-toggle {
  background: #e5e7eb;
}
html[data-theme="light"] .theme-toggle:hover {
  background: #d1d5db;
}

/* ===== Dark theme tokens ===== */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body.theme-crm {
  --bg: #16181d;
  --panel: #1e2229;
  --panel-2: #252a33;
  --ink: #e8eaed;
  --ink-soft: #c8cdd6;
  --muted: #9aa3b2;
  --line: #343b47;
  --brand-navy: #e8eaed;
  --brand-navy-mid: #c8cdd6;
  --brand-orange: #ff7a1a;
  --brand-orange-hot: #ff9a5c;
  --accent-soft: rgba(240, 80, 0, 0.16);
  --accent-wash: rgba(240, 80, 0, 0.1);
  --warn-soft: rgba(168, 90, 8, 0.18);
  --danger-soft: rgba(180, 35, 24, 0.18);
  --ok-soft: rgba(21, 122, 60, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.32);
  background: #16181d;
  color: var(--ink);
}

/* CRM link color is hardcoded to navy in app.css — force readable links */
html[data-theme="dark"] body.theme-crm a {
  color: #8ec5ff;
}
html[data-theme="dark"] body.theme-crm a:hover {
  color: #b8dcff;
}
html[data-theme="dark"] body.theme-crm .sidebar a,
html[data-theme="dark"] body.theme-crm .sidebar-link {
  color: inherit;
}
html[data-theme="dark"] body.theme-crm .btn,
html[data-theme="dark"] body.theme-crm a.btn,
html[data-theme="dark"] body.theme-crm .crm-btn {
  color: #fff !important;
}

html[data-theme="dark"] body.theme-crm h1,
html[data-theme="dark"] body.theme-crm h2,
html[data-theme="dark"] body.theme-crm h3,
html[data-theme="dark"] body.theme-crm h4,
html[data-theme="dark"] body.theme-crm label,
html[data-theme="dark"] body.theme-crm legend,
html[data-theme="dark"] body.theme-crm .panel h1,
html[data-theme="dark"] body.theme-crm .panel h2,
html[data-theme="dark"] body.theme-crm .toolbar h1 {
  color: var(--ink);
}

html[data-theme="dark"] body.theme-crm .muted,
html[data-theme="dark"] body.theme-crm .tiny.muted,
html[data-theme="dark"] body.theme-crm .cell-sub {
  color: var(--muted) !important;
}

html[data-theme="dark"] body.theme-crm a:not(.btn):not(.sidebar-link):not(.crm-btn):not(.section-tabs a):not(.filter-pill):not(.chip):not(.board-tile):not(.client-link) {
  color: #8ec5ff;
}
html[data-theme="dark"] body.theme-crm a:not(.btn):not(.sidebar-link):not(.crm-btn):not(.section-tabs a):not(.filter-pill):not(.chip):not(.board-tile):not(.client-link):hover {
  color: #b8dcff;
}

/* Layout */
html[data-theme="dark"] body.theme-crm .app-main {
  background: #16181d !important;
}
html[data-theme="dark"] body.theme-crm .crm-topbar {
  background: #1e2229 !important;
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .crm-breadcrumb,
html[data-theme="dark"] body.theme-crm .crm-breadcrumb a {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .crm-breadcrumb a:hover {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .crm-breadcrumb strong {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .crm-bc-sep {
  color: #5c6570 !important;
}
html[data-theme="dark"] body.theme-crm .crm-topbar-select,
html[data-theme="dark"] body.theme-crm .crm-topbar-icon,
html[data-theme="dark"] body.theme-crm .sidebar-open {
  color: #9aa3b2;
}
html[data-theme="dark"] body.theme-crm .crm-topbar-select {
  background: #16181d !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .crm-topbar-icon:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .crm-user-btn {
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .crm-user-name {
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .crm-user-dropdown {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] body.theme-crm .crm-user-dropdown a {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .crm-user-dropdown a:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Sidebar stays dark — tweak active states only */
html[data-theme="dark"] body.theme-crm .sidebar-settings-link.active {
  background: rgba(240, 80, 0, 0.18) !important;
  color: #fff !important;
}

/* Panels & cards */
html[data-theme="dark"] body.theme-crm .panel,
html[data-theme="dark"] body.theme-crm .card,
html[data-theme="dark"] body.theme-crm .crm-panel,
html[data-theme="dark"] body.theme-crm .stat,
html[data-theme="dark"] body.theme-crm .domain-stat,
html[data-theme="dark"] body.theme-crm .bulk-bar,
html[data-theme="dark"] body.theme-crm .trello-inline-panel {
  background: var(--panel) !important;
  border-color: var(--line) !important;
  color: var(--ink);
}
html[data-theme="dark"] body.theme-crm .stat {
  background: linear-gradient(180deg, #1e2229 0%, #1a1f27 100%) !important;
}
html[data-theme="dark"] body.theme-crm .stat .n {
  color: var(--ink);
}
html[data-theme="dark"] body.theme-crm .crm-panel-head {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] body.theme-crm .crm-panel-head h2 {
  color: var(--ink);
}
html[data-theme="dark"] body.theme-crm .crm-panel-count,
html[data-theme="dark"] body.theme-crm .crm-muted {
  color: var(--muted) !important;
}

/* Forms */
html[data-theme="dark"] body.theme-crm input,
html[data-theme="dark"] body.theme-crm select,
html[data-theme="dark"] body.theme-crm textarea {
  background: #16181d !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm input::placeholder,
html[data-theme="dark"] body.theme-crm textarea::placeholder {
  color: #6b7280;
}
html[data-theme="dark"] body.theme-crm .btn.secondary,
html[data-theme="dark"] body.theme-crm button.btn.secondary {
  background: #252a33 !important;
  color: #e8eaed !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .form-section-title {
  color: var(--ink-soft);
  border-color: var(--line);
}

/* Tables */
html[data-theme="dark"] body.theme-crm .data-table th,
html[data-theme="dark"] body.theme-crm table th,
html[data-theme="dark"] body.theme-crm .crm-table th,
html[data-theme="dark"] body.theme-crm .clients-table th {
  background: #252a33 !important;
  color: #9aa3b2 !important;
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .data-table td,
html[data-theme="dark"] body.theme-crm table td,
html[data-theme="dark"] body.theme-crm .crm-table td,
html[data-theme="dark"] body.theme-crm .clients-table td {
  color: #e8eaed !important;
  border-bottom-color: #2a3038 !important;
}
html[data-theme="dark"] body.theme-crm .data-table tbody tr:hover td,
html[data-theme="dark"] body.theme-crm .crm-table tr.is-current td {
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="dark"] body.theme-crm .domain-edit-row td {
  background: #252a33 !important;
}

/* Tabs */
html[data-theme="dark"] body.theme-crm .section-tabs {
  background: #252a33 !important;
}
html[data-theme="dark"] body.theme-crm .section-tabs a {
  color: #9aa3b2;
}
html[data-theme="dark"] body.theme-crm .section-tabs a:hover {
  color: #e8eaed;
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] body.theme-crm .section-tabs a.active {
  background: #1e2229 !important;
  color: #ff9a5c !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Settings hub */
html[data-theme="dark"] body.theme-crm .settings-hub-nav {
  background: #1e2229 !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .settings-hub-nav-head h2 {
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .settings-hub-search {
  background: #16181d !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .settings-hub-item {
  color: #c8cdd6 !important;
}
html[data-theme="dark"] body.theme-crm .settings-hub-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .settings-hub-item.is-active {
  background: #252a33 !important;
  color: #e8eaed !important;
  box-shadow: none;
}
html[data-theme="dark"] body.theme-crm .settings-notify-list {
  background: #252a33 !important;
  border-color: #343b47 !important;
}

/* Org / workspaces */
html[data-theme="dark"] body.theme-crm .org-shell {
  background: #16181d !important;
}
html[data-theme="dark"] body.theme-crm .org-shell-bar {
  background: #1e2229 !important;
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .crm-org-top-meta h1 {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .crm-org-top-meta p {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .org-portal-access {
  border-color: #343b47 !important;
  background: #1e2229;
}
html[data-theme="dark"] body.theme-crm .crm-btn-ghost {
  background: #252a33 !important;
  color: #e8eaed !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .crm-btn-ghost:hover {
  background: #2f3642 !important;
}
html[data-theme="dark"] body.theme-crm .crm-badge {
  background: #343b47;
  color: #e8eaed;
}

/* Worksuite profile (ws-*) */
html[data-theme="dark"] .ws-page,
html[data-theme="dark"] .ws-page-title h1 {
  color: #e8eaed !important;
}
html[data-theme="dark"] .ws-page-title .muted {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] .ws-tabs {
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] .ws-tab {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] .ws-tab.is-active {
  color: #e8eaed !important;
  border-bottom-color: #e8eaed !important;
}
html[data-theme="dark"] .ws-summary-profile,
html[data-theme="dark"] .ws-stat-card,
html[data-theme="dark"] .ws-card {
  background: #1e2229 !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] .ws-stat-label,
html[data-theme="dark"] .ws-info-label {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] .ws-stat-value {
  color: #e8eaed !important;
}
html[data-theme="dark"] .ws-card-head {
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] .ws-card-head h3 {
  color: #e8eaed;
}
html[data-theme="dark"] .ws-info-row {
  border-bottom-color: #2a3038 !important;
}
html[data-theme="dark"] .ws-info-value input,
html[data-theme="dark"] .ws-info-value select,
html[data-theme="dark"] .ws-info-value textarea {
  background: #16181d !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] .ws-btn-secondary {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] .ws-table th {
  background: #252a33 !important;
  color: #9aa3b2 !important;
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] .ws-table td {
  color: #e8eaed !important;
  border-bottom-color: #2a3038 !important;
}
html[data-theme="dark"] .ws-chip {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #c8cdd6 !important;
}
html[data-theme="dark"] .ws-chip.is-on {
  background: #343b47 !important;
  color: #fff !important;
}
html[data-theme="dark"] .ws-badge {
  background: #343b47;
  color: #e8eaed;
}

/* Trello board */
html[data-theme="dark"] body.theme-crm .trello-list {
  background: #2a3038 !important;
}
html[data-theme="dark"] body.theme-crm .trello-list-head strong,
html[data-theme="dark"] body.theme-crm .trello-list-name-input {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .trello-list-head em {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .trello-list-name-input:focus {
  background: #1e2229 !important;
  border-color: #0c66e4;
}
html[data-theme="dark"] body.theme-crm .trello-card {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .trello-card-title,
html[data-theme="dark"] body.theme-crm .trello-card-meta {
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .trello-card-meta {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .trello-board-search input[type="search"] {
  background: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .trello-board-search input[type="search"]:focus {
  background: #1e2229 !important;
}

/* Card modal */
html[data-theme="dark"] .card-modal-dialog,
html[data-theme="dark"] .card-modal-loading {
  background: #1e2229 !important;
  color: #e8eaed;
}
html[data-theme="dark"] .card-modal-title-input {
  color: #e8eaed !important;
}
html[data-theme="dark"] .card-modal-list-pill,
html[data-theme="dark"] .card-modal-list-pill strong {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] .card-modal-side,
html[data-theme="dark"] .card-modal-main,
html[data-theme="dark"] .card-modal-section h3 {
  color: #e8eaed;
}
html[data-theme="dark"] .card-modal-list-pill {
  background: transparent !important;
}
html[data-theme="dark"] .card-attach-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="dark"] .card-attach-preview {
  background: #252a33 !important;
}
html[data-theme="dark"] .card-modal-close {
  color: #9aa3b2;
}
html[data-theme="dark"] .card-modal-close:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e8eaed !important;
}

/* Chips, badges, flash */
html[data-theme="dark"] body.theme-crm .chip {
  background: #252a33;
  border-color: #343b47;
  color: #c8cdd6;
}
html[data-theme="dark"] body.theme-crm .chip:hover {
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .badge {
  filter: brightness(0.92);
}
html[data-theme="dark"] body.theme-crm .flash.success {
  background: var(--ok-soft);
  border-color: rgba(21, 122, 60, 0.35);
  color: #6ee7a0;
}
html[data-theme="dark"] body.theme-crm .flash.error {
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, 0.35);
  color: #fca5a5;
}
html[data-theme="dark"] body.theme-crm .flash.info {
  background: rgba(30, 58, 95, 0.35);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

/* Login (logged out) */
html[data-theme="dark"] body.theme-crm .login-wrap {
  background: #16181d !important;
}
html[data-theme="dark"] body.theme-crm .login-card {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}

/* GSC analytics page */
html[data-theme="dark"] .gsc-page .toolbar h1,
html[data-theme="dark"] .gsc-total-row strong {
  color: #e8eaed !important;
}
html[data-theme="dark"] .gsc-total-row td {
  background: #252a33 !important;
  border-top-color: #343b47 !important;
}

/* Content calendar (marketing) */
html[data-theme="dark"] .cal-wrap,
html[data-theme="dark"] .cal-band,
html[data-theme="dark"] .cal-table-wrap,
html[data-theme="dark"] .cal-sticky-bar,
html[data-theme="dark"] .cal-job,
html[data-theme="dark"] .cal-lightbox-panel {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}
html[data-theme="dark"] .cal-wrap h1,
html[data-theme="dark"] .cal-wrap h2,
html[data-theme="dark"] .cal-band h2,
html[data-theme="dark"] .cal-lightbox-meta strong {
  color: #e8eaed !important;
}
html[data-theme="dark"] .cal-band label,
html[data-theme="dark"] .cal-job span,
html[data-theme="dark"] .cal-sticky-bar .cal-sticky-hint {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] .cal-row:hover td {
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="dark"] .cal-li-pill {
  background: #252a33;
  border-color: #343b47;
  color: #c8cdd6;
}
html[data-theme="dark"] .cal-li-pill.is-on {
  background: rgba(240, 80, 0, 0.2);
  color: #ffb380;
}

/* News agent */
html[data-theme="dark"] .news-card,
html[data-theme="dark"] .news-panel,
html[data-theme="dark"] .m-toolbar {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}
html[data-theme="dark"] .m-toolbar h1 {
  color: #e8eaed !important;
}

/* Passwords / misc tables with hardcoded light rows */
html[data-theme="dark"] .pw-table th {
  background: #252a33 !important;
  color: #9aa3b2 !important;
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] .pw-table td {
  color: #e8eaed !important;
  border-bottom-color: #2a3038 !important;
}
html[data-theme="dark"] .pw-link {
  color: #7eb8ff !important;
}

/* Finance / dashboard widgets */
html[data-theme="dark"] body.theme-crm .profile-gate-banner {
  background: linear-gradient(180deg, rgba(180, 35, 24, 0.12) 0%, #1e2229 100%) !important;
  border-color: rgba(180, 35, 24, 0.35) !important;
}
html[data-theme="dark"] body.theme-crm .profile-gate-banner p {
  color: var(--ink-soft) !important;
}

/* ===== Phase 2: hardcoded light surfaces in app.css ===== */

html[data-theme="dark"] body.theme-crm .shell,
html[data-theme="dark"] body.theme-crm .shell .panel {
  color: #e8eaed;
}

/* Customers table */
html[data-theme="dark"] body.theme-crm .clients-table .sticky-actions,
html[data-theme="dark"] body.theme-crm .clients-table thead .sticky-actions,
html[data-theme="dark"] body.theme-crm .clients-table thead .th-actions,
html[data-theme="dark"] body.theme-crm .clients-table tbody tr:hover .sticky-actions {
  background: #1e2229 !important;
  border-left-color: #343b47 !important;
  box-shadow: -8px 0 12px -10px rgba(0, 0, 0, 0.45) !important;
}
html[data-theme="dark"] body.theme-crm .clients-table .client-link,
html[data-theme="dark"] body.theme-crm .clients-table .cell-username,
html[data-theme="dark"] body.theme-crm .clients-table .cell-username strong,
html[data-theme="dark"] body.theme-crm .clients-table .cell-name,
html[data-theme="dark"] body.theme-crm .clients-table .cell-source,
html[data-theme="dark"] body.theme-crm .clients-table .th-sort {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .clients-table .cell-name,
html[data-theme="dark"] body.theme-crm .clients-table .muted-link {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .clients-table .client-link:hover {
  color: #ff9a5c !important;
}
html[data-theme="dark"] body.theme-crm .clients-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
html[data-theme="dark"] body.theme-crm .clients-table tbody tr:nth-child(even) .sticky-actions {
  background: #1a1f27 !important;
}

/* Filter pills & sort chips */
html[data-theme="dark"] body.theme-crm .filter-pill {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .filter-pill em {
  background: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .filter-pill.active {
  background: rgba(240, 80, 0, 0.18) !important;
  border-color: #f05000 !important;
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .filter-pill.active em {
  background: rgba(240, 80, 0, 0.28) !important;
  color: #ffd0b0 !important;
}
html[data-theme="dark"] body.theme-crm .chip {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #c8cdd6 !important;
}
html[data-theme="dark"] body.theme-crm .chip:hover {
  color: #e8eaed !important;
  border-color: #4b5563 !important;
}
html[data-theme="dark"] body.theme-crm .chip.active {
  background: rgba(240, 80, 0, 0.18) !important;
  border-color: #f05000 !important;
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .chip em {
  color: inherit !important;
}

/* Action menus (⋯ column) */
html[data-theme="dark"] body.theme-crm .action-menu-trigger {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #c8cdd6 !important;
}
html[data-theme="dark"] body.theme-crm .action-menu-panel {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
}
html[data-theme="dark"] body.theme-crm .action-menu-panel a,
html[data-theme="dark"] body.theme-crm .action-menu-panel button {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .action-menu-panel a:hover,
html[data-theme="dark"] body.theme-crm .action-menu-panel button:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ff9a5c !important;
}

/* Project boards grid */
html[data-theme="dark"] body.theme-crm .board-tile:not(.board-tile-new) {
  background: linear-gradient(145deg, #2a3038 0%, #1e2229 100%) !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .board-tile-title {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .board-tile-desc,
html[data-theme="dark"] body.theme-crm .board-tile-meta {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .board-tile-new {
  background: #1a1f27 !important;
  border-color: #4b5563 !important;
  border-style: dashed !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .board-tile-new:hover {
  border-color: #ff7a1a !important;
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .board-drag-handle {
  background: rgba(0, 0, 0, 0.35) !important;
  color: #c8cdd6 !important;
}
html[data-theme="dark"] body.theme-crm .boards-dnd-hint,
html[data-theme="dark"] body.theme-crm .boards-dnd-hint-ico {
  color: #9aa3b2 !important;
}

/* Section tabs — beat app.css navy link inheritance */
html[data-theme="dark"] body.theme-crm .section-tabs a {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .section-tabs a:hover {
  color: #e8eaed !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
html[data-theme="dark"] body.theme-crm .section-tabs a.active {
  background: #1e2229 !important;
  color: #ff9a5c !important;
}

/* Common white cards/stats */
html[data-theme="dark"] body.theme-crm .crm-stat,
html[data-theme="dark"] body.theme-crm .package-card-body,
html[data-theme="dark"] body.theme-crm .metric-card,
html[data-theme="dark"] body.theme-crm .search-bar,
html[data-theme="dark"] body.theme-crm .bulk-bar,
html[data-theme="dark"] body.theme-crm .passwords-page.ws-page {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}

/* Table headers with tan/beige bg in app.css */
html[data-theme="dark"] body.theme-crm .data-table th {
  background: #252a33 !important;
  border-bottom-color: #343b47 !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="dark"] body.theme-crm .sort-up,
html[data-theme="dark"] body.theme-crm .sort-down {
  color: #6b7280 !important;
}
html[data-theme="dark"] body.theme-crm .th-sort.is-active,
html[data-theme="dark"] body.theme-crm .sort-up.is-on,
html[data-theme="dark"] body.theme-crm .sort-down.is-on {
  color: #ff9a5c !important;
}

/* Secondary buttons from base app.css */
html[data-theme="dark"] body.theme-crm .btn.secondary {
  background: #252a33 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .btn.secondary:hover {
  background: #2f3642 !important;
  filter: none !important;
}

/* Toolbar headings */
html[data-theme="dark"] body.theme-crm .toolbar h1,
html[data-theme="dark"] body.theme-crm .toolbar h2,
html[data-theme="dark"] body.theme-crm .panel > h1,
html[data-theme="dark"] body.theme-crm .panel > h2,
html[data-theme="dark"] body.theme-crm strong,
html[data-theme="dark"] body.theme-crm .crm-stat strong {
  color: #e8eaed;
}

/* ===== Phase 3: global dark surfaces (all pages) ===== */

html[data-theme="dark"] body.theme-crm {
  --panel-soft: #252a33;
}

/* Marketing pages — beat dashboard.css load order */
html[data-theme="dark"] body.theme-crm .marketing-dash {
  --m-bg: #16181d;
  --m-surface: #1e2229;
  --m-surface-alt: #252a33;
  --m-ink: #e8eaed;
  --m-ink-soft: #9aa3b2;
  --m-ink-faint: #6b7280;
  --m-accent: #60a5fa;
  --m-accent-soft: rgba(59, 130, 246, 0.18);
  --m-green-soft: rgba(16, 185, 129, 0.2);
  --m-amber-soft: rgba(245, 158, 11, 0.2);
  --m-red-soft: rgba(239, 68, 68, 0.2);
  --m-purple-soft: rgba(139, 92, 246, 0.2);
  color: var(--m-ink);
}

/* Badges — default draft/rest labels were light-on-light */
html[data-theme="dark"] body.theme-crm .badge {
  background: #343b47 !important;
  color: #e8eaed !important;
  filter: none;
}
html[data-theme="dark"] body.theme-crm .badge.ok {
  background: var(--ok-soft) !important;
  color: #6ee7a0 !important;
}
html[data-theme="dark"] body.theme-crm .badge.task {
  background: var(--accent-soft) !important;
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .badge.due {
  background: var(--warn-soft) !important;
  color: #fbbf24 !important;
}
html[data-theme="dark"] body.theme-crm .badge.overdue {
  background: var(--danger-soft) !important;
  color: #fca5a5 !important;
}

/* Inline ws-critical (passwords, profile) */
html[data-theme="dark"] #ws-critical .ws-summary-profile,
html[data-theme="dark"] #ws-critical .ws-stat-card,
html[data-theme="dark"] #ws-critical .ws-card {
  background: #1e2229 !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] #ws-critical .ws-stat-label,
html[data-theme="dark"] #ws-critical .ws-info-label {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] #ws-critical .ws-stat-value {
  color: #e8eaed !important;
}
html[data-theme="dark"] #ws-critical .ws-tab {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] #ws-critical .ws-tab.is-active {
  color: #e8eaed !important;
  border-bottom-color: #e8eaed !important;
}
html[data-theme="dark"] #ws-critical .ws-info-value input,
html[data-theme="dark"] #ws-critical .ws-info-value select,
html[data-theme="dark"] #ws-critical .ws-info-value textarea {
  background: #16181d !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] #ws-critical .ws-btn-secondary {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] #ws-critical .ws-table th {
  background: #252a33 !important;
  color: #9aa3b2 !important;
  border-bottom-color: #343b47 !important;
}
html[data-theme="dark"] #ws-critical .ws-table td {
  color: #e8eaed !important;
  border-bottom-color: #2a3038 !important;
}
html[data-theme="dark"] #ws-critical .ws-chip {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #c8cdd6 !important;
}
html[data-theme="dark"] #ws-critical .pw-table th {
  background: #252a33 !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] #ws-critical .pw-table td {
  color: #e8eaed !important;
}
html[data-theme="dark"] #ws-critical .pw-link {
  color: #8ec5ff !important;
}

/* Sales sheet, tabs, renewals */
html[data-theme="dark"] body.theme-crm .tab {
  background: #252a33 !important;
  border-color: #343b47 !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .tab:hover {
  color: #e8eaed !important;
  border-color: #4b5563 !important;
}
html[data-theme="dark"] body.theme-crm .tab em {
  background: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .tab.active {
  background: var(--accent-soft) !important;
  border-color: #f05000 !important;
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .tab.active em {
  background: #1e2229 !important;
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales .sticky-col {
  background: #1e2229 !important;
  box-shadow: -6px 0 10px -8px rgba(0, 0, 0, 0.45) !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales thead .sticky-col,
html[data-theme="dark"] body.theme-crm .sheet-sales tfoot .sticky-col {
  background: #252a33 !important;
}
html[data-theme="dark"] body.theme-crm .box-card,
html[data-theme="dark"] body.theme-crm .followup-card,
html[data-theme="dark"] body.theme-crm .month-box,
html[data-theme="dark"] body.theme-crm .renew-summary,
html[data-theme="dark"] body.theme-crm .list-row,
html[data-theme="dark"] body.theme-crm .quick-edit-dialog,
html[data-theme="dark"] body.theme-crm .metric-card {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .followup-message {
  background: #16181d !important;
  border-color: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .month-box.is-current {
  border-color: #f05000 !important;
}
html[data-theme="dark"] body.theme-crm .month-box.is-selected {
  background: var(--accent-soft) !important;
}

/* CRM / Sales stats */
html[data-theme="dark"] body.theme-crm .crm-stat {
  background: #1e2229 !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .crm-stat-label {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .crm-form {
  background: #1e2229 !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .crm-badge-paid { background: var(--ok-soft) !important; color: #6ee7a0 !important; }
html[data-theme="dark"] body.theme-crm .crm-badge-trial { background: var(--warn-soft) !important; color: #fbbf24 !important; }
html[data-theme="dark"] body.theme-crm .crm-badge-paused { background: var(--danger-soft) !important; color: #fca5a5 !important; }
html[data-theme="dark"] body.theme-crm .crm-badge-deleted,
html[data-theme="dark"] body.theme-crm .crm-badge-default {
  background: #343b47 !important;
  color: #c8cdd6 !important;
}

/* Domains */
html[data-theme="dark"] body.theme-crm .domain-stat.is-free { background: rgba(34, 197, 94, 0.12) !important; border-color: rgba(34, 197, 94, 0.35) !important; }
html[data-theme="dark"] body.theme-crm .domain-stat.is-used { background: rgba(8, 145, 178, 0.12) !important; border-color: rgba(8, 145, 178, 0.35) !important; }
html[data-theme="dark"] body.theme-crm .domain-stat.is-missing { background: var(--danger-soft) !important; border-color: rgba(180, 35, 24, 0.35) !important; }
html[data-theme="dark"] body.theme-crm .domain-stat.is-linked { background: rgba(139, 92, 246, 0.12) !important; border-color: rgba(139, 92, 246, 0.35) !important; }
html[data-theme="dark"] body.theme-crm .domain-stat.is-unlinked { background: var(--warn-soft) !important; border-color: rgba(245, 158, 11, 0.35) !important; }
html[data-theme="dark"] body.theme-crm .domain-stat strong {
  color: #e8eaed !important;
}

/* Kanban / project boards */
html[data-theme="dark"] body.theme-crm .kanban-col {
  background: #252a33 !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .kanban-card {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}

/* Trello panels & search */
html[data-theme="dark"] body.theme-crm .trello-board-search-results,
html[data-theme="dark"] body.theme-crm .trello-share-panel,
html[data-theme="dark"] body.theme-crm .trello-members-panel,
html[data-theme="dark"] body.theme-crm .trello-board-menu-panel {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .board-member-pick,
html[data-theme="dark"] body.theme-crm .quick-add-order-wrap {
  background: #1e2229 !important;
  border-color: #343b47 !important;
}

/* Leads / Upwork */
html[data-theme="dark"] body.theme-crm .lead-status-uploaded { background: #343b47 !important; color: #c8cdd6 !important; }
html[data-theme="dark"] body.theme-crm .lead-status-queued { background: var(--warn-soft) !important; color: #fbbf24 !important; }
html[data-theme="dark"] body.theme-crm .lead-status-sent { background: rgba(240, 80, 0, 0.18) !important; color: #ffb380 !important; }
html[data-theme="dark"] body.theme-crm .lead-status-accepted,
html[data-theme="dark"] body.theme-crm .lead-status-won { background: var(--ok-soft) !important; color: #6ee7a0 !important; }
html[data-theme="dark"] body.theme-crm .lead-status-replied { background: rgba(59, 130, 246, 0.18) !important; color: #93c5fd !important; }
html[data-theme="dark"] body.theme-crm .lead-status-lost,
html[data-theme="dark"] body.theme-crm .lead-status-not_now { background: var(--danger-soft) !important; color: #fca5a5 !important; }
html[data-theme="dark"] body.theme-crm .upwork-status-pill {
  background: #343b47 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .fit-score-mid { background: var(--warn-soft) !important; color: #fbbf24 !important; }

/* Team / org matrix */
html[data-theme="dark"] body.theme-crm .team-matrix thead th {
  background: #252a33 !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .team-matrix td {
  color: #e8eaed !important;
  border-color: #2a3038 !important;
}
html[data-theme="dark"] body.theme-crm .team-role-guide {
  color: #9aa3b2 !important;
}

/* GSC analytics */
html[data-theme="dark"] .gsc-page .toolbar h1,
html[data-theme="dark"] .gsc-page .gsc-total-row strong {
  color: #e8eaed !important;
}

/* Settings detail inline cards */
html[data-theme="dark"] body.theme-crm .settings-detail-card,
html[data-theme="dark"] body.theme-crm .settings-card {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}

/* Client mode picker */
html[data-theme="dark"] body.theme-crm .client-mode-option {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}
html[data-theme="dark"] body.theme-crm .client-mode-option:has(input:checked) {
  background: var(--accent-soft) !important;
  border-color: #f05000 !important;
}

/* Toasts */
html[data-theme="dark"] body.theme-crm .toast {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}

/* Finance document tables reuse .panel — ensure sub-panels */
html[data-theme="dark"] body.theme-crm .finance-doc-preview,
html[data-theme="dark"] body.theme-crm .finance-line-items,
html[data-theme="dark"] body.theme-crm .doc-preview-wrap {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  color: #e8eaed;
}

/* ===== Phase 4: Sales sheet + Trello board ===== */

/* Sales — white cells on has-orders / person columns */
html[data-theme="dark"] body.theme-crm .sheet-sales th.person-col {
  background: #252a33 !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales td.has-orders {
  background: rgba(255, 255, 255, 0.03) !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales td.sheet-cell {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales .sheet-order {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales .sheet-order:hover {
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales .sheet-user {
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales .sheet-amt {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales .sheet-coupon {
  color: #6ee7a0 !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales .sheet-tip {
  color: #fca5a5 !important;
}
html[data-theme="dark"] body.theme-crm .sheet-sales tfoot td,
html[data-theme="dark"] body.theme-crm .data-table.sheet-sales tfoot td {
  background: #252a33 !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .full-sales,
html[data-theme="dark"] body.theme-crm .table-wrap.full {
  background: transparent !important;
}

/* Trello — card covers (white image placeholders) + badges */
html[data-theme="dark"] body.theme-crm .trello-card-cover {
  background: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-cover img {
  background: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-title:hover {
  color: #ffb380 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-menu > summary {
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-menu > summary:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e8eaed !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-menu-panel {
  background: #1e2229 !important;
  border-color: #343b47 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-badge {
  background: #343b47 !important;
  color: #c8cdd6 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-badge.is-icon {
  background: transparent !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-badge.is-warn,
html[data-theme="dark"] body.theme-crm .trello-card-badge.due-overdue,
html[data-theme="dark"] body.theme-crm .trello-card-badge.delivery-late,
html[data-theme="dark"] body.theme-crm .trello-card-badge.delivery-delivered-late {
  background: var(--danger-soft) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-badge.due-today,
html[data-theme="dark"] body.theme-crm .trello-card-badge.delivery-today {
  background: var(--warn-soft) !important;
  color: #fbbf24 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-badge.delivery-ontrack,
html[data-theme="dark"] body.theme-crm .trello-card-badge.delivery-delivered-ontime,
html[data-theme="dark"] body.theme-crm .trello-card-badge.delivery-delivered-early {
  background: var(--ok-soft) !important;
  color: #6ee7a0 !important;
}
html[data-theme="dark"] body.theme-crm .trello-list.is-drag-over {
  background: #343b47 !important;
  outline-color: rgba(96, 165, 250, 0.45) !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-progress {
  background: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .trello-card-progress > span {
  background: #ff7a1a !important;
}

/* Upwork excel grid (same light cell pattern as sales) */
html[data-theme="dark"] body.theme-crm .upwork-excel thead th,
html[data-theme="dark"] body.theme-crm .upwork-excel th.sub,
html[data-theme="dark"] body.theme-crm .upwork-excel tfoot td {
  background: #252a33 !important;
  color: #9aa3b2 !important;
}
html[data-theme="dark"] body.theme-crm .upwork-excel th.person-head {
  background: #2a3038 !important;
}
html[data-theme="dark"] body.theme-crm .upwork-excel .sticky-col {
  background: #1e2229 !important;
}
html[data-theme="dark"] body.theme-crm .upwork-excel thead .sticky-col,
html[data-theme="dark"] body.theme-crm .upwork-excel tfoot .sticky-col {
  background: #252a33 !important;
}
html[data-theme="dark"] body.theme-crm .upwork-excel tr.is-weekend td,
html[data-theme="dark"] body.theme-crm .upwork-excel tr.is-weekend .sticky-col {
  background: rgba(255, 255, 255, 0.02) !important;
}
html[data-theme="dark"] body.theme-crm .upwork-excel tr.has-row td.has-val {
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="dark"] body.theme-crm .upwork-excel td.empty-cell {
  color: #4b5563 !important;
}
html[data-theme="dark"] body.theme-crm .upwork-log-card,
html[data-theme="dark"] body.theme-crm .upwork-prop-board {
  background: #1e2229 !important;
  border-color: #343b47 !important;
}
html[data-theme="dark"] body.theme-crm .upwork-prop-head {
  background: #252a33 !important;
  color: #9aa3b2 !important;
}

/* Report tab — professional dashboard */
.report-shell { margin: -8px -4px 24px; }
.report-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%);
  color: #f8fafc;
  border-radius: 16px;
  padding: 24px 28px 22px;
  margin-bottom: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.report-hero-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; margin: 0 0 6px; }
.report-hero-title { font-size: 28px; font-weight: 700; margin: 0 0 6px; line-height: 1.2; }
.report-hero-sub { margin: 0; color: #cbd5e1; font-size: 14px; }
.report-hero-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.report-hero-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-month-form { display: flex; align-items: center; gap: 6px; }
.report-month-form select,
.report-month-form input[type="number"] {
  min-height: 36px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  padding: 6px 10px; background: rgba(255,255,255,.08); color: #f8fafc;
}
.report-hero-btn {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18); color: #f8fafc; text-decoration: none; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,.06);
}
.report-hero-btn-primary { background: #3b82f6; border-color: #3b82f6; }
.report-hero-metrics {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 12px; margin-top: 22px;
}
.report-hero-metric {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 14px 16px;
}
.report-hero-metric-main { background: rgba(59,130,246,.15); border-color: rgba(96,165,250,.25); }
.report-hero-metric-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; }
.report-hero-metric-value { display: block; font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1.1; }
.report-hero-metric-fee { color: #fdba74; }
.report-hero-metric-hint { display: block; font-size: 12px; color: #94a3b8; margin-top: 6px; }
.report-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px;
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px; padding: 5px;
}
.report-tab {
  padding: 10px 16px; border-radius: 8px; text-decoration: none; color: var(--muted, #64748b);
  font-size: 13px; font-weight: 600;
}
.report-tab.is-active { background: #0f172a; color: #fff; }
.report-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.report-card {
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.report-card-wide { grid-column: 1 / -1; }
.report-card-muted { background: #f8fafc; }
.report-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.report-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.report-card-meta, .report-card-link { font-size: 12px; color: var(--muted, #64748b); text-decoration: none; }
.report-card-link:hover { color: #3b82f6; }
.report-negative { color: #c2410c; }
.report-delta { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.report-delta.is-up { background: #dcfce7; color: #166534; }
.report-delta.is-down { background: #fee2e2; color: #991b1b; }
.report-delta.is-flat { background: #f1f5f9; color: #64748b; }
.report-waterfall {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.1fr; gap: 10px; align-items: stretch;
}
.report-waterfall-step {
  border-radius: 12px; padding: 14px; min-height: 92px;
  display: flex; flex-direction: column; justify-content: center;
}
.report-waterfall-gross { background: #ecfdf5; border: 1px solid #a7f3d0; }
.report-waterfall-fee { background: #fff7ed; border: 1px solid #fed7aa; }
.report-waterfall-net { background: #eff6ff; border: 1px solid #bfdbfe; }
.report-waterfall-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #64748b; }
.report-waterfall-value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.report-waterfall-detail { font-size: 11px; color: #64748b; margin-top: 4px; }
.report-waterfall-arrow { display: flex; align-items: center; color: #94a3b8; font-size: 18px; }
.report-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.report-donut {
  width: 120px; height: 120px; border-radius: 50%; position: relative; flex: 0 0 auto;
  box-shadow: inset 0 0 0 16px var(--surface, #fff);
}
.report-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; }
.report-legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.report-legend li strong { grid-column: 3; }
.report-legend li .tiny { grid-column: 2 / 4; }
.report-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.report-compare-list { list-style: none; margin: 0; padding: 0; }
.report-compare-list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.report-daily-chart {
  display: grid; grid-template-columns: repeat(31, minmax(0, 1fr)); gap: 3px;
  align-items: end; min-height: 120px; padding-top: 8px;
}
.report-daily-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 100px; gap: 4px; }
.report-daily-col span { font-size: 9px; color: #94a3b8; }
.report-daily-bar { width: 100%; max-width: 14px; background: #cbd5e1; border-radius: 4px 4px 2px 2px; min-height: 4px; }
.report-daily-col.has-data .report-daily-bar { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.report-mini-table, .report-data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-mini-table th, .report-data-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: #64748b; padding: 10px 8px; border-bottom: 1px solid #e2e8f0;
}
.report-mini-table td, .report-data-table td { padding: 11px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.report-data-table tfoot th { border-top: 2px solid #e2e8f0; padding-top: 12px; }
.report-data-table tr.is-empty { opacity: .45; }
.report-leaderboard { list-style: none; margin: 0; padding: 0; }
.report-leaderboard li {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.report-rank {
  width: 24px; height: 24px; border-radius: 50%; background: #f1f5f9; color: #475569;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.report-leaderboard-amt { text-align: right; }
.report-year-chart-pro {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; min-height: 180px;
}
.report-year-col {
  text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.report-year-bars {
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  height: 140px; width: 100%;
}
.report-year-bar-gross, .report-year-bar-net { width: 42%; border-radius: 6px 6px 2px 2px; min-height: 4px; }
.report-year-bar-gross { background: linear-gradient(180deg, #93c5fd, #3b82f6); }
.report-year-bar-net { background: linear-gradient(180deg, #6ee7b7, #059669); }
.report-year-col span { font-size: 11px; color: #64748b; font-weight: 600; }
.report-year-col em { font-size: 10px; color: #334155; font-style: normal; font-weight: 600; }
.report-year-col.is-current span { color: #0f172a; }
.report-year-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: #64748b; }
.report-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.report-swatch-gross { background: #3b82f6; }
.report-swatch-net { background: #059669; }
.report-insight-list { list-style: none; margin: 0; padding: 0; }
.report-insight-list li { padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.report-insight-list li span { display: block; font-size: 12px; color: #64748b; }
.report-insight-list li strong { display: block; font-size: 16px; margin-top: 4px; }
.report-insight-list li em { display: block; font-size: 12px; color: #64748b; font-style: normal; margin-top: 2px; }
.report-mix-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.report-mix-row strong { margin-left: auto; }
.report-mix-bar { height: 6px; background: #f1f5f9; border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.report-mix-bar div { height: 100%; border-radius: 999px; }
.report-quarter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-quarter-card {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px;
}
.report-quarter-label { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.report-quarter-net { display: block; font-size: 22px; margin: 8px 0 4px; }
.report-pill {
  display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #f1f5f9;
  color: #475569; font-size: 11px; font-weight: 600;
}
.report-pill-soft { background: #eff6ff; color: #1d4ed8; }
.report-share-bar { height: 5px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 4px; max-width: 80px; }
.report-share-bar div { height: 100%; background: #3b82f6; border-radius: 999px; }
.report-client-detail-row td { background: #f8fafc !important; padding-top: 0 !important; }
.report-order-details summary { cursor: pointer; font-size: 12px; color: #64748b; padding: 6px 0; }
.report-order-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 4px; }
.report-order-chip {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px;
  font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.report-inline-link { font-size: 11px; }
.report-fee-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px;
}
.report-fee-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.report-fee-grid input {
  min-height: 38px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  padding: 8px 10px; background: var(--surface, #fff); color: inherit;
}
.report-fee-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.report-fee-note-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; font-size: 13px; }
.report-fee-note-card p { margin: 6px 0 0; color: #64748b; }
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .report-tabs,
html[data-theme="dark"] .report-fees-panel {
  background: #1e2229 !important; border-color: #343b47 !important;
}
html[data-theme="dark"] .report-card-muted,
html[data-theme="dark"] .report-client-detail-row td,
html[data-theme="dark"] .report-quarter-card,
html[data-theme="dark"] .report-fee-note-card { background: #252a33 !important; border-color: #343b47 !important; }
html[data-theme="dark"] .report-tab.is-active { background: #3b82f6; }
html[data-theme="dark"] .report-waterfall-gross { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); }
html[data-theme="dark"] .report-waterfall-fee { background: rgba(251,146,60,.1); border-color: rgba(251,146,60,.2); }
html[data-theme="dark"] .report-waterfall-net { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.25); }
html[data-theme="dark"] .report-donut { box-shadow: inset 0 0 0 16px #1e2229; }
@media (max-width: 1100px) {
  .report-hero-metrics { grid-template-columns: 1fr 1fr; }
  .report-waterfall { grid-template-columns: 1fr; }
  .report-waterfall-arrow { display: none; }
  .report-quarter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .report-grid { grid-template-columns: 1fr; }
  .report-hero-metrics { grid-template-columns: 1fr; }
  .report-daily-chart { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .report-fee-grid, .report-fee-notes { grid-template-columns: 1fr; }
  .report-quarter-grid { grid-template-columns: 1fr; }
}

/* Customer reviews */
.ws-tab-badge {
  display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #3b82f6; color: #fff; font-size: 10px; font-weight: 700; align-items: center; justify-content: center;
  margin-left: 4px; vertical-align: middle;
}
.client-stars { display: inline-flex; align-items: center; gap: 2px; color: #d1d5db; font-size: 16px; line-height: 1; }
.client-star.is-full, .client-star.is-half { color: #f59e0b; }
.client-star-num { margin-left: 6px; color: #6b7280; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.client-reviews-score-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.client-reviews-big-rating { font-size: 42px; font-weight: 700; line-height: 1; }
.client-reviews-verdict { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: 260px; }
.client-reviews-verdict-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 700; }
.client-review-list { display: flex; flex-direction: column; gap: 12px; padding: 0 18px 18px; }
.client-review-card {
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; background: #fff;
}
.client-review-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.client-review-delete { margin-left: auto; }
.client-review-text { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.client-review-team-note {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f8fafc; border-left: 3px solid #3b82f6;
  font-size: 13px;
}
.client-review-team-note p { margin: 4px 0 0; white-space: pre-wrap; }
.link-btn { background: none; border: 0; padding: 0; color: #3b82f6; cursor: pointer; font: inherit; }
.link-btn.danger { color: #dc2626; }
html[data-theme="dark"] .client-review-card { background: #1e2229; border-color: #343b47; }
html[data-theme="dark"] .client-review-team-note { background: #252a33; }

.sale-review-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.sale-review-pending { background: #fef3c7; color: #92400e; }
.sale-review-received { background: #dcfce7; color: #166534; }
.sale-review-auto_closed { background: #e2e8f0; color: #475569; }
.sale-review-no_review { background: #fee2e2; color: #991b1b; }
.sale-review-cell { min-width: 120px; }
.sale-review-panel {
  margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px; background: #fafafa;
}
.sale-review-panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sale-review-form { margin-top: 8px; }
.sale-review-quick { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.sale-review-quick .chip-row { margin-top: 6px; }
.sale-review-saved .client-review-text { margin-top: 0; }
html[data-theme="dark"] .sale-review-panel { background: #1a1d24; border-color: #343b47; }
html[data-theme="dark"] .sale-review-pending { background: #422006; color: #fcd34d; }
html[data-theme="dark"] .sale-review-received { background: #14532d; color: #86efac; }
html[data-theme="dark"] .sale-review-auto_closed { background: #334155; color: #cbd5e1; }
html[data-theme="dark"] .sale-review-no_review { background: #450a0a; color: #fca5a5; }

/* Customers list page */
.customers-list-page { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.customers-hero {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 42%, #f8fafc 100%);
  border: 1px solid #e8dfd6;
  border-radius: 18px;
  padding: 22px 24px 20px;
  box-shadow: 0 1px 2px rgba(22, 18, 15, 0.04), 0 10px 24px rgba(22, 18, 15, 0.05);
}
.customers-hero-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.customers-hero-copy h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.15; }
.customers-hero-eyebrow {
  margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #b45309;
}
.customers-hero-sub { margin: 0; color: #64748b; font-size: 14px; max-width: 52ch; }
.customers-hero-actions { display: flex; align-items: center; gap: 8px; }
.customers-add-btn { white-space: nowrap; }
.customers-hero-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px;
}
.customers-metric {
  background: rgba(255,255,255,.72); border: 1px solid #eadfd4; border-radius: 12px; padding: 12px 14px;
}
.customers-metric-accent { background: linear-gradient(135deg, #fff4eb, #fff); border-color: #f5d0b5; }
.customers-metric-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8;
}
.customers-metric-value { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.customers-metric-hint { display: block; font-size: 12px; color: #94a3b8; margin-top: 4px; }
.customers-metric-warn { color: #b45309; font-weight: 600; }

.customers-toolbar-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.customers-source-scroll { overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.customers-source-chips { flex-wrap: nowrap; min-width: max-content; }
.customers-controls {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between;
}
.customers-search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 320px; min-width: 0;
}
.customers-search-icon { color: #94a3b8; font-size: 16px; line-height: 1; }
.customers-search input[type="search"] {
  flex: 1; min-width: 0; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
}
.customers-sort { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.customers-sort-label { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.customers-sort-chips { flex-wrap: wrap; }

.customers-table-card { padding: 0; overflow: hidden; }
.customers-table-card .bulk-bar { margin: 12px 14px 0; }
.customers-table-wrap { border-top: 1px solid #ece7e2; }
.customers-table-modern { margin: 0; }
.customers-table-modern thead th {
  background: #faf6f2; border-bottom: 1px solid #eadfd4; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; color: #7c6a5d; padding-top: 12px; padding-bottom: 12px;
}
.customers-table-modern tbody tr { transition: background .12s ease; }
.customers-table-modern tbody tr:hover td { background: #fffaf5; }
.customers-table-modern .col-num { text-align: center; width: 72px; }
.customers-table-modern .col-money { min-width: 110px; }
.customers-table-modern .col-reviews { min-width: 130px; }
.customers-identity {
  display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit;
}
.customers-identity:hover .customers-username { color: #c2410c; }
.customers-avatar {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fdba74, #ea580c); color: #fff; font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.customers-identity-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.customers-username { font-size: 14px; line-height: 1.2; }
.customers-display-name { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customers-revenue { font-variant-numeric: tabular-nums; }
.customers-review-link {
  display: inline-flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit;
}
.customers-review-link:hover .customers-review-meta { color: #c2410c; }
.customers-review-meta { font-size: 11px; color: #64748b; }
.customers-review-pending {
  display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #fef3c7; color: #92400e;
  font-size: 11px; font-weight: 700; text-decoration: none;
}
.customers-review-pending:hover { background: #fde68a; }
.customers-empty { padding: 32px 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

.client-source-badge {
  display: inline-flex; max-width: 140px; padding: 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-source-badge.is-fiverr { background: #ffedd5; color: #9a3412; }
.client-source-badge.is-upwork { background: #dcfce7; color: #166534; }
.client-source-badge.is-whatsapp { background: #dcfce7; color: #15803d; }
.client-source-badge.is-linkedin { background: #dbeafe; color: #1d4ed8; }
.client-source-badge.is-email { background: #ede9fe; color: #6d28d9; }
.client-source-badge.is-ad { background: #fce7f3; color: #be185d; }
.client-source-badge.is-other { background: #f1f5f9; color: #475569; }

html[data-theme="dark"] .customers-hero {
  background: linear-gradient(135deg, #1f1510 0%, #171a20 55%, #12151a 100%);
  border-color: #3a322c;
}
html[data-theme="dark"] .customers-hero-copy h1 { color: #f8fafc; }
html[data-theme="dark"] .customers-hero-sub { color: #94a3b8; }
html[data-theme="dark"] .customers-metric { background: rgba(255,255,255,.03); border-color: #343b47; }
html[data-theme="dark"] .customers-metric-accent { background: rgba(234,88,12,.12); border-color: rgba(251,146,60,.25); }
html[data-theme="dark"] .customers-table-modern thead th { background: #1a1d24; color: #cbd5e1; border-color: #343b47; }
html[data-theme="dark"] .customers-table-modern tbody tr:hover td { background: #1f2430; }
html[data-theme="dark"] .customers-search input[type="search"] { background: #171a20; border-color: #343b47; color: #e2e8f0; }
html[data-theme="dark"] .customers-review-pending { background: #422006; color: #fcd34d; }
html[data-theme="dark"] .client-source-badge.is-fiverr { background: #431407; color: #fdba74; }
html[data-theme="dark"] .client-source-badge.is-upwork { background: #14532d; color: #86efac; }
html[data-theme="dark"] .client-source-badge.is-whatsapp { background: #14532d; color: #86efac; }
html[data-theme="dark"] .client-source-badge.is-linkedin { background: #1e3a8a; color: #93c5fd; }
html[data-theme="dark"] .client-source-badge.is-email { background: #4c1d95; color: #c4b5fd; }
html[data-theme="dark"] .client-source-badge.is-ad { background: #831843; color: #f9a8d4; }
html[data-theme="dark"] .client-source-badge.is-other { background: #334155; color: #cbd5e1; }
html[data-theme="dark"] body.theme-crm .customers-display-name,
html[data-theme="dark"] body.theme-crm .customers-review-meta,
html[data-theme="dark"] body.theme-crm .customers-metric-label,
html[data-theme="dark"] body.theme-crm .customers-metric-hint,
html[data-theme="dark"] body.theme-crm .customers-sort-label { color: #94a3b8 !important; }
html[data-theme="dark"] body.theme-crm .customers-metric-value,
html[data-theme="dark"] body.theme-crm .customers-username,
html[data-theme="dark"] body.theme-crm .customers-table-modern tbody td { color: #e8eaed !important; }
html[data-theme="dark"] body.theme-crm .customers-toolbar-card.panel,
html[data-theme="dark"] body.theme-crm .customers-table-card.panel,
html[data-theme="dark"] body.theme-crm .customers-empty.panel { color: #e8eaed !important; }

@media (max-width: 960px) {
  .customers-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customers-controls { flex-direction: column; align-items: stretch; }
  .customers-sort { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .customers-hero-metrics { grid-template-columns: 1fr; }
  .customers-hero-copy h1 { font-size: 24px; }
}

.customers-avatar.sm {
  width: 28px; height: 28px; border-radius: 8px; font-size: 11px;
}

/* Dashboard */
.dashboard-page { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.dash-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #334155 100%);
  color: #f8fafc; border-radius: 18px; padding: 22px 24px 20px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
}
.dash-hero-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.dash-hero-copy h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.15; }
.dash-hero-eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; }
.dash-hero-sub { margin: 0; color: #cbd5e1; font-size: 14px; max-width: 56ch; }
.dash-hero-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-hero-btn {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16); color: #f8fafc; text-decoration: none; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.06);
}
.dash-hero-btn-primary { background: #ea580c; border-color: #ea580c; }
.dash-year-pill { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.1); font-weight: 700; }
.dash-month-strip {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08);
}
.dash-month-chip {
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none;
  color: #cbd5e1; border: 1px solid transparent;
}
.dash-month-chip:hover { background: rgba(255,255,255,.08); color: #fff; }
.dash-month-chip.is-active { background: rgba(234,88,12,.22); border-color: rgba(251,146,60,.35); color: #fff; }
.dash-hero-metrics {
  display: grid; grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px;
}
.dash-metric {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px 14px;
}
.dash-metric-main { background: rgba(59,130,246,.14); border-color: rgba(96,165,250,.22); }
.dash-metric-warn { background: rgba(245,158,11,.12); border-color: rgba(251,191,36,.22); }
.dash-metric-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #cbd5e1; }
.dash-metric-value { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; margin-top: 4px; color: #ffffff; }
.dash-metric-hint { display: block; font-size: 12px; color: #cbd5e1; margin-top: 4px; }
.dash-metric-link { color: #ffffff; text-decoration: none; }
.dash-metric-link:hover { color: #fdba74; }
.dash-hero-copy h1 { color: #ffffff; }
.dash-month-chip { color: #e2e8f0; }
.dash-month-chip.is-active { color: #ffffff; }

/* Hero is always dark — beat body.theme-crm link color in light theme */
body.theme-crm .dash-hero { color: #f8fafc; }
body.theme-crm .dash-hero h1,
body.theme-crm .dash-hero .dash-metric-value { color: #ffffff !important; }
body.theme-crm .dash-hero .dash-hero-sub,
body.theme-crm .dash-hero .dash-hero-eyebrow,
body.theme-crm .dash-hero .dash-metric-label,
body.theme-crm .dash-hero .dash-metric-hint { color: #cbd5e1 !important; }
body.theme-crm .dash-hero a.dash-month-chip { color: #e2e8f0 !important; }
body.theme-crm .dash-hero a.dash-month-chip:hover,
body.theme-crm .dash-hero a.dash-month-chip.is-active { color: #ffffff !important; }
body.theme-crm .dash-hero a.dash-hero-btn { color: #f8fafc !important; }
body.theme-crm .dash-hero a.dash-metric-link { color: #ffffff !important; }
body.theme-crm .dash-hero a.dash-metric-link:hover { color: #fdba74 !important; }

.dash-section { padding: 22px 24px; }
.dash-client-section { padding: 26px 28px; }
.dash-section-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 20px; }
.dash-section-head h2 { margin: 0 0 6px; font-size: 22px; color: #0f172a; }
.dash-section-sub { margin: 0; color: #475569; font-size: 15px; line-height: 1.5; max-width: 62ch; }
.dash-section-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.dash-two-col-tight { margin-top: 18px; }

.dash-behavior-layout { display: flex; flex-direction: column; gap: 24px; }
.dash-behavior-row { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; }
.dash-card {
  border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dash-card-flat { background: #faf8f6; }
.dash-card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #e8edf2; background: #f8fafc;
}
.dash-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.dash-card-link { font-size: 13px; font-weight: 600; color: #c2410c; text-decoration: none; white-space: nowrap; }
.dash-card-link:hover { text-decoration: underline; }
.dash-card-body { padding: 18px 20px; }
.dash-card-body-spacious { padding: 20px 22px 22px; }
.dash-empty { padding: 22px 20px; color: #475569; font-size: 14px; line-height: 1.55; }
.dash-empty-ok { color: #15803d; }
.dash-review-sub { display: block; font-size: 13px; line-height: 1.45; color: #475569; margin-top: 2px; }

.dash-pipeline-track {
  display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #e2e8f0; margin-bottom: 18px;
}
.dash-pipeline-seg { min-width: 4px; }
.dash-pipeline-seg.is-received { background: #22c55e; }
.dash-pipeline-seg.is-pending { background: #f59e0b; }
.dash-pipeline-seg.is-auto { background: #94a3b8; }
.dash-pipeline-seg.is-none { background: #f87171; }
.dash-pipeline-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dash-pipeline-stat {
  padding: 16px 18px; border-radius: 12px; border: 1px solid #e2e8f0; background: #f8fafc;
}
.dash-pipeline-stat-label { display: block; font-size: 13px; font-weight: 600; color: #334155; }
.dash-pipeline-stat strong { display: block; margin-top: 8px; font-size: 30px; line-height: 1; color: #0f172a; }
.dash-pipeline-stat.is-received { border-color: #bbf7d0; background: #f0fdf4; }
.dash-pipeline-stat.is-pending { border-color: #fde68a; background: #fffbeb; }
.dash-pipeline-stat.is-auto { border-color: #e2e8f0; background: #f8fafc; }
.dash-pipeline-stat.is-none { border-color: #fecaca; background: #fef2f2; }
.dash-pipeline-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid #e8edf2; font-size: 14px; font-weight: 500; color: #334155;
}

.dash-review-list, .dash-awaiting-list, .dash-sales-list, .dash-hosting-list { display: flex; flex-direction: column; }
.dash-review-item, .dash-awaiting-item, .dash-sale-item {
  display: block; padding: 18px 20px; text-decoration: none; color: #0f172a; border-bottom: 1px solid #eef2f6;
}
.dash-review-item:last-child, .dash-awaiting-item:last-child, .dash-sale-item:last-child { border-bottom: 0; }
.dash-review-item:hover, .dash-awaiting-item:hover, .dash-sale-item:hover { background: #fffaf5; }
.dash-review-item-head { display: flex; align-items: flex-start; gap: 12px; }
.dash-review-item-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-review-item-meta strong { font-size: 15px; color: #0f172a; }
.dash-review-snippet { margin: 12px 0 0 40px; font-size: 14px; color: #334155; line-height: 1.55; }
.dash-awaiting-item { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.dash-awaiting-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-awaiting-client { font-size: 15px; color: #0f172a; }
.dash-awaiting-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.dash-awaiting-amount { font-size: 16px; font-weight: 700; color: #0f172a; }
.dash-awaiting-scroll { max-height: 360px; overflow-y: auto; }
.dash-sale-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-weight: 700; }

.dash-top-clients { display: flex; flex-direction: column; }
.dash-top-client {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center;
  padding: 16px 20px; text-decoration: none; color: #0f172a; border-bottom: 1px solid #eef2f6;
}
.dash-top-client:last-child { border-bottom: 0; }
.dash-top-client:hover { background: #fffaf5; }
.dash-top-client-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dash-top-client-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-top-client-score { font-size: 15px; font-weight: 700; color: #c2410c; min-width: 28px; text-align: right; }

.dash-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dash-team-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px;
  border: 1px solid #e8dfd6; background: #faf8f6; text-decoration: none; color: inherit;
}
.dash-team-card:hover { border-color: #fdba74; background: #fff7ed; }
.dash-team-name { font-size: 13px; font-weight: 700; }
.dash-team-value { font-size: 22px; font-weight: 700; }
.dash-subsection { margin-top: 16px; padding-top: 14px; border-top: 1px solid #ece7e2; }

.dash-attention-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dash-attention-block {
  border: 1px solid #ece7e2; border-radius: 12px; padding: 12px; background: #faf8f6;
}
.dash-attention-block h3 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.dash-count {
  display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  align-items: center; justify-content: center; background: #fee2e2; color: #991b1b; font-size: 11px;
}
.dash-attention-line { display: block; font-size: 13px; margin-bottom: 6px; text-decoration: none; color: inherit; }
.dash-attention-line:hover { color: #c2410c; }

.dash-table-wrap { margin-top: 4px; }
.dash-annual-table .is-current-month { background: #fff7ed; font-weight: 700; }

.dash-hosting-metrics {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 4px;
}
.dash-hosting-metric {
  border: 1px solid #e8dfd6; border-radius: 12px; padding: 12px 14px; background: #faf8f6;
  display: flex; flex-direction: column; gap: 4px;
}
.dash-hosting-metric span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.dash-hosting-metric strong { font-size: 22px; }
.dash-hosting-warn { background: #fff7ed; border-color: #fed7aa; }
.dash-hosting-item { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; }
.dash-hosting-item:last-child { border-bottom: 0; }
.dash-hosting-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 4px; }
.dash-hosting-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Dark mode: dashboard hero keeps light text on navy gradient */
html[data-theme="dark"] body.theme-crm .dash-hero { color: #f8fafc !important; }
html[data-theme="dark"] body.theme-crm .dash-hero h1,
html[data-theme="dark"] body.theme-crm .dash-hero .dash-metric-value,
html[data-theme="dark"] body.theme-crm .dash-hero .dash-metric-link { color: #ffffff !important; }
html[data-theme="dark"] body.theme-crm .dash-hero .dash-hero-sub,
html[data-theme="dark"] body.theme-crm .dash-hero .dash-metric-label,
html[data-theme="dark"] body.theme-crm .dash-hero .dash-metric-hint,
html[data-theme="dark"] body.theme-crm .dash-hero .dash-month-chip { color: #cbd5e1 !important; }
html[data-theme="dark"] body.theme-crm .dash-hero .dash-month-chip.is-active { color: #ffffff !important; }

@media (max-width: 1100px) {
  .dash-hero-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-behavior-row { grid-template-columns: 1fr; }
  .dash-pipeline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-two-col { grid-template-columns: 1fr; }
  .dash-attention-grid { grid-template-columns: 1fr; }
  .dash-hosting-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .dash-hero-metrics { grid-template-columns: 1fr 1fr; }
  .dash-hosting-metrics { grid-template-columns: 1fr 1fr; }
  .dash-hero-copy h1 { font-size: 24px; }
}

/* Dashboard — light readable body (fixes dark mode grey-on-white text) */
.dash-light-surface {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #0f172a;
}
.dash-light-surface .panel,
.dash-light-surface .dash-card,
.dash-light-surface .dash-team-card,
.dash-light-surface .dash-attention-block,
.dash-light-surface .dash-hosting-metric,
.dash-light-surface .dash-pipeline-stat {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}
.dash-light-surface .dash-card-head {
  background: #f8fafc !important;
  border-color: #e8edf2 !important;
}
.dash-light-surface .dash-card-flat,
.dash-light-surface .dash-team-card,
.dash-light-surface .dash-attention-block {
  background: #f8fafc !important;
}
.dash-light-surface h2,
.dash-light-surface h3,
.dash-light-surface strong,
.dash-light-surface .dash-section-head h2,
.dash-light-surface .dash-card-head h3,
.dash-light-surface .dash-review-item,
.dash-light-surface .dash-awaiting-item,
.dash-light-surface .dash-sale-item,
.dash-light-surface .dash-top-client,
.dash-light-surface .dash-review-item-meta strong,
.dash-light-surface .dash-awaiting-client,
.dash-light-surface .dash-awaiting-amount,
.dash-light-surface .dash-top-client-name,
.dash-light-surface .dash-team-value,
.dash-light-surface .dash-hosting-metric strong,
.dash-light-surface .dash-pipeline-stat strong,
.dash-light-surface .data-table td,
.dash-light-surface .data-table th {
  color: #0f172a !important;
}
.dash-light-surface .dash-section-sub,
.dash-light-surface .dash-review-sub,
.dash-light-surface .dash-review-snippet,
.dash-light-surface .dash-pipeline-stat-label,
.dash-light-surface .dash-pipeline-foot,
.dash-light-surface .dash-empty,
.dash-light-surface .muted,
.dash-light-surface .tiny,
.dash-light-surface .cell-sub,
.dash-light-surface .dash-team-name,
.dash-light-surface .dash-hosting-metric span,
.dash-light-surface .dash-attention-line {
  color: #334155 !important;
}
.dash-light-surface a:not(.btn):not(.dash-card-link):not(.dash-review-item):not(.dash-awaiting-item):not(.dash-sale-item):not(.dash-top-client):not(.dash-team-card):not(.dash-attention-line) {
  color: #c2410c !important;
}
.dash-light-surface .dash-card-link { color: #c2410c !important; }
.dash-light-surface .empty { color: #475569 !important; }
.dash-light-surface .dash-pipeline-stat.is-received { background: #f0fdf4 !important; border-color: #bbf7d0 !important; }
.dash-light-surface .dash-pipeline-stat.is-pending { background: #fffbeb !important; border-color: #fde68a !important; }
.dash-light-surface .dash-pipeline-stat.is-auto { background: #f8fafc !important; }
.dash-light-surface .dash-pipeline-stat.is-none { background: #fef2f2 !important; border-color: #fecaca !important; }
.dash-light-surface .dash-review-item:hover,
.dash-light-surface .dash-awaiting-item:hover,
.dash-light-surface .dash-sale-item:hover,
.dash-light-surface .dash-top-client:hover,
.dash-light-surface .dash-team-card:hover { background: #fff7ed !important; }
.dash-light-surface .dash-annual-table .is-current-month { background: #fff7ed !important; }
.dash-light-surface .dash-hosting-warn { background: #fff7ed !important; border-color: #fed7aa !important; }

html[data-theme="dark"] body.theme-crm .dash-light-surface,
html[data-theme="dark"] body.theme-crm .dash-light-surface .panel,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-card,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-team-card,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-attention-block,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-hosting-metric,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-pipeline-stat {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}
html[data-theme="dark"] body.theme-crm .dash-light-surface h2,
html[data-theme="dark"] body.theme-crm .dash-light-surface h3,
html[data-theme="dark"] body.theme-crm .dash-light-surface strong,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-review-item-meta strong,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-awaiting-client,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-top-client-name,
html[data-theme="dark"] body.theme-crm .dash-light-surface .data-table td,
html[data-theme="dark"] body.theme-crm .dash-light-surface .data-table th {
  color: #0f172a !important;
}
html[data-theme="dark"] body.theme-crm .dash-light-surface .muted,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-section-sub,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-review-sub,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-review-snippet,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-pipeline-foot,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-empty,
html[data-theme="dark"] body.theme-crm .dash-light-surface .cell-sub,
html[data-theme="dark"] body.theme-crm .dash-light-surface .tiny,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-pipeline-stat-label,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-team-name,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-hosting-metric span,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-attention-line,
html[data-theme="dark"] body.theme-crm .dash-light-surface p.muted {
  color: #334155 !important;
}
html[data-theme="dark"] body.theme-crm .shell .dash-light-surface,
html[data-theme="dark"] body.theme-crm .shell .dash-light-surface .panel {
  color: #0f172a !important;
}
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-review-item,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-awaiting-item,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-sale-item,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-top-client,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-awaiting-amount,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-team-value,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-hosting-item strong {
  color: #0f172a !important;
}
html[data-theme="dark"] body.theme-crm .dash-light-surface a.dash-card-link,
html[data-theme="dark"] body.theme-crm .dash-light-surface .dash-section-actions a.btn.secondary {
  color: #c2410c !important;
}

/* Team Control — CEO Today board */
.outreach-today-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.outreach-today-totals > div {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
}
.outreach-today-totals span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7280;
  margin-bottom: 4px;
}
.outreach-today-totals strong {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}
.outreach-today-wrap {
  width: 100%;
}
.outreach-today-table {
  width: 100%;
  min-width: 720px;
}
.outreach-today-table th,
.outreach-today-table td {
  text-align: center;
  vertical-align: middle;
}
.outreach-today-table th:first-child,
.outreach-today-table td:first-child,
.outreach-today-table th:last-child,
.outreach-today-table td:last-child {
  text-align: left;
}
.outreach-today-table tr.is-behind td {
  background: #fff7ed;
}
.outreach-today-table tr.is-active-row td {
  background: #f0fdf4;
}
.outreach-today-actions {
  white-space: nowrap;
}
.outreach-panel .leads-kpi-grid.outreach-quick-log {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Time Tracker */
.tt-fab{position:fixed;right:18px;bottom:18px;z-index:80;display:flex;align-items:center;gap:8px;background:var(--panel,#fff);border:1px solid var(--border,#ddd);border-radius:999px;padding:8px 10px 8px 14px;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.tt-fab-link{display:flex;align-items:center;gap:8px;text-decoration:none;color:inherit;max-width:220px}
.tt-fab-dot{width:8px;height:8px;border-radius:50%;background:#16a34a;flex-shrink:0;animation:tt-pulse 1.4s ease infinite}
@keyframes tt-pulse{0%,100%{opacity:1}50%{opacity:.45}}
.tt-fab-clock{font-weight:700;font-variant-numeric:tabular-nums}
.tt-fab-title{font-size:.8rem;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tt-fab-stop{margin:0}
.tt-big-clock{font-size:1.6rem;font-weight:700;font-variant-numeric:tabular-nums}
.tt-pct-bar{display:inline-block;width:72px;height:8px;background:rgba(0,0,0,.08);border-radius:999px;overflow:hidden;vertical-align:middle;margin-right:6px}
.tt-pct-bar>span{display:block;height:100%;background:#f05000}
.tt-live{color:#16a34a;margin-right:4px}
.tt-shot-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.tt-shot{display:block;border:1px solid var(--border,#ddd);border-radius:10px;overflow:hidden;text-decoration:none;color:inherit;background:var(--panel,#fff)}
.tt-shot img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;background:#111}
.tt-shot-meta{display:block;padding:8px 10px;font-size:.75rem;opacity:.8}

/* Sales sheet pipeline marker */
.sheet-order.is-pipeline { opacity: 0.85; }
.sheet-pipeline {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #c27803;
  border: 1px solid rgba(194, 120, 3, 0.35);
  border-radius: 4px;
  padding: 0 4px;
  vertical-align: middle;
}

/* ===== Board floating bottom nav (viewport pill, Trello-style) ===== */
.board-bottom-nav {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: max(36px, calc(24px + env(safe-area-inset-bottom, 0px))) !important;
  transform: translateX(-50%) !important;
  z-index: 90 !important;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  margin: 0 !important;
  width: max-content;
  font-family: var(--font, "Manrope", "Segoe UI", sans-serif);
}
.board-bottom-nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid rgba(204, 83, 35, 0.14);
  border-radius: 999px;
  box-shadow:
    0 10px 28px rgba(22, 18, 15, 0.12),
    0 2px 6px rgba(22, 18, 15, 0.05),
    0 0 0 1px rgba(243, 141, 48, 0.06);
}
.board-bottom-nav-item {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none !important;
  color: #3d342c !important;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1 !important;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.board-bottom-nav-item:hover {
  background: var(--accent-wash, #fff4eb);
  color: var(--accent, #d35400) !important;
  text-decoration: none !important;
}
.board-bottom-nav-item.is-active {
  background: var(--accent-soft, #ffe8d6);
  color: var(--accent, #d35400) !important;
  box-shadow: inset 0 0 0 1px rgba(211, 84, 0, 0.18);
}
.board-bottom-nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent, #f05000);
}
.board-bottom-nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  line-height: 0;
  color: inherit;
}
.board-bottom-nav-ico svg {
  display: block;
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}
.board-bottom-nav-label {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin: 0;
  padding: 0;
  line-height: 18px;
  font-size: inherit;
  font-weight: inherit;
}

/* Keep board lists clear of the floating bar */
body.is-project-board .trello-board-canvas,
.shell:has(.trello-board-shell) .trello-board-canvas {
  padding-bottom: 110px;
}
.boards-home {
  padding-bottom: 110px;
}

html[data-theme="dark"] body.theme-crm .board-bottom-nav-inner {
  background: #1c1917;
  border-color: rgba(243, 141, 48, 0.28);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] body.theme-crm .board-bottom-nav-item {
  color: #e7e0d8 !important;
}
html[data-theme="dark"] body.theme-crm .board-bottom-nav-item:hover {
  background: rgba(240, 80, 0, 0.14);
  color: #ff9a5c !important;
}
html[data-theme="dark"] body.theme-crm .board-bottom-nav-item.is-active {
  background: rgba(240, 80, 0, 0.2);
  color: #ff9a5c !important;
  box-shadow: inset 0 0 0 1px rgba(255, 154, 92, 0.28);
}
html[data-theme="dark"] body.theme-crm .board-bottom-nav-item.is-active::after {
  background: #ff9a5c;
}

@media (max-width: 640px) {
  .board-bottom-nav {
    bottom: max(28px, calc(16px + env(safe-area-inset-bottom, 0px))) !important;
  }
  .board-bottom-nav-item {
    height: 40px;
    padding: 0 12px;
    gap: 6px;
    font-size: 0.8125rem;
  }
  .board-bottom-nav-label {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Global go-back control in topbar */
.crm-go-back {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0 2px 0 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #6b5f55;
  cursor: pointer;
  flex-shrink: 0;
}
.crm-go-back svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.crm-go-back:hover {
  background: #fff4eb !important;
  color: #d35400 !important;
  border-color: rgba(211, 84, 0, 0.18);
  text-decoration: none !important;
}
.crm-go-back:active {
  background: #ffe8d6 !important;
}
html[data-theme="dark"] body.theme-crm .crm-go-back {
  color: #c4b8ad !important;
}
html[data-theme="dark"] body.theme-crm .crm-go-back:hover {
  background: rgba(240, 80, 0, 0.16) !important;
  color: #ff9a5c !important;
  border-color: rgba(255, 154, 92, 0.28);
}

/* Board live search — Trello-style sections */
.trello-board-search-section {
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a7d72;
}
.trello-board-search-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.trello-board-search-item-row .trello-board-search-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trello-board-search-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff4eb;
  color: #d35400;
}
.trello-board-search-badge.is-garbage {
  background: #f1f5f9;
  color: #475569;
}
.trello-board-search-board .trello-board-search-item-title {
  color: #d35400;
}
.trello-board-search-results {
  max-height: min(420px, 60vh);
  min-width: min(360px, 92vw);
}
a.trello-board-search-item {
  text-decoration: none !important;
  color: inherit !important;
}
html[data-theme="dark"] body.theme-crm .trello-board-search-section {
  color: #9aa3b2;
}
html[data-theme="dark"] body.theme-crm .trello-board-search-badge {
  background: rgba(240, 80, 0, 0.18);
  color: #ff9a5c;
}
html[data-theme="dark"] body.theme-crm .trello-board-search-badge.is-garbage {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

/* Shared live search (Sales + Customers) */
.live-search {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: min(280px, 100%);
}
.live-search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e4d8ce;
  border-radius: 10px;
  padding: 0 10px 0 34px;
  min-height: 40px;
}
.live-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a7d72;
  font-size: 14px;
  pointer-events: none;
}
.live-search-field input[type="search"] {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 8px 28px 8px 0 !important;
  margin: 0 !important;
  min-width: 0;
  font: inherit;
  color: inherit;
}
.live-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b5f55;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.live-search-clear:hover {
  background: #fff4eb;
  color: #d35400;
}
.live-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 85;
  max-height: min(420px, 60vh);
  overflow: auto;
  background: #fff;
  border: 1px solid #ddd6cf;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(22, 18, 15, 0.16);
  padding: 6px;
  min-width: min(380px, 92vw);
}
.live-search-results[hidden] { display: none !important; }
.live-search-section {
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a7d72;
}
.live-search-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit !important;
  text-decoration: none !important;
}
.live-search-item:hover,
.live-search-item.is-active {
  background: #fff4eb;
}
.live-search-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.live-search-item-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-search-item-meta {
  font-size: 0.78rem;
  color: #6b5f55;
}
.live-search-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffe8d6;
  color: #d35400;
}
.live-search-badge.is-muted {
  background: #f1f5f9;
  color: #64748b;
}
.live-search-empty {
  padding: 12px 10px;
  font-size: 0.85rem;
  color: #6b5f55;
}
.customers-controls .live-search {
  max-width: 420px;
}
html[data-theme="dark"] body.theme-crm .live-search-field {
  background: #1e2229;
  border-color: #343b47;
}
html[data-theme="dark"] body.theme-crm .live-search-results {
  background: #1e2229;
  border-color: #343b47;
}
html[data-theme="dark"] body.theme-crm .live-search-item:hover,
html[data-theme="dark"] body.theme-crm .live-search-item.is-active {
  background: rgba(240, 80, 0, 0.14);
}
html[data-theme="dark"] body.theme-crm .live-search-item-meta,
html[data-theme="dark"] body.theme-crm .live-search-section,
html[data-theme="dark"] body.theme-crm .live-search-empty {
  color: #9aa3b2;
}

/* Trello-style card labels (match Uz Logic Garbage look) */
body.theme-crm .trello-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 4px;
}
body.theme-crm .trello-card-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 16px;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--label-color, #dfe1e6);
  color: var(--label-text, #172b4d);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.theme-crm .trello-card.has-cover .trello-card-cover {
  height: 140px;
  max-height: 140px;
  margin: 0 -10px 8px;
  width: calc(100% + 20px);
  border-radius: 8px 8px 0 0;
}
body.theme-crm .trello-card.has-cover .trello-card-cover img {
  height: 140px;
  max-height: 140px;
}
body.theme-crm .trello-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #172b4d;
}
body.theme-crm .trello-card-badges {
  gap: 6px;
}
body.theme-crm .trello-card-badge {
  font-size: 11px;
  color: #5e6c84;
}

/* ===== Inbox unread badges (Gmail / WhatsApp sidebar) ===== */
.sidebar-link .sidebar-unread {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: #f05000;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px rgba(20, 18, 16, 0.55);
  flex-shrink: 0;
}
.sidebar-link .sidebar-unread.is-on {
  display: inline-flex;
}
.sidebar-link .sidebar-unread.is-bump {
  animation: sidebar-unread-pulse 1.4s ease;
}
.sidebar-flyout-parent .sidebar-unread.is-on + .sidebar-caret {
  margin-left: 6px;
}
@keyframes sidebar-unread-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 2px rgba(20, 18, 16, 0.55), 0 0 0 0 rgba(240, 80, 0, 0.55); }
  35% { transform: scale(1.18); box-shadow: 0 0 0 2px rgba(20, 18, 16, 0.55), 0 0 0 8px rgba(240, 80, 0, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(20, 18, 16, 0.55), 0 0 0 0 rgba(240, 80, 0, 0); }
}
html.nav-collapsed .sidebar-link {
  position: relative;
}
html.nav-collapsed .sidebar-link .sidebar-unread {
  position: absolute;
  top: 4px;
  right: 6px;
  margin-left: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.62rem;
  z-index: 2;
}

/* ===== Inbox sidebar flyouts (Gmail / WhatsApp account hover) ===== */
.sidebar-flyout {
  position: relative;
}
.sidebar-flyout-parent {
  width: 100%;
}
.sidebar-flyout-parent .sidebar-caret {
  margin-left: auto;
  transition: transform .15s ease, color .15s ease;
}
.sidebar-flyout-parent .sidebar-unread.is-on ~ .sidebar-caret {
  margin-left: 6px;
}
.sidebar-flyout:hover > .sidebar-flyout-parent .sidebar-caret,
.sidebar-flyout:focus-within > .sidebar-flyout-parent .sidebar-caret,
.sidebar-flyout.is-active-group > .sidebar-flyout-parent .sidebar-caret {
  transform: rotate(180deg);
  color: #ffbb4e;
}
/* Inline expand under the parent (sidebar overflow clips side flyouts) */
.sidebar-flyout-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 8px;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  position: static;
  min-width: 0;
}
.sidebar-flyout:hover > .sidebar-flyout-menu,
.sidebar-flyout:focus-within > .sidebar-flyout-menu,
.sidebar-flyout.is-active-group > .sidebar-flyout-menu {
  display: flex;
}
.sidebar-flyout-item {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin-left: 18px;
  padding: 6px 10px 6px 12px;
  border-radius: 8px;
  color: #9a9087 !important;
  text-decoration: none !important;
  font-size: 0.84rem;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-flyout-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: #3a3530;
}
.sidebar-flyout-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f1eb !important;
}
.sidebar-flyout-item.active {
  background: rgba(240, 80, 0, 0.16);
  color: #ffbb4e !important;
}
.sidebar-flyout-item.active::before {
  background: #f05000;
}
html.nav-collapsed .sidebar-flyout-menu {
  display: none !important;
}
html.nav-collapsed .sidebar-flyout-parent .sidebar-caret {
  display: none;
}

/* Seat setups (Login & Password) */
.pw-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef1f4;
}
.pw-subtabs a,
.pw-subtab-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -11px;
}
.pw-subtabs a:hover,
.pw-subtab-btn:hover { color: #1e3a5f; }
.pw-subtabs a.active,
.pw-subtab-btn.active {
  color: #1e3a5f;
  border-bottom-color: #1e3a5f;
}
.pw-subtabs-form { margin-top: 4px; }
.pw-panel { display: none; }
.pw-panel.is-active { display: block; }
.pw-form-grid select,
.pw-form-grid textarea {
  min-height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
}
.pw-form-grid textarea { min-height: 72px; resize: vertical; }
.vm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.vm-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 14px 16px;
  background: #fff;
}
.vm-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.vm-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vm-checklist a,
.vm-checklist span {
  font-size: 12.5px;
  color: #6b7280;
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}
.vm-checklist a.is-set,
.vm-checklist span.is-set {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.vm-checklist a:hover { color: #1e3a5f; }
.pw-seat-section {
  margin: 0 0 18px;
  padding: 14px 14px 4px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fafafa;
}
.pw-seat-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.vm-detail-list {
  margin: 0;
  display: grid;
  gap: 8px;
}
.vm-detail-list > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  font-size: 13px;
}
.vm-detail-list dt {
  margin: 0;
  color: #6b7280;
  font-weight: 500;
}
.vm-detail-list dd {
  margin: 0;
  word-break: break-word;
}
.vm-notes { margin: 10px 0 0; }

/* ─── AI Chat (LLM-style) ─── */
.ai-chat-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 140px);
  margin: -8px -4px 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.ai-chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  background: #f8f9fb;
  border-right: 1px solid #e5e7eb;
  min-height: 0;
  overflow: auto;
}
.ai-chat-sidebar-top {
  display: flex;
  gap: 8px;
}
.ai-chat-new {
  flex: 1;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
}
.ai-chat-icon-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  width: 42px;
  cursor: pointer;
}
.ai-chat-usage {
  font-size: 11px;
  color: #6b7280;
  padding: 4px 2px 8px;
}
.ai-chat-usage-sep { margin: 0 4px; }
.ai-chat-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-top: 6px;
}
.ai-chat-projects,
.ai-chat-threads {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-chat-proj-item,
.ai-chat-thread-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: #111827;
}
.ai-chat-proj-item:hover,
.ai-chat-thread-item:hover { background: #eef2ff; }
.ai-chat-proj-item.is-active,
.ai-chat-thread-item.is-active { background: #e0e7ff; }
.ai-chat-proj-name,
.ai-chat-thread-title {
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ai-chat-proj-vis,
.ai-chat-thread-meta {
  font-size: 11px;
  color: #6b7280;
}
.ai-chat-empty-side {
  font-size: 12px;
  color: #9ca3af;
  margin: 4px 8px;
}
.ai-chat-warn { font-size: 12px; color: #b45309; margin-top: auto; }
.ai-chat-hint { font-size: 11px; color: #6b7280; margin-top: auto; }
.ai-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 28%);
}
.ai-chat-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px 10px;
  border-bottom: 1px solid #f3f4f6;
}
.ai-chat-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ai-chat-subtitle { margin: 4px 0 0; font-size: 13px; }
.ai-chat-head-actions { display: flex; gap: 8px; }
.ai-chat-text-btn {
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 8px;
}
.ai-chat-text-btn.is-danger { color: #b91c1c; }
.ai-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 18px 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-chat-welcome {
  margin: auto;
  text-align: center;
  max-width: 520px;
  padding: 40px 16px;
}
.ai-chat-welcome h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.ai-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.ai-chat-suggestions button {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
}
.ai-chat-suggestions button:hover { border-color: #c7d2fe; background: #eef2ff; }
.ai-msg { max-width: 760px; width: 100%; margin: 0 auto; }
.ai-msg-user { display: flex; justify-content: flex-end; }
.ai-msg-user .ai-msg-bubble {
  background: #111827;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: min(640px, 92%);
  white-space: pre-wrap;
}
.ai-msg-assistant .ai-msg-bubble {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px 16px 16px 16px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.55;
  color: #111827;
}
.ai-msg-assistant.is-streaming .ai-msg-bubble { opacity: .92; }
.ai-msg-copy {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  margin-top: 4px;
  padding: 0;
}
.ai-code {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  overflow: auto;
  font-size: 12.5px;
  margin: 8px 0;
}
.ai-msg-bubble code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}
.ai-msg-bubble .ai-code code { background: transparent; padding: 0; color: inherit; }
.ai-chat-composer-wrap {
  padding: 10px 18px 18px;
  border-top: 1px solid #f3f4f6;
  background: #fff;
}
.ai-chat-composer {
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 12px 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.ai-chat-composer-toolbar { margin-bottom: 8px; }
.ai-chat-model-label select {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  background: #f9fafb;
  max-width: 100%;
}
.ai-chat-composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.ai-chat-composer textarea {
  width: 100%;
  border: 0;
  resize: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  min-height: 44px;
  max-height: 160px;
  background: transparent;
}
.ai-chat-send {
  border: 0;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
}
.ai-chat-send:disabled { opacity: .55; cursor: wait; }
.ai-chat-status { margin: 8px 2px 0; font-size: 12px; }
.ai-chat-dialog {
  border: 0;
  border-radius: 12px;
  padding: 0;
  max-width: 440px;
  width: calc(100% - 24px);
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}
.ai-chat-dialog::backdrop { background: rgba(15, 23, 42, .35); }
.ai-chat-dialog-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}
.ai-chat-dialog-body h3 { margin: 0; }
.ai-chat-dialog-body label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 560;
}
.ai-chat-dialog-body input,
.ai-chat-dialog-body select,
.ai-chat-dialog-body textarea {
  font: inherit;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
}
.ai-chat-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 860px) {
  .ai-chat-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 110px);
  }
  .ai-chat-sidebar {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }
}
