:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #eef3ff;
  --text: #071633;
  --muted: #63708a;
  --line: #dce3f0;
  --blue: #2458ff;
  --blue-dark: #1436a6;
  --green: #13a05f;
  --orange: #ff8a35;
  --indigo: #6d5dfc;
  --red: #dc2430;
  --shadow: 0 18px 50px rgba(19, 35, 71, 0.1);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(36, 88, 255, 0.08), transparent 34rem),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 38%, #edf2fb 100%);
}

body.auth-required .app-shell {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 24px;
  width: min(1760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.sidebar,
.mobile-preview,
.panel,
.stat-card,
.phone,
.modal form {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 227, 240, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  border-radius: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: linear-gradient(135deg, #061331, var(--blue));
  box-shadow: 0 10px 24px rgba(36, 88, 255, 0.28);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item,
.download-button,
.outline-button,
.soft-button,
.primary-button,
.profile-button,
.icon-button,
.segmented button,
.billing-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  min-height: 38px;
  white-space: nowrap;
}

.nav-item {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  padding: 0 12px;
  color: #243250;
  background: transparent;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  color: var(--blue);
  background: #eef3ff;
}

.nav-badge {
  margin-left: auto;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: #dce6ff;
  font-size: 12px;
}

.invite-panel {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f3f7ff, #edf2ff);
}

.invite-panel p {
  margin: 0 0 10px;
  font-weight: 750;
}

.avatar-stack {
  display: flex;
  margin-bottom: 12px;
}

.avatar-stack span {
  display: grid;
  width: 28px;
  height: 28px;
  margin-right: -8px;
  place-items: center;
  border: 2px solid white;
  border-radius: 999px;
  color: white;
  background: var(--blue);
  font-size: 12px;
}

.download-button {
  justify-content: flex-start;
  margin-top: 12px;
  padding: 0 12px;
  color: var(--blue);
  background: #f8faff;
  border: 1px solid var(--line);
  font-weight: 750;
}

.main-area {
  min-width: 0;
}

.topbar,
.panel-header,
.table-header,
.topbar-actions,
.table-actions {
  display: flex;
  align-items: center;
}

.topbar,
.panel-header {
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.menu-toggle,
.sidebar-backdrop {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.topbar-actions {
  gap: 10px;
}

.outline-button,
.soft-button,
.primary-button {
  padding: 0 14px;
  font-weight: 800;
}

.outline-button {
  color: var(--blue);
  background: white;
  border: 1px solid #cad7ff;
}

.soft-button {
  color: var(--blue);
  background: #eef3ff;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--blue), #523dff);
}

.full {
  width: 100%;
}

.profile-button {
  padding: 4px 10px 4px 4px;
  background: white;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 750;
}

.profile-photo {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #ac5d20, #f0b078);
  font-size: 11px;
}

.icon-button {
  width: 38px;
  padding: 0;
  color: #1c2a4a;
  background: white;
  border: 1px solid var(--line);
}

.alert-dot {
  position: relative;
}

.alert-dot::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--red);
}

.icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

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

.stat-card,
.panel {
  border-radius: var(--radius);
}

.stat-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  min-height: 116px;
  padding: 18px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: #cad7ff;
  box-shadow: 0 18px 56px rgba(36, 88, 255, 0.16);
  transform: translateY(-2px);
  outline: 0;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.stat-card strong {
  grid-column: 2;
  font-size: 26px;
  line-height: 1;
}

.stat-icon {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: span 3;
  place-items: center;
  border-radius: 12px;
}

.stat-icon.green {
  color: var(--green);
  background: #e7f8ef;
}

.stat-icon.blue {
  color: var(--blue);
  background: #edf3ff;
}

.stat-icon.indigo {
  color: var(--indigo);
  background: #f0edff;
}

.stat-icon.orange {
  color: var(--orange);
  background: #fff2e9;
}

.trend {
  grid-column: 2;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.trend::before {
  content: "▲ ";
  font-size: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr) minmax(220px, 0.7fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.control,
.search-box input,
.form-grid input,
.form-grid select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: white;
}

.control {
  padding: 0 10px;
}

.chart-wrap {
  height: 250px;
  margin-top: 12px;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.donut-layout {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 250px;
}

.donut {
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--blue) 0 49%, var(--green) 49% 82%, var(--orange) 82% 100%);
}

.donut::before {
  content: "";
  position: absolute;
}

.donut span {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 999px;
  text-align: center;
  background: white;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.donut strong {
  color: var(--text);
  font-size: 15px;
}

.legend {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.legend strong {
  color: var(--text);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.blue-dot {
  background: var(--blue);
}

.green-dot {
  background: var(--green);
}

.orange-dot {
  background: var(--orange);
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.mini-calendar span,
.mini-calendar button {
  display: grid;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  font-weight: 750;
}

.mini-calendar button {
  border: 0;
  color: var(--muted);
  background: transparent;
}

.mini-calendar button:hover,
.mini-calendar button:focus-visible {
  color: var(--blue);
  background: #eef3ff;
  outline: 0;
}

.mini-calendar .day-name {
  color: #9aa5ba;
  font-size: 11px;
}

.mini-calendar .due,
.mini-calendar button.due {
  color: white;
  background: var(--blue);
}

.mini-calendar .bill,
.mini-calendar button.bill {
  color: white;
  background: var(--orange);
}

.mini-calendar .emi,
.mini-calendar button.emi {
  color: white;
  background: var(--green);
}

.table-panel {
  margin-bottom: 14px;
}

.table-header {
  align-items: flex-start;
}

.table-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.segmented,
.billing-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fd;
}

.segmented button,
.billing-toggle button {
  min-height: 30px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.segmented button.active,
.billing-toggle button.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 5px 12px rgba(35, 54, 103, 0.08);
}

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
}

.search-box input {
  min-height: auto;
  width: 100%;
  border: 0;
  outline: 0;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

td {
  color: #263553;
  font-weight: 650;
}

.merchant-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.merchant-logo,
.bank-logo {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  color: white;
  font-weight: 900;
}

.netflix {
  background: #e50914;
}

.spotify {
  background: #1db954;
}

.prime {
  background: #1b75d0;
}

.fiber {
  background: #3154d4;
}

.device {
  background: #0d6b61;
}

.car {
  background: #687386;
}

.shield {
  background: #2e72de;
}

.credit {
  background: #ff9f1c;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: capitalize;
}

.tag.subscription {
  color: var(--blue);
  background: #edf3ff;
}

.tag.emi {
  color: var(--green);
  background: #e8f8ef;
}

.tag.bill {
  color: #bd5b00;
  background: #fff2df;
}

.tag.active {
  color: var(--green);
  background: #e7f8ef;
}

.tag.paused {
  color: #bd5b00;
  background: #fff2df;
}

.tag.cancelled {
  color: #6c7284;
  background: #edf1f7;
}

.tag.closed {
  color: #6c7284;
  background: #edf1f7;
}

.tag.upcoming {
  color: var(--blue);
  background: #eef3ff;
}

.tag.overdue {
  color: var(--red);
  background: #fff0f1;
}

.tag.paid {
  color: var(--green);
  background: #e7f8ef;
}

.tag.skipped {
  color: #6c7284;
  background: #edf1f7;
}

.tag.open {
  color: var(--blue);
  background: #eef3ff;
}

.tag.saved {
  color: #7b4ee8;
  background: #f0edff;
}

.tag.applied {
  color: var(--green);
  background: #e7f8ef;
}

.tag.dismissed {
  color: #6c7284;
  background: #edf1f7;
}

.status {
  color: var(--green);
}

.status.upcoming {
  color: #bd5b00;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.pill.success {
  color: var(--green);
  background: #e7f8ef;
}

.pill.info {
  color: var(--blue);
  background: #eef3ff;
}

.bank-list,
.recommendation {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.bank-list > div,
.recommendation {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
}

.bank-list small,
.recommendation p,
.phone-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.bank-list .pill {
  margin-left: auto;
}

.red {
  background: #e23b3b;
}

.orange {
  background: #f58220;
}

.recommendation {
  grid-template-columns: auto 1fr auto;
}

.pricing-panel {
  display: grid;
  align-content: center;
  gap: 16px;
}

.billing-toggle {
  justify-self: center;
}

.plan-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.plan {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.plan span {
  color: var(--muted);
  font-weight: 850;
}

.plan strong {
  font-size: 26px;
}

.plan small {
  color: var(--muted);
}

.plan.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 88, 255, 0.1);
}

.mobile-preview {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 246, 255, 0.9));
}

.phone {
  position: relative;
  width: 260px;
  min-height: 620px;
  overflow: hidden;
  padding: 16px;
  border-radius: 28px;
}

.phone-status,
.phone-head,
.phone-card-head,
.phone-payment,
.phone-nav {
  display: flex;
  align-items: center;
}

.phone-status,
.phone-card-head {
  justify-content: space-between;
}

.phone-status {
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 800;
}

.phone-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.phone-head p {
  margin: 0 0 2px;
  font-weight: 850;
}

.phone-head h2 {
  color: var(--muted);
  font-size: 11px;
}

.phone-hero {
  padding: 18px;
  border-radius: 12px;
  color: white;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 40%),
    linear-gradient(135deg, #0b1c58, #2458ff);
}

.phone-hero span,
.phone-hero small {
  display: block;
  opacity: 0.78;
  font-size: 12px;
}

.phone-hero strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
}

.phone-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.phone-stats div,
.phone-card {
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: white;
}

.phone-stats div {
  padding: 12px;
}

.phone-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.phone-card {
  margin-top: 10px;
  padding: 12px;
}

.phone-card-head {
  margin-bottom: 10px;
  font-size: 12px;
}

.phone-card-head span {
  color: var(--blue);
  font-size: 11px;
}

.phone-payment {
  gap: 9px;
  padding: 8px 0;
}

.phone-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  justify-content: space-around;
  min-height: 64px;
  padding: 8px 12px;
  background: white;
  border-top: 1px solid var(--line);
}

.phone-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 800;
}

.phone-nav button.active {
  color: var(--blue);
}

.phone-nav .phone-add {
  width: 42px;
  height: 42px;
  margin-top: -24px;
  border-radius: 999px;
  color: white;
  background: var(--blue);
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.55fr) minmax(180px, 0.55fr);
  gap: 14px;
  margin-bottom: 14px;
}

