:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #091427;
  --muted: #55637b;
  --accent: #2563eb;
  --accent-2: #0f766e;
  --accent-3: #2563eb;
  --border: rgba(15, 23, 42, 0.1);
  --border-soft: rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px rgba(8, 20, 48, 0.08);
  --shadow-soft: 0 6px 18px rgba(8, 20, 48, 0.06);
  --radius: 14px;
  --font: "Plus Jakarta Sans", "Sora", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.55) rgba(15, 23, 42, 0.08);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.1));
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.8), rgba(59, 130, 246, 0.9));
  border-radius: 999px;
  border: 2px solid rgba(248, 251, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.9), rgba(37, 99, 235, 0.95));
}

*::-webkit-scrollbar-corner {
  background: rgba(15, 23, 42, 0.06);
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fbff 0%, #eef3fa 100%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 70% 80%, rgba(37, 99, 235, 0.08), transparent 50%);
  z-index: -1;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.app-shell.is-monthly-focused {
  grid-template-columns: 220px 1fr;
}

.app-shell.is-monthly-focused .right-panel {
  display: none;
}

.app-shell.is-profile-focused {
  grid-template-columns: 220px 1fr;
}

.app-shell.is-profile-focused .right-panel {
  display: none;
}

.sidebar {
  background: linear-gradient(160deg, #0b1220 0%, #111c33 50%, #1f2a44 100%);
  color: #f8fafc;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 14px 0 34px rgba(15, 23, 42, 0.18);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, 0.7) rgba(248, 251, 255, 0.08);
}

.sidebar::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.08), rgba(248, 251, 255, 0.14));
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.92), rgba(56, 189, 248, 0.92));
  border: 2px solid rgba(11, 18, 32, 0.85);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.98), rgba(14, 165, 233, 0.98));
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand-sub {
  font-size: 12px;
  color: #c8c7c2;
}

.sidebar-profile-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(248, 251, 255, 0.1);
  border-radius: 14px;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sidebar-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}

.sidebar-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(120deg, #3b82f6, #0ea5a4);
  color: #fff;
  font-weight: 700;
}

.sidebar-profile-info {
  min-width: 0;
}

