
    :root {
      color-scheme: dark;
      --ink: #f7f7f8;
      --muted: #a7adb8;
      --line: #303037;
      --panel: #18181c;
      --panel-2: #202026;
      --canvas: #0b0b0d;
      --soft: #2a2a31;
      --blue: #dc2626;
      --green: #22c55e;
      --amber: #f59e0b;
      --red: #ef4444;
      --teal: #ef4444;
      --shadow: 0 16px 36px rgba(0, 0, 0, .34);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * { box-sizing: border-box; }
    body {
      margin: 0;
      background: var(--canvas);
      color: var(--ink);
      min-height: 100vh;
    }

    button, input, select, textarea {
      font: inherit;
    }

    button {
      border: 1px solid var(--line);
      background: #202026;
      color: var(--ink);
      min-height: 36px;
      border-radius: 7px;
      padding: 0 12px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      white-space: nowrap;
    }

    button:hover { border-color: #ef4444; background: #292930; }
    button.primary {
      background: var(--blue);
      color: white;
      border-color: var(--blue);
    }

    button.ghost {
      background: transparent;
      border-color: transparent;
    }

    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 9px 10px;
      background: #101014;
      color: var(--ink);
      min-height: 38px;
    }

    input:disabled,
    input[readonly] {
      background: #202026;
      color: #777d89;
      cursor: not-allowed;
    }

    textarea {
      min-height: 84px;
      resize: vertical;
    }

    label {
      display: grid;
      gap: 5px;
      color: #d7d9de;
      font-size: 12px;
      font-weight: 650;
    }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 244px minmax(0, 1fr);
    }

    .app.sidebar-collapsed {
      grid-template-columns: minmax(0, 1fr);
    }

    aside {
      background: #050506;
      color: #f8fafc;
      padding: 18px 14px;
      display: grid;
      align-content: start;
      gap: 18px;
      position: sticky;
      top: 0;
      height: 100vh;
      overflow-y: auto;
    }

    .app.sidebar-collapsed aside {
      display: none;
    }

    .app.sidebar-collapsed main {
      grid-column: 1 / -1;
    }

    .brand, .header-brand {
      display: grid;
      grid-template-columns: 38px 1fr;
      gap: 10px;
      align-items: center;
    }

    .brand {
      padding: 4px 8px 10px;
      border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .brand img, .header-brand img {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      background: #fff;
      padding: 3px;
      object-fit: contain;
    }

    .brand strong { font-size: 18px; color: #fff; }
    .brand span { color: #a7adb8; font-size: 13px; }

    .header-brand {
      min-width: 0;
    }

    .header-brand strong {
      color: var(--ink);
      font-size: 15px;
      line-height: 1.1;
      display: block;
    }

    .title-text {
      min-width: 0;
    }

    .nav {
      display: grid;
      gap: 4px;
    }

    .nav button {
      width: 100%;
      justify-content: flex-start;
      color: #dbe4f0;
      background: transparent;
      border-color: transparent;
      padding: 10px;
      min-height: 42px;
    }

    .nav button.active,
    .nav button:hover {
      background: rgba(239, 68, 68, .18);
      color: white;
      border-color: rgba(239, 68, 68, .3);
    }

    .hidden {
      display: none !important;
    }

    .theme-switch {
      display: grid;
      gap: 8px;
      padding: 12px 8px;
      border-top: 1px solid rgba(255, 255, 255, .12);
    }

    .theme-switch span {
      color: #a7adb8;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .theme-switch button {
      width: 100%;
      justify-content: flex-start;
      background: #18181c;
      color: #f7f7f8;
      border-color: #303037;
    }

    main {
      min-width: 0;
      display: grid;
      grid-template-rows: auto 1fr;
    }

    header {
      background: rgba(12, 12, 15, .92);
      border-bottom: 1px solid var(--line);
      padding: 14px 22px;
      display: grid;
      grid-template-columns: minmax(210px, 1fr) auto;
      gap: 16px;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 3;
      backdrop-filter: blur(12px);
    }

    .title h1 {
      font-size: 22px;
      line-height: 1.2;
      margin: 0;
    }

    .title p {
      margin: 3px 0 0;
      color: var(--muted);
      font-size: 13px;
    }

    .header-title-row {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .icon-btn {
      width: 38px;
      min-width: 38px;
      padding: 0;
      justify-content: center;
      font-size: 18px;
      line-height: 1;
    }

    .actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .content {
      padding: 22px;
      display: grid;
      gap: 18px;
      align-content: start;
    }

    .metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(140px, 1fr));
      gap: 12px;
    }

    .metric {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      min-height: 92px;
      box-shadow: var(--shadow);
      display: grid;
      gap: 4px;
    }

    .metric span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .metric strong {
      font-size: 26px;
      line-height: 1.1;
    }

    .admin-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 12px;
    }

    .admin-list {
      display: grid;
      gap: 8px;
    }

    .admin-role-form {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) auto;
      gap: 10px;
      align-items: end;
    }

    .admin-role-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    #adminManagePanel {
      align-self: start;
    }

    #adminManagePanel .panel-body {
      align-content: start;
    }

    .admin-log {
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 10px;
      background: var(--panel-2);
      display: grid;
      gap: 5px;
      min-height: auto;
      text-align: left;
      justify-items: start;
      white-space: normal;
      width: 100%;
    }

    .admin-log strong {
      font-size: 14px;
    }

    .admin-log.active {
      border-color: var(--blue);
      box-shadow: 0 0 0 1px rgba(220, 38, 38, .35);
    }

    .admin-user-detail {
      display: grid;
      gap: 12px;
    }

    .toolbar {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) 170px 170px auto;
      gap: 10px;
      align-items: end;
    }

    .tracker-controls {
      grid-template-columns: 84px 130px 130px auto auto minmax(0, 1fr) max-content auto;
    }

    .tracker-controls label {
      min-width: 0;
    }

    .annual-goal-control {
      grid-column: 7;
      justify-self: end;
      width: max-content;
    }

    .annual-goal-control .money-field input {
      min-width: 1in;
      width: var(--annual-goal-width, 1in);
      max-width: 150px;
    }

    .tracker-controls button {
      white-space: nowrap;
    }

    #saveGoalsBtn {
      grid-column: 8;
    }

    .section {
      display: none;
      gap: 14px;
    }

    .section.active {
      display: grid;
    }

    .workspace {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 16px;
      align-items: start;
    }

    .dashboard-workspace {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      align-items: stretch;
    }

    .dashboard-workspace .panel {
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .workspace.detail-closed {
      grid-template-columns: minmax(0, 1fr);
    }

    .account-detail {
      display: none;
    }

    .workspace.detail-open .account-detail {
      display: grid;
      position: fixed;
      inset: 0;
      z-index: 60;
      place-items: center;
      padding: 18px;
      background: rgba(0, 0, 0, .72);
    }

    .workspace.detail-closed .account-detail {
      display: none !important;
    }

    .account-detail > .panel {
      width: min(760px, 100%);
      max-height: min(820px, 92vh);
      overflow: auto;
    }

    #visitPanel {
      display: none;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      min-width: 0;
    }

    .panel-head {
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .panel-head h2 {
      margin: 0;
      font-size: 16px;
    }

    .followup-panel-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start;
      gap: 8px;
    }

    .followup-panel-head h2 {
      white-space: nowrap;
      font-size: 15px;
    }

    .followup-panel-head .split-actions {
      justify-content: flex-end;
      flex-wrap: nowrap;
      gap: 4px;
    }

    .followup-panel-head .icon-btn {
      width: 30px;
      min-width: 30px;
      min-height: 32px;
      font-size: 16px;
    }

    .followup-panel-head [data-view-jump="tasks"] {
      min-height: 32px;
      padding: 0 8px;
      font-size: 12px;
      white-space: nowrap;
    }

    .panel-body {
      padding: 16px;
    }

    .list {
      display: grid;
      gap: 10px;
    }

    .item {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #141418;
      padding: 12px;
      display: grid;
      gap: 8px;
    }

    .item.clickable {
      cursor: pointer;
    }

    .item.clickable:hover {
      border-color: #ef4444;
      background: #1d1d22;
    }

    .item-top {
      display: grid;
      grid-template-columns: minmax(0, 1fr) max-content;
      gap: 10px;
      align-items: start;
    }

    .account-card-main {
      min-width: 0;
    }

    .item h3 {
      margin: 0;
      font-size: 15px;
      line-height: 1.25;
    }

    .account-children {
      display: grid;
      gap: 8px;
      margin-top: 10px;
      padding-left: 14px;
      border-left: 3px solid var(--soft);
    }

    .account-child {
      background: #1e1e24;
    }

    .account-child h3::before {
      content: "";
    }

    .meta {
      color: var(--muted);
      font-size: 13px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px 12px;
      min-width: 0;
      overflow: visible;
      white-space: normal;
    }

    .account-card-notes {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .chip {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 4px 8px;
      background: var(--soft);
      color: #f4f4f5;
      font-size: 12px;
      font-weight: 650;
    }

    .chip.hot { background: rgba(239, 68, 68, .18); color: #fca5a5; }
    .chip.warm { background: rgba(245, 158, 11, .16); color: #fbbf24; }
    .chip.customer { background: rgba(34, 197, 94, .16); color: #86efac; }
    .chip.prospect { background: rgba(239, 68, 68, .13); color: #fca5a5; }
    .chip.route { background: rgba(255, 255, 255, .08); color: #e5e7eb; }

    .contact-list {
      display: grid;
      gap: 10px;
    }

    .contact-item {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: #141418;
      display: grid;
      gap: 8px;
    }

    .contact-item-top {
      display: grid;
      grid-template-columns: minmax(0, 1fr) max-content;
      gap: 10px;
      align-items: start;
    }

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

    .form-grid .wide {
      grid-column: 1 / -1;
    }

    .stack {
      display: grid;
      gap: 12px;
    }

    .visit-log {
      display: grid;
      gap: 8px;
      max-height: 280px;
      overflow: auto;
      padding-right: 4px;
    }

    .visit-entry {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      display: grid;
      gap: 5px;
      background: #141418;
    }

    .visit-entry strong {
      font-size: 13px;
    }

    .visit-template-heading {
      text-align: center;
      font-size: 18px;
      font-weight: 900;
      color: var(--ink);
      padding: 4px 0 8px;
    }

    .visit-template-section {
      display: grid;
      gap: 4px;
    }

    .visit-template-section strong {
      font-size: 13px;
      color: var(--ink);
    }

    .visit-age {
      border: 1px solid var(--line);
      border-left: 5px solid var(--red);
      border-radius: 8px;
      padding: 12px 14px;
      background: #141418;
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 10px;
      align-items: center;
    }

    .visit-age strong {
      font-size: 36px;
      line-height: 1;
      color: var(--red);
    }

    .visit-age span {
      color: #f7f7f8;
      font-weight: 800;
    }

    .visit-age small {
      color: var(--muted);
      display: block;
      margin-top: 2px;
    }

    .aging-list {
      display: grid;
      gap: 10px;
    }

    .aging-item {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #141418;
      padding: 12px 14px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 14px;
      align-items: center;
      cursor: pointer;
    }

    .aging-item:hover {
      border-color: #ef4444;
      background: #1d1d22;
    }

    .aging-item h3 {
      margin: 0;
      font-size: 15px;
      line-height: 1.25;
    }

    .aging-item small {
      color: var(--muted);
      font-weight: 700;
    }

    .aging-days {
      min-width: 96px;
      text-align: center;
      color: var(--teal);
    }

    .aging-days strong {
      display: block;
      font-size: 38px;
      line-height: .9;
      font-weight: 900;
      letter-spacing: 0;
    }

    .aging-days span {
      display: block;
      margin-top: 4px;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
      color: #f7f7f8;
    }

    .tracker-tabs {
      display: inline-flex;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #101014;
    }

    .tracker-tabs button {
      border: 0;
      border-radius: 0;
      min-width: 92px;
    }

    .tracker-tabs button.active {
      background: var(--red);
      color: white;
    }

    .tracker-summary {
      display: grid;
      grid-template-columns: repeat(5, minmax(130px, 1fr));
      gap: 10px;
    }

    .tracker-table-wrap {
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
    }

    .tracker-scrollbar {
      overflow-x: auto;
      overflow-y: hidden;
      height: 18px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #101014;
      margin-bottom: 8px;
    }

    .tracker-scrollbar-inner {
      height: 1px;
    }

    .tracker-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      min-width: 1120px;
      background: #101014;
    }

    .tracker-table th,
    .tracker-table td {
      border-bottom: 1px solid var(--line);
      border-right: 1px solid var(--line);
      padding: 7px 8px;
      text-align: right;
      font-size: 12px;
      white-space: nowrap;
      background: #101014;
    }

    .tracker-input {
      width: 118px;
      min-height: 30px;
      padding: 5px 7px;
      text-align: right;
      border-radius: 5px;
    }

    .tracker-input.projection-input {
      width: 132px;
      font-weight: 700;
    }

    .money-field {
      position: relative;
      display: block;
    }

    .money-field .currency-prefix {
      position: absolute;
      left: 10px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      font-weight: 800;
      pointer-events: none;
    }

    .money-field input {
      padding-left: 24px;
    }

    .tracker-money {
      width: 118px;
      margin-left: auto;
    }

    .tracker-money.projection-money {
      width: 132px;
    }

    .tracker-money .tracker-input {
      width: 100%;
    }

    .tracker-table th {
      background: #202026;
      color: #f7f7f8;
      font-weight: 800;
      position: sticky;
      top: 0;
      z-index: 1;
    }

    .tracker-table th:first-child,
    .tracker-table td:first-child {
      text-align: left;
      position: sticky;
      left: 0;
      z-index: 2;
      background: #101014;
      min-width: 220px;
      max-width: 260px;
      white-space: normal;
    }

    .tracker-table th:first-child {
      background: #202026;
      z-index: 3;
    }

    .tracker-table th:nth-last-child(3),
    .tracker-table td:nth-last-child(3),
    .tracker-table th:nth-last-child(2),
    .tracker-table td:nth-last-child(2),
    .tracker-table th:last-child,
    .tracker-table td:last-child {
      position: sticky;
      background: #101014;
      z-index: 2;
      box-shadow: -1px 0 0 var(--line);
    }

    .tracker-table th:nth-last-child(3),
    .tracker-table td:nth-last-child(3) {
      right: 300px;
      min-width: 130px;
      width: 130px;
    }

    .tracker-table th:nth-last-child(2),
    .tracker-table td:nth-last-child(2) {
      right: 150px;
      min-width: 150px;
      width: 150px;
    }

    .tracker-table th:last-child,
    .tracker-table td:last-child {
      right: 0;
      min-width: 150px;
      width: 150px;
    }

    .tracker-table th:nth-last-child(3),
    .tracker-table th:nth-last-child(2),
    .tracker-table th:last-child {
      background: #202026;
      z-index: 4;
    }

    .progress {
      min-width: 120px;
      display: grid;
      gap: 3px;
    }

    .progress-track {
      height: 10px;
      background: #303037;
      border-radius: 999px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background: var(--green);
      width: 0;
    }

    .tracker-mobile-cards {
      display: none;
      gap: 12px;
    }

    .tracker-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #101014;
      padding: 12px;
      display: grid;
      gap: 12px;
    }

    .tracker-card h3 {
      margin: 0;
      font-size: 15px;
      line-height: 1.25;
    }

    .tracker-card-summary {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .tracker-card-stat {
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 8px;
      background: #141418;
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .tracker-card-stat span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .tracker-card-stat strong {
      font-size: 15px;
      line-height: 1.15;
      overflow-wrap: anywhere;
    }

    .tracker-card-months {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .tracker-card-months label {
      gap: 4px;
      min-width: 0;
    }

    .tracker-card-total {
      border-color: rgba(34, 197, 94, .35);
    }

    .tracker-card .progress {
      min-width: 0;
    }

    .variance.good { color: var(--green); font-weight: 800; }
    .variance.bad { color: var(--red); font-weight: 800; }
    .variance.good .variance-stack,
    .variance.good .variance-amount,
    .variance.good .variance-pct { color: var(--green); }
    .variance.bad .variance-stack,
    .variance.bad .variance-amount,
    .variance.bad .variance-pct { color: var(--red); }

    .variance-stack {
      display: grid;
      gap: 2px;
      line-height: 1.05;
      color: inherit;
    }

    .variance-amount {
      font-size: 22px;
      font-weight: 900;
      color: inherit;
    }

    .variance-pct {
      font-size: 13px;
      font-weight: 800;
      color: inherit;
    }

    .empty {
      color: var(--muted);
      border: 1px dashed #4b4b55;
      border-radius: 8px;
      padding: 18px;
      text-align: center;
      background: #141418;
    }

    .route-list {
      counter-reset: stop;
      display: grid;
      gap: 10px;
    }

    .stop {
      display: grid;
      grid-template-columns: 34px 1fr;
      gap: 10px;
      align-items: start;
    }

    .stop::before {
      counter-increment: stop;
      content: counter(stop);
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: var(--teal);
      color: white;
      display: grid;
      place-items: center;
      font-weight: 800;
    }

    .danger {
      color: var(--red);
    }

    .sync-status {
      color: var(--muted);
      font-size: 12px;
      min-width: 120px;
      text-align: right;
    }

    .sync-status.online { color: var(--green); }
    .sync-status.warning { color: var(--amber); }
    .sync-status.error { color: var(--red); }

    .split-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .followup-action-bar {
      align-items: center;
    }

    #openTaskDialogBtn {
      min-height: 30px;
      height: 32px;
      padding: 0 12px;
      align-self: center;
    }

    .queue-pill {
      min-height: 32px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--panel);
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      box-shadow: var(--shadow);
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .queue-pill strong {
      color: var(--ink);
      font-size: 15px;
      line-height: 1;
    }

    .item-top .split-actions {
      align-items: flex-start;
      flex-wrap: wrap;
      justify-content: flex-end;
      max-width: 280px;
      min-width: 180px;
    }

    .dialog-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .72);
      display: none;
      place-items: center;
      padding: 18px;
      z-index: 10;
    }

    .dialog-backdrop.open {
      display: grid;
    }

    .dialog {
      width: min(680px, 100%);
      max-height: min(760px, 92vh);
      overflow: auto;
      background: #18181c;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 20px 60px rgba(15, 23, 42, .24);
    }

    .dialog-head {
      padding: 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
    }

    .dialog-head h2 {
      margin: 0;
      font-size: 18px;
    }

    .dialog-body {
      padding: 16px;
      display: grid;
      gap: 14px;
    }

    .rich-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      padding: 8px;
      border: 1px solid var(--line);
      border-bottom: 0;
      border-radius: 8px 8px 0 0;
      background: #111115;
    }

    .rich-toolbar button {
      min-height: 32px;
      padding: 6px 9px;
    }

    .color-dot {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, .55);
      display: inline-block;
    }

    .rich-editor {
      min-height: 140px;
      padding: 11px;
      border: 1px solid var(--line);
      border-radius: 0 0 8px 8px;
      background: #0f0f12;
      color: var(--ink);
      line-height: 1.45;
      outline: none;
      overflow: auto;
    }

    .rich-editor:focus {
      border-color: var(--red);
      box-shadow: 0 0 0 3px rgba(239, 68, 68, .14);
    }

    .rich-editor ul {
      margin: 6px 0;
      padding-left: 22px;
    }

    .rich-editor:empty::before {
      content: attr(data-placeholder);
      color: var(--muted);
      pointer-events: none;
    }

    .help-text {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

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

    .mobile-nav {
      display: none;
    }

    body.light-theme {
      color-scheme: light;
      --ink: #1d2430;
      --muted: #667085;
      --line: #d7dde7;
      --panel: #ffffff;
      --panel-2: #f8fafc;
      --canvas: #f5f7fa;
      --soft: #edf2f7;
      --red: #c2413a;
      --teal: #c2413a;
      --shadow: 0 10px 28px rgba(27, 36, 48, .08);
      background: var(--canvas);
      color: var(--ink);
    }

    body.light-theme aside,
    body.light-theme .mobile-nav {
      background: #111827;
    }

    body.light-theme header {
      background: rgba(255, 255, 255, .92);
    }

    body.light-theme button {
      background: #fff;
      color: var(--ink);
    }

    body.light-theme button.primary,
    body.light-theme .tracker-tabs button.active {
      background: var(--red);
      color: white;
      border-color: var(--red);
    }

    body.light-theme input,
    body.light-theme select,
    body.light-theme textarea {
      background: #fff;
      color: var(--ink);
    }

    body.light-theme input:disabled,
    body.light-theme input[readonly] {
      background: #f3f6fa;
      color: #667085;
    }

    body.light-theme label {
      color: #344054;
    }

    body.light-theme .item,
    body.light-theme .aging-item,
    body.light-theme .visit-entry {
      background: #fff;
    }

    body.light-theme .account-child {
      background: #fbfcfe;
    }

    body.light-theme .item.clickable:hover,
    body.light-theme .aging-item:hover {
      background: #fbfcff;
      border-color: #9aa8bb;
    }

    body.light-theme .chip {
      background: var(--soft);
      color: #344054;
    }

    body.light-theme .chip.hot { background: #fee4e2; color: var(--red); }
    body.light-theme .chip.warm { background: #fef0c7; color: var(--amber); }
    body.light-theme .chip.customer { background: #dcfce7; color: var(--green); }
    body.light-theme .chip.prospect { background: #fee4e2; color: var(--red); }
    body.light-theme .chip.route { background: #f2f4f7; color: #344054; }

    body.light-theme .visit-age {
      background: #fff5f5;
    }

    body.light-theme .visit-age span,
    body.light-theme .aging-days span {
      color: #344054;
    }

    body.light-theme .tracker-tabs,
    body.light-theme .tracker-scrollbar,
    body.light-theme .tracker-table {
      background: #fff;
    }

    body.light-theme .tracker-table th {
      background: #eef2f7;
      color: #344054;
    }

    body.light-theme .tracker-table th:first-child,
    body.light-theme .tracker-table td:first-child {
      background: #fff;
    }

    body.light-theme .tracker-table th:first-child {
      background: #eef2f7;
    }

    body.light-theme .tracker-table th:nth-last-child(3),
    body.light-theme .tracker-table th:nth-last-child(2),
    body.light-theme .tracker-table th:last-child {
      background: #eef2f7;
    }

    body.light-theme .tracker-table td:nth-last-child(3),
    body.light-theme .tracker-table td:nth-last-child(2),
    body.light-theme .tracker-table td:last-child {
      background: #fff;
    }

    body.light-theme .tracker-card,
    body.light-theme .tracker-card-stat {
      background: #fff;
    }

    body.light-theme .progress-track {
      background: #e4e7ec;
    }

    body.light-theme .empty {
      background: #fbfcfe;
      border-color: #b8c2d1;
    }

    body.light-theme .dialog {
      background: #fff;
    }

    body.light-theme .rich-toolbar {
      background: #f1f5f9;
    }

    body.light-theme .rich-editor {
      background: #fff;
    }

    body.light-theme .theme-switch button {
      background: #fff;
      color: var(--ink);
      border-color: #d7dde7;
    }

    @media (max-width: 980px) {
      .app {
        grid-template-columns: 1fr;
      }
      .app.sidebar-collapsed {
        grid-template-columns: 1fr;
      }
      aside {
        display: none;
      }
      .mobile-nav {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding: 10px 12px;
        background: #050506;
        position: sticky;
        top: 0;
        z-index: 4;
      }
      .mobile-nav button {
        color: #dbe4f0;
        background: transparent;
        border-color: rgba(255,255,255,.14);
      }
      .mobile-nav button.active {
        background: rgba(239, 68, 68, .2);
        color: white;
      }
      header {
        grid-template-columns: 1fr;
      }
      #sidebarToggleBtn {
        display: none;
      }
      .actions {
        justify-content: flex-start;
      }
      .metrics,
      .admin-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
      }
      .tracker-summary {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
      }
      .workspace {
        grid-template-columns: 1fr;
      }
      .dashboard-workspace {
        grid-template-columns: 1fr;
      }
      .toolbar {
        grid-template-columns: 1fr 1fr;
      }
      .tracker-controls {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
      }
      .annual-goal-control,
      #saveGoalsBtn {
        grid-column: auto;
        justify-self: stretch;
        width: auto;
      }
      .annual-goal-control .money-field input {
        width: 100%;
      }
    }

    @media (max-width: 620px) {
      .content {
        padding: 14px;
      }
      .metrics, .admin-grid, .tracker-summary, .toolbar, .form-grid {
        grid-template-columns: 1fr;
      }
      .tracker-controls {
        grid-template-columns: 1fr;
      }
      .annual-goal-control,
      #saveGoalsBtn {
        grid-column: auto;
        justify-self: stretch;
        width: auto;
      }
      .annual-goal-control .money-field input {
        width: 100%;
      }
      .panel-head {
        align-items: flex-start;
        flex-direction: column;
      }
      .tracker-scrollbar,
      .tracker-table-wrap {
        display: none;
      }
      .tracker-mobile-cards {
        display: grid;
      }
      .tracker-card-summary {
        grid-template-columns: 1fr;
      }
      .title h1 {
        font-size: 19px;
      }
      button {
        min-width: 36px;
      }
    }
  