.page-hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 156px;
  background:
    linear-gradient(135deg, rgba(36, 88, 255, 0.1), transparent 46%),
    rgba(255, 255, 255, 0.92);
}

.page-copy {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.metric-panel {
  display: grid;
  align-content: center;
  gap: 8px;
}

.metric-panel span {
  color: var(--muted);
  font-weight: 850;
}

.metric-panel strong {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.metric-panel small {
  color: var(--muted);
}

.management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 14px;
}

.wide-panel {
  min-width: 0;
}

.card-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.subscription-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

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

.payment-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.6fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: #fff;
}

.subscription-card {
  grid-template-columns: minmax(220px, 1.2fr) minmax(145px, 0.52fr) minmax(110px, 0.38fr) auto;
}

.emi-card {
  grid-template-columns: minmax(220px, 1.1fr) minmax(145px, 0.48fr) minmax(170px, 0.6fr) auto;
}

.bill-card {
  grid-template-columns: minmax(220px, 1.15fr) minmax(145px, 0.5fr) minmax(130px, 0.45fr) auto;
}

.subscription-card.is-inactive,
.emi-card.is-inactive,
.bill-card.is-inactive {
  opacity: 0.72;
  background: #fbfcff;
}

.payment-card small,
.payment-card-meta small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.payment-card-meta span {
  font-size: 17px;
  font-weight: 900;
}

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