.sidebar-profile-info strong {
  display: block;
  font-size: 12px;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-info span {
  display: block;
  font-size: 11px;
  color: #d2dbe8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-section {
  margin-top: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c8c7c2;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  padding: 9px 10px;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-item:hover {
  border-color: rgba(248, 246, 241, 0.25);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-item.is-active {
  background: rgba(37, 99, 235, 0.24);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-foot {
  margin-top: auto;
}

.note {
  background: rgba(248, 246, 241, 0.08);
  padding: 12px;
  border-radius: 12px;
  font-size: 12px;
  color: #d2d0ca;
}

.main {
  padding: 16px 18px 22px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#btn-logout {
  display: none;
}

#btn-logout.is-visible {
  display: inline-flex;
}

.is-hidden {
  display: none !important;
}

.filters label {
  font-size: 12px;
  display: grid;
  gap: 6px;
  color: #334155;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input,
select,
textarea {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.content-section {
  display: none;
  margin-top: 12px;
  gap: 12px;
  --section-accent-rgb: 37, 99, 235;
  --section-accent-soft: rgba(37, 99, 235, 0.12);
}

.content-section.is-active {
  display: grid;
  animation: none;
}

.content-section.is-active .panel {
  border-color: var(--border-soft);
  box-shadow: var(--shadow);
}

.content-section.is-active .panel h3 {
  color: var(--ink);
}

.content-section.is-active .table-wrap {
  border-color: rgba(var(--section-accent-rgb), 0.22);
}

.content-section.is-active .btn-outline {
  border-color: rgba(15, 23, 42, 0.16);
  background: #ffffff;
}

.content-section.is-active .btn-outline:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.content-section.is-active > .panel,
.content-section.is-active > .cards,
.content-section.is-active > .grid-2,
.content-section.is-active > .excel-summary-row,
.content-section.is-active > .excel-metric-grid,
.content-section.is-active > .excel-top-grid,
.content-section.is-active > .annual-kpi-grid,
.content-section.is-active > .annual-top-grid {
  animation: none;
}

#dashboard-bulanan.content-section {
  gap: 10px;
}

#dashboard-bulanan .panel {
  padding: 12px;
}

#dashboard-bulanan .panel h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

#dashboard-bulanan .muted {
  font-size: 11px;
}

.content-section.is-subview [data-view] {
  display: none;
}

.content-section.is-subview [data-view].is-active-view {
  display: block;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.card-label {
  color: var(--muted);
  font-size: 13px;
}

.card-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.panel h3 {
  margin-top: 0;
}

.excel-monthly-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(140deg, #f8fcff 0%, #f4f8fb 70%, #eef7fa 100%);
  border: 1px solid #cfdde6;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  padding: 12px 14px;
}

.excel-monthly-hero h3 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.excel-month-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.excel-month-pill {
  min-width: 124px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #6bb6c2;
  background: linear-gradient(180deg, #effafc 0%, #e4f5f7 100%);
  text-align: center;
}

.excel-month-pill span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.excel-month-pill strong {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  color: #0f6c74;
}

.excel-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.excel-summary-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
  border: 1px solid #d0dee7;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
}

.excel-summary-card .card-value {
  font-size: clamp(16px, 1.35vw, 24px);
  margin: 2px 0 3px;
  line-height: 1.1;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.excel-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.excel-metric-card {
  border: 1px solid #cfdbe4;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  min-height: 210px;
  display: flex;
  flex-direction: column;
}

.excel-metric-card[data-metric-card="income"] {
  border-top: 4px solid #3fb375;
}

.excel-metric-card[data-metric-card="expense"] {
  border-top: 4px solid #db3434;
}

.excel-metric-card[data-metric-card="savings"] {
  border-top: 4px solid #48b985;
}

.excel-metric-card[data-metric-card="investment"] {
  border-top: 4px solid #49aeb8;
}

.excel-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.excel-metric-head h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.1;
}

.excel-metric-month {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  line-height: 1.2;
}

.excel-metric-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.excel-metric-main > div {
  min-width: 0;
}

.excel-metric-caption {
  font-size: 10px;
  color: var(--muted);
}

.excel-metric-actual {
  margin-top: 1px;
  font-size: clamp(16px, 1.55vw, 24px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.excel-metric-card[data-metric-card="investment"] .excel-metric-actual {
  font-size: clamp(14px, 1.25vw, 21px);
}

.number-fit {
  display: block;
  width: 100%;
  min-width: 0;
}

.number-fit.is-long {
  font-size: clamp(14px, 1.25vw, 20px) !important;
}

.number-fit.is-xlong {
  font-size: clamp(12px, 1vw, 17px) !important;
}

.number-fit.is-xxlong {
  font-size: clamp(11px, 0.9vw, 15px) !important;
}

.excel-metric-delta {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  white-space: nowrap;
}

.excel-metric-delta.is-good {
  color: #0f7a46;
  background: rgba(15, 122, 70, 0.12);
}

.excel-metric-delta.is-bad {
  color: #c02222;
  background: rgba(192, 34, 34, 0.12);
}

.excel-metric-target {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
}

.excel-metric-vs {
  margin-top: 2px;
  font-size: 10px;
}

.excel-metric-progress {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.excel-metric-progress > progress {
  display: block;
  width: 100%;
  height: 100%;
  appearance: none;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
  background: transparent;
}

.excel-metric-progress > progress::-webkit-progress-bar {
  background: transparent;
}

.excel-metric-progress > progress::-webkit-progress-value {
  background: linear-gradient(90deg, #5dd39e, #40b381);
  border-radius: inherit;
}

.excel-metric-progress > progress::-moz-progress-bar {
  background: linear-gradient(90deg, #5dd39e, #40b381);
  border-radius: inherit;
}

.excel-metric-card[data-metric-card="expense"] .excel-metric-progress > progress::-webkit-progress-value {
  background: linear-gradient(90deg, #ff8585, #db3434);
}

.excel-metric-card[data-metric-card="expense"] .excel-metric-progress > progress::-moz-progress-bar {
  background: linear-gradient(90deg, #ff8585, #db3434);
}

.excel-metric-card[data-metric-card="investment"] .excel-metric-progress > progress::-webkit-progress-value {
  background: linear-gradient(90deg, #7dd5d2, #49aeb8);
}

.excel-metric-card[data-metric-card="investment"] .excel-metric-progress > progress::-moz-progress-bar {
  background: linear-gradient(90deg, #7dd5d2, #49aeb8);
}

.excel-metric-breakdown {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  margin-top: auto;
}

.excel-breakdown-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.12);
  padding-bottom: 4px;
}

.excel-breakdown-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.excel-top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.excel-top-list {
  display: grid;
  gap: 6px;
}

.excel-top-item {
  border: 1px solid #d4dde3;
  border-radius: 9px;
  padding: 6px 8px;
  background: #fbfcfd;
}

.excel-top-item strong {
  display: block;
  font-size: 11px;
}

.excel-top-item span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.excel-matrix-panel .panel-head h3 {
  margin: 0;
  font-size: 13px;
}

.excel-matrix-table thead th {
  background: #1f5b66;
  color: #ecfeff;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 10px;
  padding: 7px 8px;
}

.excel-matrix-row-section td {
  font-weight: 700;
  color: #fff;
}

.excel-matrix-row-section.is-income td {
  background: #2c9f64;
}

.excel-matrix-row-section.is-expense td {
  background: #c52a2a;
}

.excel-matrix-row-section.is-savings td {
  background: #1f9c73;
}

.excel-matrix-row-section.is-investment td {
  background: #2d8f9e;
}

.excel-matrix-row-item td:nth-child(2),
.excel-matrix-row-item td:nth-child(3),
.excel-matrix-row-item td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.excel-matrix-row-item td:first-child {
  font-size: 10px;
}

.excel-matrix-row-item.is-subitem td:first-child {
  padding-left: 18px;
  color: #5b6775;
}

.excel-matrix-row-item.is-negative td:last-child {
  color: #be123c;
  font-weight: 600;
}

.excel-matrix-row-item.is-positive td:last-child {
  color: #166534;
  font-weight: 600;
}

.excel-matrix-table td {
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.2;
}

.legacy-monthly-charts {
  display: none;
}

#dashboard-tahunan.content-section {
  gap: 10px;
}

#dashboard-tahunan .panel {
  padding: 12px;
}

#dashboard-investasi.content-section {
  gap: 10px;
}

#dashboard-investasi .panel {
  padding: 12px;
}

#dashboard-investasi .panel h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.annual-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(140deg, #f8fcff 0%, #f3f8fc 70%, #edf6fa 100%);
  border: 1px solid #ccdce6;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.annual-hero h3 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.annual-year-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.annual-year-trigger {
  height: 34px;
  min-width: 112px;
  border-radius: 8px;
  white-space: nowrap;
}

.annual-year-chip {
  min-width: 132px;
  border: 1px solid #5eb3bf;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0fbfd 0%, #e6f7fa 100%);
  text-align: center;
  padding: 6px 12px;
}

.annual-year-chip span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.annual-year-chip strong {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  color: #0f6c74;
}

.annual-compare-panel {
  border: 1px solid #cfdbe4;
}

.annual-compare-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.annual-control-block label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.annual-control-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
}

.annual-control-row select {
  width: 100%;
  min-width: 0;
}

.annual-chart-shell {
  margin-top: 10px;
  border: 1px solid #d3dfe7;
  border-radius: 14px;
  padding: 10px;
  background: #fdfefe;
}

.annual-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.annual-kpi-card {
  border: 1px solid #cfdae3;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.annual-kpi-card.is-income {
  border-top: 4px solid #38a169;
}

.annual-kpi-card.is-expense {
  border-top: 4px solid #d73030;
}

.annual-kpi-card.is-savings {
  border-top: 4px solid #2f9e6b;
}

.annual-kpi-card.is-investment {
  border-top: 4px solid #3d9cb3;
}

.annual-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.annual-kpi-head h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.1;
}

.annual-kpi-head span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.annual-kpi-main {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.annual-kpi-label {
  font-size: 10px;
  color: var(--muted);
}

.annual-kpi-value {
  margin-top: 2px;
  font-size: clamp(16px, 1.35vw, 24px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.annual-kpi-target {
  margin-top: 8px;
  font-size: 11px;
}

.annual-kpi-note {
  margin-top: 4px;
  font-size: 10px;
  font-style: italic;
}

.annual-kpi-donut {
  margin-top: 8px;
  width: 100%;
  max-height: 116px;
}

.annual-progress-ring {
  --ring-color: #2f9e6b;
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.annual-progress-ring > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.annual-progress-ring span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.annual-progress-track {
  fill: none;
  stroke: rgba(15, 23, 42, 0.1);
  stroke-width: 10;
}

.annual-progress-value {
  fill: none;
  stroke: var(--ring-color);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 263.89;
  stroke-dashoffset: 263.89;
  transition: stroke-dashoffset 0.3s ease;
}

.annual-kpi-card.is-income .annual-progress-ring {
  --ring-color: #38a169;
}

.annual-kpi-card.is-expense .annual-progress-ring {
  --ring-color: #d73030;
}

.annual-kpi-card.is-savings .annual-progress-ring {
  --ring-color: #2f9e6b;
}

.annual-kpi-card.is-investment .annual-progress-ring {
  --ring-color: #3d9cb3;
}

.annual-breakdown {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  margin-top: auto;
}

.annual-breakdown-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.12);
  padding-bottom: 4px;
}

.annual-breakdown-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.annual-breakdown-item strong {
  white-space: nowrap;
}

.annual-breakdown-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.annual-breakdown-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-breakdown-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
  background: #94a3b8;
}

.annual-kpi-card.is-income .annual-breakdown-item:nth-child(1) .annual-breakdown-swatch,
#annual-top-income .annual-top-item:nth-child(1) .annual-top-item-swatch {
  background: #2f9e6b;
}

.annual-kpi-card.is-income .annual-breakdown-item:nth-child(2) .annual-breakdown-swatch,
#annual-top-income .annual-top-item:nth-child(2) .annual-top-item-swatch {
  background: #45b97c;
}

.annual-kpi-card.is-income .annual-breakdown-item:nth-child(3) .annual-breakdown-swatch,
#annual-top-income .annual-top-item:nth-child(3) .annual-top-item-swatch {
  background: #66c792;
}

.annual-kpi-card.is-income .annual-breakdown-item:nth-child(4) .annual-breakdown-swatch,
#annual-top-income .annual-top-item:nth-child(4) .annual-top-item-swatch {
  background: #8ed9ad;
}

