:root {
  --ink: #06133a;
  --text: #0a1640;
  --muted: #5f6f94;
  --soft: #f3f7ff;
  --line: #dfe7f4;
  --panel: #ffffff;
  --blue: #2563ff;
  --blue-2: #5b5ff6;
  --green: #18b96f;
  --red: #ff4548;
  --purple: #7c3fff;
  --amber: #ffb21c;
  --shadow: 0 14px 34px rgba(24, 45, 93, .09);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(118deg, rgba(255,255,255,.86), rgba(244,248,255,.94) 52%, rgba(236,245,255,.9)),
    #f4f8ff;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.dashboard-shell svg,
.modal svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.error-card {
  width: min(460px, calc(100% - 32px));
  margin: 15vh auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.boot-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100dvh;
  place-content: center;
  gap: 18px;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(68, 113, 255, .11), transparent 29rem),
    linear-gradient(145deg, #f9fbff 0%, #f2f6fc 58%, #edf4ff 100%);
}

.boot-screen::before,
.boot-screen::after {
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  content: "";
  filter: blur(2px);
  opacity: .48;
}

.boot-screen::before {
  top: -190px;
  right: -100px;
  background: radial-gradient(circle, rgba(83, 72, 255, .2), transparent 68%);
}

.boot-screen::after {
  bottom: -210px;
  left: -90px;
  background: radial-gradient(circle, rgba(21, 189, 151, .18), transparent 68%);
}

.boot-panel {
  width: min(430px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid rgba(207, 218, 236, .92);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 70px rgba(27, 52, 102, .12), 0 2px 8px rgba(27, 52, 102, .04);
  backdrop-filter: blur(16px);
}

.boot-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #101a35;
  font-size: 14px;
  font-weight: 800;
}

.boot-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: #07152f;
  box-shadow: 0 8px 22px rgba(19, 65, 151, .2);
  animation: bootLogoPulse 1.8s ease-in-out infinite;
}

.boot-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.boot-logo-dark { display: none; }

:root[data-theme="dark"] .boot-logo-light { display: none; }
:root[data-theme="dark"] .boot-logo-dark { display: block; }

.boot-copy {
  margin-top: 28px;
}

.boot-eyebrow {
  color: #275cf2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.boot-copy h1,
.error-card h1 {
  margin: 8px 0 8px;
  color: #07132d;
  font-size: clamp(23px, 5vw, 28px);
  letter-spacing: -.035em;
}

.boot-copy p,
.error-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.boot-progress {
  height: 6px;
  margin-top: 26px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8eef8;
}

.boot-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #18b96f, #2475ff, #5d4cf5);
  animation: bootProgress 1.45s ease-in-out infinite;
}

.boot-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #77849d;
  font-size: 10px;
  font-weight: 650;
}

.boot-status span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #168a5a;
}

.boot-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #18b96f;
  box-shadow: 0 0 0 4px rgba(24, 185, 111, .1);
}

.boot-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  color: #71809a;
  font-size: 10px;
  text-align: center;
}

.boot-privacy svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@keyframes bootProgress {
  0% { transform: translateX(-110%); }
  55%, 100% { transform: translateX(245%); }
}

@keyframes bootLogoPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 8px 22px rgba(19, 65, 151, .2); }
  50% { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(19, 65, 151, .28); }
}

@media (max-width: 480px) {
  .boot-screen {
    place-content: center;
    padding: 16px;
  }

  .boot-panel {
    padding: 23px 20px;
    border-radius: 16px;
  }

  .boot-copy {
    margin-top: 24px;
  }

  .boot-copy h1 {
    font-size: 23px;
  }

  .boot-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-logo,
  .boot-progress span {
    animation: none;
  }

  .boot-progress span {
    width: 68%;
  }
}

/* Modern secure workspace loader */
.boot-screen {
  gap: 16px;
  background:
    linear-gradient(rgba(61, 103, 216, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 103, 216, .035) 1px, transparent 1px),
    radial-gradient(circle at 50% 44%, rgba(78, 92, 255, .15), transparent 25rem),
    radial-gradient(circle at 15% 85%, rgba(20, 204, 163, .11), transparent 22rem),
    linear-gradient(145deg, #fbfdff 0%, #f3f7ff 56%, #eef5ff 100%);
  background-size: 38px 38px, 38px 38px, auto, auto, auto;
}

.boot-screen::before {
  top: -170px;
  right: -70px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(95, 73, 255, .2), transparent 68%);
  animation: bootAmbientFloat 8s ease-in-out infinite;
}

.boot-screen::after {
  bottom: -190px;
  left: -60px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(20, 203, 163, .18), transparent 68%);
  animation: bootAmbientFloat 9s ease-in-out -3s infinite reverse;
}

.boot-panel {
  position: relative;
  width: min(470px, calc(100vw - 32px));
  padding: 30px 32px 27px;
  overflow: hidden;
  border: 1px solid rgba(204, 216, 239, .92);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(250,252,255,.93));
  box-shadow: 0 34px 90px rgba(29, 52, 112, .16), 0 6px 20px rgba(33, 62, 126, .07), inset 0 1px rgba(255,255,255,.96);
  backdrop-filter: blur(24px);
}

.boot-panel::before {
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 102, 255, .62), transparent);
  content: "";
}

.boot-visual {
  position: relative;
  width: 124px;
  height: 124px;
  margin: -2px auto 4px;
}

.boot-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 1px solid rgba(130, 166, 234, .3);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 17px 38px rgba(40, 84, 173, .18), 0 0 0 8px rgba(255,255,255,.82);
  transform: translate(-50%, -50%);
  animation: bootLogoFloat 2.4s ease-in-out infinite;
}

.boot-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.boot-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(72, 109, 241, .2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.boot-orbit-one {
  width: 108px;
  height: 108px;
  animation: bootOrbit 4.8s linear infinite;
}

.boot-orbit-two {
  width: 124px;
  height: 124px;
  border-style: dashed;
  border-color: rgba(26, 188, 145, .2);
  animation: bootOrbitReverse 7s linear infinite;
}

.boot-orbit i {
  position: absolute;
  top: 50%;
  right: -4px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #356cff;
  box-shadow: 0 0 14px rgba(53, 108, 255, .65);
}

.boot-orbit-two i {
  top: 15%;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #18b96f;
  box-shadow: 0 0 13px rgba(24, 185, 111, .6);
}

.boot-spark {
  position: absolute;
  z-index: 4;
  color: #6a53f5;
  font-size: 13px;
  animation: bootSpark 1.8s ease-in-out infinite;
}

.boot-spark-one { top: 15px; left: 13px; }
.boot-spark-two { right: 8px; bottom: 17px; color: #16b985; animation-delay: -.8s; }

.boot-brand {
  justify-content: center;
  gap: 10px;
  font-size: 14px;
}

.boot-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: #18855b;
  border: 1px solid #d7f1e5;
  border-radius: 99px;
  background: #f2fcf7;
  font-size: 9px;
  font-weight: 700;
}

.boot-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #18b96f;
  box-shadow: 0 0 0 3px rgba(24, 185, 111, .12);
}

.boot-copy {
  margin-top: 23px;
  text-align: center;
}

.boot-eyebrow {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 99px;
  background: #eef3ff;
  letter-spacing: .09em;
}

.boot-copy h1 {
  margin-top: 10px;
  font-size: clamp(25px, 5vw, 30px);
}

.boot-copy p {
  max-width: 370px;
  margin-inline: auto;
  font-size: 12px;
  line-height: 1.6;
}

.boot-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 24px;
}

.boot-steps > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 8px 7px;
  color: #8290aa;
  border: 1px solid #e4eaf4;
  border-radius: 9px;
  background: rgba(249,251,255,.9);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.boot-steps > span > i {
  display: grid;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d4ddea;
  border-radius: 50%;
  color: transparent;
  font-size: 9px;
  font-style: normal;
}

.boot-steps .is-complete {
  color: #16865a;
  border-color: #d8eee4;
  background: #f5fcf8;
}

.boot-steps .is-complete i {
  color: #fff;
  border-color: #18b96f;
  background: #18b96f;
}

.boot-steps .is-active {
  color: #2754dc;
  border-color: #d6e0ff;
  background: #f5f7ff;
}

.boot-steps .is-active i {
  border: 4px solid #dbe4ff;
  background: #356cff;
  animation: bootStepPulse 1.25s ease-in-out infinite;
}

.boot-progress {
  position: relative;
  height: 7px;
  margin-top: 15px;
  background: #e9eef8;
}

.boot-progress::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent);
  content: "";
  transform: translateX(-100%);
  animation: bootShimmer 1.5s linear infinite;
}

.boot-progress span {
  width: 58%;
  background: linear-gradient(90deg, #18b96f 0%, #2482ef 52%, #664cff 100%);
  box-shadow: 0 0 18px rgba(55, 92, 244, .25);
  animation: bootProgressModern 2.4s cubic-bezier(.45, 0, .2, 1) infinite;
}

.boot-status {
  margin-top: 11px;
}

.boot-status-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.boot-typing {
  display: inline-flex;
  gap: 2px;
}

.boot-typing i {
  width: 3px;
  height: 3px;
  background: #61708f;
  box-shadow: none;
  animation: bootTyping 1s ease-in-out infinite;
}

.boot-typing i:nth-child(2) { animation-delay: .15s; }
.boot-typing i:nth-child(3) { animation-delay: .3s; }

.boot-privacy {
  font-size: 9px;
}

@keyframes bootLogoFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) scale(1); }
  50% { transform: translate(-50%, -50%) translateY(-4px) scale(1.015); }
}

@keyframes bootOrbit {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes bootOrbitReverse {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0); }
}

@keyframes bootSpark {
  0%, 100% { opacity: .35; transform: scale(.8) rotate(0); }
  50% { opacity: 1; transform: scale(1.15) rotate(18deg); }
}

@keyframes bootStepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(53,108,255,.15); }
  50% { box-shadow: 0 0 0 4px rgba(53,108,255,.12); }
}

@keyframes bootProgressModern {
  0% { width: 18%; }
  52% { width: 64%; }
  100% { width: 92%; }
}

@keyframes bootShimmer {
  to { transform: translateX(100%); }
}

@keyframes bootTyping {
  0%, 70%, 100% { opacity: .3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

@keyframes bootAmbientFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(20px, -14px, 0); }
}

@media (max-width: 480px) {
  .boot-screen {
    padding: 14px;
    background-size: 30px 30px, 30px 30px, auto, auto, auto;
  }

  .boot-panel {
    width: min(100%, 390px);
    padding: 23px 18px 21px;
    border-radius: 21px;
  }

  .boot-visual {
    width: 108px;
    height: 108px;
  }

  .boot-logo {
    width: 68px;
    height: 68px;
    border-radius: 20px;
  }

  .boot-orbit-one { width: 94px; height: 94px; }
  .boot-orbit-two { width: 108px; height: 108px; }

  .boot-copy {
    margin-top: 20px;
  }

  .boot-copy h1 {
    font-size: 25px;
  }

  .boot-steps {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 20px;
  }

  .boot-steps > span {
    min-height: 34px;
    justify-content: flex-start;
    padding-inline: 10px;
  }

  .boot-status {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-screen::before,
  .boot-screen::after,
  .boot-logo,
  .boot-orbit,
  .boot-spark,
  .boot-steps .is-active i,
  .boot-progress::after,
  .boot-progress span,
  .boot-typing i {
    animation: none;
  }

  .boot-progress span {
    width: 72%;
  }
}

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

.marketing-rail {
  display: none;
}

.promo-card {
  display: block;
  width: 100%;
  max-width: 430px;
  margin-left: auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(20, 38, 83, .16);
  background: #071336;
  transition: transform .18s ease, box-shadow .18s ease;
}

.promo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 55px rgba(20, 38, 83, .22);
}

.promo-card img {
  display: block;
  width: 100%;
  height: auto;
}

.assistant-rail {
  display: none;
}

.assistant-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
}

.assistant-heading {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.assistant-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.assistant-title i {
  color: #315cff;
  font-size: 21px;
  font-style: normal;
}

.assistant-title b {
  padding: 3px 6px;
  border-radius: 5px;
  color: #315cff;
  background: #eef2ff;
  font-size: 8px;
  letter-spacing: .06em;
}

.comet-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 4px;
  padding: 3px 8px 3px 4px;
  border: 1px solid #eadfff;
  border-radius: 999px;
  color: #5f4a78;
  background: linear-gradient(105deg, #fff8f1, #f7f1ff);
  box-shadow: 0 3px 10px rgba(116, 72, 169, .08);
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.comet-badge strong {
  color: #3e245d;
  font-weight: 850;
}

.comet-badge-mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #ff8a28, #8b4cff);
  font-size: 9px;
}

.comet-badge:hover {
  border-color: #cdb4f2;
  box-shadow: 0 5px 14px rgba(116, 72, 169, .15);
  transform: translateY(-1px);
}

.comet-badge-modal {
  margin: -8px 0 14px;
}

.copilot-modal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -8px 0 14px;
}

.copilot-modal-status .comet-badge-modal {
  margin: 0;
}

.assistant-collapse {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 7px;
  color: #43506f;
  background: transparent;
  font-size: 19px;
}

.assistant-collapse:hover {
  color: var(--blue);
  background: #eef3ff;
}

.assistant-rail-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 75px);
  min-height: 0;
  gap: 12px;
  padding: 20px 18px 16px;
}

.assistant-welcome {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.assistant-welcome img {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  box-shadow: 0 8px 16px rgba(37, 99, 255, .16);
}

.assistant-welcome > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dce6f7;
  border-radius: 0 11px 11px 11px;
  background: #f8faff;
}

.assistant-welcome b {
  color: var(--ink);
  font-size: 12px;
}

.assistant-welcome span {
  color: #455577;
  font-size: 11px;
  line-height: 1.48;
}

.assistant-welcome small {
  color: #7180a4;
  font-size: 9px;
}

.assistant-rail-messages,
.assistant-rail-chat .ai-chat-messages {
  flex: 1 1 auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  align-content: normal !important;
  padding-right: 4px;
}

.assistant-rail .ai-message {
  max-width: 100%;
  padding: 12px 13px;
  box-shadow: none;
  height: auto !important;
  flex: 0 0 auto !important;
  align-self: flex-start;
}

.assistant-rail .ai-message.user {
  max-width: 90%;
  margin-left: auto;
  align-self: flex-end;
  height: auto !important;
  flex: 0 0 auto !important;
}

.assistant-rail .ai-message small {
  color: inherit;
  opacity: .68;
  display: block;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  line-height: 1.2;
}

.assistant-rail .ai-message.assistant small {
  color: var(--muted);
  opacity: 1;
}

.ai-rail-insight {
  border-color: #dfe7f6 !important;
  background: #fff !important;
}

.ai-rail-insight .ai-message-body {
  display: grid;
  gap: 7px;
  color: #263858 !important;
  font-size: 12px;
}

.ai-rail-insight .ai-message-body b {
  color: var(--ink);
  font-size: 12px;
}

.ai-rail-insight .ai-message-body span {
  color: #5a6a8c;
  font-size: 11px;
}

.assistant-rail-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.assistant-rail-suggestions button {
  overflow: hidden;
  padding: 8px 7px;
  color: #3154a8;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-rail-form {
  gap: 7px;
}

.assistant-rail-form textarea {
  min-height: 54px;
  max-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

.assistant-rail-form > div {
  align-items: center;
}

.assistant-rail-form small {
  max-width: 220px;
  line-height: 1.35;
}

.assistant-send {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2563ff, #4d4bf5);
  box-shadow: 0 8px 16px rgba(37, 99, 255, .25);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.assistant-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 20px rgba(37, 99, 255, .32);
}

.assistant-send:disabled,
.action-button:disabled {
  cursor: wait;
  opacity: .78;
  transform: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 25px 14px;
  color: #fff;
  background: linear-gradient(180deg, #071a44 0%, #041331 100%);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 34px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  object-position: left center;
  border-radius: 12px;
  box-shadow: 0 11px 24px rgba(0, 0, 0, .35);
}

.brand .brand-logo-light {
  display: none;
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.05;
}

.brand span {
  display: block;
  color: #4f86ff;
}

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

.nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #eff5ff;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 760;
}

.nav button.active,
.nav button:hover {
  background: linear-gradient(100deg, #3472ff, #314eea);
  box-shadow: 0 12px 20px rgba(26, 67, 178, .34);
}

.pill-new {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 5px;
  background: #5737ff;
  color: #fff;
  font-size: 10px;
}

.streak-card,
.profile-card {
  position: absolute;
  left: 14px;
  right: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.streak-card {
  bottom: 126px;
  padding: 16px;
}

.streak-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f4f8ff;
  font-size: 12px;
  font-weight: 720;
}

.flame {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #ffbc27;
  background: linear-gradient(145deg, rgba(255, 94, 58, .24), rgba(255, 183, 28, .12));
}

.streak-card b {
  display: block;
  margin: 8px 0 8px;
  color: #ffbf28;
  font-size: 22px;
}

.streak-card p {
  margin: 0;
  color: #c9d6f3;
  font-size: 11px;
  line-height: 1.45;
}

.streak-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-top: 14px;
}

.streak-bars i {
  height: 6px;
  border-radius: 99px;
  background: #34d891;
}

.profile-card {
  bottom: 27px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.profile-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-card b {
  display: block;
  color: #fff;
  font-size: 12px;
}

.profile-card span {
  color: #58a0ff;
  font-size: 11px;
}

.main {
  width: min(100%, 1276px);
  margin: 0;
  padding: 24px 28px 36px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: start;
  gap: 22px;
  margin-bottom: 8px;
}

.headline h1 {
  margin: 3px 0 9px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.1;
  font-weight: 850;
}

.headline p {
  margin: 0;
  color: #3f4f78;
  font-size: 14px;
}

.headline strong {
  color: var(--green);
}

.toolbar {
  display: grid;
  grid-template-columns: 140px 280px 38px;
  column-gap: 13px;
  row-gap: 8px;
  justify-content: end;
}

.toolbar-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: end;
  gap: 12px;
}

.input-shell,
.month-input,
.notice-button,
.action-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(25, 46, 92, .05);
}

.month-input {
  width: 100%;
  padding: 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: #8190ac;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 12px;
}

.kbd {
  color: #8792ad;
  font-size: 11px;
}

.notice-button {
  position: relative;
  display: grid;
  place-items: center;
  color: #2f3c66;
}

.notice-button b {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  line-height: 12px;
  text-align: center;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 128px;
  padding: 0 14px;
  color: var(--green);
  border-color: #d8f3e6;
  font-size: 12px;
  font-weight: 760;
}

.action-button.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(100deg, #356fff, #274be7);
}

.toolbar-actions .action-button {
  height: 32px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.28fr .94fr .94fr 1.04fr;
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .93);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  min-height: 172px;
  padding: 22px 22px 15px;
  overflow: hidden;
}

.metric-card.balance {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #6d76ff 0%, #4257ef 54%, #253fd4 100%);
}

.metric-card label {
  display: block;
  color: #6b789c;
  font-size: 12px;
  font-weight: 680;
}

.metric-card.balance label {
  color: #e8edff;
}

.metric-card h2 {
  margin: 12px 0 10px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.05;
}

.metric-card.balance h2 {
  color: #fff;
  font-size: 25px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: #e5faef;
  font-size: 11px;
  font-weight: 820;
}

.trend span {
  color: #37466f;
  font-weight: 650;
}

.trend.bad {
  color: var(--red);
  background: #fff0f0;
}

.trend.purple {
  color: var(--purple);
  background: #f2edff;
}

.balance .trend {
  color: #0b8d56;
  background: #c8ffdf;
}

.metric-icon {
  position: absolute;
  top: 16px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--blue);
  background: #edf3ff;
}

.metric-card.balance .metric-icon {
  color: #fff;
  background: rgba(255, 255, 255, .2);
}

.metric-card.income .metric-icon {
  color: var(--green);
  background: #dcf9ea;
}

.metric-card.expense .metric-icon {
  color: var(--red);
  background: #ffe8ea;
}

.metric-card.saving .metric-icon {
  color: var(--purple);
  background: #f0e8ff;
}

.sparkline {
  position: absolute;
  right: 18px;
  bottom: 13px;
  left: 18px;
  height: 50px;
}

.sparkline svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sparkline path.area {
  fill: currentColor;
  opacity: .1;
}

.sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content-grid {
  display: grid;
  grid-template-columns: 340px minmax(260px, 1fr) minmax(280px, 1.06fr) 300px;
  gap: 14px;
  align-items: stretch;
}

.panel {
  padding: 14px;
}

.panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-link {
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.financial-health {
  grid-column: 1;
  grid-row: 1;
  min-height: 246px;
}

.health-body {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 24px;
}

.score-ring,
.budget-ring,
.donut {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.score-ring {
  width: 150px;
  height: 150px;
  padding: 11px;
  background: conic-gradient(var(--green) var(--score), #edf3f7 0);
}

.score-ring .inner,
.budget-ring .inner,
.donut .inner {
  display: grid;
  place-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  text-align: center;
}

.score-ring b {
  font-size: 38px;
  line-height: 1;
}

.score-ring span,
.budget-ring span,
.donut span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.health-stats {
  display: grid;
  gap: 15px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.health-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.health-stat b {
  color: var(--text);
}

.health-stat b.good {
  color: var(--green);
}

.status-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border-radius: 6px;
  color: var(--tone);
  background: var(--tone-bg);
}

.large-chart {
  grid-column: 2 / 4;
  grid-row: 1;
  min-height: 246px;
}

.chart-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #40517b;
  font-size: 10px;
  font-weight: 700;
}

.legend i {
  display: inline-block;
  width: 17px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--tone);
}

.period-select {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-size: 11px;
  font-weight: 750;
}

.income-expense-chart {
  position: relative;
  height: 166px;
}

.income-expense-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.grid-line {
  stroke: #e5ebf5;
  stroke-width: 1;
}

.axis-label {
  fill: #68789e;
  font-family: inherit;
  font-size: 10px;
}

.chart-area-income {
  fill: url(#incomeFill);
  stroke: none;
}

.chart-area-expense {
  fill: url(#expenseFill);
  stroke: none;
}

.chart-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: points .18s ease;
}

.chart-line.income {
  stroke: var(--green);
}

.chart-line.expense {
  stroke: var(--red);
}

.chart-line.saving {
  stroke: var(--blue);
}

.chart-point {
  fill: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 4px 8px rgba(13, 26, 62, .16));
  pointer-events: none;
  transition: cx .12s ease, cy .12s ease;
}

.chart-cursor {
  stroke: #95a5c3;
  stroke-dasharray: 3 5;
  stroke-width: 1;
  opacity: .75;
  pointer-events: none;
}

.chart-hitbox {
  fill: transparent;
  stroke: none;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  top: 46px;
  left: 54%;
  min-width: 124px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #fff;
  background: #10182c;
  box-shadow: 0 16px 35px rgba(8, 16, 44, .28);
  font-size: 10px;
  pointer-events: none;
  transition: left .12s ease;
}

.chart-tooltip b {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
}

.chart-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}

.budget-panel {
  grid-column: 4;
  grid-row: 1;
  min-height: 246px;
}

.budget-ring {
  width: 116px;
  height: 116px;
  margin: 0 auto 11px;
  padding: 11px;
  background: conic-gradient(var(--red) var(--budget), #fad5dc 0);
}

.budget-ring b {
  font-size: 27px;
  line-height: 1;
}

.budget-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  text-align: center;
}

.budget-values small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.budget-values b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 10px;
}

.budget-values b.negative {
  color: var(--red);
}

.alert-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--red);
  background: #fff0f0;
  font-size: 10px;
  font-weight: 800;
}

.budget-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(96px, .85fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.budget-footer .alert-pill,
.budget-footer .wide-button {
  width: 100%;
  margin: 0;
}

.spending-panel,
.insights-panel,
.goals-panel,
.side-stack {
  min-height: 242px;
}

.spending-panel {
  grid-column: 1;
  grid-row: 2;
}

.insights-panel {
  grid-column: 2;
  grid-row: 2;
}

.goals-panel {
  grid-column: 3;
  grid-row: 2;
}

.category-body {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.donut {
  width: 142px;
  height: 142px;
  padding: 28px;
  background: var(--donut);
}

.donut b {
  font-size: 15px;
}

.donut span {
  color: var(--muted);
  font-size: 9px;
}

.category-legend {
  display: grid;
  gap: 9px;
}

.category-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 9px;
  color: #17254c;
  font-size: 10px;
}

.category-line label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}

.category-line b,
.category-line span:last-child {
  font-size: 10px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--tone);
}

.wide-button {
  width: 100%;
  height: 28px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  color: var(--blue);
  background: #eef3ff;
  font-size: 11px;
  font-weight: 850;
}

.insight-list {
  display: grid;
  gap: 9px;
}

.insight-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 8px;
  background: #fbfcff;
}

.insight-item i,
.bill-icon,
.subscription-icon,
.goal-art {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-style: normal;
}

.insight-item i {
  width: 30px;
  height: 30px;
  color: var(--tone);
  background: var(--tone-bg);
}

.insight-item b,
.goal-card b,
.mini-row b {
  display: block;
  color: var(--text);
  font-size: 11px;
}

.insight-item span,
.goal-card small,
.mini-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.goals-list {
  display: grid;
  gap: 12px;
}

.goal-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.goal-art {
  width: 58px;
  height: 48px;
  color: #fff;
  background: linear-gradient(135deg, #47d4d8, #3076ff);
}

.goal-percent {
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.progress-track {
  height: 6px;
  margin-top: 8px;
  border-radius: 99px;
  background: #edf1f7;
  overflow: hidden;
}

.progress-track i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #18b96f, #48d08d);
}

.side-stack {
  grid-column: 4;
  grid-row: 2 / 4;
  display: grid;
  gap: 14px;
  align-self: start;
}

.mini-panel {
  padding: 14px;
}

.mini-list {
  display: grid;
}

.mini-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.mini-row:last-child {
  border-bottom: 0;
}

.bill-icon,
.subscription-icon {
  width: 28px;
  height: 28px;
  color: var(--tone);
  background: var(--tone-bg);
}

.mini-row strong {
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}

.transactions-panel {
  grid-column: 1 / 4;
  grid-row: 3;
  padding: 14px 16px 9px;
}

.transactions-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.transactions {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.transactions th {
  padding: 8px 0 9px;
  color: #516185;
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 850;
}

.transactions td {
  padding: 9px 0;
  border-bottom: 1px solid #edf1f7;
  vertical-align: middle;
}

.tx-title {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.tx-avatar {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  color: var(--tone);
  background: var(--tone-bg);
  font-weight: 850;
}

.tx-title b {
  display: block;
  font-size: 11px;
}

.tx-title span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--tone);
  background: var(--tone-bg);
  text-transform: capitalize;
  font-size: 10px;
  font-weight: 800;
}

.payment {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #26375f;
}

.payment i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 18px;
  border-radius: 5px;
  color: #fff;
  background: #1849b8;
  font-style: normal;
  font-size: 8px;
  font-weight: 900;
}

.amount {
  color: var(--red);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.amount.positive {
  color: var(--green);
}

.empty-state {
  padding: 22px 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 17, 46, .54);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 85px rgba(5, 17, 48, .35);
}