.payment-card-actions button:disabled,
.subscription-choice-list button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.subscription-status {
  display: grid;
  gap: 5px;
}

.subscription-status small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.emi-progress {
  display: grid;
  gap: 7px;
}

.emi-progress > div {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #edf1f7;
}

.emi-progress > div span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.emi-progress small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.action-panel {
  align-self: start;
}

.action-row {
  display: grid;
  width: 100%;
  gap: 4px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  text-align: left;
}

.action-row:hover {
  border-color: #cad7ff;
  background: #f7f9ff;
}

.action-row span {
  color: var(--muted);
  font-size: 12px;
}

.calculator-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.calculator-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.calculator-panel input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.calculator-panel select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
}

.sim-result {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
}

.sim-result span {
  color: var(--muted);
}

.calendar-management {
  align-items: start;
}

.full-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.calendar-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.calendar-day,
.empty-day {
  min-height: 94px;
  padding: 9px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: white;
  text-align: left;
}

.empty-day {
  background: #f8faff;
  cursor: default;
}

.calendar-day:hover,
.calendar-day.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 88, 255, 0.08);
}

.calendar-day.today {
  border-color: var(--green);
}

.calendar-day strong {
  display: block;
  margin-bottom: 8px;
}

.calendar-day span {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  padding: 4px 6px;
  border-radius: 999px;
  color: var(--blue);
  background: #eef3ff;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day span.emi {
  color: var(--green);
  background: #e7f8ef;
}