.annual-kpi-card.is-income .annual-breakdown-item:nth-child(5) .annual-breakdown-swatch,
#annual-top-income .annual-top-item:nth-child(5) .annual-top-item-swatch {
  background: #b7ebca;
}

.annual-kpi-card.is-expense .annual-breakdown-item:nth-child(1) .annual-breakdown-swatch,
#annual-top-expense .annual-top-item:nth-child(1) .annual-top-item-swatch {
  background: #cf2e2e;
}

.annual-kpi-card.is-expense .annual-breakdown-item:nth-child(2) .annual-breakdown-swatch,
#annual-top-expense .annual-top-item:nth-child(2) .annual-top-item-swatch {
  background: #e14949;
}

.annual-kpi-card.is-expense .annual-breakdown-item:nth-child(3) .annual-breakdown-swatch,
#annual-top-expense .annual-top-item:nth-child(3) .annual-top-item-swatch {
  background: #ef6363;
}

.annual-kpi-card.is-expense .annual-breakdown-item:nth-child(4) .annual-breakdown-swatch,
#annual-top-expense .annual-top-item:nth-child(4) .annual-top-item-swatch {
  background: #f68b8b;
}

.annual-kpi-card.is-expense .annual-breakdown-item:nth-child(5) .annual-breakdown-swatch,
#annual-top-expense .annual-top-item:nth-child(5) .annual-top-item-swatch {
  background: #fbb4b4;
}