.modal.wide {
  width: min(900px, 100%);
}

.modal-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 20px;
}

.modal p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.tx-modal-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tx-modal-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line, #e2ebe6);
  border-radius: 9px;
  background: var(--page-mint, #f8fbfa);
  color: var(--muted, #66778a);
}

.tx-modal-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink, #102131);
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.tx-modal-select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line, #e2ebe6);
  border-radius: 9px;
  background: var(--page-mint, #f8fbfa);
  color: var(--ink, #102131);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  outline: 0;
  cursor: pointer;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #f0f4fb;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  height: 41px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: 0;
  font-size: 13px;
  font-weight: 650;
}

.form-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 10px;
}

.floating-ai {
  position: fixed;
  right: 34px;
  bottom: 100px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #7c3fff, #2563ff);
  box-shadow: 0 18px 42px rgba(92, 72, 236, .35);
  font-size: 22px;
}

.ai-chat { display: grid; gap: 12px; }
.ai-chat-messages { display: grid; gap: 10px; max-height: 390px; overflow: auto; padding: 2px; }
.ai-message { max-width: 92%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px 13px 13px 4px; background: #f7f9ff; }
.ai-message.user { justify-self: end; border: 0; border-radius: 13px 13px 4px 13px; color: #fff; background: linear-gradient(135deg, #2563ff, #4f46e5); }
.ai-message-label { margin-bottom: 5px; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; opacity: .8; }
.ai-message-body { color: inherit; font-size: 13px; line-height: 1.55; }
.ai-message.assistant .ai-message-body { color: var(--ink); }
.ai-message-body code { padding: 1px 4px; border-radius: 4px; background: #e9effc; font-size: 11px; }
.ai-message small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.ai-loading-message {
  background: linear-gradient(180deg, #f9fbff, #f2f6ff);
}
.ai-loading-message .ai-message-body {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #40527d;
  font-weight: 700;
}
.ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ai-loading-text {
  transition: opacity .18s ease-in-out;
}
.ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563ff;
  animation: aiTypingPulse .9s ease-in-out infinite;
}
.ai-typing i:nth-child(2) { animation-delay: .12s; }
.ai-typing i:nth-child(3) { animation-delay: .24s; }
.button-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .48);
  border-top-color: #fff;
  border-radius: 50%;
  animation: aiSpin .7s linear infinite;
}
.action-button .button-spinner {
  flex: 0 0 auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes aiTypingPulse {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@keyframes aiSpin {
  to { transform: rotate(360deg); }
}
.ai-suggestions { display: flex; gap: 7px; flex-wrap: wrap; }
.ai-suggestions button { border: 1px solid #dce5fb; border-radius: 999px; padding: 7px 9px; color: #3154a8; background: #f6f8ff; font-size: 11px; font-weight: 750; }
.ai-chat-form { display: grid; gap: 8px; }
.ai-chat-form textarea { min-height: 76px; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit; font-size: 13px; outline: 0; }
.ai-chat-form textarea:focus { border-color: #2563ff; box-shadow: 0 0 0 3px rgba(37, 99, 255, .1); }
.ai-chat-form > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-chat-form small { color: var(--muted); font-size: 10px; }

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

.plain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.plain-row b {
  display: block;
  font-size: 13px;
}

.plain-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.panel-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.panel-metric {
  padding: 12px;
  border-radius: 8px;
  background: #f6f8fc;
}

.panel-metric span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.panel-metric b {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

@media (min-width: 1440px) {
  .dashboard-shell {
    grid-template-columns: 228px minmax(0, 1fr) var(--assistant-rail-width, 440px);
  }

  .assistant-rail {
    position: sticky;
    top: 0;
    display: block;
    height: 100vh;
    min-width: 0;
    overflow: hidden;
    border-left: 1px solid #e1e8f4;
    background: rgba(255, 255, 255, .92);
    box-shadow: -14px 0 34px rgba(33, 59, 111, .04);
  }

  .floating-ai {
    display: none;
  }

  .dashboard-shell:has(.assistant-rail.collapsed) {
    grid-template-columns: 228px minmax(0, 1fr) 62px;
  }

  .assistant-rail.collapsed .assistant-rail-header {
    justify-content: center;
    padding: 0;
  }

  .assistant-rail.collapsed .assistant-heading,
  .assistant-rail.collapsed .assistant-rail-chat {
    display: none;
  }

  .assistant-rail.collapsed .assistant-collapse::before {
    content: "+";
  }

  .assistant-rail.collapsed .assistant-collapse {
    color: transparent;
    font-size: 0;
  }

  .assistant-rail.collapsed .assistant-collapse::before {
    color: #315cff;
    font-size: 20px;
  }
}

@media (max-width: 1350px) {
  .content-grid {
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
  }

  .financial-health,
  .budget-panel,
  .spending-panel,
  .insights-panel,
  .goals-panel,
  .large-chart,
  .transactions-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .side-stack {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 140px 220px 38px;
  }
}

@media (max-width: 900px) {
  .dashboard-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 8px;
  }

  .brand {
    justify-content: center;
  }

  .brand strong,
  .nav span,
  .pill-new,
  .streak-card,
  .profile-card {
    display: none;
  }

  .nav button {
    justify-content: center;
    padding: 0;
  }

  .topbar,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .action-button {
    flex: 1;
  }
}

@media (max-width: 720px) {
  body {
    background:
      linear-gradient(180deg, rgba(245,248,255,.96), rgba(235,243,255,.98)),
      #eef5ff;
  }

  .dashboard-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    display: block;
    padding: 10px 11px 8px;
    box-shadow: 0 12px 32px rgba(3, 16, 45, .22);
  }

  .brand {
    justify-content: flex-start;
    margin: 0;
  }

  .brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand strong {
    display: block;
    font-size: 15px;
  }

  .brand span {
    display: inline;
    margin-left: 4px;
  }

  .nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 42px;
    gap: 7px;
    margin-top: 10px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    min-height: 38px;
    border-radius: 10px;
    justify-content: center;
    scroll-snap-align: start;
  }

  .main {
    padding: 13px 10px 34px;
  }

  .topbar {
    gap: 11px;
    margin-bottom: 12px;
  }

  .headline h1 {
    margin: 0 0 5px;
    font-size: 20px;
    line-height: 1.18;
  }

  .headline p {
    font-size: 12px;
    line-height: 1.45;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px;
  }

  .month-input,
  .notice-button {
    height: 38px;
  }

  .month-input {
    grid-column: 1;
    grid-row: 1;
  }

  .notice-button {
    grid-column: 2;
    grid-row: 1;
  }

  .input-shell {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 38px;
  }

  .kbd {
    display: none;
  }

  .toolbar-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .toolbar-actions .action-button {
    min-width: 0;
    height: 38px;
    padding: 0 10px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
  }

  .metric-card {
    min-height: 126px;
    padding: 14px 13px 11px;
  }

  .metric-card.balance,
  .metric-card.saving {
    grid-column: 1 / -1;
  }

  .metric-card.balance {
    min-height: 145px;
  }

  .metric-card label {
    max-width: calc(100% - 42px);
    font-size: 10px;
  }

  .metric-card h2 {
    margin: 9px 0 8px;
    font-size: 20px;
  }

  .metric-card.balance h2 {
    font-size: 25px;
  }

  .trend {
    max-width: 100%;
    padding: 4px 7px;
    font-size: 9px;
    white-space: nowrap;
  }

  .trend span {
    display: none;
  }

  .metric-icon {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
  }

  .sparkline {
    right: 12px;
    bottom: 10px;
    left: 12px;
    height: 37px;
  }

  .content-grid,
  .side-stack,
  .health-body,
  .category-body,
  .form-grid,
  .panel-metrics {
    grid-template-columns: 1fr;
  }

  .content-grid {
    gap: 10px;
  }

  .panel {
    padding: 13px;
    border-radius: 10px;
  }

  .panel-head {
    margin-bottom: 12px;
  }

  .panel h3 {
    font-size: 14px;
  }

  .financial-health,
  .large-chart,
  .budget-panel,
  .spending-panel,
  .insights-panel,
  .goals-panel,
  .side-stack,
  .transactions-panel {
    min-height: 0;
  }

  .health-body {
    justify-items: center;
    gap: 14px;
  }

  .score-ring {
    width: 136px;
    height: 136px;
  }

  .health-stats {
    width: 100%;
    gap: 9px;
    padding-left: 0;
    border-left: 0;
  }

  .health-stat {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 7px 0;
    border-top: 1px solid var(--line);
  }

  .large-chart .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-tools {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .legend {
    gap: 9px;
    flex-wrap: wrap;
    font-size: 9px;
  }

  .period-select {
    height: 28px;
    min-width: 95px;
  }

  .income-expense-chart {
    height: 180px;
    margin-top: 2px;
  }

  .income-expense-chart .axis-label {
    display: none;
  }

  .chart-tooltip {
    top: 58px;
    left: 46%;
    min-width: 118px;
    padding: 9px 10px;
    font-size: 9px;
  }

  .budget-ring {
    width: 122px;
    height: 122px;
  }

  .budget-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .alert-pill {
    justify-content: center;
  }

  .category-body {
    justify-items: center;
    gap: 12px;
  }

  .category-legend {
    width: 100%;
  }

  .category-line {
    grid-template-columns: minmax(0, 1fr) auto auto;
    font-size: 10px;
  }

  .goal-card {
    grid-template-columns: 52px minmax(0, 1fr) 34px;
  }

  .goal-art {
    width: 52px;
    height: 46px;
  }

  .side-stack {
    gap: 10px;
  }

  .transactions-panel {
    padding: 13px;
  }

  .transactions-wrap {
    overflow: visible;
  }

  .transactions,
  .transactions tbody {
    display: block;
  }

  .transactions thead {
    display: none;
  }

  .transactions tbody {
    display: grid;
    gap: 9px;
  }

  .transactions tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .transactions td {
    display: block;
    padding: 0;
    border: 0;
  }

  .transactions td:nth-child(1),
  .transactions td:nth-child(4) {
    display: none;
  }

  .transactions td:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
  }

  .transactions td:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  .transactions td:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .tx-title {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .floating-ai {
    right: 16px;
    bottom: 18px;
    z-index: 35;
    width: 56px;
    height: 56px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 18px;
    box-shadow: 0 16px 34px rgba(53, 63, 210, .4);
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 88vh;
    padding: 18px 15px 20px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .modal.notifications-modal {
    max-height: calc(88vh - 72px);
    margin-bottom: calc(72px + env(safe-area-inset-bottom));
    border-radius: 16px;
  }

  body.dashboard-modal-open .modal.notifications-modal {
    max-height: 88vh;
    margin-bottom: 0;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal.ai-modal {
    height: min(720px, calc(100dvh - 12px));
    max-height: calc(100dvh - 12px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0;
    padding: 17px 14px 15px;
  }

  .ai-modal .modal-top {
    align-items: center;
    margin-bottom: 12px;
  }

  .ai-modal .modal-top h2 {
    font-size: 18px;
  }

  .ai-modal .modal-top p {
    max-width: 250px;
    font-size: 11px;
    line-height: 1.35;
  }

  .ai-modal .ai-chat {
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .ai-modal .ai-chat-messages {
    min-height: 0;
    max-height: none;
    align-content: start;
    padding: 3px 2px 3px 0;
  }

  .ai-modal .assistant-alert {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 12px 10px 10px;
  }

  .ai-modal .assistant-alert-icon {
    width: 42px;
    height: 42px;
  }

  .ai-modal .assistant-alert-icon svg {
    width: 24px;
    height: 24px;
  }

  .ai-modal .assistant-alert-actions button {
    padding-inline: 5px;
    white-space: nowrap;
  }

  .ai-modal .ai-message {
    max-width: 95%;
    padding: 10px 11px;
  }

  .ai-modal .ai-message-body {
    font-size: 12px;
    line-height: 1.48;
  }

  .ai-modal .ai-suggestions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .ai-modal .ai-suggestions button {
    min-height: 34px;
    padding: 7px 6px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ai-modal .ai-chat-form {
    gap: 7px;
  }

  .ai-modal .ai-chat-form textarea {
    min-height: 54px;
    max-height: 82px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .ai-modal .ai-chat-form > div {
    gap: 8px;
  }

  .ai-modal .ai-chat-form small {
    max-width: 190px;
    line-height: 1.3;
  }

  .ai-modal .ai-chat-form .action-button {
    min-width: 92px;
    min-height: 38px;
    flex: 0 0 auto;
  }
}

/* Authenticated first-run dashboard */
.empty-dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty-onboarding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .85fr);
  align-items: stretch;
  gap: 16px;
}

.empty-onboarding-left {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.empty-onboarding-left .empty-hero {
  grid-template-columns: 1fr;
  min-height: 228px;
  padding: 26px 34px;
  border-radius: 11px;
}

.empty-onboarding-left .empty-hero::after {
  mask-image: linear-gradient(90deg, transparent 18%, #000 100%);
}

.empty-onboarding-left .empty-hero h2 {
  max-width: 620px;
  font-size: clamp(28px, 2.15vw, 35px);
  line-height: 1.08;
}

.empty-onboarding-left .empty-hero p {
  margin-top: 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.empty-onboarding-left .empty-client-card {
  grid-template-columns: 62px minmax(0, 1fr);
  padding-top: 12px;
  border-radius: 9px;
}

.empty-onboarding-left .client-logo {
  width: 56px;
  height: 56px;
}

.empty-onboarding-left .empty-client-card p {
  font-size: 10px;
}

.empty-onboarding-left .client-connect {
  grid-column: 1 / -1;
}

.empty-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 14px 14px 12px;
  border-radius: 11px;
}

.empty-preview .panel-head {
  margin-bottom: 8px;
}

.empty-preview .panel-head a {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #13213b;
  transform: rotate(-45deg);
}

.empty-preview .panel-head svg {
  width: 17px;
  height: 17px;
}

.empty-preview > img {
  width: 100%;
  min-height: 0;
  flex: 1;
  border-radius: 9px;
  object-fit: fill;
  object-position: center top;
  background: #f3f6fc;
  box-shadow: 0 10px 24px rgba(25, 42, 82, .12);
}

.empty-preview > a:last-child {
  margin-top: 10px;
  color: #6478d7;
  font-size: 10px;
  text-align: center;
  text-decoration: none;
}

.empty-benefits-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.empty-benefits-compact article {
  min-height: 78px;
  gap: 11px;
  padding: 12px;
  border-radius: 9px;
}

.empty-benefits-compact article > svg {
  width: 38px;
  height: 38px;
  padding: 9px;
}

.empty-benefits-compact b {
  line-height: 1.25;
}

.empty-client-strip {
  display: grid;
  min-height: 64px;
  place-items: center;
  padding: 9px 20px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  background: #fff;
}

.empty-client-strip > span {
  color: #697a99;
  font-size: 9px;
}

.empty-client-strip > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #162039;
  font-size: 11px;
  font-weight: 650;
}

.empty-client-strip .brand-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.empty-client-strip .brand-item img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.empty-client-strip i {
  width: 1px;
  height: 22px;
  background: #dbe1ea;
}

.empty-copilot-greeting {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 28px;
  padding: 9px 10px;
  color: #54647f;
  border: 1px solid #e0e5ed;
  border-radius: 8px;
  font-size: 11px;
  text-align: left;
}

.empty-copilot-greeting > span {
  display: grid;
  width: 30px;
  height: 30px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: #244ef0;
}

.empty-copilot-greeting img {
  width: 38px;
  height: 38px;
  object-fit: cover;
}

.empty-assistant-rail .empty-copilot-body > img {
  width: 120px;
  height: 120px;
}

.empty-assistant-rail .empty-copilot-body h2 {
  font-size: 20px;
}

.empty-assistant-rail .empty-questions button {
  min-height: 48px;
  color: #164aec;
  font-size: 12px;
  font-weight: 650;
}

.empty-assistant-rail .empty-questions button svg {
  width: 20px;
  height: 20px;
}

.empty-dashboard-main .empty-topbar {
  margin-bottom: 0;
}

.empty-topbar .toolbar {
  justify-content: flex-end;
}

.empty-manual-action {
  height: 38px;
  padding: 0 14px;
  border: 0;
  color: #2346ef;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.empty-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  min-height: 242px;
  overflow: hidden;
  padding: 34px 40px;
  border-radius: 10px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 90%, rgba(0, 176, 255, .46), transparent 35%),
    linear-gradient(125deg, #031336 0%, #081b51 56%, #1233a1 100%);
  box-shadow: 0 12px 30px rgba(8, 30, 83, .14);
}

.empty-hero::after {
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: radial-gradient(circle, #74d7ff 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 48%, #000 100%);
  content: "";
}

.empty-hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

.empty-hero h2 {
  max-width: 610px;
  margin: 0;
  font-size: clamp(29px, 2.7vw, 40px);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.empty-hero h2 span {
  color: #36d6b3;
}

.empty-hero p {
  max-width: 560px;
  margin: 13px 0 18px;
  color: #e0e8ff;
  font-size: 13px;
  line-height: 1.55;
}

.empty-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-hero-actions a,
.empty-hero-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.empty-hero-actions a {
  background: linear-gradient(135deg, #326dff, #4b3ff4);
  box-shadow: 0 10px 22px rgba(24, 81, 255, .32);
}

.empty-hero-actions svg { width: 15px; height: 15px; }
.empty-hero-copy > small { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #dbe4fb; font-size: 10px; }
.empty-hero-copy > small svg { width: 13px; height: 13px; }

.empty-hero-visual {
  position: relative;
  z-index: 2;
  min-height: 170px;
}

.source-card,
.report-card {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 14px 32px rgba(0, 5, 30, .25);
}

.source-card {
  left: 8%;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: 1fr 1fr;
  width: 54%;
  height: 66px;
  padding: 11px;
  border-radius: 9px;
}

.source-card:first-child { top: 7px; }
.source-card:nth-child(2) { top: 86px; }
.source-card i { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; font-size: 25px; font-style: normal; }
.source-card span { align-self: center; width: 74%; height: 5px; border-radius: 9px; background: #cdd5e4; }
.source-card span:last-child { width: 54%; }
.chatgpt-mark { color: #fff; background: #13b98b !important; }
.claude-mark { color: #ee7042; background: #fff7f2 !important; }
.brand-logo-card img { width: 28px; height: 28px; object-fit: contain; }
.brand-logo-card.chatgpt-mark img { filter: invert(1); }
.flow-dots { position: absolute; top: 60px; left: 61%; color: #b9c8ff; font-size: 24px; }

.report-card {
  top: 24px;
  right: 0;
  width: 30%;
  height: 132px;
  padding: 18px 13px;
  border-radius: 10px;
}

.report-card i { display: block; width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(#37cf9e 0 25%, #7847f7 0 52%, #3978ff 0 77%, #e6ebf5 0); }
.report-card b, .report-card span { position: absolute; left: 62px; display: block; width: 48%; height: 6px; border-radius: 8px; background: #cad2e1; }
.report-card b { top: 31px; }
.report-card span:nth-of-type(1) { top: 47px; width: 34%; }
.report-card span:nth-of-type(2) { top: 80px; }
.report-card span:nth-of-type(3) { top: 98px; width: 40%; }

.empty-connect { padding: 14px 18px 12px; }
.empty-onboarding-left .empty-connect,
.empty-onboarding-left .empty-how {
  border-radius: 11px;
}
.empty-section-heading h3 { margin: 0 0 4px; }
.empty-section-heading p { margin: 0; color: #69758c; font-size: 11px; }
.empty-client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.empty-onboarding-left .empty-client-grid { gap: 14px; }

.empty-client-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  padding: 14px 14px 0;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  background: #fff;
}

.client-logo { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 13px; font-size: 38px; }
.empty-client-card h3 { margin: 3px 0 5px; font-size: 14px; }
.empty-client-card h3 em { margin-left: 8px; padding: 4px 8px; border-radius: 99px; color: #078448; background: #e7f9ef; font-size: 9px; font-style: normal; font-weight: 600; }
.empty-client-card p { margin: 0; color: #627089; font-size: 11px; line-height: 1.5; }
.client-connect { grid-column: 2; display: flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid #bfc9db; border-radius: 6px; color: #101827; font-size: 11px; font-weight: 650; text-decoration: none; }
.empty-onboarding-left .client-connect {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 0 42px;
  box-sizing: border-box;
  justify-content: center;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.client-connect.primary { color: #fff; border-color: #3456f5; background: linear-gradient(135deg, #326dff, #4b3ff4); }
.client-connect svg { width: 14px; height: 14px; margin-left: auto; margin-right: 10px; }
.empty-onboarding-left .client-connect svg {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 14px;
  height: 14px;
  margin: 0;
  transform: translateY(-50%);
}
.empty-onboarding-left .client-connect:not(.primary):hover {
  border-color: #8394b6;
  background: #f8faff;
  box-shadow: 0 4px 12px rgba(34, 55, 101, .08);
}
.empty-onboarding-left .client-connect.primary:hover {
  box-shadow: 0 7px 16px rgba(55, 75, 237, .22);
  transform: translateY(-1px);
}
.empty-onboarding-left .client-connect:focus-visible {
  outline: 3px solid rgba(63, 88, 255, .2);
  outline-offset: 2px;
}
.empty-client-card > small { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 0 -14px; padding: 10px 14px; color: #69758c; border-top: 1px solid #e4e8ef; font-size: 10px; }
.empty-client-card > small svg { width: 14px; height: 14px; }

.empty-how { padding: 12px 18px; }
.empty-onboarding-left .empty-how { padding: 13px 18px; }
.empty-how > h3 { margin-bottom: 8px; }
.empty-how > div { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 18px; max-width: 760px; margin: auto; }
.empty-how > div > span { display: flex; align-items: center; gap: 10px; }
.empty-how > div > span > b { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #1644df; background: #e9efff; }
.empty-how strong { font-size: 10px; }
.empty-how strong small { display: block; margin-top: 3px; color: #6d7890; font-weight: 400; }
.empty-how i { height: 1px; background: #9ba6bb; }

.empty-benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.empty-benefits article { display: flex; align-items: center; gap: 14px; min-height: 90px; padding: 15px 20px; border: 1px solid #dce3ed; border-radius: 9px; background: #fff; }
.empty-benefits article > svg { width: 42px; height: 42px; padding: 10px; border-radius: 10px; color: #2456ff; background: #eef3ff; }
.empty-benefits article:nth-child(2) > svg { color: #7744ef; background: #f3edff; }
.empty-benefits article:nth-child(3) > svg { color: #08a765; background: #e8faef; }
.empty-benefits b, .empty-benefits small { display: block; }
.empty-benefits b { font-size: 12px; }
.empty-benefits small { margin-top: 4px; color: #66738b; font-size: 10px; }

.empty-copilot-body { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 30px 24px; text-align: center; }
.empty-copilot-body > img { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; }
.empty-copilot-body h2 { margin: 14px 0 7px; font-size: 21px; letter-spacing: -.03em; }
.empty-copilot-body p { max-width: 260px; margin: 0; color: #71809c; font-size: 12px; line-height: 1.55; }
.empty-primary-link { display: grid; width: 100%; min-height: 44px; margin-top: 18px; place-items: center; border-radius: 7px; color: #fff; background: linear-gradient(135deg, #326dff, #4b3ff4); font-size: 12px; font-weight: 650; text-decoration: none; }
.empty-primary-link { border: 0; }
.empty-model-note { margin-top: 9px; color: #7a86a0; font-size: 10px; }
.empty-model-picker { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; margin-top: 18px; }
.empty-model-picker button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border: 1px solid #d5ddea; color: #1c2537; background: #fff; font-size: 12px; font-weight: 650; }
.empty-model-picker button:first-child { border-radius: 9px 0 0 9px; }
.empty-model-picker button:last-child { border-radius: 0 9px 9px 0; }
.empty-model-picker button.active { position: relative; z-index: 1; color: #203ed2; border-color: #3f51f4; box-shadow: 0 0 0 1px #3f51f4; }
.empty-model-picker span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; font-size: 17px; }
.empty-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; width: 100%; margin: 26px 0 16px; color: #78849a; font-size: 10px; }
.empty-divider::before, .empty-divider::after { height: 1px; background: #dfe4ec; content: ""; }
.empty-questions { display: grid; gap: 9px; width: 100%; }
.empty-questions button { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 12px; color: #65738d; border: 1px solid #dce3ed; border-radius: 7px; background: #fff; font-size: 11px; text-align: left; }
.empty-questions button:hover { color: #2646dc; border-color: #bfcaff; background: #f8f9ff; }
.empty-questions svg { width: 14px; height: 14px; }
.empty-ai-messages:empty { display: none; }
.empty-ai-messages { width: 100%; max-height: 260px; margin-top: 14px; overflow: auto; text-align: left; }
.empty-copilot-compose { padding: 12px; }
.empty-copilot-compose form { display: grid; grid-template-columns: 18px 1fr 38px; align-items: center; gap: 8px; min-height: 58px; padding: 8px 8px 8px 12px; color: #8490a6; border: 1px solid #dce3ed; border-radius: 9px; font-size: 11px; }
.empty-copilot-compose textarea { width: 100%; min-height: 38px; max-height: 72px; padding: 10px 4px; border: 0; outline: 0; resize: none; }
.empty-copilot-compose button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #326dff, #4b3ff4); }
.empty-copilot-compose small { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: #7a879d; font-size: 9px; }
.empty-copilot-compose svg { width: 14px; height: 14px; }
.empty-import-link { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px auto 0; color: #2346e7; font-size: 10px; text-decoration: none; }
.empty-import-link > svg { width: 18px; height: 18px; }
.empty-import-link b, .empty-import-link small { display: block; }
.empty-import-link small { margin-top: 2px; color: #77839a; }
.empty-secondary-link { box-shadow: none !important; background: transparent !important; }

@media (max-width: 1180px) {
  .empty-hero { grid-template-columns: 1fr; }
  .empty-hero-visual { display: none; }
  .empty-client-grid { grid-template-columns: 1fr; }
  .empty-benefits { grid-template-columns: repeat(2, 1fr); }
  .empty-onboarding-grid { grid-template-columns: 1fr; }
  .empty-preview > img { max-height: 720px; object-fit: contain; background: #f3f6fc; }
  .empty-benefits-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .empty-dashboard-main { gap: 12px; }
  .empty-topbar .toolbar { grid-template-columns: 1fr 40px; }
  .empty-manual-action { grid-column: 1 / -1; border: 1px solid #d9e2f1; background: #fff; }
  .empty-hero { min-height: 0; padding: 28px 22px; }
  .empty-onboarding-left .empty-hero { padding: 28px 22px; }
  .empty-hero h2 { font-size: 29px; }
  .empty-hero-actions { align-items: stretch; flex-direction: column; }
  .empty-hero-actions a, .empty-hero-actions button { width: 100%; }
  .empty-client-grid, .empty-benefits { grid-template-columns: 1fr; }
  .empty-benefits-compact { grid-template-columns: 1fr; }
  .empty-client-card { grid-template-columns: 56px 1fr; }
  .client-logo { width: 52px; height: 52px; }
  .client-connect { grid-column: 1 / -1; }
  .empty-how > div { grid-template-columns: 1fr; gap: 10px; }
  .empty-how i { display: none; }
  .empty-benefits article { min-height: 78px; }
  .empty-preview { padding: 12px; }
  .empty-preview > img { max-height: none; }
  .empty-client-strip > div { flex-wrap: wrap; gap: 12px; }
  .empty-client-strip i { display: none; }
}

@media (max-width: 420px) {
  .main {
    padding-inline: 8px;
  }

  .metric-card h2 {
    font-size: 18px;
  }

  .metric-card.balance h2 {
    font-size: 24px;
  }

  .action-button {
    font-size: 11px;
  }

  .category-line {
    gap: 6px;
  }

  .mini-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
  }
}

/* Modern minimal dashboard — July 2026 redesign */
body {
  background: #f8fafc;
}

.dashboard-shell {
  grid-template-columns: 160px minmax(0, 1fr);
  background: #f8fafc;
}

.sidebar {
  padding: 22px 10px 14px;
  background:
    radial-gradient(circle at 30% 18%, rgba(21, 112, 183, .18), transparent 32%),
    linear-gradient(180deg, #061a31 0%, #041427 100%);
  border-right: 1px solid #14283d;
}

.brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin: 0 12px 22px;
}

.brand img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(68, 234, 210, .42);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.brand strong {
  font-size: 15px;
  line-height: 1.25;
}

.brand span {
  color: #fff;
}

.nav {
  gap: 6px;
}

.nav button {
  min-height: 44px;
  gap: 12px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: linear-gradient(105deg, #326dff, #5648f5);
  box-shadow: 0 10px 24px rgba(38, 72, 207, .3);
}

.pill-new {
  padding: 2px 5px;
  font-size: 8px;
}

.profile-card {
  right: 8px;
  bottom: 12px;
  left: 8px;
  padding: 10px;
  border-radius: 9px;
}

.profile-card img {
  width: 32px;
  height: 32px;
}

.profile-card b {
  font-size: 10px;
  white-space: nowrap;
}

.profile-card span {
  font-size: 9px;
}

.main {
  width: 100%;
  max-width: none;
  padding: 20px 24px 12px;
  overflow: hidden;
}

.topbar {
  grid-template-columns: minmax(270px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.headline h1 {
  margin: 0 0 5px;
  color: #050b17;
  font-size: 23px;
  font-weight: 800;
}

.headline p {
  color: #596680;
  font-size: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.input-shell,
.month-input,
.notice-button,
.action-button {
  height: 38px;
  border-color: #dbe2ec;
  border-radius: 7px;
  box-shadow: none;
}

.month-input {
  width: 126px;
  padding-inline: 10px;
  font-size: 11px;
}

.input-shell {
  width: 194px;
  padding-inline: 10px;
}

.input-shell input {
  font-size: 11px;
}

.notice-button {
  flex: 0 0 38px;
}

.toolbar-actions .action-button,
.action-button {
  min-width: 92px;
  height: 38px;
  padding: 0 12px;
  font-size: 11px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid #dbe2ea;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(23, 43, 77, .025);
}

.metric-card,
.metric-card.balance {
  min-height: 124px;
  padding: 16px 18px 12px;
  color: var(--text);
  border: 1px solid #dbe2ea;
  background: #fff;
}

.metric-card label,
.metric-card.balance label {
  color: #41506b;
  font-size: 12px;
  font-weight: 550;
}

.metric-card h2,
.metric-card.balance h2 {
  margin: 9px 0 0;
  color: #080d17;
  font-size: 23px;
  font-weight: 760;
}

.metric-card.expense h2,
.metric-card.is-negative h2 {
  color: #f11f25;
}

.metric-icon,
.metric-card.balance .metric-icon {
  top: 17px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ff4548;
  background: #ffe8e9;
}

.metric-card.income .metric-icon {
  color: #18a963;
  background: #dcf6e8;
}

.metric-card.saving:not(.is-negative) .metric-icon {
  color: #2563ff;
  background: #e8efff;
}

.metric-card.saving.is-negative .metric-icon {
  color: #ff4548;
  background: #ffe8e9;
}

.sparkline {
  right: 18px;
  bottom: 11px;
  left: 18px;
  height: 35px;
}

.sparkline polyline {
  stroke-width: 1.8;
}

.content-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  padding: 15px;
}

.panel h3 {
  color: #090e19;
  font-size: 14px;
  font-weight: 800;
}

.panel-head {
  margin-bottom: 11px;
}

.large-chart {
  grid-column: 1 / 3;
  grid-row: 1;
  min-height: 225px;
}

.budget-panel {
  grid-column: 3;
  grid-row: 1;
  min-height: 225px;
}

.spending-panel {
  grid-column: 1;
  grid-row: 2;
  min-height: 228px;
}

.financial-health {
  grid-column: 2;
  grid-row: 2;
  min-height: 228px;
}

.insights-panel {
  grid-column: 3;
  grid-row: 2;
  min-height: 228px;
}

.transactions-panel {
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 0;
  padding: 14px 15px 11px;
}

.income-expense-chart {
  height: 154px;
}

.legend {
  color: #53617c;
  font-size: 9px;
}

.period-select {
  color: #161c28;
  border-color: #dbe2ea;
  font-size: 10px;
}

.chart-tooltip {
  display: none;
}

.budget-ring {
  width: 118px;
  height: 118px;
  margin: 4px auto 8px;
  padding: 9px;
  background: conic-gradient(#f31920 var(--budget), #f7dfe2 0);
}

.budget-ring b {
  color: #0b1220;
  font-size: 28px;
}

.budget-ring span {
  margin-top: 3px;
  color: #596780;
  font-size: 11px;
}

.budget-total,
.budget-over {
  margin: 0;
  text-align: center;
}

.budget-total {
  color: #111827;
  font-size: 14px;
}

.budget-over {
  margin-top: 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
}

.budget-over.negative {
  color: #f11f25;
}

.category-legend {
  gap: 8px;
}

.category-line {
  grid-template-columns: 58px minmax(70px, 1fr) 61px;
  gap: 9px;
  color: #172033;
  font-size: 11px;
}

.category-line label {
  text-transform: capitalize;
}

.category-line b {
  color: #344057;
  font-size: 10px;
  font-weight: 650;
  text-align: right;
}

.category-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf0f4;
}

.category-track i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
}

.panel-footer-link {
  width: 100%;
  margin-top: 8px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid #e3e8ef;
  color: #233ee7;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.health-body {
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
}

.score-ring {
  width: 120px;
  height: 120px;
  padding: 9px;
  background: conic-gradient(#08a65c var(--score), #edf1f4 0);
}

.score-ring b {
  color: #050b17;
  font-size: 30px;
}

.score-ring span {
  margin-top: 3px;
  color: #718096;
  font-size: 11px;
}

.health-stats {
  gap: 0;
  padding-left: 12px;
}

.health-stat {
  min-height: 42px;
  border-bottom: 1px solid #e7ebf0;
  color: #536078;
  font-size: 10px;
}

.health-stat:last-child {
  border-bottom: 0;
}

.health-stat b.negative {
  color: #f11f25;
}

.insight-list {
  gap: 7px;
}

.insight-item {
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid #e1e6ed;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  text-align: left;
}

.insight-item > svg {
  width: 14px;
  height: 14px;
  color: #647089;
}

.insight-item i {
  width: 32px;
  height: 32px;
}

.insight-item b {
  font-size: 10px;
}

.transactions th {
  padding: 7px 0 8px;
  color: #3f4c65;
  text-transform: none;
  font-size: 9px;
}

.transactions td {
  padding: 6px 0;
  color: #25314a;
}

.tx-title {
  display: block;
}

.tx-title b {
  font-size: 10px;
  font-weight: 500;
}

.payment {
  gap: 6px;
  font-size: 10px;
}

.payment svg {
  width: 15px;
  height: 15px;
  color: #2457ff;
}

.tag {
  min-height: 20px;
  padding-inline: 7px;
  font-size: 9px;
}

.amount {
  color: #f11f25;
  font-size: 10px;
}

.assistant-rail-header {
  min-height: 78px;
  padding: 11px 18px;
  border-bottom-color: #e0e5eb;
}

.assistant-heading {
  gap: 5px;
}

.assistant-title {
  color: #070c16;
  font-size: 15px;
}

.assistant-title i {
  font-size: 22px;
}

.copilot-logo {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #f7fbff;
  box-shadow: 0 4px 12px rgba(20, 91, 170, .12);
}

.brand img,
.copilot-logo,
.copilot-logo img {
  border: 0 !important;
}

.copilot-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.35);
}

.floating-ai {
  overflow: hidden;
  padding: 0;
  border-color: #cfe2f8;
  background: #fff;
}

.floating-ai img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.22);
}

.assistant-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comet-badge {
  gap: 5px;
  padding: 3px 7px;
  color: #667188;
  border: 1px solid #dfe4eb;
  border-radius: 5px;
  background: #fff;
  box-shadow: none;
}

.comet-badge > span {
  color: #68748a;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.comet-badge img {
  display: block;
  width: 84px;
  height: 18px;
  object-fit: cover;
  object-position: center;
}

.assistant-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4c5a6f;
  font-size: 10px;
}

.assistant-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12aa66;
}

.assistant-rail-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 79px);
  gap: 13px;
  padding: 18px 12px 11px;
}

.assistant-alert {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  padding: 18px 11px 11px;
  border: 1px solid #9ea7ff;
  border-radius: 7px;
  background: linear-gradient(145deg, #fff, #fbfbff);
}

.assistant-alert-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: #4250ef;
  background: #eef0ff;
}

.assistant-alert-icon svg {
  width: 28px;
  height: 28px;
}

.assistant-alert > div > b,
.assistant-alert > div > span {
  display: block;
}

.assistant-alert > div > b {
  color: #111827;
  font-size: 13px;
}

.assistant-alert > div > b strong {
  color: #f11f25;
}

.assistant-alert > div > span {
  margin-top: 5px;
  color: #58647c;
  font-size: 11px;
  line-height: 1.45;
}

.assistant-alert-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 5px;
}

.assistant-alert-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 5px;
  border: 1px solid #cfd5ff;
  border-radius: 6px;
  color: #2541d9;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}

.assistant-alert-actions svg {
  width: 14px;
  height: 14px;
}

.assistant-day {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: #6f7a90;
  font-size: 10px;
}

.assistant-day::before,
.assistant-day::after {
  content: "";
  height: 1px;
  background: #dbe1e9;
}

.assistant-rail-messages {
  gap: 16px;
}

.assistant-integration-cta {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8dfff;
  border-radius: 10px;
  background: linear-gradient(145deg, #f8faff 0%, #f1f5ff 100%);
  box-shadow: 0 8px 22px rgba(48, 70, 170, .07);
}

.assistant-integration-cta > div,
.assistant-integration-cta strong,
.assistant-integration-cta span {
  display: block;
}

.assistant-integration-cta strong {
  color: #17213a;
  font-size: 11px;
  line-height: 1.4;
}

.assistant-integration-cta span {
  margin-top: 3px;
  color: #68758d;
  font-size: 9px;
  line-height: 1.45;
}

.assistant-integration-cta nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.assistant-integration-cta a {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 8px;
  color: #24324d;
  border: 1px solid #d8dfeb;
  border-radius: 7px;
  background: #fff;
  font-size: 9.5px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.assistant-integration-cta a:hover {
  border-color: #9fafff;
  box-shadow: 0 5px 14px rgba(42, 67, 180, .1);
  transform: translateY(-1px);
}

.assistant-integration-cta img {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  object-fit: contain;
}

.assistant-rail .ai-message.user {
  max-width: 78%;
  padding: 14px 13px;
  color: #213c8e;
  border: 1px solid #cbd1ff;
  border-radius: 7px 7px 2px 7px;
  background: #f0f1ff;
}

.assistant-rail .ai-message.assistant {
  border-color: #dde2e9;
  border-radius: 7px;
  background: #fff;
}

.copilot-summary .ai-message-body {
  color: #273248;
  font-size: 11px;
}

.copilot-summary p {
  margin: 0 0 6px;
}

.copilot-summary .ai-message-body > b {
  display: block;
  margin-bottom: 8px;
  color: #141b29;
}

.copilot-progress {
  position: relative;
  height: 7px;
  margin-right: 38px;
  border-radius: 99px;
  background: #edf0f4;
}

.copilot-progress i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: #f11f25;
}

.copilot-progress strong {
  position: absolute;
  top: -5px;
  left: calc(100% + 8px);
  color: #151b28;
  font-size: 11px;
}

.copilot-budget-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: #657088;
  font-size: 9px;
}

.copilot-budget-row b {
  color: #f11f25;
}

.copilot-summary ul {
  margin: 18px 0 0;
  padding-left: 17px;
  color: #4b5870;
  line-height: 1.65;
}

.assistant-rail-form {
  gap: 8px;
}

.copilot-compose {
  display: grid !important;
  grid-template-columns: 26px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 10px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
}

.compose-clip {
  display: grid;
  place-items: center;
  color: #111827;
}

.compose-clip svg {
  width: 21px;
  height: 21px;
}

.assistant-rail-form .copilot-compose textarea {
  width: 100%;
  min-height: 38px;
  max-height: 72px;
  padding: 10px 4px;
  border: 0;
  outline: 0;
  resize: none;
}

.assistant-rail-form > small {
  color: #667188;
  font-size: 9px;
}

.assistant-send {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

@media (min-width: 1440px) {
  .dashboard-shell {
    grid-template-columns: 160px minmax(0, 1fr) var(--assistant-rail-width, 418px);
  }

  .dashboard-shell:has(.assistant-rail.collapsed) {
    grid-template-columns: 160px minmax(0, 1fr) 58px;
  }

  .assistant-rail {
    border-left-color: #dfe4eb;
    background: #fff;
    box-shadow: none;
  }
}

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

  .toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .large-chart,
  .transactions-panel {
    grid-column: 1 / -1;
  }

  .budget-panel,
  .spending-panel,
  .financial-health,
  .insights-panel {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .dashboard-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .brand {
    align-items: center;
    margin-inline: 0;
  }
}

@media (max-width: 720px) {
  .dashboard-shell {
    display: block;
  }

  .sidebar {
    padding: 9px 10px 7px;
  }

  .brand {
    align-items: center;
    flex-direction: row;
    margin: 0;
  }

  .main {
    padding: 14px 10px 30px;
  }

  .topbar {
    gap: 12px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .month-input,
  .input-shell {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card.balance,
  .metric-card.saving {
    grid-column: auto;
  }

  .metric-card,
  .metric-card.balance {
    min-height: 124px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .large-chart,
  .budget-panel,
  .spending-panel,
  .financial-health,
  .insights-panel,
  .transactions-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .health-body {
    grid-template-columns: 120px minmax(0, 1fr);
    justify-items: initial;
  }

  .category-body {
    display: block;
  }

  .transactions tr {
    border-radius: 8px;
  }
}

@media (max-width: 440px) {
  .headline h1 {
    font-size: 19px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .metric-card.balance {
    min-height: 116px;
  }

  .health-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* Final type and icon polish: a single readable scale across the dashboard. */
body,
button,
input,
select,
textarea {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.dashboard-shell svg,
.modal svg {
  stroke-width: 1.8;
}

.headline h1,
.panel h3,
.assistant-title,
.brand strong {
  letter-spacing: -.025em;
}

.headline h1 {
  font-size: clamp(22px, 1.7vw, 27px);
  font-weight: 750;
  line-height: 1.15;
}

.headline p {
  font-size: 12px;
  line-height: 1.55;
}

.nav button {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.nav button svg {
  width: 17px;
  height: 17px;
}

.metric-card label,
.metric-card.balance label {
  color: #59657a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .005em;
}

.metric-card h2,
.metric-card.balance h2 {
  font-size: clamp(22px, 1.6vw, 26px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.metric-icon svg {
  width: 15px;
  height: 15px;
}

.panel h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.month-input,
.input-shell input,
.action-button,
.period-select {
  font-size: 11px;
  font-weight: 600;
}

.category-line,
.health-stat,
.insight-item b,
.tx-title b,
.payment,
.amount {
  font-size: 10.5px;
  line-height: 1.35;
}

.category-line b,
.transactions th,
.tag {
  font-weight: 600;
}

.transactions th {
  color: #69758a;
  font-size: 9px;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.assistant-title {
  font-weight: 700;
}

.assistant-alert > div > b {
  font-weight: 700;
  letter-spacing: -.015em;
}

.assistant-alert-actions button,
.panel-footer-link {
  font-weight: 650;
}

.assistant-send {
  display: grid;
  place-items: center;
  color: #fff;
}

.assistant-send svg {
  width: 17px;
  height: 17px;
}

.chart-y-axis,
.chart-x-axis {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  color: #68758b;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.01em;
}

.chart-y-axis span,
.chart-x-axis span {
  position: absolute;
  white-space: nowrap;
}

.chart-y-axis span {
  left: 0;
  transform: translateY(-50%);
}

.chart-y-axis span:nth-child(1) { top: 18.4%; }
.chart-y-axis span:nth-child(2) { top: 37.9%; }
.chart-y-axis span:nth-child(3) { top: 57.4%; }
.chart-y-axis span:nth-child(4) { top: 76.8%; }

.chart-x-axis span {
  bottom: 4px;
  color: #4f5d73;
  font-weight: 550;
}

.chart-x-axis span:nth-child(1) { left: 6.5%; }
.chart-x-axis span:nth-child(2) { left: 50%; transform: translateX(-50%); }
.chart-x-axis span:nth-child(3) { right: 1%; }

.profile-card b {
  font-weight: 650;
  letter-spacing: -.01em;
}

.profile-logout {
  display: grid;
  width: 30px;
  height: 30px;
  margin-left: auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  color: #b9c9e3;
  background: rgba(255, 255, 255, .04);
}

.profile-logout:hover {
  color: #fff;
  border-color: rgba(255, 112, 112, .5);
  background: rgba(255, 69, 72, .18);
}

.profile-logout svg {
  width: 15px;
  height: 15px;
}

.data-management-grid {
  display: grid;
  gap: 12px;
}

.data-action-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #fff;
}

.data-action-card > i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #2657ee;
  background: #edf3ff;
}

.data-action-card h3,
.data-action-card p {
  margin: 0;
}

.data-action-card h3 {
  font-size: 13px;
}

.data-action-card p {
  margin-top: 4px;
  color: #66748c;
  font-size: 10px;
  line-height: 1.5;
}

.data-action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.data-action-buttons a.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 130px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #10b981;
  border-radius: 9px;
  color: #047857;
  background: #ecfdf5;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s ease;
  box-shadow: 0 1px 3px rgba(16, 185, 129, .08);
}

.data-action-buttons a.action-button svg {
  width: 14px;
  height: 14px;
}

.data-action-buttons a.action-button:hover,
.data-action-buttons a.action-button:focus-visible {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .25);
}

.data-action-card.danger-soft {
  border-color: #f2d7d8;
  background: #fffafa;
}

.data-action-card.danger-soft > i {
  color: #e6383b;
  background: #ffecee;
}

.action-button.danger {
  color: #fff;
  border-color: #e3383b;
  background: #e3383b;
  min-height: 40px;
  border-radius: 9px;
  font-weight: 700;
}

.action-button.danger:hover {
  background: #c9282b;
}

@media (max-width: 620px) {
  .data-action-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .data-action-card > button,
  .data-action-buttons {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 6px;
  }

  .data-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .data-action-buttons a.action-button {
    width: 100%;
    min-height: 44px;
    font-size: 13px;
    box-sizing: border-box;
  }

  .data-action-card > button.action-button.danger {
    width: 100%;
    min-height: 44px;
    font-size: 13px;
  }
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 255, .22);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .headline h1 {
    font-size: 21px;
  }

  .metric-card h2,
  .metric-card.balance h2 {
    font-size: 23px;
  }

  .panel h3 {
    font-size: 14px;
  }

  .chart-y-axis,
  .chart-x-axis {
    font-size: 9px;
  }
}

/* Mobile-first refinement: optimize the primary dashboard experience for touch. */
@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-x: none;
  }

  .sidebar {
    padding-top: max(9px, env(safe-area-inset-top));
  }

  .brand {
    min-height: 40px;
    padding-right: 96px;
  }

  .brand img {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
  }

  .nav {
    grid-auto-columns: 46px;
    gap: 8px;
    margin-top: 8px;
    scroll-snap-type: x proximity;
  }

  .nav button {
    min-width: 46px;
    min-height: 44px;
    padding: 0;
  }

  .nav button svg {
    width: 19px;
    height: 19px;
  }

  .main,
  .empty-dashboard-main {
    width: 100%;
    padding: 14px 10px calc(34px + env(safe-area-inset-bottom));
  }

  .topbar,
  .empty-topbar {
    margin-bottom: 12px;
  }

  .toolbar button,
  .toolbar a,
  .month-input,
  .input-shell,
  .empty-manual-action {
    min-height: 44px;
  }

  .empty-onboarding-grid,
  .empty-onboarding-left {
    gap: 12px;
  }

  .empty-hero,
  .empty-onboarding-left .empty-hero {
    padding: 25px 22px 24px;
    border-radius: 13px;
  }

  .empty-onboarding-left .empty-hero h2 {
    max-width: 320px;
    font-size: clamp(27px, 8.2vw, 31px);
    line-height: 1.08;
  }

  .empty-onboarding-left .empty-hero p {
    margin-top: 13px;
    font-size: 13px;
    line-height: 1.5;
  }

  .empty-hero-actions {
    gap: 8px;
  }

  .empty-hero-actions a,
  .empty-hero-actions button {
    min-height: 48px;
    border-radius: 8px;
  }

  .empty-connect {
    padding: 16px;
    border-radius: 12px;
  }

  .empty-section-heading {
    margin-bottom: 12px;
  }

  .empty-section-heading h3 {
    font-size: 15px;
  }

  .empty-section-heading p {
    margin-top: 4px;
    font-size: 11px;
  }

  .empty-client-grid {
    gap: 12px;
  }

  .empty-onboarding-left .empty-client-card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 14px 0;
    border-radius: 11px;
  }

  .empty-onboarding-left .client-logo {
    width: 56px;
    height: 56px;
  }

  .empty-onboarding-left .client-connect {
    min-height: 46px;
    font-size: 12px;
  }

  .empty-client-card > small {
    min-height: 44px;
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .empty-how,
  .empty-onboarding-left .empty-how {
    padding: 16px 18px;
    border-radius: 12px;
  }

  .empty-how > h3 {
    margin-bottom: 12px;
    font-size: 15px;
  }

  .empty-how > div {
    gap: 12px;
  }

  .empty-how > div > span > b {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
  }

  .empty-how strong {
    font-size: 11px;
  }

  .empty-client-strip {
    min-height: 112px;
    padding: 13px 12px;
    border-radius: 12px;
  }

  .empty-client-strip > span {
    margin-bottom: 9px;
    font-size: 9px;
    text-align: center;
  }

  .empty-client-strip > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 8px;
    width: 100%;
  }

  .empty-client-strip .brand-item {
    justify-content: center;
    gap: 5px;
    font-size: 10px;
  }

  .empty-client-strip .brand-item img {
    width: 16px;
    height: 16px;
  }

  .empty-preview {
    padding: 14px;
    border-radius: 12px;
  }

  .empty-preview .panel-head {
    min-height: 34px;
  }

  .empty-preview > img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: contain;
  }

  .panel {
    border-radius: 12px;
  }

  .summary-grid,
  .content-grid {
    gap: 12px;
  }

  .modal-backdrop {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .modal {
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .modal-close,
  .empty-copilot-compose button,
  .assistant-rail-form button {
    min-width: 44px;
    min-height: 44px;
  }

  .floating-ai {
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 380px) {
  .main,
  .empty-dashboard-main {
    padding-inline: 8px;
  }

  .empty-hero,
  .empty-onboarding-left .empty-hero {
    padding-inline: 20px;
  }

  .empty-client-strip .brand-item {
    font-size: 9px;
  }
}

@media (hover: none) and (pointer: coarse) {
  button,
  a,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  .empty-onboarding-left .client-connect.primary:hover {
    box-shadow: none;
    transform: none;
  }
}

/* Empty-state Copilot modal mirrors the desktop onboarding rail on phones. */
.empty-ai-modal {
  overflow: hidden;
}

.empty-copilot-status {
  margin: -2px 0 12px;
}

.empty-mobile-copilot {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.empty-mobile-copilot-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.empty-mobile-copilot-intro > img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
}

.empty-mobile-copilot-intro h2 {
  margin: 10px 0 5px;
  font-size: 20px;
  letter-spacing: -.03em;
}

.empty-mobile-copilot-intro > p {
  max-width: 280px;
  margin: 0;
  color: #71809c;
  font-size: 12px;
  line-height: 1.5;
}

.empty-mobile-copilot .empty-copilot-greeting {
  margin-top: 16px;
}

.empty-mobile-copilot .empty-divider {
  margin: 17px 0 12px;
}

.empty-mobile-copilot .empty-questions {
  gap: 8px;
}

.empty-mobile-copilot .empty-questions button {
  min-height: 46px;
  color: #1644df;
  font-size: 12px;
  font-weight: 650;
}

.empty-mobile-copilot-compose {
  margin-top: auto;
  padding-top: 14px;
}

.empty-mobile-copilot-compose > div {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 7px 7px 7px 12px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
}

.empty-mobile-copilot-compose textarea {
  width: 100%;
  min-height: 42px;
  max-height: 78px;
  padding: 11px 3px;
  border: 0;
  outline: 0;
  resize: none;
}

.empty-mobile-copilot-compose button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #326dff, #4b3ff4);
}

.empty-mobile-copilot-compose > small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: #7a879d;
  font-size: 9px;
}

.empty-mobile-copilot-compose svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 720px) {
  .modal.ai-modal.empty-ai-modal {
    grid-template-rows: auto auto minmax(0, 1fr);
    height: min(760px, calc(100dvh - 10px));
    padding: 17px 14px max(14px, env(safe-area-inset-bottom));
  }

  .empty-ai-modal .modal-top {
    margin-bottom: 8px;
  }

  .empty-ai-modal .modal-top h2 {
    font-size: 19px;
  }

  .empty-ai-modal .modal-top p {
    max-width: 270px;
  }

  .empty-mobile-copilot {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px 1px 0;
  }
}

@media (max-width: 380px), (max-height: 700px) {
  .empty-mobile-copilot-intro > img {
    width: 70px;
    height: 70px;
  }

  .empty-mobile-copilot-intro h2 {
    margin-top: 7px;
    font-size: 18px;
  }

  .empty-mobile-copilot-intro > p {
    font-size: 11px;
  }

  .empty-mobile-copilot .empty-copilot-greeting {
    margin-top: 10px;
  }

  .empty-mobile-copilot .empty-divider {
    margin: 12px 0 9px;
  }
}

/* Expandable desktop navigation rail */
@media (min-width: 721px) {
  .dashboard-shell {
    grid-template-columns: 224px minmax(0, 1fr);
    transition: grid-template-columns .24s ease;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: 100vh;
    padding: 22px 14px 14px;
    overflow: visible;
    color: #53627a;
    border-right: 1px solid #e2e8f1;
    background: rgba(255, 255, 255, .97);
    box-shadow: 8px 0 30px rgba(30, 50, 91, .045);
    backdrop-filter: blur(18px);
    transition: padding .24s ease, background .24s ease;
  }

  .sidebar .brand {
    min-height: 44px;
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 11px;
    margin: 0 7px 22px;
  }

  .sidebar .brand img {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 1px solid #dce5f3;
    border-radius: 13px;
    box-shadow: 0 8px 20px rgba(41, 74, 141, .12);
  }

  .sidebar .brand .brand-logo-dark {
    display: none;
  }

  .sidebar .brand .brand-logo-light {
    display: block;
    padding: 0;
    object-fit: contain;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .sidebar .brand strong {
    display: block;
    min-width: 0;
    color: #0d1935;
    font-size: 14px;
    font-weight: 780;
    line-height: 1.15;
    white-space: nowrap;
  }

  .sidebar .brand span {
    display: block;
    margin: 2px 0 0;
    color: #275cf2;
  }

  .sidebar-toggle {
    position: absolute;
    top: 31px;
    right: -14px;
    z-index: 3;
    display: grid;
    width: 28px;
    height: 32px;
    place-items: center;
    padding: 0;
    color: #697993;
    border: 1px solid #e0e6ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(29, 49, 87, .1);
    transition: color .18s ease, border-color .18s ease, transform .24s ease, box-shadow .18s ease;
  }

  .sidebar-toggle:hover {
    color: #2255e8;
    border-color: #bfcdf5;
    box-shadow: 0 7px 18px rgba(37, 80, 197, .14);
  }

  .sidebar-toggle svg {
    width: 15px;
    height: 15px;
    transform: rotate(180deg);
    transition: transform .24s ease;
  }

  .sidebar-search {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    color: #77859b;
    border: 1px solid #e2e8f1;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 11px;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  }

  .sidebar-search:hover,
  .sidebar-search:focus-visible {
    color: #3154bf;
    border-color: #c8d5f3;
    background: #fff;
    box-shadow: 0 5px 14px rgba(37, 72, 150, .07);
  }

  .sidebar-search svg {
    width: 17px;
    height: 17px;
  }

  .sidebar-search span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-search kbd {
    padding: 3px 5px;
    color: #8b97aa;
    border: 1px solid #e0e6ef;
    border-radius: 5px;
    background: #fff;
    font-family: inherit;
    font-size: 8px;
    font-weight: 650;
  }

  .nav-label {
    display: block;
    margin: 22px 10px 8px;
    color: #9aa5b5;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .sidebar .nav {
    display: grid;
    gap: 6px;
    margin: 0;
  }

  .sidebar .nav button {
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    padding: 0 12px;
    color: #5b6a80;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    font-size: 11px;
    font-weight: 650;
    transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
  }

  .sidebar .nav button:hover {
    color: #214bc8;
    border-color: #e3e9f5;
    background: #f5f8ff;
    transform: translateX(2px);
  }

  .sidebar .nav button.active {
    color: #fff;
    border-color: #315df3;
    background: linear-gradient(135deg, #286eff, #5349f5);
    box-shadow: 0 9px 21px rgba(48, 81, 226, .22);
  }

  .sidebar .nav button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
  }

  .sidebar .nav .pill-new {
    margin-left: auto;
    padding: 3px 6px;
    color: #5e38dc;
    border-radius: 99px;
    background: #eee8ff;
    font-size: 8px;
    font-style: normal;
  }

  .sidebar .nav button.active .pill-new {
    color: #fff;
    background: rgba(255, 255, 255, .18);
  }

  .sidebar .profile-card {
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    gap: 9px;
    min-height: 60px;
    padding: 10px;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
  }

  .sidebar .profile-card > img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
  }

  .sidebar .profile-card b,
  .profile-card b {
    color: #0f172a !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }

  .sidebar .profile-card span,
  .profile-card span {
    display: block;
    margin-top: 2px;
    color: #2563eb !important;
    font-size: 11px !important;
    font-weight: 600 !important;
  }

  .sidebar .profile-logout {
    width: 30px;
    height: 30px;
    color: #66758d;
    border-color: #dce3ee;
    background: #fff;
  }

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

  .sidebar-collapsed .sidebar {
    padding-inline: 10px;
  }

  .sidebar-collapsed .sidebar .brand {
    justify-content: center;
    margin-inline: 0;
  }

  .sidebar-collapsed .sidebar .brand strong,
  .sidebar-collapsed .sidebar-search span,
  .sidebar-collapsed .sidebar-search kbd,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .sidebar .nav button > span,
  .sidebar-collapsed .sidebar .nav .pill-new,
  .sidebar-collapsed .sidebar .profile-card > div,
  .sidebar-collapsed .sidebar .profile-logout {
    display: none;
  }

  .sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(0);
  }

  .sidebar-collapsed .sidebar-search {
    min-height: 44px;
    justify-content: center;
    padding: 0;
  }

  .sidebar-collapsed .sidebar .nav {
    margin-top: 20px;
  }

  .sidebar-collapsed .sidebar .nav button {
    justify-content: center;
    padding: 0;
  }

  .sidebar-collapsed .sidebar .nav button:hover {
    transform: none;
  }

  .sidebar-collapsed .sidebar .nav button::after {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    z-index: 60;
    padding: 7px 9px;
    color: #fff;
    border-radius: 7px;
    background: #111a30;
    box-shadow: 0 8px 20px rgba(11, 22, 45, .18);
    content: attr(data-tooltip);
    font-size: 10px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translate(-5px, -50%);
    transition: opacity .15s ease, transform .15s ease;
    white-space: nowrap;
  }

  .sidebar-collapsed .sidebar .nav button:hover::after,
  .sidebar-collapsed .sidebar .nav button:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
  }

  .sidebar-collapsed .sidebar .profile-card {
    left: 10px;
    right: 10px;
    bottom: 12px;
    min-height: 48px;
    height: 48px;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 5px;
  }

  .sidebar-collapsed .sidebar .profile-card > img {
    width: 36px;
    height: 36px;
  }
}

/* Persistent light / dark appearance control */
.theme-switch {
  position: absolute;
  right: 14px;
  bottom: 84px;
  left: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 4px;
  border: 1px solid #dfe5ee;
  border-radius: 999px;
  background: #f2f5f9;
  box-shadow: inset 0 1px 2px rgba(20, 39, 77, .04);
}

.theme-switch button {
  display: flex;
  min-width: 0;
  height: 33px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 7px;
  color: #71809a;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.theme-switch button svg { width: 16px; height: 16px; }
.theme-switch button.active { color: #12203a; background: #fff; box-shadow: 0 3px 10px rgba(25, 45, 80, .1); }

.sidebar-promo {
  position: absolute;
  right: 14px;
  bottom: 142px;
  left: 14px;
  display: block;
  overflow: hidden;
  border: 1px solid #dce4f0;
  border-radius: 13px;
  background: #071336;
  box-shadow: 0 12px 28px rgba(25, 47, 91, .13);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.sidebar-promo:hover {
  border-color: #aebffc;
  box-shadow: 0 16px 34px rgba(31, 67, 159, .2);
  transform: translateY(-2px);
}

.sidebar-promo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f6ff;
  --text: #e8eefb;
  --muted: #9caac2;
  --soft: #172238;
  --line: #293850;
  --panel: #111c2d;
  --shadow: 0 14px 34px rgba(0, 0, 0, .25);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .dashboard-shell {
  color: var(--text);
  background: #091321;
}

:root[data-theme="dark"] .main,
:root[data-theme="dark"] .empty-dashboard-main { background: #091321; }

:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-card.balance,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .assistant-rail,
:root[data-theme="dark"] .assistant-rail .ai-message.assistant,
:root[data-theme="dark"] .assistant-alert,
:root[data-theme="dark"] .copilot-compose,
:root[data-theme="dark"] .empty-setup,
:root[data-theme="dark"] .empty-client-card,
:root[data-theme="dark"] .empty-how,
:root[data-theme="dark"] .empty-client-strip,
:root[data-theme="dark"] .empty-preview,
:root[data-theme="dark"] .empty-benefits article,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .data-card,
:root[data-theme="dark"] .settings-card {
  color: var(--text);
  border-color: #293850;
  background: #111c2d;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] .headline h1,
:root[data-theme="dark"] .panel h3,
:root[data-theme="dark"] .metric-card h2,
:root[data-theme="dark"] .metric-card.balance h2,
:root[data-theme="dark"] .budget-ring b,
:root[data-theme="dark"] .score-ring b,
:root[data-theme="dark"] .assistant-title,
:root[data-theme="dark"] .assistant-alert > div > b,
:root[data-theme="dark"] .copilot-summary .ai-message-body > b,
:root[data-theme="dark"] .empty-client-card h3,
:root[data-theme="dark"] .empty-setup h2,
:root[data-theme="dark"] .modal-card h2,
:root[data-theme="dark"] .insight-item,
:root[data-theme="dark"] .budget-total { color: #f4f7ff; }

:root[data-theme="dark"] .headline p,
:root[data-theme="dark"] .metric-card label,
:root[data-theme="dark"] .metric-card.balance label,
:root[data-theme="dark"] .legend,
:root[data-theme="dark"] .health-stat,
:root[data-theme="dark"] .assistant-alert > div > span,
:root[data-theme="dark"] .copilot-summary .ai-message-body,
:root[data-theme="dark"] .copilot-summary ul,
:root[data-theme="dark"] .empty-client-card p,
:root[data-theme="dark"] .empty-setup p { color: #9eabc0; }

:root[data-theme="dark"] .input-shell,
:root[data-theme="dark"] .month-input,
:root[data-theme="dark"] .notice-button,
:root[data-theme="dark"] .period-select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .assistant-alert-actions button,
:root[data-theme="dark"] .empty-model-picker button,
:root[data-theme="dark"] .empty-questions button,
:root[data-theme="dark"] .client-connect:not(.primary) {
  color: #dce5f5;
  border-color: #314158;
  background: #162337;
}

:root[data-theme="dark"] .input-shell input,
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #8391a8; }

:root[data-theme="dark"] .category-line,
:root[data-theme="dark"] .category-line b,
:root[data-theme="dark"] .transactions td,
:root[data-theme="dark"] .transactions th,
:root[data-theme="dark"] .tx-title b { color: #cbd5e6; }

:root[data-theme="dark"] .transactions td,
:root[data-theme="dark"] .transactions th,
:root[data-theme="dark"] .health-stat,
:root[data-theme="dark"] .panel-footer-link { border-color: #293850; }

:root[data-theme="dark"] .category-track,
:root[data-theme="dark"] .copilot-progress { background: #253248; }

:root[data-theme="dark"] .score-ring {
  background: conic-gradient(var(--green) var(--score), #28374b 0);
}
:root[data-theme="dark"] .budget-ring {
  background: conic-gradient(#f31920 var(--budget), #3a2934 0);
}
:root[data-theme="dark"] .score-ring .inner,
:root[data-theme="dark"] .budget-ring .inner,
:root[data-theme="dark"] .donut .inner {
  color: #f2f6ff;
  background: #162337;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
}
:root[data-theme="dark"] .score-ring span,
:root[data-theme="dark"] .budget-ring span,
:root[data-theme="dark"] .donut span { color: #cbd5e5; }

:root[data-theme="dark"] .insight-item { border-color: #293850; background: #152237; }
:root[data-theme="dark"] .assistant-day::before,
:root[data-theme="dark"] .assistant-day::after { background: #314158; }
:root[data-theme="dark"] .assistant-rail .ai-message.user { color: #dbe4ff; border-color: #4352a5; background: #25316a; }
:root[data-theme="dark"] .assistant-integration-cta {
  border-color: #30415d;
  background: linear-gradient(145deg, #142238 0%, #101c2f 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}
:root[data-theme="dark"] .assistant-integration-cta strong { color: #f0f4fc; }
:root[data-theme="dark"] .assistant-integration-cta span { color: #9eabc0; }
:root[data-theme="dark"] .assistant-integration-cta a {
  color: #e7edf8;
  border-color: #34465f;
  background: #17263b;
}
:root[data-theme="dark"] .assistant-integration-cta a:hover { border-color: #6576df; }
:root[data-theme="dark"] .assistant-integration-cta a:first-child img { filter: invert(1) brightness(1.9); }
:root[data-theme="dark"] .comet-badge {
  border-color: #304159;
  background: #101d31;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
:root[data-theme="dark"] .comet-badge > span { color: #aab7ca; }
:root[data-theme="dark"] .comet-badge img {
  filter: invert(1) grayscale(1) brightness(2.2);
  mix-blend-mode: screen;
}
:root[data-theme="dark"] .assistant-online { color: #a7b4c9; }
:root[data-theme="dark"] .copilot-logo,
:root[data-theme="dark"] .floating-ai {
  border-color: #31435d;
  background: #16253b;
}
:root[data-theme="dark"] .copilot-logo img,
:root[data-theme="dark"] .floating-ai img {
  filter: brightness(1.35) saturate(1.15);
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .empty-copilot-body > img,
:root[data-theme="dark"] .empty-mobile-copilot-intro > img {
  padding: 5px;
  border: 1px solid #31435d;
  background: #16253b;
  box-shadow: 0 12px 35px rgba(0,0,0,.24);
  filter: brightness(1.35) saturate(1.15);
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .empty-copilot-greeting {
  color: #b9c5d8;
  border-color: #34455e;
  background: #111e31;
}
:root[data-theme="dark"] .empty-copilot-greeting > span {
  border: 1px solid #405674;
  background: #1a2c46;
}
:root[data-theme="dark"] .empty-copilot-greeting img {
  filter: brightness(1.35) saturate(1.15);
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .empty-copilot-compose form {
  color: #91a0b7;
  border-color: #34455e;
  background: #101d30;
}
:root[data-theme="dark"] .empty-client-strip > div { color: #d8e2f2; }
:root[data-theme="dark"] .empty-client-strip i { background: #35445a; }

:root[data-theme="dark"] .sidebar {
  color: #d8e3f4;
  border-right-color: #1e3048;
  background: radial-gradient(circle at 25% 15%, rgba(45, 102, 229, .16), transparent 32%), #071528;
  box-shadow: 8px 0 32px rgba(0, 0, 0, .2);
}

:root[data-theme="dark"] .sidebar .brand strong { color: #f4f8ff; }
:root[data-theme="dark"] .sidebar .brand span { color: #73a1ff; }
:root[data-theme="dark"] .sidebar .brand .brand-logo-light { display: none; }
:root[data-theme="dark"] .sidebar .brand .brand-logo-dark { display: block; }
:root[data-theme="dark"] .sidebar-search,
:root[data-theme="dark"] .sidebar-toggle { color: #aab7cb; border-color: #2c3c54; background: #122036; }
:root[data-theme="dark"] .sidebar .nav button { color: #afbdd1; }
:root[data-theme="dark"] .sidebar .nav button:hover,
:root[data-theme="dark"] .sidebar .nav button.active { color: #fff; }
:root[data-theme="dark"] .profile-card { color: #e5ecf8; border-color: #2a3c55; background: #111f34; }
:root[data-theme="dark"] .sidebar .profile-logout {
  color: #b7c5d9;
  border-color: #33465f;
  background: #17263b;
}
:root[data-theme="dark"] .sidebar .profile-logout:hover {
  color: #fff;
  border-color: rgba(255,112,112,.55);
  background: rgba(255,69,72,.18);
}

:root[data-theme="dark"] .action-button:not(.primary):not(.danger) {
  color: #62dda4;
  border-color: #285542;
  background: #112a25;
  box-shadow: none;
}
:root[data-theme="dark"] .action-button:not(.primary):not(.danger):hover {
  color: #83ecc0;
  border-color: #34775a;
  background: #15372f;
}
:root[data-theme="dark"] .assistant-alert-icon {
  color: #8297ff;
  border: 1px solid #344a78;
  background: #1b2b4c;
}

:root[data-theme="dark"] .theme-switch { border-color: #2d3d54; background: #0c192b; }
:root[data-theme="dark"] .theme-switch button { color: #8796ad; }
:root[data-theme="dark"] .theme-switch button.active { color: #f2f6ff; background: #233149; box-shadow: 0 3px 12px rgba(0,0,0,.24); }
:root[data-theme="dark"] .sidebar-promo { border-color: #30425b; box-shadow: 0 14px 32px rgba(0,0,0,.3); }

:root[data-theme="dark"] .boot-screen {
  background: radial-gradient(circle at 50% 42%, rgba(73, 97, 255, .16), transparent 29rem), linear-gradient(145deg, #091321, #0b1728 58%, #0d1b30);
}
:root[data-theme="dark"] .boot-panel { color: var(--text); border-color: #293850; background: rgba(17,28,45,.95); }
:root[data-theme="dark"] .boot-brand,
:root[data-theme="dark"] .boot-copy h1 { color: #f4f7ff; }
:root[data-theme="dark"] .boot-progress { background: #253248; }

@media (max-width: 900px) and (min-width: 721px) {
  .theme-switch { grid-template-columns: 1fr; gap: 5px; padding: 5px; }
  .theme-switch button { padding: 0; }
  .theme-switch button span { display: none; }
}

@media (min-width: 721px) {
  .sidebar-collapsed .theme-switch {
    left: 50%;
    right: auto;
    bottom: 68px;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
  }
  .sidebar-collapsed .theme-switch button {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
  }
  .sidebar-collapsed .theme-switch button:not(.active) {
    display: none;
  }
  .sidebar-collapsed .theme-switch button span { display: none; }
  .sidebar-collapsed .sidebar-promo { display: none; }
}

@media (max-width: 900px), (max-height: 820px) {
  .sidebar-promo { display: none; }
}

@media (max-width: 720px) {
  .theme-switch {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: auto;
    width: 94px;
    z-index: 2;
  }
  .theme-switch button { width: 40px; height: 30px; padding: 0; }
  .theme-switch button span { display: none; }
  .sidebar-promo { display: none; }
  :root[data-theme="dark"] body { background: #091321; }

  .ai-modal .assistant-integration-cta {
    gap: 11px;
    margin-top: 2px;
    padding: 12px;
  }

  .ai-modal .ai-chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
  }
  .ai-modal .ai-chat-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }
  .ai-modal .assistant-integration-cta strong { font-size: 12px; }
  .ai-modal .assistant-integration-cta span { font-size: 10px; }
  .ai-modal .assistant-integration-cta a { min-height: 42px; font-size: 11px; }
  .ai-modal .assistant-integration-cta img { width: 19px; height: 19px; }

  /* Keep the Copilot chrome compact so the answer remains the focus on phones. */
  .ai-modal {
    height: calc(100dvh - 10px);
    min-height: calc(100dvh - 10px);
    max-height: calc(100dvh - 10px);
    display: flex;
    flex-direction: column;
    padding: 12px 12px max(10px, env(safe-area-inset-bottom));
  }
  .ai-modal .modal-top {
    margin-bottom: 7px;
  }
  .ai-modal .modal-top h2 {
    font-size: 18px;
  }
  .ai-modal .modal-top p {
    font-size: 11px;
    line-height: 1.35;
    margin-top: 2px;
  }
  .ai-modal .copilot-modal-status {
    gap: 8px;
    margin-bottom: 8px;
  }
  .ai-modal .assistant-alert {
    padding: 10px;
  }
  .ai-modal .assistant-alert-icon {
    width: 38px;
    height: 38px;
  }
  .ai-modal .assistant-alert > div > b {
    font-size: 12px;
  }
  .ai-modal .assistant-alert > div > span {
    font-size: 10px;
    line-height: 1.3;
  }
  .ai-modal .assistant-alert-actions {
    gap: 6px;
    margin-top: 6px;
  }
  .ai-modal .assistant-alert-actions button {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 9px;
  }
  .ai-modal .ai-chat-messages {
    gap: 7px;
    padding: 4px 0;
  }
  .ai-modal .ai-message {
    padding: 9px 10px;
    border-radius: 11px 11px 11px 3px;
  }
  .ai-modal .ai-message.user {
    padding: 9px 10px;
  }
  .ai-modal .copilot-summary .ai-message-body {
    font-size: 11px;
    line-height: 1.4;
  }
  .ai-modal .copilot-summary .ai-message-body > b {
    font-size: 12px;
  }
  .ai-modal .copilot-summary p {
    margin-bottom: 7px;
  }
  .ai-modal .copilot-summary ul {
    font-size: 11px;
    line-height: 1.4;
    margin: 6px 0 0;
  }
  .ai-modal .copilot-summary ul li + li {
    margin-top: 2px;
  }
  .ai-modal .copilot-progress {
    height: 6px;
  }
  .ai-modal .assistant-integration-cta {
    gap: 7px;
    padding: 8px;
  }
  .ai-modal .assistant-integration-cta a {
    min-height: 34px;
  }
  .ai-modal .assistant-rail-form textarea {
    min-height: 42px;
    max-height: 76px;
    padding: 10px 42px 10px 34px;
  }
  .ai-modal .ai-visual-panel {
    margin-bottom: 6px;
    padding: 8px;
    border-radius: 10px;
  }
  .ai-modal .ai-metric-row {
    gap: 6px;
    margin-bottom: 8px;
  }
  .ai-modal .ai-metric-card {
    min-width: 0;
    padding: 8px 5px;
    border-radius: 8px;
  }
  .ai-modal .ai-metric-value {
    font-size: 14px;
  }
  .ai-modal .ai-metric-label {
    margin-top: 2px;
    font-size: 9px;
    letter-spacing: .02em;
  }
  .ai-modal .ai-progress-block {
    margin-bottom: 5px;
  }
  .ai-modal .ai-progress-head {
    margin-bottom: 4px;
    font-size: 10px;
  }
  .ai-modal .ai-progress-head strong {
    font-size: 11px;
  }
  .ai-modal .ai-progress-track {
    height: 6px;
  }
}

@media (min-width: 1440px) {
  .dashboard-shell:has(.assistant-rail) {
    grid-template-columns: 224px minmax(0, 1fr) var(--assistant-rail-width, 440px);
  }

  .dashboard-shell.sidebar-collapsed:has(.assistant-rail) {
    grid-template-columns: 76px minmax(0, 1fr) var(--assistant-rail-width, 440px);
  }
}

@media (max-width: 720px) {
  .sidebar-toggle,
  .sidebar-search,
  .nav-label {
    display: none;
  }

  .sidebar-collapsed {
    display: block;
  }
}

/* ─── Visual Polish Pass ─── */

/* Metric cards: subtle top accent border + refined shadow depth */
.metric-card,
.metric-card.balance {
  border-top: 2.5px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 1px 2px rgba(23, 43, 77, .04),
    0 4px 16px rgba(23, 43, 77, .045);
  transition: box-shadow .2s ease, transform .2s ease;
}

.metric-card:hover {
  box-shadow:
    0 2px 4px rgba(23, 43, 77, .05),
    0 8px 24px rgba(23, 43, 77, .07);
  transform: translateY(-1px);
}

.metric-card.income {
  border-top-color: #18b96f;
}

.metric-card.expense {
  border-top-color: #ff4548;
}

.metric-card.saving:not(.is-negative) {
  border-top-color: #2563ff;
}

.metric-card.saving.is-negative {
  border-top-color: #ff4548;
}

.metric-card.balance {
  border-top-color: #7c6cff;
}

/* Metric icon: softer shape with subtle ring */
.metric-icon,
.metric-card.balance .metric-icon {
  box-shadow: 0 0 0 3px rgba(37, 99, 255, .06);
}

.metric-card.income .metric-icon {
  box-shadow: 0 0 0 3px rgba(24, 185, 111, .08);
}

.metric-card.expense .metric-icon {
  box-shadow: 0 0 0 3px rgba(255, 69, 72, .08);
}

/* Panels: consistent elevated feel */
.panel {
  box-shadow:
    0 1px 2px rgba(23, 43, 77, .03),
    0 4px 14px rgba(23, 43, 77, .04);
  transition: box-shadow .2s ease;
}

.panel:hover {
  box-shadow:
    0 2px 4px rgba(23, 43, 77, .04),
    0 6px 20px rgba(23, 43, 77, .06);
}

/* Chart area: refined grid lines and slight inner glow */
.large-chart {
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}

.grid-line {
  stroke: #ebeef5;
  stroke-dasharray: 3 4;
}

.chart-line {
  stroke-width: 2.6;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .06));
}

.chart-point {
  stroke-width: 2.5;
  filter: drop-shadow(0 3px 6px rgba(13, 26, 62, .12));
}

/* Budget ring: gradient arc and smoother ring */
.budget-ring {
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .02);
}

.budget-ring .inner {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

/* Score ring polish */
.score-ring {
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .02);
}

.score-ring .inner {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

/* Transactions table: better row definition */
.transactions td {
  border-bottom-color: #f0f3f7;
}

.transactions tr:hover td {
  background: #f8fafd;
}

.transactions th {
  color: #5a6a84;
  font-weight: 700;
  letter-spacing: .05em;
}

/* Transaction amount: bolder for readability */
.amount {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* Category bars: rounded ends with subtle glow */
.category-track {
  background: #f0f3f8;
}

.category-track i {
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

/* Insight cards: lift on hover */
.insight-item {
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.insight-item:hover {
  border-color: #cdd4e4;
  background: #f9fbff;
  box-shadow: 0 2px 8px rgba(23, 43, 77, .04);
}

/* Typography: improved contrast on key elements */
.headline p {
  color: #4b5d7a;
}

.metric-card label,
.metric-card.balance label {
  color: #566479;
}

.panel h3 {
  color: #0a1223;
}

.legend {
  font-weight: 650;
}

.legend i {
  height: 2.5px;
  border-radius: 2px;
}

/* Sparklines: smoother stroke */
.sparkline polyline {
  stroke-width: 2;
  stroke-linecap: round;
}

.sparkline path.area {
  opacity: .08;
}

/* Action buttons: micro-interaction */
.action-button {
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 255, .12);
}

.action-button.primary:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(37, 99, 255, .22);
}

/* Period select and toolbar inputs: focus ring polish */
.period-select:focus-visible,
.month-input:focus-visible {
  border-color: #2563ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 255, .1);
}

/* Panel footer link: subtle arrow hint */
.panel-footer-link {
  transition: color .15s ease;
}

.panel-footer-link:hover {
  color: #1a32c4;
}

/* Dark mode overrides for new polish */
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-card.balance {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .12),
    0 4px 16px rgba(0, 0, 0, .1);
}

:root[data-theme="dark"] .metric-card:hover {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .14),
    0 8px 24px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] .panel {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .1),
    0 4px 14px rgba(0, 0, 0, .08);
}

:root[data-theme="dark"] .panel:hover {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .12),
    0 6px 20px rgba(0, 0, 0, .12);
}

:root[data-theme="dark"] .large-chart {
  background: #111c2d;
}

:root[data-theme="dark"] .grid-line {
  stroke: #253248;
}

:root[data-theme="dark"] .transactions td {
  border-bottom-color: #1e2d42;
}

:root[data-theme="dark"] .transactions tr:hover td {
  background: #162538;
}

:root[data-theme="dark"] .category-track {
  background: #1e2d42;
}

:root[data-theme="dark"] .insight-item:hover {
  border-color: #3a4c66;
  background: #182840;
}

:root[data-theme="dark"] .metric-icon,
:root[data-theme="dark"] .metric-card.balance .metric-icon {
  box-shadow: 0 0 0 3px rgba(255, 69, 72, .06);
}

:root[data-theme="dark"] .metric-card.income .metric-icon {
  box-shadow: 0 0 0 3px rgba(24, 185, 111, .06);
}

:root[data-theme="dark"] .budget-ring .inner,
:root[data-theme="dark"] .score-ring .inner {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

/* ─── Dark Theme Deep Polish ─── */

/* Surface hierarchy: use layered backgrounds for depth */
:root[data-theme="dark"] body,
:root[data-theme="dark"] .dashboard-shell {
  background: #060e1a;
}

:root[data-theme="dark"] .main,
:root[data-theme="dark"] .empty-dashboard-main {
  background: #060e1a;
}

/* Metric cards: glassy elevated surface with colored glow */
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-card.balance {
  border-color: #1e2e44;
  background: linear-gradient(145deg, #0f1b2c, #111f33);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .02) inset,
    0 2px 8px rgba(0, 0, 0, .18),
    0 8px 24px rgba(0, 0, 0, .12);
}

:root[data-theme="dark"] .metric-card:hover {
  border-color: #2a3d56;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .03) inset,
    0 4px 12px rgba(0, 0, 0, .22),
    0 12px 32px rgba(0, 0, 0, .16);
}

:root[data-theme="dark"] .metric-card.income {
  border-top-color: rgba(24, 185, 111, .5);
}

:root[data-theme="dark"] .metric-card.expense {
  border-top-color: rgba(255, 69, 72, .5);
}

:root[data-theme="dark"] .metric-card.saving:not(.is-negative) {
  border-top-color: rgba(37, 99, 255, .5);
}

:root[data-theme="dark"] .metric-card.saving.is-negative {
  border-top-color: rgba(255, 69, 72, .5);
}

:root[data-theme="dark"] .metric-card.balance {
  border-top-color: rgba(124, 108, 255, .5);
}

/* Metric labels: better contrast */
:root[data-theme="dark"] .metric-card label,
:root[data-theme="dark"] .metric-card.balance label {
  color: #8fa0be;
}

/* Metric values: brighter white */
:root[data-theme="dark"] .metric-card h2,
:root[data-theme="dark"] .metric-card.balance h2 {
  color: #f8fbff;
}

:root[data-theme="dark"] .metric-card.expense h2,
:root[data-theme="dark"] .metric-card.is-negative h2 {
  color: #ff6b6e;
}

/* Metric icons: vivid against dark */
:root[data-theme="dark"] .metric-icon,
:root[data-theme="dark"] .metric-card.balance .metric-icon {
  color: #ff6b6e;
  background: rgba(255, 69, 72, .12);
  box-shadow: 0 0 0 3px rgba(255, 69, 72, .06);
}

:root[data-theme="dark"] .metric-card.income .metric-icon {
  color: #4ce8a2;
  background: rgba(24, 185, 111, .12);
  box-shadow: 0 0 0 3px rgba(24, 185, 111, .06);
}

:root[data-theme="dark"] .metric-card.saving:not(.is-negative) .metric-icon {
  color: #6fa4ff;
  background: rgba(37, 99, 255, .12);
  box-shadow: 0 0 0 3px rgba(37, 99, 255, .06);
}

/* Sparklines: brighter in dark mode */
:root[data-theme="dark"] .sparkline polyline {
  opacity: .85;
}

:root[data-theme="dark"] .sparkline path.area {
  opacity: .12;
}

/* Panels: elevated glass effect */
:root[data-theme="dark"] .panel {
  border-color: #1e2e44;
  background: linear-gradient(160deg, #0d1928, #101e30);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .02) inset,
    0 2px 8px rgba(0, 0, 0, .14),
    0 6px 20px rgba(0, 0, 0, .1);
}

:root[data-theme="dark"] .panel:hover {
  border-color: #273a52;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .025) inset,
    0 4px 12px rgba(0, 0, 0, .18),
    0 10px 28px rgba(0, 0, 0, .14);
}

/* Panel headings: crisp white */
:root[data-theme="dark"] .panel h3 {
  color: #f0f5ff;
}

/* Cash flow chart: subtle gradient background */
:root[data-theme="dark"] .large-chart {
  background: linear-gradient(180deg, #0d1928, #0b1724);
}

/* Chart lines: glow effect in dark */
:root[data-theme="dark"] .chart-line.income {
  filter: drop-shadow(0 0 4px rgba(24, 185, 111, .3));
}

:root[data-theme="dark"] .chart-line.expense {
  filter: drop-shadow(0 0 4px rgba(255, 69, 72, .3));
}

:root[data-theme="dark"] .chart-line.saving {
  filter: drop-shadow(0 0 4px rgba(37, 99, 255, .3));
}

:root[data-theme="dark"] .chart-point {
  fill: #0f1b2c;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3));
}

/* Grid lines: barely visible for clean look */
:root[data-theme="dark"] .grid-line {
  stroke: #1a2840;
  stroke-dasharray: 3 5;
}

/* Axis labels */
:root[data-theme="dark"] .axis-label {
  fill: #6b7f9c;
}

:root[data-theme="dark"] .chart-y-axis,
:root[data-theme="dark"] .chart-x-axis {
  color: #6b7f9c;
}

/* Legend: better visibility */
:root[data-theme="dark"] .legend {
  color: #9aacca;
}

:root[data-theme="dark"] .period-select {
  color: #d0daf0;
  border-color: #253548;
  background: #0c1826;
}

/* Budget ring: softer red glow */
:root[data-theme="dark"] .budget-ring {
  background: conic-gradient(#e8333a var(--budget), #1a2840 0);
  box-shadow: 0 0 20px rgba(232, 51, 58, .08);
}

:root[data-theme="dark"] .budget-ring .inner {
  background: #0d1928;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .2),
    inset 0 0 0 1px rgba(255, 255, 255, .03);
}

:root[data-theme="dark"] .budget-ring b {
  color: #f8fbff;
}

:root[data-theme="dark"] .budget-ring span {
  color: #8fa0be;
}

:root[data-theme="dark"] .budget-total {
  color: #e4ecf8;
}

:root[data-theme="dark"] .budget-over.negative {
  color: #ff6b6e;
}

/* Score ring: vivid green glow */
:root[data-theme="dark"] .score-ring {
  background: conic-gradient(#22d983 var(--score), #1a2840 0);
  box-shadow: 0 0 18px rgba(34, 217, 131, .06);
}

:root[data-theme="dark"] .score-ring .inner {
  background: #0d1928;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .2),
    inset 0 0 0 1px rgba(255, 255, 255, .03);
}

:root[data-theme="dark"] .score-ring b {
  color: #f8fbff;
}

:root[data-theme="dark"] .score-ring span {
  color: #8fa0be;
}

/* Health stats: refined separator */
:root[data-theme="dark"] .health-stat {
  border-bottom-color: #1a2840;
  color: #8fa0be;
}

:root[data-theme="dark"] .health-stat b {
  color: #dde6f4;
}

:root[data-theme="dark"] .health-stat b.good {
  color: #4ce8a2;
}

:root[data-theme="dark"] .health-stat b.negative {
  color: #ff6b6e;
}

/* Spending breakdown: vibrant category bars */
:root[data-theme="dark"] .category-line {
  color: #c4d1e6;
}

:root[data-theme="dark"] .category-line b {
  color: #a3b4ce;
}

:root[data-theme="dark"] .category-track {
  background: #162236;
}

:root[data-theme="dark"] .category-track i {
  box-shadow: 0 0 6px rgba(0, 0, 0, .15);
}

/* Panel footer link */
:root[data-theme="dark"] .panel-footer-link {
  color: #6fa4ff;
  border-top-color: #1a2840;
}

:root[data-theme="dark"] .panel-footer-link:hover {
  color: #8fb8ff;
}

/* Insight items: elevated cards with glow */
:root[data-theme="dark"] .insight-item {
  border-color: #1e2e44;
  background: linear-gradient(145deg, #0f1b2c, #111f33);
}

:root[data-theme="dark"] .insight-item:hover {
  border-color: #2a3d56;
  background: #142337;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

:root[data-theme="dark"] .insight-item b {
  color: #e4ecf8;
}

:root[data-theme="dark"] .insight-item span {
  color: #8fa0be;
}

/* Transactions: cleaner rows with hover */
:root[data-theme="dark"] .transactions-panel {
  border-color: #1e2e44;
  background: linear-gradient(160deg, #0d1928, #101e30);
}

:root[data-theme="dark"] .transactions th {
  color: #7b90ad;
  border-bottom-color: #1e2e44;
}

:root[data-theme="dark"] .transactions td {
  color: #c4d1e6;
  border-bottom-color: #152232;
}

:root[data-theme="dark"] .transactions tr:hover td {
  background: rgba(37, 99, 255, .04);
}

:root[data-theme="dark"] .tx-title b {
  color: #dde6f4;
}

:root[data-theme="dark"] .tx-title span {
  color: #7b90ad;
}

:root[data-theme="dark"] .amount {
  color: #ff6b6e;
}

:root[data-theme="dark"] .amount.positive {
  color: #4ce8a2;
}

:root[data-theme="dark"] .payment {
  color: #a3b4ce;
}

:root[data-theme="dark"] .payment svg {
  color: #6fa4ff;
}

/* Tags: vivid against dark */
:root[data-theme="dark"] .tag {
  border: 1px solid rgba(255, 255, 255, .06);
}

/* Headline: more presence */
:root[data-theme="dark"] .headline h1 {
  color: #f8fbff;
}

:root[data-theme="dark"] .headline p {
  color: #7b90ad;
}

/* Toolbar inputs: seamless with the surface */
:root[data-theme="dark"] .input-shell,
:root[data-theme="dark"] .month-input,
:root[data-theme="dark"] .notice-button {
  border-color: #1e2e44;
  background: #0b1724;
}

:root[data-theme="dark"] .input-shell:focus-within {
  border-color: #3563d4;
  box-shadow: 0 0 0 3px rgba(37, 99, 255, .08);
}

:root[data-theme="dark"] .notice-button:hover {
  background: #142337;
  border-color: #2a3d56;
}

/* Action buttons: vibrant in dark */
:root[data-theme="dark"] .action-button.primary {
  background: linear-gradient(135deg, #2d63f5, #4a42f0);
  box-shadow: 0 4px 14px rgba(45, 99, 245, .25);
}

:root[data-theme="dark"] .action-button.primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(45, 99, 245, .35);
}

/* Sidebar: deeper with ambient glow */
:root[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 30% 12%, rgba(37, 99, 255, .08), transparent 40%),
    linear-gradient(180deg, #06111f, #040d18);
  border-right-color: #14243a;
  box-shadow: 8px 0 32px rgba(0, 0, 0, .3);
}

:root[data-theme="dark"] .sidebar .nav button {
  color: #8fa0be;
}

:root[data-theme="dark"] .sidebar .nav button:hover {
  color: #dce6f4;
  background: rgba(37, 99, 255, .08);
  border-color: rgba(37, 99, 255, .15);
}

:root[data-theme="dark"] .sidebar .nav button.active {
  color: #fff;
  background: linear-gradient(135deg, #2458e8, #4a3ef0);
  border-color: rgba(37, 99, 255, .4);
  box-shadow: 0 6px 18px rgba(37, 99, 255, .2);
}

:root[data-theme="dark"] .sidebar-search {
  color: #7b90ad;
  border-color: #1a2a3f;
  background: #080f1c;
}

:root[data-theme="dark"] .sidebar-search:hover {
  color: #a3b4ce;
  border-color: #253a52;
  background: #0b1624;
}

/* Profile card: polished dark */
:root[data-theme="dark"] .sidebar .profile-card {
  border-color: #1a2a3f;
  background: #0a1522;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}

:root[data-theme="dark"] .sidebar .profile-card b,
:root[data-theme="dark"] .profile-card b {
  color: #f8fafc !important;
}

:root[data-theme="dark"] .sidebar .profile-card span,
:root[data-theme="dark"] .profile-card span {
  color: #60a5fa !important;
}
  color: #6b7f9c;
}

/* Theme switch: blends into sidebar */
:root[data-theme="dark"] .theme-switch {
  border-color: #1a2a3f;
  background: #080f1c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
}

:root[data-theme="dark"] .theme-switch button {
  color: #6b7f9c;
}

:root[data-theme="dark"] .theme-switch button.active {
  color: #f0f5ff;
  background: #1a2a3f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

/* Sidebar promo: subtle glow on dark */
:root[data-theme="dark"] .sidebar-promo {
  border-color: #1a2a3f;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}

:root[data-theme="dark"] .sidebar-promo:hover {
  border-color: #3a5080;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .4);
}

/* Finance Copilot rail: polished dark */
:root[data-theme="dark"] .assistant-rail {
  border-left-color: #14243a;
  background: #080f1c;
}

:root[data-theme="dark"] .assistant-rail-header {
  border-bottom-color: #14243a;
}

:root[data-theme="dark"] .assistant-title {
  color: #f0f5ff;
}

:root[data-theme="dark"] .assistant-alert {
  border-color: #253a6a;
  background: linear-gradient(145deg, #0c1826, #101e32);
}

:root[data-theme="dark"] .assistant-alert-icon {
  color: #7b9bff;
  background: rgba(37, 99, 255, .1);
  border: 1px solid rgba(37, 99, 255, .2);
}

:root[data-theme="dark"] .assistant-alert-actions button {
  color: #7b9bff;
  border-color: #253a5e;
  background: #0b1724;
}

:root[data-theme="dark"] .assistant-alert-actions button:hover {
  background: #142337;
  border-color: #3a5580;
}

/* AI messages in copilot */
:root[data-theme="dark"] .assistant-rail .ai-message.user {
  color: #c8d8ff;
  border-color: #2d4580;
  background: linear-gradient(135deg, #162748, #1a2d52);
}

:root[data-theme="dark"] .assistant-rail .ai-message.assistant {
  border-color: #1e2e44;
  background: #0d1928;
}

:root[data-theme="dark"] .copilot-summary .ai-message-body {
  color: #b8c8e0;
}

:root[data-theme="dark"] .copilot-summary ul {
  color: #8fa0be;
}

:root[data-theme="dark"] .copilot-progress {
  background: #162236;
}

:root[data-theme="dark"] .copilot-budget-row {
  color: #7b90ad;
}

/* Integration CTA: polished glass card */
:root[data-theme="dark"] .assistant-integration-cta {
  border-color: #1e2e44;
  background: linear-gradient(145deg, #0c1826, #101e32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
}

:root[data-theme="dark"] .assistant-integration-cta a {
  border-color: #1e2e44;
  background: #0b1724;
  color: #dde6f4;
}

:root[data-theme="dark"] .assistant-integration-cta a:hover {
  border-color: #3a5580;
  background: #142337;
}

.ai-table-wrap {
  width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  border: 1px solid #e5eeea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 33, 49, .03);
}

.ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.ai-table th {
  padding: 8px 10px;
  background: #f4f8f6;
  color: #102131;
  font-weight: 700;
  border-bottom: 1px solid #e5eeea;
  white-space: nowrap;
}

.ai-table td {
  padding: 8px 10px;
  color: #243547;
  border-bottom: 1px solid #edf4f0;
}

.ai-table tbody tr:last-child td {
  border-bottom: 0;
}

.ai-table tbody tr:hover td {
  background: #f8fbf9;
}

:root[data-theme="dark"] .ai-table-wrap {
  border-color: #234334;
  background: #102119;
}

:root[data-theme="dark"] .ai-table th {
  background: #172d22;
  color: #ecf8f1;
  border-bottom-color: #234334;
}

:root[data-theme="dark"] .ai-table td {
  color: #d3e5dc;
  border-bottom-color: #1a362a;
}

:root[data-theme="dark"] .ai-table tbody tr:hover td {
  background: #162a20;
}

.ai-visual-panel {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: linear-gradient(165deg, #f8faff 0%, #f1f5fd 100%);
}

.ai-chat-scroll {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  overflow-y: auto;
}

.ai-metric-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ai-metric-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid #e8edf5;
  border-top: 3px solid var(--accent, #2563ff);
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 43, 77, .04);
  text-align: center;
  overflow: hidden;
}

.ai-metric-value {
  display: block;
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 780;
  letter-spacing: -.02em;
  color: var(--accent, #0c1426);
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.ai-metric-label {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #5a6985;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.ai-progress-block {
  margin-bottom: 12px;
}

.ai-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #41506b;
}

.ai-progress-head strong {
  font-size: 13px;
  font-weight: 800;
}

.ai-progress-track {
  height: 8px;
  border-radius: 6px;
  background: #e8edf5;
  overflow: hidden;
}

.ai-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

.ai-pie-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai-pie-wrap {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
}

.ai-pie-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .06));
}

.ai-pie-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #41506b;
}

.ai-legend-item i {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.ai-legend-item span {
  flex: 1;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-legend-item b {
  font-weight: 700;
  color: #0c1426;
  white-space: nowrap;
}

.ai-legend-item small {
  font-size: 11px;
  color: #7b8da8;
  font-weight: 500;
}

/* Dark mode: AI Visual components */
:root[data-theme="dark"] .ai-visual-panel {
  border-color: rgba(60, 80, 110, .3);
  background: linear-gradient(165deg, #111d2e 0%, #0d1826 100%);
}

:root[data-theme="dark"] .ai-metric-card {
  border-color: rgba(60, 80, 110, .35);
  background: #152236;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

:root[data-theme="dark"] .ai-metric-value {
  color: #e8edf5;
}

:root[data-theme="dark"] .ai-metric-label {
  color: #7b8da8;
}

:root[data-theme="dark"] .ai-progress-head {
  color: #9aacbf;
}

:root[data-theme="dark"] .ai-progress-track {
  background: #1e2d42;
}

:root[data-theme="dark"] .ai-legend-item {
  color: #9aacbf;
}

:root[data-theme="dark"] .ai-legend-item b {
  color: #e0e8f2;
}

:root[data-theme="dark"] .ai-legend-item small {
  color: #6b7f96;
}

:root[data-theme="dark"] .ai-pie-svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .2));
}

/* ─── Cards & Panels Premium Polish ─── */

/* Metric cards: glass morphism + refined surface */
.metric-card,
.metric-card.balance {
  border: 1px solid rgba(220, 228, 240, .7);
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f8faff 100%);
  box-shadow:
    0 1px 1px rgba(23, 43, 77, .02),
    0 2px 6px rgba(23, 43, 77, .03),
    0 8px 24px rgba(23, 43, 77, .04),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: box-shadow .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1), border-color .25s ease;
}

.metric-card:hover {
  border-color: rgba(190, 205, 225, .9);
  box-shadow:
    0 2px 4px rgba(23, 43, 77, .04),
    0 8px 20px rgba(23, 43, 77, .06),
    0 16px 40px rgba(23, 43, 77, .05),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

/* Top accent: thicker gradient strip */
.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #e0e4ee 0%, #d0d8e8 100%);
  opacity: 1;
}

.metric-card.income::before {
  background: linear-gradient(90deg, #10d070 0%, #18b96f 50%, #0fa85d 100%);
}

.metric-card.expense::before {
  background: linear-gradient(90deg, #ff5a5d 0%, #ff2d2f 50%, #e81820 100%);
}

.metric-card.saving:not(.is-negative)::before {
  background: linear-gradient(90deg, #5590ff 0%, #2563ff 50%, #1a4cd4 100%);
}

.metric-card.saving.is-negative::before {
  background: linear-gradient(90deg, #ff5a5d 0%, #ff2d2f 50%, #e81820 100%);
}

.metric-card.balance::before {
  background: linear-gradient(90deg, #a78bfa 0%, #7c6cff 50%, #5b4cdb 100%);
}

/* Balance card: richer gradient with subtle noise texture */
.metric-card.balance {
  border: none;
  border-radius: 14px;
  background: linear-gradient(145deg, #7b6cff 0%, #4f5dfa 40%, #3548e8 80%, #2840d4 100%);
  box-shadow:
    0 4px 12px rgba(75, 70, 220, .15),
    0 12px 32px rgba(55, 50, 200, .12),
    inset 0 1px 0 rgba(255, 255, 255, .15);
}

.metric-card.balance:hover {
  box-shadow:
    0 6px 16px rgba(75, 70, 220, .2),
    0 16px 44px rgba(55, 50, 200, .16),
    inset 0 1px 0 rgba(255, 255, 255, .2);
  transform: translateY(-2px);
}

.metric-card.balance::before {
  display: none;
}

/* Label typography: refined */
.metric-card label,
.metric-card.balance label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.metric-card label {
  color: #5a6985;
}

.metric-card.balance label {
  color: rgba(255, 255, 255, .82);
}

/* Value typography: sharper */
.metric-card h2,
.metric-card.balance h2 {
  font-size: 24px;
  font-weight: 780;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.metric-card.balance h2 {
  font-size: 26px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* Metric icons: premium feel with ring + gradient bg */
.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, .06),
    inset 0 -1px 0 rgba(0, 0, 0, .04);
}

.metric-card.balance .metric-icon {
  background: rgba(255, 255, 255, .18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.metric-card.income .metric-icon {
  background: linear-gradient(145deg, #e6faf0 0%, #d1f5e4 100%);
  color: #0d9955;
  box-shadow: 0 2px 6px rgba(16, 185, 100, .1);
}

.metric-card.expense .metric-icon {
  background: linear-gradient(145deg, #fff0f0 0%, #ffe4e4 100%);
  color: #e81820;
  box-shadow: 0 2px 6px rgba(255, 45, 47, .1);
}

.metric-card.saving:not(.is-negative) .metric-icon {
  background: linear-gradient(145deg, #eef4ff 0%, #dce8ff 100%);
  color: #1a4cd4;
  box-shadow: 0 2px 6px rgba(37, 99, 255, .1);
}

/* Sparklines: smoother with area gradient */
.sparkline {
  opacity: .85;
}

.sparkline polyline {
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Panels: elevated glass surface */
.panel {
  border: 1px solid rgba(220, 228, 240, .7);
  border-radius: 14px;
  background: linear-gradient(170deg, #ffffff 0%, #fafcff 100%);
  box-shadow:
    0 1px 2px rgba(23, 43, 77, .02),
    0 4px 12px rgba(23, 43, 77, .035),
    0 12px 32px rgba(23, 43, 77, .03),
    inset 0 1px 0 rgba(255, 255, 255, .85);
  transition: box-shadow .25s cubic-bezier(.4,0,.2,1), border-color .25s ease;
}

.panel:hover {
  border-color: rgba(195, 210, 230, .9);
  box-shadow:
    0 2px 4px rgba(23, 43, 77, .03),
    0 6px 16px rgba(23, 43, 77, .05),
    0 16px 40px rgba(23, 43, 77, .04),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* Panel headers: refined type scale */
.panel h3 {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -.01em;
  color: #0c1426;
}

/* Large chart panel: subtle gradient canvas */
.large-chart {
  background: linear-gradient(175deg, #ffffff 0%, #f9fbff 60%, #f4f7fd 100%);
  border-radius: 14px;
}

/* Budget panel: centered focus with refined ring */
.budget-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.budget-ring {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .06));
}

.budget-ring .inner {
  box-shadow:
    0 1px 4px rgba(0, 0, 0, .04),
    0 4px 12px rgba(0, 0, 0, .03);
}

/* Budget text below ring: better hierarchy */
.budget-spent {
  font-weight: 700;
  letter-spacing: -.01em;
}

/* Legend dots: wider rounded chips */
.legend i {
  width: 14px;
  height: 3px;
  border-radius: 3px;
}

/* Cash flow chart area: fill beneath lines */
.chart-line {
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Dark mode: Cards & Panels Premium ─── */

:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-card.balance {
  border-color: rgba(60, 80, 110, .4);
  background: linear-gradient(165deg, #152236 0%, #111d2e 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .2),
    0 4px 12px rgba(0, 0, 0, .12),
    0 12px 32px rgba(0, 0, 0, .08),
    inset 0 1px 0 rgba(255, 255, 255, .04);
}

:root[data-theme="dark"] .metric-card:hover {
  border-color: rgba(80, 110, 150, .5);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .22),
    0 8px 20px rgba(0, 0, 0, .15),
    0 20px 48px rgba(0, 0, 0, .1),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}

:root[data-theme="dark"] .metric-card::before {
  opacity: .85;
}

:root[data-theme="dark"] .metric-card.balance {
  border: none;
  background: linear-gradient(145deg, #4a3dcc 0%, #3a30b8 40%, #2c25a0 80%, #241e8a 100%);
  box-shadow:
    0 4px 12px rgba(60, 50, 180, .2),
    0 12px 32px rgba(40, 30, 150, .15),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

:root[data-theme="dark"] .metric-card.balance:hover {
  box-shadow:
    0 6px 16px rgba(60, 50, 180, .28),
    0 16px 44px rgba(40, 30, 150, .2),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

:root[data-theme="dark"] .metric-card label {
  color: #7b8da8;
}

:root[data-theme="dark"] .metric-card h2 {
  color: #e8edf5;
}

:root[data-theme="dark"] .metric-card.expense h2,
:root[data-theme="dark"] .metric-card.is-negative h2 {
  color: #ff6b6e;
}

:root[data-theme="dark"] .metric-icon {
  border-radius: 10px;
}

:root[data-theme="dark"] .metric-card.income .metric-icon {
  background: rgba(16, 185, 100, .12);
  color: #3de08a;
  box-shadow: 0 0 12px rgba(16, 185, 100, .08);
}

:root[data-theme="dark"] .metric-card.expense .metric-icon {
  background: rgba(255, 69, 72, .12);
  color: #ff7a7c;
  box-shadow: 0 0 12px rgba(255, 69, 72, .08);
}

:root[data-theme="dark"] .metric-card.saving:not(.is-negative) .metric-icon {
  background: rgba(37, 99, 255, .12);
  color: #6b9aff;
  box-shadow: 0 0 12px rgba(37, 99, 255, .08);
}

:root[data-theme="dark"] .panel {
  border-color: rgba(60, 80, 110, .35);
  background: linear-gradient(170deg, #13213a 0%, #0f1c30 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .18),
    0 4px 12px rgba(0, 0, 0, .1),
    0 12px 32px rgba(0, 0, 0, .06),
    inset 0 1px 0 rgba(255, 255, 255, .03);
}

:root[data-theme="dark"] .panel:hover {
  border-color: rgba(80, 110, 150, .45);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .2),
    0 6px 16px rgba(0, 0, 0, .12),
    0 16px 40px rgba(0, 0, 0, .08),
    inset 0 1px 0 rgba(255, 255, 255, .05);
}

:root[data-theme="dark"] .panel h3 {
  color: #dfe6f0;
}

:root[data-theme="dark"] .large-chart {
  background: linear-gradient(175deg, #13213a 0%, #0e1a2e 60%, #0b1525 100%);
}

:root[data-theme="dark"] .budget-ring {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .2));
}

:root[data-theme="dark"] .budget-ring .inner {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .15),
    inset 0 0 0 1px rgba(255, 255, 255, .04);
}

:root[data-theme="dark"] .sparkline {
  opacity: .9;
}

/* Compose area */
:root[data-theme="dark"] .copilot-compose {
  border-color: #1e2e44;
  background: #0b1724;
}

:root[data-theme="dark"] .assistant-rail-form textarea {
  color: #e4ecf8;
  background: transparent;
}

:root[data-theme="dark"] .assistant-send {
  background: linear-gradient(135deg, #2458e8, #4a3ef0);
  box-shadow: 0 4px 12px rgba(37, 99, 255, .25);
}

/* Donut chart (spending breakdown) */
:root[data-theme="dark"] .donut .inner {
  background: #0d1928;
}

/* Day separator */
:root[data-theme="dark"] .assistant-day {
  color: #5a6f8c;
}

/* Wide buttons */
:root[data-theme="dark"] .wide-button {
  color: #6fa4ff;
  background: rgba(37, 99, 255, .08);
}

:root[data-theme="dark"] .wide-button:hover {
  background: rgba(37, 99, 255, .12);
}

/* Alert pill */
:root[data-theme="dark"] .alert-pill {
  color: #ff6b6e;
  background: rgba(255, 69, 72, .1);
}

/* Modal in dark */
:root[data-theme="dark"] .modal {
  border-color: #1e2e44;
  background: #0c1826;
  box-shadow: 0 28px 85px rgba(0, 0, 0, .5);
}

:root[data-theme="dark"] .modal h2 {
  color: #f0f5ff;
}

:root[data-theme="dark"] .modal p {
  color: #8fa0be;
}

:root[data-theme="dark"] .modal-close {
  color: #dde6f4;
  background: #162236;
}

:root[data-theme="dark"] .modal-close:hover {
  background: #1e2e44;
}

/* Form fields in dark */
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select {
  color: #e4ecf8;
  border-color: #1e2e44;
  background: #0b1724;
}

:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .field select:focus {
  border-color: #3563d4;
  box-shadow: 0 0 0 3px rgba(37, 99, 255, .1);
}

:root[data-theme="dark"] .field label {
  color: #7b90ad;
}

/* Focus outlines for dark */
:root[data-theme="dark"] button:focus-visible,
:root[data-theme="dark"] input:focus-visible,
:root[data-theme="dark"] select:focus-visible,
:root[data-theme="dark"] textarea:focus-visible {
  outline-color: rgba(99, 148, 255, .3);
}

/* ─── Finance Copilot Modal & Chat Polish ─── */

/* Modal container: rounder, elevated */
.modal.ai-modal {
  border-radius: 18px;
  border-color: #e2e8f3;
  box-shadow:
    0 4px 12px rgba(5, 17, 48, .06),
    0 24px 72px rgba(5, 17, 48, .2);
}

/* Modal header: tighter spacing */
.ai-modal .modal-top {
  margin-bottom: 14px;
}

.ai-modal .modal-top h2 {
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -.03em;
}

.ai-modal .modal-top p {
  color: #5a6b87;
  font-size: 12px;
  line-height: 1.5;
}

/* Close button: softer */
.ai-modal .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #4a5872;
  background: #f4f6fa;
  transition: background .15s ease, color .15s ease;
}

.ai-modal .modal-close:hover {
  color: #ff4548;
  background: #fff0f0;
}

/* CometAPI badge + Online status: refined */
.copilot-modal-status {
  gap: 12px;
}

.copilot-modal-status .comet-badge-modal {
  border-radius: 6px;
  border-color: #e2e8f0;
  background: #f8fafc;
}

/* Alert card: modern glass card */
.ai-modal .assistant-alert,
.assistant-alert {
  border-radius: 12px;
  border-color: #d4dcff;
  background: linear-gradient(145deg, #f8faff, #f2f5ff);
  box-shadow: 0 2px 8px rgba(37, 99, 255, .04);
}

.assistant-alert-icon {
  border-radius: 14px;
}

.assistant-alert > div > b {
  font-size: 13px;
  line-height: 1.35;
}

.assistant-alert > div > span {
  font-size: 11px;
  line-height: 1.5;
  color: #546280;
}

/* Alert action buttons: pill-shaped, modern */
.assistant-alert-actions {
  margin-top: 8px;
}

.assistant-alert-actions button {
  min-height: 36px;
  border-radius: 8px;
  border-color: #d4dcff;
  color: #2541d9;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.assistant-alert-actions button:hover {
  border-color: #a8b8ff;
  background: #f0f3ff;
  box-shadow: 0 2px 8px rgba(37, 99, 255, .08);
  transform: translateY(-1px);
}

/* Day separator: refined */
.assistant-day {
  font-size: 10px;
  font-weight: 600;
  color: #8392ae;
}

.assistant-day::before,
.assistant-day::after {
  background: #e8edf5;
}

/* User message bubble: polished gradient */
.ai-message.user {
  background: linear-gradient(135deg, #2c5ff5, #5046ea);
  box-shadow: 0 4px 14px rgba(37, 99, 255, .18);
  border-radius: 14px 14px 4px 14px;
}

.ai-message.user small {
  color: rgba(255, 255, 255, .65);
}

/* Assistant message bubble: cleaner card */
.ai-message {
  border-radius: 14px 14px 14px 4px;
  border-color: #e4eaf4;
  background: #f8fafd;
  box-shadow: 0 1px 4px rgba(23, 43, 77, .03);
}

/* Copilot summary: better typography */
.copilot-summary .ai-message-body {
  font-size: 12px;
  line-height: 1.6;
  color: #2c3a54;
}

.copilot-summary .ai-message-body > b {
  color: #0d1b33;
  font-size: 13px;
  font-weight: 700;
}

.copilot-summary p {
  margin-bottom: 12px;
}

/* Copilot progress bar: polished */
.copilot-progress {
  height: 8px;
  border-radius: 99px;
  background: #edf0f7;
  overflow: hidden;
}

.copilot-progress i {
  border-radius: 99px;
  background: linear-gradient(90deg, #ff4548, #e83538);
  box-shadow: 0 1px 4px rgba(255, 69, 72, .2);
}

.copilot-progress strong {
  font-size: 12px;
  font-weight: 800;
}

.copilot-budget-row {
  font-size: 10px;
  color: #6b7a96;
}

.copilot-budget-row b {
  color: #e83538;
  font-weight: 750;
}

.copilot-summary ul {
  color: #3d4f6f;
  font-size: 12px;
  line-height: 1.7;
}

.copilot-summary ul li + li {
  margin-top: 4px;
}

/* Integration CTA: polished card */
.assistant-integration-cta {
  position: relative;
  border-radius: 12px;
  border-color: #dfe5f2;
  background: linear-gradient(145deg, #fcfdff, #f6f9ff);
  box-shadow: 0 2px 8px rgba(33, 58, 126, .04);
}

.assistant-integration-cta.is-dismissed {
  display: none;
}

.assistant-integration-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #74829b;
  background: transparent;
  cursor: pointer;
}

.assistant-integration-dismiss:hover {
  color: #1d2e4d;
  background: #edf2fb;
}

.assistant-integration-dismiss svg {
  width: 14px;
  height: 14px;
}

.assistant-integration-cta strong {
  font-size: 12px;
  font-weight: 750;
  color: #0d1b33;
}

.assistant-integration-cta span {
  font-size: 10px;
  color: #6b7a96;
}

.assistant-integration-cta a {
  min-height: 40px;
  border-radius: 9px;
  border-color: #dfe5f0;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(23, 43, 77, .04);
  transition: all .15s ease;
}

.assistant-integration-cta a:hover {
  border-color: #a8b8ff;
  background: #f6f8ff;
  box-shadow: 0 3px 10px rgba(37, 99, 255, .08);
  transform: translateY(-1px);
}

/* Compose area: sleek input */
.copilot-compose {
  border-radius: 12px;
  border-color: #dfe5f0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 43, 77, .03);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.copilot-compose:focus-within {
  border-color: #a8b8ff;
  box-shadow: 0 2px 8px rgba(37, 99, 255, .06);
}

.compose-clip {
  color: #7b8aa6;
}

.compose-clip:hover {
  color: #2563ff;
}

.assistant-rail-form textarea::placeholder {
  color: #94a3bd;
}

/* Send button: polished gradient */
.assistant-send {
  background: linear-gradient(135deg, #2c5ff5, #4a3ef0);
  box-shadow: 0 4px 12px rgba(37, 99, 255, .25);
  transition: box-shadow .15s ease, transform .15s ease;
}

.assistant-send:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(37, 99, 255, .35);
  transform: translateY(-1px);
}

/* Privacy note: refined */
.assistant-rail-form > small {
  color: #8a9ab4;
  font-size: 9px;
}

/* AI suggestions: nicer pills */
.ai-suggestions button {
  border-color: #dfe5f2;
  border-radius: 8px;
  background: #f8faff;
  color: #2c4ea8;
  font-weight: 700;
  transition: all .15s ease;
}

.ai-suggestions button:hover {
  border-color: #a8b8ff;
  background: #eef2ff;
  box-shadow: 0 2px 6px rgba(37, 99, 255, .06);
  transform: translateY(-1px);
}

/* Dark mode: Copilot modal polish */
:root[data-theme="dark"] .modal.ai-modal {
  border-color: #1e2e44;
  background: #0a1320;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, .2),
    0 24px 72px rgba(0, 0, 0, .4);
}

:root[data-theme="dark"] .ai-modal .modal-close {
  color: #b8c8e0;
  background: #152236;
}

:root[data-theme="dark"] .ai-modal .modal-close:hover {
  color: #ff6b6e;
  background: rgba(255, 69, 72, .1);
}

:root[data-theme="dark"] .ai-modal .assistant-alert,
:root[data-theme="dark"] .assistant-alert {
  border-color: #253a6a;
  background: linear-gradient(145deg, #0d1928, #101e34);
}

/* Match the Money Copilot wordmark used on the public homepage. */
.brand strong {
  color: #0b1738;
  letter-spacing: -.03em;
}

.brand strong span {
  color: #078bdc;
  background: linear-gradient(90deg, #10b981, #078bdc 72%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

:root[data-theme="dark"] .brand strong {
  color: #f7faff;
}

:root[data-theme="dark"] .assistant-alert-actions button {
  border-color: #253a5e;
  color: #7b9bff;
  background: #0b1724;
}

:root[data-theme="dark"] .assistant-alert-actions button:hover {
  border-color: #3a5580;
  background: #142337;
}

:root[data-theme="dark"] .ai-message {
  border-color: #1e2e44;
  background: #0d1928;
}

:root[data-theme="dark"] .ai-message.user {
  background: linear-gradient(135deg, #1e3f8a, #352e80);
  box-shadow: 0 4px 14px rgba(37, 99, 255, .12);
}

:root[data-theme="dark"] .copilot-summary .ai-message-body {
  color: #b8c8e0;
}

:root[data-theme="dark"] .copilot-summary .ai-message-body > b {
  color: #f0f5ff;
}

:root[data-theme="dark"] .copilot-summary ul {
  color: #8fa0be;
}

:root[data-theme="dark"] .copilot-progress {
  background: #162236;
}

:root[data-theme="dark"] .copilot-progress i {
  background: linear-gradient(90deg, #e83538, #ff4548);
  box-shadow: 0 1px 4px rgba(255, 69, 72, .15);
}

:root[data-theme="dark"] .assistant-integration-cta {
  border-color: #1e2e44;
  background: linear-gradient(145deg, #0c1826, #0f1c2e);
}

:root[data-theme="dark"] .assistant-integration-cta a {
  border-color: #1e2e44;
  background: #0b1724;
}

:root[data-theme="dark"] .assistant-integration-cta a:hover {
  border-color: #3a5580;
  background: #142337;
}

:root[data-theme="dark"] .copilot-compose {
  border-color: #1e2e44;
  background: #0b1724;
}

:root[data-theme="dark"] .copilot-compose:focus-within {
  border-color: #3563d4;
  box-shadow: 0 2px 8px rgba(37, 99, 255, .08);
}

:root[data-theme="dark"] .assistant-day {
  color: #5a6f8c;
}

:root[data-theme="dark"] .assistant-day::before,
:root[data-theme="dark"] .assistant-day::after {
  background: #1a2840;
}

:root[data-theme="dark"] .ai-suggestions button {
  border-color: #1e2e44;
  background: #0d1928;
  color: #7b9bff;
}

:root[data-theme="dark"] .ai-suggestions button:hover {
  border-color: #3a5580;
  background: #142337;
}

/* Email Report Modal Styling */
.email-report-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.email-report-form .field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #1e293b);
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #64748b;
  pointer-events: none;
  transition: color .15s ease;
}

.input-with-icon input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink, #0f172a);
  background: #ffffff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input-with-icon input:focus {
  outline: 0;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.input-with-icon input:focus + svg,
.input-with-icon:focus-within svg {
  color: var(--accent, #2563eb);
}

.email-report-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.8), 0 4px 12px rgba(15,23,42,.03);
}

.email-report-card-header {
  margin-bottom: 12px;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.report-badge svg {
  width: 13px;
  height: 13px;
}

.email-report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.report-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.report-stat span {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.report-stat strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.report-stat strong.spent { color: #dc2626; }
.report-stat strong.budget { color: #2563eb; }
.report-stat strong.used { color: #d97706; }
.report-stat strong.remaining.under-budget { color: #16a34a; }
.report-stat strong.remaining.over-budget { color: #dc2626; }

.report-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 6px;
  gap: 12px;
}

.report-success-state .success-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
}

.report-success-state .success-icon svg {
  width: 28px;
  height: 28px;
}

.report-success-state p {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  margin: 0;
}

/* Dark mode overrides for Email Report Modal */
:root[data-theme="dark"] .email-report-card {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
}

:root[data-theme="dark"] .report-stat {
  background: #0f172a;
  border-color: #334155;
}

:root[data-theme="dark"] .report-stat strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .input-with-icon input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

:root[data-theme="dark"] .input-with-icon svg {
  color: #94a3b8;
}

:root[data-theme="dark"] .report-badge {
  background: rgba(37, 99, 235, .2);
  border-color: rgba(37, 99, 235, .4);
  color: #60a5fa;
}

:root[data-theme="dark"] .data-action-buttons a.action-button {
  background: rgba(16, 185, 129, .15);
  border-color: rgba(16, 185, 129, .4);
  color: #34d399;
}

:root[data-theme="dark"] .data-action-buttons a.action-button:hover {
  background: #10b981;
  color: #ffffff;
}

/* Settings Modal Styling */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 6px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.settings-section-title svg {
  width: 16px;
  height: 16px;
  color: #2563eb;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.settings-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.settings-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}

.settings-label strong {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.settings-label small {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.settings-select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  min-width: 160px;
  outline: 0;
  cursor: pointer;
}

.settings-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.settings-pill-group {
  display: flex;
  gap: 6px;
}

.settings-pill {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #ffffff;
  cursor: pointer;
  transition: all .15s ease;
}

.settings-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
}

/* Custom Toggle Switch */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

.settings-toggle input:checked + .toggle-slider {
  background-color: #2563eb;
}

.settings-toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.notification-settings-section {
  gap: 0;
}

.notification-settings-title {
  margin-bottom: 4px;
}

.notification-settings-title svg {
  box-sizing: content-box;
  padding: 6px;
  border-radius: 8px;
  color: #059669;
  background: #dff8ef;
}

.notification-setting-row {
  min-height: 62px;
  padding: 12px 0;
}

.notification-setting-row:first-of-type {
  padding-top: 12px;
}

.notification-setting-row .settings-label strong {
  font-size: 13px;
}

.notification-setting-row .settings-label small {
  color: #64748b;
}

.notification-setting-row .settings-toggle input:checked + .toggle-slider {
  background: #10b981;
}

.notification-delivery-row {
  min-height: 58px;
}

.notification-status::before {
  content: "\00D7";
  margin-right: 4px;
  font-weight: 900;
}

.notification-status.is-enabled {
  color: #059669 !important;
}

.notification-status.is-enabled::before {
  content: "\2713";
}

.notification-status.is-blocked {
  color: #dc2626 !important;
}

.notification-enable-button {
  min-width: 108px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.notification-enable-button:hover:not(:disabled),
.notification-enable-button:focus-visible {
  background: #059669;
  box-shadow: 0 6px 16px rgba(16, 185, 129, .3);
  transform: translateY(-1px);
}

.notification-enable-button:focus-visible {
  outline: 3px solid rgba(16, 185, 129, .22);
  outline-offset: 2px;
}

.notification-enable-button.is-enabled,
.notification-enable-button:disabled {
  cursor: default;
  opacity: .72;
}

.settings-info-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row span {
  color: #64748b;
  font-weight: 600;
}

.info-row strong {
  color: #0f172a;
  font-weight: 700;
}

/* Dark mode overrides for Settings Modal */
:root[data-theme="dark"] .settings-section {
  background: #0f172a;
  border-color: #334155;
}

:root[data-theme="dark"] .settings-section-title {
  color: #f8fafc;
}

:root[data-theme="dark"] .settings-row {
  border-top-color: #1e293b;
}

:root[data-theme="dark"] .settings-label strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .settings-label small {
  color: #94a3b8;
}

:root[data-theme="dark"] .settings-select {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

:root[data-theme="dark"] .settings-pill {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

:root[data-theme="dark"] .settings-pill.active {
  background: #2563eb;
  color: #ffffff;
}

:root[data-theme="dark"] .notification-settings-title svg {
  color: #34d399;
  background: rgba(16, 185, 129, .14);
}

:root[data-theme="dark"] .notification-setting-row .settings-label small {
  color: #8fa0be;
}

:root[data-theme="dark"] .notification-enable-button {
  color: #04150f;
  background: #34d399;
}

:root[data-theme="dark"] .notification-enable-button:hover:not(:disabled),
:root[data-theme="dark"] .notification-enable-button:focus-visible {
  background: #6ee7b7;
}

:root[data-theme="dark"] .info-row {
  border-bottom-color: #1e293b;
}

:root[data-theme="dark"] .info-row span {
  color: #94a3b8;
}

:root[data-theme="dark"] .info-row strong {
  color: #f8fafc;
}

@media (max-width: 620px) {
  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .settings-select {
    width: 100%;
  }

  .notification-settings-section {
    padding: 15px;
  }

  .notification-setting-row {
    min-height: 66px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
  }

  .notification-setting-row .settings-label {
    min-width: 0;
  }

  .notification-setting-row .settings-label small {
    max-width: 230px;
    font-size: 10px;
  }

  .notification-enable-button {
    min-width: 102px;
    min-height: 40px;
    padding-inline: 12px;
  }
}

/* Copilot Chat UI Enhancements */
.ai-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  width: 100%;
  min-width: 0;
}

.ai-message-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: -0.01em;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.ai-bot-avatar {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dbeafe;
  flex-shrink: 0;
  overflow: hidden;
}

.ai-bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-meta-tag {
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 110px !important;
  border: 1px solid #e2e8f0;
  flex-shrink: 1 !important;
}

.ai-heading {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 10px 0 4px;
}

.ai-heading:first-child {
  margin-top: 0;
}

.ai-bullet {
  padding-left: 4px;
  margin: 2px 0;
  line-height: 1.4;
}

.ai-hr {
  border: 0;
  border-top: 1px dashed #cbd5e1;
  margin: 8px 0;
}

.ai-message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.ai-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all .15s ease;
}

.ai-action-btn svg {
  width: 12px;
  height: 12px;
  color: #64748b;
}

.ai-action-btn:hover {
  background: #f8fafc;
  color: #2563eb;
  border-color: #bfdbfe;
}

.ai-rating-btns {
  display: flex;
  gap: 4px;
}

.ai-rate-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.ai-rate-btn:hover {
  transform: scale(1.1);
  background: #f1f5f9;
}

.ai-rate-btn.active {
  background: #dbeafe;
  border-color: #93c5fd;
}

:root[data-theme="dark"] .ai-message-footer {
  border-top-color: rgba(51, 65, 85, 0.6);
}

:root[data-theme="dark"] .ai-action-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

:root[data-theme="dark"] .ai-action-btn:hover {
  background: #334155;
  color: #60a5fa;
}

:root[data-theme="dark"] .ai-rate-btn {
  background: #1e293b;
  border-color: #334155;
}

:root[data-theme="dark"] .ai-meta-tag {
  background: #1e293b;
  color: #94a3b8;
}

/* Reference dashboard redesign: calm finance workspace */
:root { --ink:#102131; --text:#13263a; --muted:#66778a; --line:#e5eeea; --green:#079a55; --page-mint:#f7fbf9; }
body { background:radial-gradient(circle at 48% -20%,#effbf6 0,transparent 38rem),var(--page-mint); }
@media (min-width:721px) {
  .dashboard-shell,.dashboard-shell:has(.assistant-rail){grid-template-columns:218px minmax(0,1fr) var(--assistant-rail-width, 440px);background:transparent}
  .dashboard-shell.sidebar-collapsed:has(.assistant-rail){grid-template-columns:76px minmax(0,1fr) var(--assistant-rail-width, 440px)}
  .sidebar{padding:23px 14px 15px;border-right-color:#edf2ef;background:rgba(255,255,255,.91);box-shadow:10px 0 32px rgba(27,71,50,.035)}
  .sidebar .brand{margin-bottom:24px}.sidebar .brand strong{font-size:14px;color:#102131}.sidebar .brand span{color:#079a55}
  .sidebar-search{border-color:#e2ebe6;background:#f8fbfa}.nav-label{color:#728177;margin-top:20px}.sidebar .nav{gap:4px}
  .sidebar .nav button{min-height:42px;color:#314255;font-weight:680}.sidebar .nav button:hover{color:#087f4a;background:#edfaf3;border-color:#e1f4e9}
  .sidebar .nav button.active{border-color:#0aba68;background:linear-gradient(110deg,#078f50,#09be70);box-shadow:0 9px 20px rgba(7,154,85,.17)}
  .sidebar .nav .pill-new{color:#078f50;background:#dff7eb}.theme-switch{border-color:#e1ebe6;background:#f5f9f7}.theme-switch button.active{color:#0a7745}
  .sidebar .profile-card{border-color:#e2ece7;box-shadow:0 5px 18px rgba(30,78,53,.045)}.sidebar .profile-card span{color:#079a55!important}.sidebar-promo{display:none}
  .main{padding:0 17px 30px}.topbar{min-height:101px;padding:20px 4px 14px}.headline h1{color:#102131;font-size:clamp(21px,1.7vw,27px);letter-spacing:-.045em}.headline p{color:#5e6e80;font-size:12px}
  .toolbar{gap:10px}.month-input,.input-shell,.notice-button,.action-button{height:43px;border-color:#e0ebe5;border-radius:9px;box-shadow:none}.month-input{width:130px;font-size:11px}.input-shell{width:178px;background:#fff}.notice-button{width:43px;color:#079a55}.toolbar-actions .action-button{height:43px;min-width:112px;font-size:11px}.action-button{color:#078f50;border-color:#bfe8d3}.action-button.primary{background:linear-gradient(110deg,#078f50,#08aa60);box-shadow:0 8px 18px rgba(7,154,85,.17)}
  .summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:15px}
  .metric-card,.metric-card.balance{min-height:176px;padding:21px 16px 12px;border:1px solid #e4ede8;border-top:1px solid #e4ede8;border-radius:12px;color:#102131;background:#fff;box-shadow:0 7px 22px rgba(30,83,57,.035)}.metric-card::before{display:none}.metric-card.balance{color:#102131;background:#fff}.metric-card:hover,.metric-card.balance:hover{border-color:#cfead9;box-shadow:0 12px 25px rgba(30,83,57,.065);transform:translateY(-2px)}
  .metric-card label,.metric-card.balance label{color:#102131;font-size:11px;font-weight:760;letter-spacing:0;text-transform:none}.metric-card h2,.metric-card.balance h2{margin:9px 0 8px;color:#102131;font-size:clamp(21px,1.75vw,27px);text-shadow:none}.metric-card.expense h2,.metric-card.is-negative h2{color:#102131}
  .metric-icon,.metric-card.balance .metric-icon{position:static;width:54px;height:54px;margin-right:12px;border-radius:50%;color:#fff;background:linear-gradient(145deg,#51d69d,#009350);box-shadow:0 10px 18px rgba(8,157,86,.19)}.metric-card.income .metric-icon,.metric-card.expense .metric-icon,.metric-card.saving:not(.is-negative) .metric-icon{color:#fff;background:linear-gradient(145deg,#51d69d,#009350)}.metric-card-main{display:flex;align-items:flex-start}.metric-copy{min-width:0}.metric-direction{margin-left:auto;border-radius:50%;background:#e7f8ef;color:#079a55}.metric-trend{font-size:9px;color:#079a55!important;background:transparent!important;padding:0}.metric-trend small{color:#697889}.sparkline{left:16px;right:16px;bottom:12px;opacity:.9}
  .content-grid{gap:12px}.panel{border:1px solid #e3ece7;border-radius:12px;background:#fff;box-shadow:0 7px 22px rgba(30,83,57,.03)}.panel:hover{border-color:#cfe7d9;box-shadow:0 12px 27px rgba(30,83,57,.055)}.panel h3{color:#102131;font-size:14px}.panel-head{padding-bottom:12px}.large-chart{background:#fff}.chart-line.income,.chart-line.saving{stroke:#079a55}.grid-line{stroke:#dce9e2}.legend i{background:#079a55}.budget-ring{background:conic-gradient(#079a55 var(--budget),#86debb var(--budget),#e6f0eb 0)}.budget-ring .inner{background:#fff}.budget-over.positive,.panel-footer-link{color:#079a55}.score-ring{background:conic-gradient(#079a55 var(--score),#b7e6cf var(--score),#e7f0eb 0)}.score-ring .inner{background:#fff;color:#102131}.insight-item{border-color:#e4eee8;background:#fbfdfc}.insight-item:hover{border-color:#bfe7d1;background:#f1faf5}.transactions thead{background:#fbfdfc}.transactions td,.transactions th{border-color:#edf2ef}.tag{color:#078f50}
  .assistant-rail{display:block;min-width:0;border-left:1px solid #ebf1ed;background:rgba(255,255,255,.84)}.assistant-rail-header{min-height:101px;padding:16px 15px;border-bottom-color:#edf2ef}.assistant-title{color:#102131;font-size:13px}.copilot-logo{width:38px;height:38px}.assistant-rail-chat{height:calc(100vh - 102px);gap:12px;padding:16px 10px 14px}.assistant-alert{padding:13px;border-color:#e0eee6;border-radius:12px;background:linear-gradient(135deg,#f5fcf8,#eff9f4)}.assistant-alert-icon{color:#079a55;background:#e1f8eb}.assistant-alert b{color:#174432}.assistant-alert-actions button{color:#078f50;border-color:#d8ede2;background:#fff;font-size:9px}.assistant-rail .ai-message.user{border-color:#d4eddf;background:#e3f6eb;color:#1f4e39}.assistant-rail .ai-message.assistant{border-color:#e2ece7;background:#fff}.assistant-integration-cta{border-color:#ddede4;background:linear-gradient(140deg,#f5fcf8,#edf9f3)}.assistant-integration-cta a{border-color:#e1ebe6}.assistant-rail-form .copilot-compose{border-color:#dceae2;background:#fff}.assistant-send{background:linear-gradient(135deg,#079a55,#05b66a)}
}
@media (max-width:1180px) and (min-width:721px){.dashboard-shell,.dashboard-shell:has(.assistant-rail){grid-template-columns:218px minmax(0,1fr)}.assistant-rail{display:none}.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){body{background:var(--page-mint)}.mobile-dashboard-header{background:linear-gradient(155deg,#f8fdf9,#eefaf3)}.mobile-greeting h1,.mobile-brand-title{color:#102131}.mobile-bottom-nav{border-top-color:#e0ebe5;background:rgba(255,255,255,.96)}.mobile-bottom-nav button.active{color:#079a55}.mobile-add-button{background:linear-gradient(135deg,#079a55,#08b468)!important}.metric-card,.metric-card.balance,.panel{border-color:#e3ece7;border-radius:14px;background:#fff;box-shadow:0 6px 18px rgba(30,83,57,.035)}.metric-card.balance{color:#102131}.metric-card.balance h2,.metric-card h2{color:#102131}.metric-card.balance label,.metric-card label{color:#102131}.metric-icon,.metric-card.balance .metric-icon{background:linear-gradient(145deg,#51d69d,#009350);color:#fff}.mobile-finance-composer{border-color:#dbeae2}.mobile-composer-action{background:#079a55}}
:root[data-theme="dark"] body,:root[data-theme="dark"] .dashboard-shell{background:#091711}:root[data-theme="dark"] .metric-card,:root[data-theme="dark"] .metric-card.balance,:root[data-theme="dark"] .panel{border-color:#234334;background:#102119}:root[data-theme="dark"] .metric-card h2,:root[data-theme="dark"] .metric-card.balance h2,:root[data-theme="dark"] .metric-card label,:root[data-theme="dark"] .metric-card.balance label,:root[data-theme="dark"] .panel h3{color:#ecf8f1}:root[data-theme="dark"] .sidebar,:root[data-theme="dark"] .assistant-rail{background:#0b1812;border-color:#1c382a}:root[data-theme="dark"] .sidebar .nav button.active,:root[data-theme="dark"] .action-button.primary{background:linear-gradient(110deg,#078f50,#08ad63)}

/* Pixel-aligned reference surfaces */
@media (min-width:1181px) {
  .main{padding-inline:18px}
  .topbar{min-height:88px;margin-bottom:18px;padding:16px 4px 10px}
  .summary-grid{gap:12px;margin-bottom:15px}
  .metric-card,.metric-card.balance{height:177px;min-height:177px;padding:21px 20px 12px}
  .metric-icon,.metric-card.balance .metric-icon{margin-right:18px}
  .sparkline{right:18px;left:18px}
  .content-grid{grid-template-columns:1.82fr .88fr;gap:14px}
  .large-chart{grid-column:1;grid-row:1;min-height:260px}
  .budget-panel{grid-column:2;grid-row:1;min-height:260px}
  .spending-panel{grid-column:1;grid-row:2;min-height:232px;width:49.25%}
  .financial-health{grid-column:1;grid-row:2;min-height:232px;width:49.25%;justify-self:end}
  .insights-panel{grid-column:2;grid-row:2;min-height:232px}
  .transactions-panel{grid-column:1/-1;grid-row:3}
  .sidebar .brand{margin-bottom:29px}
}

/* Dark reference: black-teal glass with emerald interaction color */
:root[data-theme="dark"] {
  --ink:#f4fbf7;
  --text:#e7f2ec;
  --muted:#8ca098;
  --line:#20372e;
  --panel:#07150f;
  --green:#18e381;
}
:root[data-theme="dark"] body{
  color:#e9f4ee;
  background:radial-gradient(circle at 54% 5%,rgba(5,62,40,.22),transparent 34rem),#020b08;
}
:root[data-theme="dark"] .dashboard-shell{background:transparent}
:root[data-theme="dark"] .main{background:linear-gradient(145deg,rgba(3,13,10,.96),rgba(2,18,13,.98))}
:root[data-theme="dark"] .sidebar{
  border-right-color:#173128;
  background:linear-gradient(180deg,#020b08 0%,#03110d 100%);
  box-shadow:10px 0 34px rgba(0,0,0,.28);
}
:root[data-theme="dark"] .sidebar .brand strong{color:#f4fbf7}
:root[data-theme="dark"] .sidebar .brand span{color:#21e183}
:root[data-theme="dark"] .sidebar-search{
  color:#9db0a8;
  border-color:#1d372e;
  background:#071510;
}
:root[data-theme="dark"] .sidebar-search kbd{color:#a5b5ae;border-color:#29443a;background:#0a1b15}
:root[data-theme="dark"] .nav-label{color:#82938c}
:root[data-theme="dark"] .sidebar .nav button{color:#d2dfd9}
:root[data-theme="dark"] .sidebar .nav button:hover{color:#fff;border-color:#175c3e;background:#08291d}
:root[data-theme="dark"] .sidebar .nav button.active{
  color:#fff;
  border-color:#14d978;
  background:linear-gradient(105deg,#057842,#08b965);
  box-shadow:0 8px 22px rgba(0,191,103,.18),inset 0 1px rgba(255,255,255,.12);
}
:root[data-theme="dark"] .sidebar .nav .pill-new{color:#48ec9e;background:#0d3526;border:1px solid #1a5d43}
:root[data-theme="dark"] .theme-switch{border-color:#1c382d;background:#071510}
:root[data-theme="dark"] .theme-switch button{color:#8ea199}
:root[data-theme="dark"] .theme-switch button.active{color:#fff;background:#113226;box-shadow:0 3px 12px rgba(0,0,0,.3)}
:root[data-theme="dark"] .sidebar .profile-card{
  color:#edf8f2;
  border-color:#1b392e;
  background:#071710;
  box-shadow:0 7px 20px rgba(0,0,0,.25);
}
:root[data-theme="dark"] .sidebar .profile-card span{color:#26e184!important}
:root[data-theme="dark"] .sidebar .profile-logout{color:#51e49b;border-color:#28503e;background:#0b2118}
:root[data-theme="dark"] .headline h1{color:#f6fbf8}
:root[data-theme="dark"] .headline p{color:#bbc8c2}
:root[data-theme="dark"] .month-input,
:root[data-theme="dark"] .input-shell,
:root[data-theme="dark"] .notice-button,
:root[data-theme="dark"] .action-button{
  color:#e7f2ec;
  border-color:#1c392f;
  background:#071510;
  box-shadow:0 5px 16px rgba(0,0,0,.12);
}
:root[data-theme="dark"] .input-shell input{color:#e8f1ed}
:root[data-theme="dark"] .input-shell input::placeholder{color:#8da099}
:root[data-theme="dark"] .notice-button{color:#ecf8f2}
:root[data-theme="dark"] .action-button{color:#e9f8f1}
:root[data-theme="dark"] .action-button.primary{border-color:#0ada72;background:linear-gradient(105deg,#078b4d,#08bc68)}
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-card.balance,
:root[data-theme="dark"] .panel{
  color:#e8f3ed;
  border:1px solid #1b372e;
  background:linear-gradient(150deg,#07140f 0%,#061710 100%);
  box-shadow:0 9px 26px rgba(0,0,0,.18),inset 0 1px rgba(255,255,255,.015);
}
:root[data-theme="dark"] .metric-card:hover,
:root[data-theme="dark"] .metric-card.balance:hover,
:root[data-theme="dark"] .panel:hover{border-color:#276047;box-shadow:0 12px 30px rgba(0,0,0,.24)}
:root[data-theme="dark"] .metric-card label,
:root[data-theme="dark"] .metric-card.balance label{color:#f1f8f4}
:root[data-theme="dark"] .metric-card h2,
:root[data-theme="dark"] .metric-card.balance h2,
:root[data-theme="dark"] .metric-card.expense h2,
:root[data-theme="dark"] .metric-card.is-negative h2{color:#f7fbf9}
:root[data-theme="dark"] .metric-icon,
:root[data-theme="dark"] .metric-card.balance .metric-icon,
:root[data-theme="dark"] .metric-card.income .metric-icon,
:root[data-theme="dark"] .metric-card.expense .metric-icon,
:root[data-theme="dark"] .metric-card.saving:not(.is-negative) .metric-icon{
  color:#effff7;
  background:radial-gradient(circle at 35% 28%,#24cb77,#05733f 72%);
  box-shadow:0 0 0 1px #0ac36b,0 11px 22px rgba(0,196,105,.22);
}
:root[data-theme="dark"] .metric-direction{color:#65eca5;background:#0d2b20;border:1px solid #1b4936}
:root[data-theme="dark"] .metric-trend{color:#27e583!important}
:root[data-theme="dark"] .metric-trend small{color:#91a49b}
:root[data-theme="dark"] .sparkline polyline{stroke:#67eda8!important;filter:drop-shadow(0 0 4px rgba(35,226,130,.25))}
:root[data-theme="dark"] .panel h3{color:#f3f8f5}
:root[data-theme="dark"] .large-chart{background:linear-gradient(150deg,#07140f,#061710)}
:root[data-theme="dark"] .grid-line{stroke:#294039}
:root[data-theme="dark"] .chart-y-axis,
:root[data-theme="dark"] .chart-x-axis,
:root[data-theme="dark"] .legend{color:#a5b5ae}
:root[data-theme="dark"] .period-select,
:root[data-theme="dark"] .panel-menu{color:#edf6f1;border-color:#203b32;background:#091912}
:root[data-theme="dark"] .chart-line.income{stroke:#17dc79}
:root[data-theme="dark"] .chart-line.expense{stroke:#9af5ca}
:root[data-theme="dark"] .chart-line.saving{stroke:#66eab0}
:root[data-theme="dark"] .budget-ring{background:conic-gradient(#09d774 var(--budget),#7befb8 var(--budget),#18372b 0);filter:drop-shadow(0 0 13px rgba(10,211,113,.16))}
:root[data-theme="dark"] .budget-ring .inner,
:root[data-theme="dark"] .score-ring .inner{color:#f1f8f4;background:#07140f;box-shadow:inset 0 0 14px rgba(0,0,0,.28)}
:root[data-theme="dark"] .budget-total{color:#eef7f2}
:root[data-theme="dark"] .budget-over.positive,
:root[data-theme="dark"] .panel-footer-link,
:root[data-theme="dark"] .panel-link{color:#27e583}
:root[data-theme="dark"] .spending-donut{filter:drop-shadow(0 0 10px rgba(22,212,120,.12))}
:root[data-theme="dark"] .spending-donut>div{background:#07140f;color:#f2faf6}
:root[data-theme="dark"] .category-line{color:#d5e2dc}
:root[data-theme="dark"] .category-line b{color:#eaf3ef}
:root[data-theme="dark"] .score-ring{background:conic-gradient(#11da78 var(--score),#547066 var(--score),#18372b 0)}
:root[data-theme="dark"] .health-stat{border-color:#20382f}
:root[data-theme="dark"] .health-stat span,
:root[data-theme="dark"] .health-stat b{color:#c4d2cc}
:root[data-theme="dark"] .insight-item{color:#e6f1eb;border-color:#1d3b30;background:#091912}
:root[data-theme="dark"] .insight-item:hover{border-color:#277451;background:#0b2419}
:root[data-theme="dark"] .insight-item b{color:#edf7f2}
:root[data-theme="dark"] .transactions thead{background:#07150f}
:root[data-theme="dark"] .transactions th{color:#8fa39a}
:root[data-theme="dark"] .transactions td{color:#b9cac2;border-color:#1a3128}
:root[data-theme="dark"] .transactions .amount{color:#f1f8f4}
:root[data-theme="dark"] .tag{color:#62eda5;border-color:#205a41;background:#0b2a1e!important}
:root[data-theme="dark"] .payment{color:#b6c7bf}
:root[data-theme="dark"] .assistant-rail{
  border-left-color:#173128;
  background:linear-gradient(180deg,#020b08,#03110d);
}
:root[data-theme="dark"] .assistant-rail-header{border-bottom-color:#183329}
:root[data-theme="dark"] .assistant-title{color:#f5faf7}
:root[data-theme="dark"] .comet-badge{color:#c4d2cb;border-color:#294239;background:#081710}
:root[data-theme="dark"] .assistant-online{color:#b8c8c1}
:root[data-theme="dark"] .assistant-alert{border-color:#1b3d30;background:linear-gradient(145deg,#071710,#0a1e16)}
:root[data-theme="dark"] .assistant-alert-icon{color:#32e88d;border-color:#18583d;background:#092a1d}
:root[data-theme="dark"] .assistant-alert b{color:#f1f8f4}
:root[data-theme="dark"] .assistant-alert span{color:#9caea6}
:root[data-theme="dark"] .assistant-alert-actions button{color:#d8e8e0;border-color:#1e4234;background:#071610}
:root[data-theme="dark"] .assistant-alert-actions button:hover{color:#45ed98;border-color:#26704e;background:#0a251a}
:root[data-theme="dark"] .assistant-day:before,
:root[data-theme="dark"] .assistant-day:after{background:#1c372c}
:root[data-theme="dark"] .assistant-day span{color:#bdcbc5;background:#03110d}
:root[data-theme="dark"] .assistant-rail .ai-message.user{color:#d9f9e9;border-color:#12593b;background:linear-gradient(135deg,#073222,#06422b)}
:root[data-theme="dark"] .assistant-rail .ai-message.assistant{color:#d6e3dc;border-color:#1b392e;background:#071710}
:root[data-theme="dark"] .copilot-summary .ai-message-body{color:#d3dfd9}
:root[data-theme="dark"] .copilot-summary b{color:#eff8f3}
:root[data-theme="dark"] .copilot-progress{background:#1c3129}
:root[data-theme="dark"] .copilot-budget-row{color:#a4b5ad}
:root[data-theme="dark"] .assistant-integration-cta{border-color:#1b3c2f;background:linear-gradient(145deg,#071710,#0a1e16)}
:root[data-theme="dark"] .assistant-integration-cta strong{color:#ecf5f0}
:root[data-theme="dark"] .assistant-integration-cta span{color:#9caea6}
:root[data-theme="dark"] .assistant-integration-cta a{color:#eef7f2;border-color:#1e4234;background:#081710}
:root[data-theme="dark"] .assistant-rail-form .copilot-compose{border-color:#1e4033;background:#071710}
:root[data-theme="dark"] .assistant-rail-form textarea{color:#edf6f1;background:transparent}
:root[data-theme="dark"] .assistant-rail-form textarea::placeholder{color:#91a49b}
:root[data-theme="dark"] .compose-clip{color:#42e894}
:root[data-theme="dark"] .assistant-send{color:#fff;background:linear-gradient(135deg,#078b4d,#09c36d);box-shadow:0 6px 17px rgba(0,202,109,.22)}

/* Light reference palette: sampled from the supplied 1616px screenshot */
:root[data-theme="light"] {
  --ink:#10283a;
  --text:#11293c;
  --muted:#617386;
  --soft:#f3f9f7;
  --line:#e4efeb;
  --panel:#fefefe;
  --green:#019a56;
  --red:#ef2e2e;
}
:root[data-theme="light"] body{color:#11293c;background:#f7fbfa}
:root[data-theme="light"] .main{background:radial-gradient(circle at 58% -12%,rgba(219,244,233,.52),transparent 31rem),#f7fbfa}
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .assistant-rail{border-color:#e8f1ed;background:rgba(252,253,253,.96);box-shadow:none}
:root[data-theme="light"] .sidebar .brand strong,
:root[data-theme="light"] .headline h1,
:root[data-theme="light"] .panel h3,
:root[data-theme="light"] .assistant-title{color:#10283a}
:root[data-theme="light"] .sidebar .brand span,
:root[data-theme="light"] .sidebar .profile-card span{color:#019a56!important}
:root[data-theme="light"] .sidebar-search{color:#617386;border-color:#e0ebe6;background:#f9fbfa}
:root[data-theme="light"] .sidebar-search kbd{color:#627487;border-color:#dfe9e5;background:#fefefe}
:root[data-theme="light"] .nav-label{color:#68796e}
:root[data-theme="light"] .sidebar .nav button{color:#152c3e}
:root[data-theme="light"] .sidebar .nav button:hover{color:#017e48;border-color:#dcefe6;background:#eff9f4}
:root[data-theme="light"] .sidebar .nav button.active{color:#fff;border-color:#09aa63;background:linear-gradient(105deg,#07854e,#08b968);box-shadow:0 7px 17px rgba(1,154,86,.16)}
:root[data-theme="light"] .sidebar .nav .pill-new{color:#07834b;background:#dff4e9}
:root[data-theme="light"] .theme-switch{border-color:#e0ebe6;background:#f0f6f4}
:root[data-theme="light"] .theme-switch button{color:#3d5364}
:root[data-theme="light"] .theme-switch button.active{color:#10283a;background:#fff;box-shadow:0 3px 11px rgba(29,71,51,.08)}
:root[data-theme="light"] .sidebar .profile-card{border-color:#e3ece8;background:#fff;box-shadow:0 4px 13px rgba(27,72,50,.035)}
:root[data-theme="light"] .sidebar .profile-logout{color:#019a56;border-color:#dcebe4;background:#fff}
:root[data-theme="light"] .headline p{color:#556a7d}
:root[data-theme="light"] .month-input,
:root[data-theme="light"] .input-shell,
:root[data-theme="light"] .notice-button,
:root[data-theme="light"] .action-button{color:#11293c;border-color:#dceae4;background:#fff;box-shadow:0 3px 10px rgba(29,72,51,.025)}
:root[data-theme="light"] .input-shell input{color:#11293c}
:root[data-theme="light"] .input-shell input::placeholder{color:#607386}
:root[data-theme="light"] .notice-button,
:root[data-theme="light"] .action-button{color:#019a56}
:root[data-theme="light"] .action-button{border-color:#bce2d0}
:root[data-theme="light"] .action-button.primary{color:#fff;border-color:#019a56;background:linear-gradient(105deg,#04874d,#02a75d);box-shadow:0 7px 16px rgba(1,154,86,.14)}
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .metric-card.balance,
:root[data-theme="light"] .panel{color:#11293c;border:1px solid #e3eeea;background:#fefefe;box-shadow:0 4px 16px rgba(33,79,57,.025)}
:root[data-theme="light"] .metric-card:hover,
:root[data-theme="light"] .metric-card.balance:hover,
:root[data-theme="light"] .panel:hover{border-color:#d9eae2;box-shadow:0 7px 20px rgba(33,79,57,.045)}
:root[data-theme="light"] .metric-card label,
:root[data-theme="light"] .metric-card.balance label,
:root[data-theme="light"] .metric-card h2,
:root[data-theme="light"] .metric-card.balance h2,
:root[data-theme="light"] .metric-card.expense h2,
:root[data-theme="light"] .metric-card.is-negative h2{color:#11293c}
:root[data-theme="light"] .metric-icon,
:root[data-theme="light"] .metric-card.balance .metric-icon,
:root[data-theme="light"] .metric-card.income .metric-icon,
:root[data-theme="light"] .metric-card.expense .metric-icon,
:root[data-theme="light"] .metric-card.saving:not(.is-negative) .metric-icon{color:#fff;background:radial-gradient(circle at 32% 26%,#35d58c,#019a56 72%);box-shadow:0 9px 18px rgba(1,154,86,.19)}
:root[data-theme="light"] .metric-direction{color:#019a56;border:0;background:#e7f5ee}
:root[data-theme="light"] .metric-trend{color:#019a56!important}
:root[data-theme="light"] .metric-trend small{color:#607386}
:root[data-theme="light"] .sparkline polyline{stroke:#019a56!important;filter:none}
:root[data-theme="light"] .large-chart{background:#fefefe}
:root[data-theme="light"] .grid-line{stroke:#dbe9e3}
:root[data-theme="light"] .chart-y-axis,
:root[data-theme="light"] .chart-x-axis,
:root[data-theme="light"] .legend{color:#536a7c}
:root[data-theme="light"] .period-select,
:root[data-theme="light"] .panel-menu{color:#11293c;border-color:#dfeae5;background:#fbfdfc}
:root[data-theme="light"] .chart-line.income{stroke:#078f50}
:root[data-theme="light"] .chart-line.expense{stroke:#019a56}
:root[data-theme="light"] .chart-line.saving{stroke:#20bfa0}
:root[data-theme="light"] .chart-point.income{stroke:#078f50}
:root[data-theme="light"] .chart-point.expense{stroke:#019a56}
:root[data-theme="light"] .chart-point.saving{stroke:#20bfa0}
:root[data-theme="light"] .chart-area-income{fill:url(#incomeFill)}
:root[data-theme="light"] .chart-area-expense{fill:rgba(1,154,86,.025)}
:root[data-theme="light"] .budget-ring{background:conic-gradient(#019a56 var(--budget),#80d8b3 var(--budget),#e1eee8 0);filter:drop-shadow(0 4px 10px rgba(1,154,86,.08))}
:root[data-theme="light"] .budget-ring .inner,
:root[data-theme="light"] .score-ring .inner{color:#11293c;background:#fefefe;box-shadow:none}
:root[data-theme="light"] .budget-total{color:#11293c}
:root[data-theme="light"] .budget-over.positive,
:root[data-theme="light"] .panel-footer-link,
:root[data-theme="light"] .panel-link{color:#019a56}
:root[data-theme="light"] .spending-donut>div{color:#11293c;background:#fefefe}
:root[data-theme="light"] .category-line,
:root[data-theme="light"] .category-line b{color:#243b4c}
:root[data-theme="light"] .score-ring{background:conic-gradient(#019a56 var(--score),#b6e4d0 var(--score),#e2ede8 0)}
:root[data-theme="light"] .health-stat{border-color:#e3ece8}
:root[data-theme="light"] .health-stat span,
:root[data-theme="light"] .health-stat b{color:#304758}
:root[data-theme="light"] .insight-item{color:#193246;border-color:#dfeae5;background:#fbfdfc}
:root[data-theme="light"] .insight-item:hover{border-color:#cce4d9;background:#f3faf7}
:root[data-theme="light"] .insight-item b{color:#193246}
:root[data-theme="light"] .transactions thead{background:#fdfefe}
:root[data-theme="light"] .transactions th{color:#53687a}
:root[data-theme="light"] .transactions td{color:#4a6071;border-color:#e7efec}
:root[data-theme="light"] .transactions .amount{color:#11293c}
:root[data-theme="light"] .tag{color:#07894e;border-color:#d1ebdf;background:#e7f6ee!important}
:root[data-theme="light"] .payment{color:#506778}
:root[data-theme="light"] .assistant-rail-header{border-bottom-color:#e7efec}
:root[data-theme="light"] .comet-badge{color:#304858;border-color:#e1ebe7;background:#fff;box-shadow:none}
:root[data-theme="light"] .assistant-online{color:#526a5f}
:root[data-theme="light"] .assistant-alert{border-color:#e1ece7;background:linear-gradient(145deg,#eff7f3,#eef7f3)}
:root[data-theme="light"] .assistant-alert-icon{color:#019a56;border:0;background:#e2f3ea}
:root[data-theme="light"] .assistant-alert b{color:#173c2c}
:root[data-theme="light"] .assistant-alert span{color:#5c7167}
:root[data-theme="light"] .assistant-alert-actions button{color:#07864d;border-color:#dceae4;background:#fff}
:root[data-theme="light"] .assistant-alert-actions button:hover{border-color:#bfe0d0;background:#f5faf7}
:root[data-theme="light"] .assistant-day:before,
:root[data-theme="light"] .assistant-day:after{background:#e2ebe7}
:root[data-theme="light"] .assistant-day span{color:#5e7168;background:#fcfdfd}
:root[data-theme="light"] .assistant-rail .ai-message.user{color:#294b3c;border-color:#dcebe4;background:linear-gradient(135deg,#e7f4ee,#e5f3ec)}
:root[data-theme="light"] .assistant-rail .ai-message.assistant{color:#3d5364;border-color:#e1eae6;background:#fff}
:root[data-theme="light"] .copilot-summary .ai-message-body{color:#405667}
:root[data-theme="light"] .copilot-summary b{color:#183043}
:root[data-theme="light"] .copilot-progress{background:#e8efec}
:root[data-theme="light"] .copilot-budget-row{color:#516777}
:root[data-theme="light"] .assistant-integration-cta{border-color:#e1ece7;background:linear-gradient(145deg,#eff7f3,#eef7f3)}
:root[data-theme="light"] .assistant-integration-cta strong{color:#173243}
:root[data-theme="light"] .assistant-integration-cta span{color:#5b7166}
:root[data-theme="light"] .assistant-integration-cta a{color:#193043;border-color:#dce9e3;background:#fff}
:root[data-theme="light"] .assistant-rail-form .copilot-compose{border-color:#dfeae5;background:#fff}
:root[data-theme="light"] .assistant-rail-form textarea{color:#193043;background:transparent}
:root[data-theme="light"] .assistant-rail-form textarea::placeholder{color:#647789}
:root[data-theme="light"] .compose-clip{color:#019a56}
:root[data-theme="light"] .assistant-send{color:#fff;background:linear-gradient(135deg,#019a56,#05ad64);box-shadow:0 6px 15px rgba(1,154,86,.18)}

/* Final desktop reference lock: wins over the legacy dashboard cascade */
@media (min-width:1181px) {
  .dashboard-shell:has(.assistant-rail),
  .dashboard-shell.sidebar-collapsed:has(.assistant-rail){
    grid-template-columns:218px minmax(0,1fr) var(--assistant-rail-width, 440px)!important;
  }
  .sidebar{width:218px!important;padding:23px 14px 15px!important}
  .assistant-rail{width:var(--assistant-rail-width, 440px);min-width:280px;max-width:560px}
  .sidebar-toggle{display:none!important}
  .main{padding:0 18px 30px!important}
  .topbar{min-height:88px!important;margin:0 0 18px!important;padding:16px 4px 10px!important}
  .headline h1{font-size:25px!important;font-weight:700!important;line-height:1.12!important}
  .headline p{font-size:12px!important;font-weight:400!important}
  .summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;margin-bottom:15px!important}
  .metric-card,.metric-card.balance{height:177px!important;min-height:177px!important;padding:21px 20px 12px!important;border-radius:12px!important}
  .metric-card-main{display:flex!important;align-items:flex-start!important}
  .metric-card label,.metric-card.balance label{font-size:11px!important;font-weight:650!important;line-height:1.25!important}
  .metric-card h2,.metric-card.balance h2{margin:8px 0!important;font-size:26px!important;font-weight:700!important;line-height:1!important}
  .metric-icon,.metric-card.balance .metric-icon,.metric-card.saving.is-negative .metric-icon{position:static!important;width:54px!important;height:54px!important;margin-right:18px!important;border-radius:50%!important;color:#fff!important;background:radial-gradient(circle at 32% 26%,#35d58c,#019a56 72%)!important;box-shadow:0 9px 18px rgba(1,154,86,.19)!important}
  .metric-direction{top:18px!important;right:14px!important;width:30px!important;height:30px!important}
  .metric-trend{font-size:9px!important;font-weight:600!important}
  .sparkline{right:18px!important;bottom:12px!important;left:18px!important;height:44px!important}
  .content-grid{grid-template-columns:1.82fr .88fr!important;gap:14px!important}
  .large-chart{grid-column:1!important;grid-row:1!important;min-height:260px!important;height:260px!important}
  .budget-panel{grid-column:2!important;grid-row:1!important;min-height:260px!important;height:260px!important}
  .spending-panel{grid-column:1!important;grid-row:2!important;width:49.25%!important;min-height:232px!important;height:232px!important;justify-self:start!important}
  .financial-health{grid-column:1!important;grid-row:2!important;width:49.25%!important;min-height:232px!important;height:232px!important;justify-self:end!important}
  .insights-panel{grid-column:2!important;grid-row:2!important;min-height:232px!important;height:232px!important}
  .transactions-panel{grid-column:1/-1!important;grid-row:3!important}
  .panel{padding:15px!important;border-radius:12px!important}
  .panel h3{font-size:14px!important;font-weight:700!important}
  .panel-head{margin-bottom:11px!important;padding-bottom:0!important}
  .assistant-rail-header{height:101px!important;min-height:101px!important;padding:16px 15px!important}
  .assistant-rail-chat{height:calc(100vh - 101px)!important;padding:16px 10px 14px!important}
  .assistant-title{font-size:13px!important;font-weight:700!important}
  .assistant-alert{padding:13px!important;border-radius:12px!important}
  .assistant-alert-actions button{min-height:35px!important;font-size:9px!important;font-weight:600!important}
  .assistant-rail .ai-message{font-size:11px!important;font-weight:400!important}
  .assistant-integration-cta strong{font-size:10px!important}
  .sidebar .nav button{font-size:11px!important;font-weight:600!important}
  .sidebar .profile-card b{font-size:11px!important;font-weight:650!important}
  .copilot-logo img,.mobile-copilot-button img,.mobile-composer-bot img{filter:hue-rotate(-65deg) saturate(1.15)}
  .sidebar .brand-logo-light{filter:hue-rotate(-65deg) saturate(1.25)}
}

:root[data-theme="light"] body,
:root[data-theme="light"] .main{background:#f7fbfa!important}
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .assistant-rail{background:#fcfdfd!important}
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .metric-card.balance,
:root[data-theme="light"] .panel{border-color:#e3eeea!important;background:linear-gradient(145deg,#fff 0%,#fefefe 64%,#f8fbfa 100%)!important;box-shadow:0 4px 16px rgba(33,79,57,.025)!important}
:root[data-theme="light"] .metric-card.saving.is-negative h2{color:#11293c!important}
:root[data-theme="light"] .metric-card.saving.is-negative .metric-direction{color:#019a56!important;background:#e7f5ee!important}
:root[data-theme="light"] .budget-ring{background:conic-gradient(from -90deg,#80d9b4 0 38%,#019a56 38% 79%,#3bc888 79% 100%)!important}

/* Reference material system: gradient, bloom, inset light and surface depth */
:root[data-theme="light"] body{
  background:
    radial-gradient(circle at 54% -12%,rgba(219,244,233,.62),transparent 34rem),
    linear-gradient(180deg,#f6faf9 0%,#f8fbfa 100%)!important;
}
:root[data-theme="light"] .main{
  background:
    radial-gradient(circle at 55% -14%,rgba(220,244,234,.55),transparent 32rem),
    linear-gradient(180deg,#f6faf9 0%,#f8fbfa 100%)!important;
}
:root[data-theme="light"] .sidebar .nav button.active{
  border-color:#08a962!important;
  background:linear-gradient(108deg,#04894f 0%,#019b59 52%,#13b570 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),inset 0 -1px 0 rgba(0,102,61,.14),0 7px 17px rgba(1,154,86,.18)!important;
}
:root[data-theme="light"] .action-button.primary{
  border-color:#029c59!important;
  background:linear-gradient(112deg,#038c51 0%,#019d58 58%,#0bad67 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),inset 0 -1px 0 rgba(0,100,58,.16),0 8px 18px rgba(1,154,86,.18)!important;
}
:root[data-theme="light"] .action-button:not(.primary),
:root[data-theme="light"] .notice-button,
:root[data-theme="light"] .month-input,
:root[data-theme="light"] .input-shell{
  background:linear-gradient(145deg,#fff 0%,#fbfdfc 72%,#f3f9f6 100%)!important;
  box-shadow:inset 0 1px 0 #fff,0 4px 12px rgba(30,82,56,.035)!important;
}
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .metric-card.balance,
:root[data-theme="light"] .panel{
  background:
    radial-gradient(circle at 12% 8%,rgba(255,255,255,.98),transparent 38%),
    linear-gradient(145deg,#fff 0%,#fafdfc 62%,#f2f8f6 100%)!important;
  box-shadow:inset 0 1px 0 #fff,0 1px 2px rgba(28,75,52,.018),0 7px 22px rgba(28,75,52,.04)!important;
}
@media (min-width:1181px){
  :root[data-theme="light"] .metric-icon,
  :root[data-theme="light"] .metric-card.balance .metric-icon,
  :root[data-theme="light"] .metric-card.income .metric-icon,
  :root[data-theme="light"] .metric-card.expense .metric-icon,
  :root[data-theme="light"] .metric-card.saving.is-negative .metric-icon,
  :root[data-theme="light"] .metric-card.saving:not(.is-negative) .metric-icon{
    border:1px solid rgba(0,151,86,.12)!important;
    background:linear-gradient(145deg,#59d7a1 0%,#27bf7e 46%,#019a59 100%)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.42),inset 0 -9px 18px rgba(0,117,69,.1),0 8px 20px rgba(1,154,86,.2)!important;
  }
}
:root[data-theme="light"] .metric-direction{
  background:linear-gradient(145deg,#eff9f4,#e1f3ea)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8)!important;
}
:root[data-theme="light"] .budget-ring{
  background:conic-gradient(from -90deg,#70d2ae 0 20%,#91dbc1 20% 40%,#5fcda1 40% 55%,#079f5c 55% 82%,#019858 82% 100%)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22),0 9px 24px rgba(1,154,86,.12)!important;
  filter:none!important;
}
:root[data-theme="light"] .budget-ring .inner{
  background:radial-gradient(circle at 42% 32%,#fff,#f9fcfb 72%,#f0f7f4)!important;
  box-shadow:inset 0 1px 0 #fff,0 2px 8px rgba(16,87,53,.06)!important;
}
:root[data-theme="light"] .score-ring{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18),0 6px 16px rgba(1,154,86,.07)!important;
}
:root[data-theme="light"] .score-ring .inner,
:root[data-theme="light"] .spending-donut>div{
  background:radial-gradient(circle at 42% 30%,#fff,#f9fcfb 76%,#f1f7f4)!important;
  box-shadow:inset 0 1px 0 #fff!important;
}
:root[data-theme="light"] .insight-item,
:root[data-theme="light"] .assistant-alert,
:root[data-theme="light"] .assistant-integration-cta{
  background:linear-gradient(145deg,#f8fcfa 0%,#eef7f3 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85),0 3px 10px rgba(29,76,53,.025)!important;
}
:root[data-theme="light"] .assistant-alert-actions button,
:root[data-theme="light"] .assistant-integration-cta a,
:root[data-theme="light"] .assistant-rail-form .copilot-compose{
  background:linear-gradient(145deg,#fff,#f7fbf9)!important;
  box-shadow:inset 0 1px 0 #fff,0 3px 9px rgba(29,76,53,.035)!important;
}
:root[data-theme="light"] .assistant-rail .ai-message.user{
  background:linear-gradient(135deg,#e9f5ef 0%,#e1f2e9 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65),0 4px 12px rgba(29,77,53,.045)!important;
}
:root[data-theme="light"] .assistant-rail .ai-message.assistant{
  background:linear-gradient(145deg,#fff,#f9fcfb)!important;
  box-shadow:inset 0 1px 0 #fff,0 4px 12px rgba(29,77,53,.035)!important;
}
:root[data-theme="light"] .theme-switch{
  background:linear-gradient(145deg,#f3f8f6,#eaf3ef)!important;
  box-shadow:inset 0 1px 2px rgba(25,72,49,.035)!important;
}
:root[data-theme="light"] .theme-switch button.active{
  background:linear-gradient(145deg,#fff,#fafdfb)!important;
  box-shadow:inset 0 1px 0 #fff,0 4px 12px rgba(25,72,49,.08)!important;
}

/* Flat reference finish: retain soft color texture, remove physical depth */
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .assistant-rail,
:root[data-theme="light"] .sidebar .nav button,
:root[data-theme="light"] .sidebar .profile-card,
:root[data-theme="light"] .sidebar .profile-logout,
:root[data-theme="light"] .sidebar-search,
:root[data-theme="light"] .sidebar-search kbd,
:root[data-theme="light"] .theme-switch,
:root[data-theme="light"] .theme-switch button,
:root[data-theme="light"] .month-input,
:root[data-theme="light"] .input-shell,
:root[data-theme="light"] .notice-button,
:root[data-theme="light"] .action-button,
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .metric-card.balance,
:root[data-theme="light"] .metric-icon,
:root[data-theme="light"] .metric-direction,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .period-select,
:root[data-theme="light"] .panel-menu,
:root[data-theme="light"] .budget-ring,
:root[data-theme="light"] .budget-ring .inner,
:root[data-theme="light"] .score-ring,
:root[data-theme="light"] .score-ring .inner,
:root[data-theme="light"] .spending-donut,
:root[data-theme="light"] .spending-donut>div,
:root[data-theme="light"] .insight-item,
:root[data-theme="light"] .tag,
:root[data-theme="light"] .assistant-alert,
:root[data-theme="light"] .assistant-alert-icon,
:root[data-theme="light"] .assistant-alert-actions button,
:root[data-theme="light"] .assistant-rail .ai-message,
:root[data-theme="light"] .assistant-integration-cta,
:root[data-theme="light"] .assistant-integration-cta a,
:root[data-theme="light"] .assistant-rail-form .copilot-compose,
:root[data-theme="light"] .assistant-send{
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
}
:root[data-theme="light"] .metric-card:hover,
:root[data-theme="light"] .metric-card.balance:hover,
:root[data-theme="light"] .panel:hover,
:root[data-theme="light"] .sidebar .nav button:hover,
:root[data-theme="light"] .action-button:hover,
:root[data-theme="light"] .insight-item:hover,
:root[data-theme="light"] .assistant-alert-actions button:hover,
:root[data-theme="light"] .assistant-integration-cta a:hover{
  box-shadow:none!important;
  transform:none!important;
}
@media (min-width:1181px){
  :root[data-theme="light"] .metric-icon,
  :root[data-theme="light"] .metric-card.balance .metric-icon,
  :root[data-theme="light"] .metric-card.income .metric-icon,
  :root[data-theme="light"] .metric-card.expense .metric-icon,
  :root[data-theme="light"] .metric-card.saving.is-negative .metric-icon,
  :root[data-theme="light"] .metric-card.saving:not(.is-negative) .metric-icon{
    box-shadow:none!important;
  }
}

/* Dark reference texture: flat black-teal surfaces with tonal separation */
:root[data-theme="dark"]{
  --ink:#f3f7f5;
  --text:#e9f1ed;
  --muted:#91a29b;
  --line:#1b2c31;
  --panel:#050f15;
  --green:#18df80;
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] .main{
  color:#e9f1ed;
  background:linear-gradient(145deg,#01070b 0%,#020b10 48%,#010a0f 100%)!important;
}
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .assistant-rail{
  border-color:#17282e!important;
  background:linear-gradient(180deg,#020a0e 0%,#030d13 52%,#020c12 100%)!important;
}
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-card.balance,
:root[data-theme="dark"] .panel{
  color:#e9f1ed!important;
  border-color:#1a2c31!important;
  background:linear-gradient(145deg,#061116 0%,#050f15 52%,#040e14 100%)!important;
}
:root[data-theme="dark"] .large-chart{
  background:linear-gradient(145deg,#061116,#040e14)!important;
}
:root[data-theme="dark"] .month-input,
:root[data-theme="dark"] .input-shell,
:root[data-theme="dark"] .notice-button,
:root[data-theme="dark"] .action-button:not(.primary),
:root[data-theme="dark"] .sidebar-search,
:root[data-theme="dark"] .period-select,
:root[data-theme="dark"] .panel-menu{
  color:#e8f0ec!important;
  border-color:#1b3036!important;
  background:linear-gradient(145deg,#07141a,#051118)!important;
}
:root[data-theme="dark"] .sidebar .nav button.active,
:root[data-theme="dark"] .action-button.primary{
  color:#fff!important;
  border-color:#0ba962!important;
  background:linear-gradient(110deg,#047b47 0%,#079c58 58%,#0bb369 100%)!important;
}
:root[data-theme="dark"] .sidebar .nav button:hover{
  color:#fff!important;
  border-color:#174b39!important;
  background:#07231b!important;
}
@media (min-width:1181px){
  :root[data-theme="dark"] .metric-icon,
  :root[data-theme="dark"] .metric-card.balance .metric-icon,
  :root[data-theme="dark"] .metric-card.income .metric-icon,
  :root[data-theme="dark"] .metric-card.expense .metric-icon,
  :root[data-theme="dark"] .metric-card.saving.is-negative .metric-icon,
  :root[data-theme="dark"] .metric-card.saving:not(.is-negative) .metric-icon{
    color:#effff7!important;
    border:1px solid #0ba75f!important;
    background:linear-gradient(145deg,#18b86e 0%,#078d50 56%,#045f39 100%)!important;
  }
}
:root[data-theme="dark"] .metric-direction{
  color:#70edac!important;
  border-color:#1c4437!important;
  background:linear-gradient(145deg,#0d2a22,#0a201a)!important;
}
:root[data-theme="dark"] .budget-ring{
  background:conic-gradient(from -90deg,#78e5b4 0 20%,#9af0c7 20% 39%,#48d994 39% 55%,#08a85f 55% 82%,#027b49 82% 100%)!important;
}
:root[data-theme="dark"] .budget-ring .inner,
:root[data-theme="dark"] .score-ring .inner,
:root[data-theme="dark"] .spending-donut>div{
  color:#f1f7f4!important;
  background:linear-gradient(145deg,#071218,#040e14)!important;
}
:root[data-theme="dark"] .score-ring{
  background:conic-gradient(#12d978 var(--score),#49645c var(--score),#172b2a 0)!important;
}
:root[data-theme="dark"] .grid-line{stroke:#26383d!important}
:root[data-theme="dark"] .insight-item{
  color:#e8f0ec!important;
  border-color:#1b3036!important;
  background:linear-gradient(145deg,#07151a,#051118)!important;
}
:root[data-theme="dark"] .transactions thead{background:#040e14!important}
:root[data-theme="dark"] .transactions td,
:root[data-theme="dark"] .transactions th{border-color:#192b30!important}
:root[data-theme="dark"] .tag{color:#6ce8a9!important;border-color:#20523f!important;background:#08271e!important}
:root[data-theme="dark"] .assistant-alert,
:root[data-theme="dark"] .assistant-integration-cta{
  border-color:#19332f!important;
  background:linear-gradient(145deg,#071216,#051115)!important;
}
:root[data-theme="dark"] .assistant-alert-actions button,
:root[data-theme="dark"] .assistant-integration-cta a,
:root[data-theme="dark"] .assistant-rail .ai-message.assistant,
:root[data-theme="dark"] .assistant-rail-form .copilot-compose{
  color:#e8f0ec!important;
  border-color:#1b3437!important;
  background:linear-gradient(145deg,#07141a,#051118)!important;
}
:root[data-theme="dark"] .assistant-rail .ai-message.user{
  color:#dcf4e8!important;
  border-color:#12533d!important;
  background:linear-gradient(135deg,#03251f,#02201c)!important;
}
:root[data-theme="dark"] .theme-switch{
  border-color:#1b3035!important;
  background:#061218!important;
}
:root[data-theme="dark"] .theme-switch button.active{
  color:#fff!important;
  background:#0c2921!important;
}
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .assistant-rail,
:root[data-theme="dark"] .sidebar .nav button,
:root[data-theme="dark"] .sidebar .profile-card,
:root[data-theme="dark"] .sidebar .profile-logout,
:root[data-theme="dark"] .sidebar-search,
:root[data-theme="dark"] .theme-switch,
:root[data-theme="dark"] .theme-switch button,
:root[data-theme="dark"] .month-input,
:root[data-theme="dark"] .input-shell,
:root[data-theme="dark"] .notice-button,
:root[data-theme="dark"] .action-button,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-card.balance,
:root[data-theme="dark"] .metric-icon,
:root[data-theme="dark"] .metric-direction,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .period-select,
:root[data-theme="dark"] .panel-menu,
:root[data-theme="dark"] .budget-ring,
:root[data-theme="dark"] .budget-ring .inner,
:root[data-theme="dark"] .score-ring,
:root[data-theme="dark"] .score-ring .inner,
:root[data-theme="dark"] .spending-donut,
:root[data-theme="dark"] .spending-donut>div,
:root[data-theme="dark"] .insight-item,
:root[data-theme="dark"] .tag,
:root[data-theme="dark"] .assistant-alert,
:root[data-theme="dark"] .assistant-alert-icon,
:root[data-theme="dark"] .assistant-alert-actions button,
:root[data-theme="dark"] .assistant-rail .ai-message,
:root[data-theme="dark"] .assistant-integration-cta,
:root[data-theme="dark"] .assistant-integration-cta a,
:root[data-theme="dark"] .assistant-rail-form .copilot-compose,
:root[data-theme="dark"] .assistant-send{
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
}
:root[data-theme="dark"] .metric-card:hover,
:root[data-theme="dark"] .metric-card.balance:hover,
:root[data-theme="dark"] .panel:hover,
:root[data-theme="dark"] .sidebar .nav button:hover,
:root[data-theme="dark"] .action-button:hover,
:root[data-theme="dark"] .insight-item:hover{
  box-shadow:none!important;
  transform:none!important;
}

/* Measured light-surface correction from deployed vs. reference screenshots */
:root[data-theme="light"] body,
:root[data-theme="light"] .main{
  background:#f7fbfa!important;
}
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .assistant-rail{
  background:#fcfdfd!important;
}
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .metric-card.balance,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .large-chart,
:root[data-theme="light"] .transactions thead{
  background:#fefefe!important;
}
:root[data-theme="light"] .month-input,
:root[data-theme="light"] .input-shell,
:root[data-theme="light"] .notice-button,
:root[data-theme="light"] .action-button:not(.primary),
:root[data-theme="light"] .assistant-alert-actions button,
:root[data-theme="light"] .assistant-integration-cta a,
:root[data-theme="light"] .assistant-rail-form .copilot-compose{
  background:#fff!important;
}
:root[data-theme="light"] .insight-item{
  background:#fbfdfc!important;
}
:root[data-theme="light"] .assistant-alert,
:root[data-theme="light"] .assistant-integration-cta{
  background:#eff7f3!important;
}
:root[data-theme="light"] .assistant-rail .ai-message.user{
  background:#e7f4ee!important;
}
:root[data-theme="light"] .assistant-rail .ai-message.assistant{
  background:#fff!important;
}
:root[data-theme="light"] .budget-ring .inner,
:root[data-theme="light"] .score-ring .inner,
:root[data-theme="light"] .spending-donut>div{
  background:#fefefe!important;
}

/* Final component-level audit corrections */
@media (min-width:1181px){
  .topbar{min-height:90px!important}
  :root[data-theme="light"] .metric-card.saving .metric-icon,
  :root[data-theme="light"] .metric-card.saving.is-negative .metric-icon,
  :root[data-theme="light"] .metric-card.saving:not(.is-negative) .metric-icon{
    color:#078a4c!important;
    border-color:#d9eee3!important;
    background:#e5f4ea!important;
  }
  :root[data-theme="dark"] .metric-card.saving .metric-icon,
  :root[data-theme="dark"] .metric-card.saving.is-negative .metric-icon,
  :root[data-theme="dark"] .metric-card.saving:not(.is-negative) .metric-icon{
    color:#75efad!important;
    border-color:#174d39!important;
    background:#0e3528!important;
  }
}
.sparkline polyline{stroke-width:1.8!important}
.chart-line{stroke-width:2.3!important}
.chart-point{stroke-width:2!important}
:root[data-theme="light"] .grid-line{
  stroke:#dce9e3!important;
  stroke-dasharray:3 4!important;
}
:root[data-theme="dark"] .grid-line{
  stroke:#26383d!important;
  stroke-dasharray:3 4!important;
}
:root[data-theme="light"] .budget-ring{
  background:conic-gradient(from -90deg,#91dfbe 0%,#019a56 var(--budget),#e1eee8 var(--budget) 100%)!important;
}
:root[data-theme="dark"] .budget-ring{
  background:conic-gradient(from -90deg,#9af0c7 0%,#079e59 var(--budget),#18352c var(--budget) 100%)!important;
}

/* Dark live audit: remove the remaining legacy blue, red and light surfaces */
:root[data-theme="dark"] .metric-card h2,
:root[data-theme="dark"] .metric-card.balance h2,
:root[data-theme="dark"] .metric-card.expense h2,
:root[data-theme="dark"] .metric-card.saving h2,
:root[data-theme="dark"] .metric-card.is-negative h2{
  color:#f3f7f5!important;
}
:root[data-theme="dark"] .chart-area-income{
  fill:rgba(19,213,119,.09)!important;
}
:root[data-theme="dark"] .chart-area-expense{
  fill:rgba(109,235,176,.045)!important;
}
:root[data-theme="dark"] .chart-line.income{stroke:#16d779!important}
:root[data-theme="dark"] .chart-line.expense{stroke:#8cefc0!important}
:root[data-theme="dark"] .chart-line.saving{stroke:#58dfaa!important}
:root[data-theme="dark"] .sidebar .brand span{
  color:#25e486!important;
}
:root[data-theme="dark"] .sidebar .brand-logo-dark,
:root[data-theme="dark"] .copilot-logo img,
:root[data-theme="dark"] .mobile-copilot-button img,
:root[data-theme="dark"] .mobile-composer-bot img{
  filter:hue-rotate(-68deg) saturate(1.45) brightness(1.14)!important;
}
:root[data-theme="dark"] .insight-item>i,
:root[data-theme="dark"] .status-dot{
  background:color-mix(in srgb,var(--tone) 16%,#07141a)!important;
  border-color:color-mix(in srgb,var(--tone) 28%,#162a2e)!important;
}
:root[data-theme="dark"] .assistant-rail,
:root[data-theme="dark"] .assistant-rail-header,
:root[data-theme="dark"] .assistant-rail-chat{
  background:#020c12!important;
}
:root[data-theme="dark"] .assistant-rail-header{
  border-bottom-color:#17282e!important;
}
:root[data-theme="dark"] .legend,
:root[data-theme="dark"] .chart-x-axis,
:root[data-theme="dark"] .chart-y-axis{
  color:#9baca5!important;
}

:root[data-theme="dark"] .plain-row {
  background: #091724!important;
  border-color: #1e3248!important;
  color: #e4edf8!important;
}

:root[data-theme="dark"] .plain-row b {
  color: #f0f6ff!important;
}

:root[data-theme="dark"] .plain-row small {
  color: #8da1c2!important;
}

:root[data-theme="dark"] .plain-row .amount {
  color: #ff6b6e!important;
}

:root[data-theme="dark"] .manage-card {
  background: #091724!important;
  border-color: #1e3248!important;
  color: #e4edf8!important;
}

:root[data-theme="dark"] .manage-card b {
  color: #f0f6ff!important;
}

:root[data-theme="dark"] .manage-card small {
  color: #8da1c2!important;
}

:root[data-theme="dark"] .tx-modal-search,
:root[data-theme="dark"] .tx-modal-select {
  background: #0d1e30!important;
  border-color: #1e354e!important;
  color: #cbd5e6!important;
}

:root[data-theme="dark"] .tx-modal-search input {
  color: #f0f6ff!important;
}

:root[data-theme="dark"] .tx-modal-search input::placeholder {
  color: #7b8fae!important;
}

:root[data-theme="dark"] .tx-modal-select option {
  background: #0d1e30!important;
  color: #f0f6ff!important;
}

:root[data-theme="dark"] .data-action-card {
  background: #091724!important;
  border-color: #1e3248!important;
  color: #e4edf8!important;
}

:root[data-theme="dark"] .data-action-card h3 {
  color: #f0f6ff!important;
}

:root[data-theme="dark"] .data-action-card p {
  color: #8da1c2!important;
}

:root[data-theme="dark"] .data-action-card.danger-soft {
  background: #170f1a!important;
  border-color: #3b1c28!important;
}

:root[data-theme="dark"] .data-action-card > i {
  background: #162438!important;
  color: #58a6ff!important;
}

:root[data-theme="dark"] .data-action-card.danger-soft > i {
  background: #2d141e!important;
  color: #ff6b6e!important;
}

:root[data-theme="dark"] .data-action-buttons a.action-button {
  background: #122820!important;
  border-color: #1b4d3a!important;
  color: #38d996!important;
}

:root[data-theme="dark"] .data-action-buttons a.action-button:hover {
  background: #1b4d3a!important;
  color: #ffffff!important;
}

/* Boot screen dark theme polish */
:root[data-theme="dark"] .boot-screen {
  background: radial-gradient(circle at 50% 42%, rgba(16, 185, 129, .15), transparent 32rem), linear-gradient(145deg, #070f1a, #0b1728 58%, #081424)!important;
}

:root[data-theme="dark"] .boot-panel {
  background: rgba(11, 23, 40, .96)!important;
  border-color: #1e324a!important;
  color: #e4edf8!important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6), inset 0 1px rgba(255, 255, 255, .06)!important;
}

:root[data-theme="dark"] .boot-logo {
  background: #091726!important;
  border-color: #1e3654!important;
  box-shadow: 0 17px 38px rgba(0, 0, 0, .4), 0 0 0 8px rgba(11, 23, 40, .96)!important;
}

:root[data-theme="dark"] .boot-eyebrow {
  background: rgba(37, 99, 255, .15)!important;
  border: 1px solid rgba(59, 130, 246, .3)!important;
  color: #60a5fa!important;
}

:root[data-theme="dark"] .boot-live {
  background: rgba(16, 185, 129, .15)!important;
  border-color: rgba(16, 185, 129, .3)!important;
  color: #34d399!important;
}

:root[data-theme="dark"] .boot-copy p {
  color: #94a3b8!important;
}

:root[data-theme="dark"] .boot-steps > span {
  background: rgba(15, 29, 48, .9)!important;
  border-color: #1e324a!important;
  color: #94a3b8!important;
}

:root[data-theme="dark"] .boot-steps > span > i {
  border-color: #2a4365!important;
}

:root[data-theme="dark"] .boot-steps .is-complete {
  background: rgba(16, 185, 129, .15)!important;
  border-color: rgba(16, 185, 129, .35)!important;
  color: #34d399!important;
}

:root[data-theme="dark"] .boot-steps .is-complete i {
  background: #10b981!important;
  border-color: #10b981!important;
  color: #ffffff!important;
}

:root[data-theme="dark"] .boot-steps .is-active {
  background: rgba(37, 99, 255, .18)!important;
  border-color: rgba(59, 130, 246, .4)!important;
  color: #60a5fa!important;
}

:root[data-theme="dark"] .boot-steps .is-active i {
  background: #3b82f6!important;
  border-color: #1d4ed8!important;
}

:root[data-theme="dark"] .boot-progress {
  background: #16263b!important;
}

:root[data-theme="dark"] .boot-status {
  color: #94a3b8!important;
}

:root[data-theme="dark"] .boot-status span:first-child {
  color: #34d399!important;
}

:root[data-theme="dark"] .boot-privacy {
  color: #64748b!important;
}