.calendar-day span.bill {
  color: #bd5b00;
  background: #fff2df;
}

.calendar-day em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

[data-calendar-nav="prev"] .icon {
  transform: rotate(90deg);
}

.calendar-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.calendar-summary div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: #f8faff;
}

.calendar-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.calendar-summary strong {
  font-size: 16px;
}

.timeline-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: white;
}

.timeline-item small,
.empty-state {
  color: var(--muted);
}

.calendar-event-item {
  align-items: flex-start;
}

.calendar-event-item > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.calendar-event-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.calendar-event-actions .soft-button,
.calendar-event-actions .outline-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

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

.insight-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.insight-card.is-inactive {
  opacity: 0.72;
}

.insight-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.insight-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.score-ring {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--green) var(--score), #edf1f7 0);
}

.score-ring span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 999px;
  background: white;
  color: var(--green);
  font-weight: 900;
}

.insight-impact {
  grid-template-columns: 1fr 1fr;
}

.insight-actions {
  justify-content: flex-start;
}

.insight-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.alert-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.alert-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: white;
}

.alert-card.read {
  opacity: 0.62;
}

.alert-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.settings-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.settings-form input {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(135deg, #071633 0%, #173a89 55%, #2458ff 100%);
}

body.auth-required .auth-gate {
  display: grid;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1fr);
  gap: 12px;
  width: min(920px, 100%);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(7, 22, 51, 0.32);
}

.auth-panel {
  display: grid;
  align-content: space-between;
  min-height: 560px;
  padding: 26px;
  border-radius: 12px;
  color: white;
  background:
    linear-gradient(180deg, rgba(7, 22, 51, 0.26), rgba(7, 22, 51, 0.72)),
    linear-gradient(135deg, var(--blue), #071633);
}

.auth-panel .eyebrow {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.74);
}

.auth-panel h1 {
  max-width: 10ch;
  margin: 10px 0 14px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.96;
}

.auth-panel p {
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.auth-benefits {
  display: grid;
  gap: 10px;
}

.auth-benefits span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.auth-benefits svg {
  stroke: currentColor;
}

.auth-form {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 26px;
}

.auth-form h2 {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.1;
}

.auth-copy,
.auth-hint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf3ff;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.auth-tabs button.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 8px 20px rgba(36, 88, 255, 0.12);
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.auth-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.password-field input {
  border: 0;
  background: transparent;
}

.password-field button {
  min-height: 34px;
  margin-right: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--blue);
  background: #eef3ff;
  font-weight: 850;
}