.annual-kpi-card.is-savings .annual-breakdown-item:nth-child(1) .annual-breakdown-swatch,
#annual-top-savings .annual-top-item:nth-child(1) .annual-top-item-swatch {
  background: #2f9e6b;
}

.annual-kpi-card.is-savings .annual-breakdown-item:nth-child(2) .annual-breakdown-swatch,
#annual-top-savings .annual-top-item:nth-child(2) .annual-top-item-swatch {
  background: #45b97c;
}

.annual-kpi-card.is-savings .annual-breakdown-item:nth-child(3) .annual-breakdown-swatch,
#annual-top-savings .annual-top-item:nth-child(3) .annual-top-item-swatch {
  background: #66c792;
}

.annual-kpi-card.is-savings .annual-breakdown-item:nth-child(4) .annual-breakdown-swatch,
#annual-top-savings .annual-top-item:nth-child(4) .annual-top-item-swatch {
  background: #8ed9ad;
}

.annual-kpi-card.is-savings .annual-breakdown-item:nth-child(5) .annual-breakdown-swatch,
#annual-top-savings .annual-top-item:nth-child(5) .annual-top-item-swatch {
  background: #b7ebca;
}

.annual-kpi-card.is-investment .annual-breakdown-item:nth-child(1) .annual-breakdown-swatch,
#annual-top-investments .annual-top-item:nth-child(1) .annual-top-item-swatch {
  background: #27879a;
}

.annual-kpi-card.is-investment .annual-breakdown-item:nth-child(2) .annual-breakdown-swatch,
#annual-top-investments .annual-top-item:nth-child(2) .annual-top-item-swatch {
  background: #3b9cb0;
}

.annual-kpi-card.is-investment .annual-breakdown-item:nth-child(3) .annual-breakdown-swatch,
#annual-top-investments .annual-top-item:nth-child(3) .annual-top-item-swatch {
  background: #56b6c8;
}

.annual-kpi-card.is-investment .annual-breakdown-item:nth-child(4) .annual-breakdown-swatch,
#annual-top-investments .annual-top-item:nth-child(4) .annual-top-item-swatch {
  background: #7ecad8;
}