.auth-check {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px !important;
  line-height: 1.45;
}

.auth-check input {
  width: 17px;
  min-height: 17px;
  margin: 2px 0 0;
}

.auth-gate[data-mode="login"] .auth-register-only {
  display: none;
}

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

.toggle-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.toggle-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: white;
}

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

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle-row i {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 44px;
  border-radius: 999px;
  background: #cfd8ea;
}

.toggle-row i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 8px rgba(15, 26, 49, 0.18);
  transition: transform 0.18s ease;
}

.toggle-row input:checked + i {
  background: var(--blue);
}

.toggle-row input:checked + i::after {
  transform: translateX(20px);
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(36, 88, 255, 0.18);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  font-weight: 750;
}

.modal {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(7, 22, 51, 0.32);
}

.modal form {
  padding: 18px;
  border-radius: 14px;
}

.action-modal-body {
  display: grid;
  gap: 14px;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-table {
  margin-top: 0;
}

.modal-table table {
  min-width: 520px;
}

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

.detail-grid > div,
.referral-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: #f8faff;
}

.detail-grid span,
.referral-box small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid strong,
.referral-box strong {
  color: var(--text);
  font-size: 14px;
}

.referral-box strong {
  font-size: 18px;
  letter-spacing: 0;
}

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

.subscription-choice-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  text-align: left;
}

.subscription-choice-list button:hover:not(:disabled) {
  border-color: #cad7ff;
  background: #f7f9ff;
}

.subscription-choice-list span {
  color: var(--muted);
  font-size: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.form-grid input,
.form-grid select {
  width: 100%;
  padding: 0 10px;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .mobile-preview {
    display: none;
  }
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(300px, calc(100vw - 52px));
    height: 100dvh;
    border-radius: 0 18px 18px 0;
    transform: translateX(-106%);
    transition: transform 0.22s ease;
  }

  .brand {
    margin: 0 0 24px;
  }

  .nav-list {
    display: grid;
    min-width: 0;
  }

  .nav-item {
    width: 100%;
  }

  .invite-panel,
  .download-button {
    display: block;
  }

  .download-button {
    display: inline-flex;
  }

  .menu-toggle {
    display: inline-flex;
    flex: 0 0 42px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    border: 0;
    background: rgba(7, 22, 51, 0.42);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid,
  .lower-grid,
  .workspace-grid,
  .management-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .auth-card {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
  }

  .auth-panel {
    min-height: auto;
    align-content: start;
  }

  .auth-panel h1 {
    max-width: 14ch;
    font-size: 34px;
  }

  .auth-benefits {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar,
  .table-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
  }

  .topbar-actions {
    grid-column: 1 / -1;
  }

  .topbar-actions,
  .table-actions {
    justify-content: flex-start;
  }

  .profile-button span:not(.profile-photo):not(.icon) {
    display: none;
  }

  .quick-stats,
  .plan-row,
  .form-grid,
  .detail-grid,
  .card-list.compact,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .page-hero-panel,
  .payment-card,
  .subscription-card,
  .emi-card,
  .bill-card,
  .alert-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .page-hero-panel {
    flex-direction: column;
  }

  .payment-card-actions {
    justify-content: flex-start;
  }

  .full-calendar {
    gap: 5px;
  }

  .calendar-day,
  .empty-day {
    min-height: 72px;
    padding: 6px;
  }

  .calendar-day span {
    display: none;
  }

  .calendar-summary,
  .calendar-event-item {
    grid-template-columns: 1fr;
  }

  .calendar-event-item {
    display: grid;
  }

  .calendar-event-actions {
    justify-content: flex-start;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: auto;
  }

  .search-box {
    width: 100%;
  }

  .auth-gate {
    padding: 12px;
  }

  .auth-card {
    padding: 8px;
  }

  .auth-panel,
  .auth-form {
    padding: 18px;
  }

  .auth-name-row {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }
}