.annual-kpi-card.is-investment .annual-breakdown-item:nth-child(5) .annual-breakdown-swatch,
#annual-top-investments .annual-top-item:nth-child(5) .annual-top-item-swatch {
  background: #a8deea;
}

#invest-top-returns .annual-top-item:nth-child(1) .annual-top-item-swatch,
#invest-top-types .annual-top-item:nth-child(1) .annual-top-item-swatch,
#invest-top-assets .annual-top-item:nth-child(1) .annual-top-item-swatch,
#invest-top-platforms .annual-top-item:nth-child(1) .annual-top-item-swatch {
  background: #38a169;
}

#invest-top-returns .annual-top-item:nth-child(2) .annual-top-item-swatch,
#invest-top-types .annual-top-item:nth-child(2) .annual-top-item-swatch,
#invest-top-assets .annual-top-item:nth-child(2) .annual-top-item-swatch,
#invest-top-platforms .annual-top-item:nth-child(2) .annual-top-item-swatch {
  background: #3d9cb3;
}

#invest-top-returns .annual-top-item:nth-child(3) .annual-top-item-swatch,
#invest-top-types .annual-top-item:nth-child(3) .annual-top-item-swatch,
#invest-top-assets .annual-top-item:nth-child(3) .annual-top-item-swatch,
#invest-top-platforms .annual-top-item:nth-child(3) .annual-top-item-swatch {
  background: #f4b740;
}

#invest-top-returns .annual-top-item:nth-child(4) .annual-top-item-swatch,
#invest-top-types .annual-top-item:nth-child(4) .annual-top-item-swatch,
#invest-top-assets .annual-top-item:nth-child(4) .annual-top-item-swatch,
#invest-top-platforms .annual-top-item:nth-child(4) .annual-top-item-swatch {
  background: #ef7d3c;
}

#invest-top-returns .annual-top-item:nth-child(5) .annual-top-item-swatch,
#invest-top-types .annual-top-item:nth-child(5) .annual-top-item-swatch,
#invest-top-assets .annual-top-item:nth-child(5) .annual-top-item-swatch,
#invest-top-platforms .annual-top-item:nth-child(5) .annual-top-item-swatch {
  background: #6f87d7;
}

.annual-top-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.annual-top-panel {
  min-height: 250px;
}

.annual-top-panel h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.annual-top-list {
  display: grid;
  gap: 0;
}

.annual-top-item {
  border-bottom: 1px dashed rgba(15, 23, 42, 0.15);
  padding: 8px 0;
  background: transparent;
}

.annual-top-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.annual-top-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.annual-top-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.annual-top-item-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
  background: #94a3b8;
}

.annual-top-item strong {
  display: inline-block;
  font-size: 11px;
}

.annual-top-item-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-top-item span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.annual-top-item-value {
  white-space: nowrap;
}

.annual-top-item-note {
  margin-top: 2px;
  font-style: italic;
}

.annual-top-item.is-empty-placeholder {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  min-height: 156px;
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
}

.annual-top-item.is-empty-placeholder span {
  font-size: 16px;
  line-height: 1.3;
  color: #9ca3af;
}

.annual-matrix-table thead th {
  background: #1f5b66;
  color: #ecfeff;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 10px;
  padding: 7px 8px;
}

.annual-matrix-row-section td {
  font-weight: 700;
  color: #fff;
}

.annual-matrix-row-section.is-income td {
  background: #2c9f64;
}

.annual-matrix-row-section.is-expense td {
  background: #c52a2a;
}

.annual-matrix-row-section.is-savings td {
  background: #1f9c73;
}

.annual-matrix-row-section.is-investment td {
  background: #2d8f9e;
}

.annual-matrix-row-item td:nth-child(2),
.annual-matrix-row-item td:nth-child(3),
.annual-matrix-row-item td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.annual-matrix-row-item td:first-child {
  font-size: 10px;
}

.annual-matrix-row-item.is-subitem td:first-child {
  padding-left: 18px;
  color: #5b6775;
}

.annual-matrix-row-item.is-negative td:last-child {
  color: #be123c;
  font-weight: 600;
}

.annual-matrix-row-item.is-positive td:last-child {
  color: #166534;
  font-weight: 600;
}

.annual-matrix-table td {
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.2;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.muted.is-success {
  color: #1d7a3d;
}

.muted.is-error {
  color: #b42318;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
  z-index: 1;
  color: #284168;
  font-weight: 700;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.015);
}

th[data-sort] {
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.form-grid label,
.profile-form-section label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.btn-primary {
  background: linear-gradient(120deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-outline {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(148, 163, 184, 0.36);
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  color: #1e293b;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-outline:hover,
.btn-danger:hover {
  transform: translateY(-1px);
}

.btn-primary:hover {
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
  filter: none;
}

.btn-outline:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.btn-danger {
  border: none;
  color: #fff;
  background: linear-gradient(120deg, #dc2626, #b91c1c);
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 10px 20px rgba(185, 28, 28, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-settings-panel {
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.profile-settings-hero {
  margin-top: 14px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: linear-gradient(145deg, #f8fbff, #edf4ff);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
}

.profile-photo-preview-wrap {
  width: 112px;
  height: 112px;
}

.profile-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #dbe6fb;
  background: #f8fafc;
  object-fit: cover;
  display: block;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.profile-avatar-preview:not(.has-photo) {
  background: linear-gradient(140deg, #f3f6fb, #e7edf7);
}

.profile-hero-meta {
  display: grid;
  gap: 4px;
}

.profile-hero-meta strong {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.profile-hero-meta span {
  color: #475569;
  font-size: 13px;
}

.profile-hero-meta p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 13px;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}

.profile-upload-label input[type="file"] {
  max-width: 190px;
}

.profile-form-grid {
  margin-top: 14px;
  gap: 14px;
}

.profile-form-section {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  background: #ffffff;
  padding: 14px;
}

.profile-form-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.profile-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.profile-security-card {
  margin-top: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  padding: 14px;
}

.profile-security-card h4 {
  margin: 0;
  font-size: 15px;
}

.security-fact {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.security-fact span {
  font-size: 11px;
  color: #64748b;
}

.security-fact strong {
  font-size: 14px;
  color: #0f172a;
}

.profile-security-form {
  margin-top: 12px;
}

.mfa-setup-box {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.04);
}

.mfa-disable-form {
  margin-top: 10px;
}

.danger-zone {
  border: 1px solid rgba(185, 28, 28, 0.2);
  background: linear-gradient(180deg, #fff, #fff7f7);
}

.photo-crop-card {
  width: min(440px, 94vw);
}

.photo-crop-canvas-wrap {
  width: 320px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 8px auto 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f1f5f9;
}

#photo-crop-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#photo-crop-canvas.is-dragging {
  cursor: grabbing;
}

.photo-crop-zoom {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.photo-crop-zoom input[type="range"] {
  width: 100%;
}

.btn-small {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
}

.right-panel {
  padding: 22px 20px;
  background: linear-gradient(180deg, #f9fbff 0%, #edf2fb 100%);
  border-left: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.budget-list {
  display: grid;
  gap: 10px;
}

.budget-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
}

.budget-item strong {
  display: block;
  margin-bottom: 6px;
}

.summary-inline {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 80px 1fr;
  }

  .right-panel {
    display: none;
  }

  .sidebar {
    padding: 20px 12px;
  }

  .brand-sub,
  .brand-title {
    display: none;
  }

  .sidebar-profile-card {
    justify-content: center;
  }

  .sidebar-profile-info {
    display: none;
  }

  .nav-item {
    font-size: 12px;
  }

  .excel-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .excel-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .excel-summary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .excel-summary-card .card-value {
    font-size: clamp(16px, 2.6vw, 24px);
  }

  .excel-metric-actual {
    font-size: clamp(16px, 2.8vw, 26px);
  }

  .annual-compare-controls {
    grid-template-columns: 1fr;
  }

  .annual-kpi-grid,
  .annual-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: visible;
    position: static;
    height: auto;
    overflow-y: visible;
    gap: 12px;
    padding: 12px 14px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-section {
    display: none;
  }

  .brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .nav-item {
    padding: 8px 10px;
    font-size: 11px;
    white-space: normal;
  }

  .profile-settings-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .main {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters {
    flex-wrap: wrap;
    align-items: center;
  }
}

@media (max-width: 720px) {
  .cards,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .excel-summary-row,
  .excel-metric-grid,
  .excel-top-grid,
  .annual-compare-controls,
  .annual-kpi-grid,
  .annual-top-grid {
    grid-template-columns: 1fr;
  }

  .excel-monthly-hero,
  .annual-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .annual-year-actions {
    justify-content: space-between;
  }

  .annual-control-row {
    grid-template-columns: 1fr;
  }

  .annual-kpi-main {
    align-items: flex-start;
  }

  .excel-metric-actual,
  .excel-summary-card .card-value {
    font-size: clamp(16px, 6vw, 22px);
  }

  .excel-monthly-hero h3 {
    font-size: 18px;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table {
    table-layout: fixed;
    width: 100%;
  }

  th,
  td {
    padding: 8px 6px;
    font-size: 12px;
    word-break: break-word;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

.ai-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ai-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  background: rgba(14, 165, 164, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.ai-prompt {
  width: 100%;
  min-height: 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

.wallet-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
}

.wallet-item strong {
  display: block;
  margin-bottom: 4px;
}

.import-status {
  margin-top: 10px;
}

.import-status.is-success {
  color: #1d7a3d;
}

.import-status.is-error {
  color: #b42318;
}

#form-bulk-csv {
  margin-top: 12px;
}

.bulk-errors {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: #b42318;
}

#bulk-action,
#bulk-action-value {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.audit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

#table-admins td,
#table-admins th {
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  top: 24px;
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

#export-status {
  font-size: 13px;
}

#export-queue {
  font-size: 12px;
  margin-top: 6px;
  color: var(--muted);
}

.export-queue {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.export-job {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.03);
}

.export-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.export-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  margin-top: 6px;
}

.export-bar-fill {
  height: 100%;
  background: linear-gradient(120deg, #ff7a00, #ff9f3f);
  width: 0%;
  transition: width 0.2s ease;
}

.export-bar-progress {
  display: block;
  width: 100%;
  height: 100%;
  appearance: none;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
  background: transparent;
}

.export-bar-progress::-webkit-progress-bar {
  background: transparent;
}

.export-bar-progress::-webkit-progress-value {
  background: linear-gradient(120deg, #ff7a00, #ff9f3f);
  border-radius: inherit;
}

.export-bar-progress::-moz-progress-bar {
  background: linear-gradient(120deg, #ff7a00, #ff9f3f);
  border-radius: inherit;
}

.export-bar-fill.is-indeterminate {
  width: 40%;
  animation: export-indeterminate 1.2s ease infinite;
}

@keyframes export-indeterminate {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(160%);
  }
}

.budget-progress {
  height: 8px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.budget-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
}

.budget-progress-bar::-webkit-progress-bar {
  background: transparent;
}

.budget-progress-bar::-webkit-progress-value {
  background: rgba(14, 165, 164, 0.85);
  border-radius: inherit;
}

.budget-progress-bar::-moz-progress-bar {
  background: rgba(14, 165, 164, 0.85);
  border-radius: inherit;
}

.budget-progress-bar.is-warn::-webkit-progress-value,
.budget-progress-bar.is-warn::-moz-progress-bar {
  background: rgba(255, 122, 0, 0.85);
}

.budget-progress-bar.is-danger::-webkit-progress-value,
.budget-progress-bar.is-danger::-moz-progress-bar {
  background: rgba(239, 68, 68, 0.85);
}

.budget-progress-bar.is-ok::-webkit-progress-value,
.budget-progress-bar.is-ok::-moz-progress-bar {
  background: rgba(14, 165, 164, 0.85);
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(120deg, #ff7a00, #ff9f3f);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(255, 122, 0, 0.35);
  z-index: 20;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.modal.is-open {
  display: flex;
}

.modal-card {
  width: min(520px, 92vw);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.profile-modal-card {
  max-width: 560px;
}

.profile-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.profile-daily {
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
}

.profile-daily-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-daily-total {
  font-weight: 700;
  color: #0f172a;
}

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

.profile-daily-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f8fb;
  border: 1px solid #e2e8f0;
}

.profile-daily-item strong {
  display: block;
  font-size: 0.9rem;
}

.profile-daily-item span {
  display: block;
  font-size: 0.8rem;
}

.profile-daily-amount {
  font-weight: 700;
  color: #1f2937;
}

.profile-daily-empty {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed #cbd5f5;
  text-align: center;
}

.profile-summary-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, #eff6ff, #f8fbff);
  border: 1px solid #cdddf5;
}

.profile-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-summary-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-summary-chip {
  background: #ffffff;
  border: 1px solid #d7e3f4;
  border-radius: 999px;
  padding: 6px 12px;
  text-align: center;
  min-width: 160px;
}

.profile-summary-chip span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.profile-summary-chip strong {
  display: block;
  font-size: 13px;
  color: #1e3a8a;
}

.profile-summary-grid {
  gap: 12px;
}

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

@media (max-width: 720px) {
  .profile-summary-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .fab {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 900px) {
  .main {
    padding: 12px;
  }

  .page-header {
    padding: 10px;
    border-radius: 14px;
    gap: 10px;
  }

  .page-header h1 {
    font-size: 21px;
    margin: 0 0 4px;
  }

  .page-header p {
    font-size: 12px;
  }

  .panel,
  .card,
  .excel-summary-card,
  .excel-metric-card,
  .annual-kpi-card {
    border-radius: 12px;
    padding: 10px;
  }

  .btn-primary,
  .btn-outline,
  .btn-danger {
    min-height: 36px;
    font-size: 12px;
    padding: 0 11px;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 25;
    margin: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: linear-gradient(145deg, rgba(11, 18, 32, 0.94), rgba(17, 28, 51, 0.94));
    backdrop-filter: blur(10px);
    padding: 10px 10px 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
    gap: 8px;
  }

  .brand,
  .sidebar-profile-card,
  .sidebar-foot {
    display: none;
  }

  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    gap: 7px;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.9) rgba(248, 251, 255, 0.06);
    scroll-snap-type: x proximity;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 11.5px;
    scroll-snap-align: start;
  }

  .main {
    padding: 10px 10px 14px;
  }

  .page-header {
    position: sticky;
    top: 56px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
  }

  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filters label {
    min-width: 0;
  }

  #btn-logout {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 640px;
    table-layout: auto;
  }

  th,
  td {
    white-space: nowrap;
    word-break: normal;
    font-size: 11.5px;
    padding: 7px 8px;
  }

  .table-footer {
    align-items: stretch;
  }

  .pager {
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .cards,
  .grid-2,
  .excel-summary-row,
  .excel-metric-grid,
  .excel-top-grid,
  .annual-kpi-grid,
  .annual-top-grid {
    gap: 8px;
  }

  .card-value,
  .excel-summary-card .card-value,
  .excel-metric-actual {
    font-size: clamp(15px, 5vw, 20px);
  }

  .fab {
    width: 50px;
    height: 50px;
    right: 12px;
    bottom: 12px;
    font-size: 26px;
  }
}


.section-title-gap-sm {
  margin-top: 14px;
}

.table-wrap-gap-sm {
  margin-top: 10px;
}

.form-grid-gap-sm {
  margin-top: 12px;
}

/* INVESTMENT DASHBOARD */
.invest-section {
  gap: 10px;
}

.invest-section .panel {
  padding: 12px;
  border: 1px solid #cfdbe4;
}

.invest-kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.invest-kpi-card {
  border: 1px solid #cfdae3;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.invest-kpi-card.is-realized {
  border-top: 4px solid #38a169;
}

.invest-kpi-card.is-unrealized {
  border-top: 4px solid #3d9cb3;
}

.invest-kpi-card.is-total {
  border-top: 4px solid #1f5b66;
}

.invest-kpi-title {
  font-weight: 600;
  color: #20323f;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.invest-kpi-metrics {
  display: grid;
  gap: 10px;
}

.invest-kpi-label {
  color: #7a8a96;
  font-size: 0.85rem;
}

.invest-kpi-value {
  font-weight: 700;
  font-size: clamp(15px, 1.1vw, 18px);
  color: #20323f;
  font-variant-numeric: tabular-nums;
}

.invest-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 16px;
}

.invest-returns {
  display: grid;
  gap: 12px;
}

.invest-return-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.6fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f3f8fc;
  border: 1px solid #e4eef4;
}

.invest-return-label {
  font-weight: 600;
  color: #20323f;
}

.invest-return-sub {
  font-size: 0.85rem;
  color: #7a8a96;
}

.invest-return-value {
  font-weight: 600;
  color: #20323f;
  text-align: right;
}

.invest-return-roi {
  font-weight: 700;
  color: #1f9d66;
  text-align: right;
}

.invest-platform-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.invest-platform-card {
  border: 1px solid #cfdae3;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.invest-platform-title {
  color: #7a8a96;
  font-size: 0.85rem;
}

.invest-platform-value {
  font-weight: 700;
  color: #20323f;
  margin-top: 6px;
}

.invest-table-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 16px;
}

.invest-section .panel {
  padding: 12px;
  background: #ffffff;
}

.invest-section .panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #1f3b4d;
}

.invest-section .table-wrap {
  margin-top: 6px;
}

.invest-donut-wrap {
  display: grid;
  gap: 10px;
}

.invest-alloc-list {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
}

.invest-alloc-item {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.6fr;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f7fbfd;
}

.invest-alloc-label {
  color: #20323f;
  font-weight: 600;
}

.invest-alloc-value {
  color: #334a57;
  text-align: right;
}

.invest-alloc-percent {
  color: #1f9d66;
  font-weight: 600;
  text-align: right;
}

.invest-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f6ef;
  color: #1f9d66;
  font-weight: 700;
  font-size: 0.8rem;
}

.invest-platform-name {
  font-weight: 700;
  color: #20323f;
  margin-top: 4px;
}

.invest-table thead th {
  background: #1f5b66;
  color: #ecfeff;
}

.invest-table tbody td {
  font-size: 11.5px;
}

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

@media (max-width: 640px) {
  .invest-kpi-grid {
    grid-template-columns: 1fr;
  }
}
