:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  padding: 0;
}

body:not(.login-page):not(.home-page) {
  height: 100vh;
  overflow: hidden;
  padding-top: 76px;
}

body.portfolio-report-page {
  height: auto !important;
  min-height: 100vh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-color: #64748b #eef3f8;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

html.portfolio-report-document {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #64748b #eef3f8;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

body.portfolio-report-page::-webkit-scrollbar {
  width: 12px;
}

html.portfolio-report-document::-webkit-scrollbar {
  width: 12px;
}

body.portfolio-report-page::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #eef3f8, #f8fafc);
}

html.portfolio-report-document::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #eef3f8, #f8fafc);
}

body.portfolio-report-page::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8, #475569);
  border: 3px solid #eef3f8;
  border-radius: 999px;
}

html.portfolio-report-document::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8, #475569);
  border: 3px solid #eef3f8;
  border-radius: 999px;
}

body.home-page {
  padding-top: 76px;
}

html.home-document,
body.home-page {
  scrollbar-color: #64748b #eef3f8;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

html.home-document::-webkit-scrollbar,
body.home-page::-webkit-scrollbar {
  width: 12px;
}

html.home-document::-webkit-scrollbar-track,
body.home-page::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #eef3f8, #f8fafc);
}

html.home-document::-webkit-scrollbar-thumb,
body.home-page::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8, #475569);
  border: 3px solid #eef3f8;
  border-radius: 999px;
}

html.home-document::-webkit-scrollbar-thumb:hover,
body.home-page::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64748b, #334155);
}

.app-navbar {
  align-items: center;
  background: linear-gradient(90deg, #0d1740 0%, #142d72 44%, #2863df 100%);
  border-bottom: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 76px;
  margin: 0;
  padding: 0 24px;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 20;
}

.app-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 150px;
}

.app-brand-mark {
  align-items: center;
  background: #ffffff;
  border-radius: 4px;
  color: #0d1740;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  padding: 4px 8px;
  text-decoration: none;
  width: 154px;
}

.app-brand-logo {
  display: block;
  height: 42px;
  object-fit: contain;
  width: 138px;
}

.app-brand-title,
.brand-title {
  font-weight: 900;
  letter-spacing: .02em;
}

.app-brand-subtitle,
.brand-subtitle {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.app-nav-links {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

.nav-item {
  align-items: center;
  color: rgba(255, 255, 255, 0.62);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  min-height: 38px;
  padding: 0 10px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-dropdown-trigger {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-family: inherit;
  list-style: none;
}

.nav-dropdown-trigger::after {
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  content: "";
  height: 6px;
  margin-left: 4px;
  transform: rotate(45deg);
  width: 6px;
}

.nav-dropdown:hover .nav-dropdown-trigger::after,
.nav-dropdown:focus-within .nav-dropdown-trigger::after {
  transform: rotate(-135deg);
}

.nav-dropdown-menu {
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  display: none;
  gap: 4px;
  left: 0;
  min-width: 260px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 8px);
  z-index: 50;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: grid;
}

.nav-dropdown-item {
  align-items: center;
  color: #172033;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
  background: #eef3ff;
  color: #1d4ed8;
}

.nav-icon {
  display: inline-flex;
  height: 16px;
  width: 16px;
}

.nav-icon svg,
.btn-logout svg,
.home-card-icon svg,
.refresh-icon svg {
  fill: none;
  height: 100%;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 100%;
}

.app-user {
  align-items: center;
  display: flex;
  gap: 14px;
  flex: 0 0 auto;
  justify-content: flex-end;
  min-width: 150px;
}

.user-meta {
  display: grid;
  gap: 2px;
  text-align: right;
}

.user-role {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-name {
  color: #ffffff;
  font-size: 13px;
}

.logout-form {
  margin: 0;
}

.btn-logout {
  align-items: center;
  background: #dc2626;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  width: 38px;
}

.btn-logout:hover {
  background: #b91c1c;
}

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

.home-only-shell {
  display: block;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e1e6ef;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}

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

.brand-badge {
  align-items: center;
  background: #0f766e;
  color: #ffffff;
  display: flex;
  font-size: 20px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.side-link {
  align-items: center;
  border: 1px solid #e1e6ef;
  color: #172033;
  display: flex;
  font-weight: 800;
  justify-content: space-between;
  padding: 12px;
  text-decoration: none;
}

.side-link:hover,
.side-link.active {
  background: #e8f5f1;
  border-color: #a7d8c8;
  color: #0f513c;
}

.side-link small {
  color: #64748b;
}

.sidebar-card {
  background: #f8fafc;
  border: 1px solid #e1e6ef;
  margin-top: 8px;
  padding: 16px;
}

.sidebar-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-value {
  font-size: 34px;
  font-weight: 900;
  margin-top: 4px;
}

.sidebar-hint {
  color: #64748b;
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 22px;
}

.page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 76px);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 4px 10px 20px;
  width: 100%;
}

.topbar {
  align-items: center;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.eyebrow {
  color: #516070;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

h1 {
  font-size: 23px;
  margin: 0;
}

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

.export,
.nav-link,
.filters button,
.pager button {
  background: #1b6b4f;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 34px;
  padding: 8px 12px;
  text-decoration: none;
}

.nav-link {
  background: #ffffff;
  border: 1px solid #cdd5e0;
  color: #172033;
}

.home-shell {
  min-height: calc(100vh - 120px);
}

.home-panel {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(16, 185, 129, 0.08), transparent 28%),
    rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.75);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  min-height: calc(100vh - 142px);
  padding: 32px;
}

.home-head {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.home-kicker {
  color: #ef4444;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  margin-bottom: 10px;
}

.home-title {
  color: #172033;
  font-size: 44px;
  line-height: 1.05;
  margin: 0;
}

.highlight {
  background: linear-gradient(90deg, #2563eb, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-subtitle {
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: 720px;
}

.home-refresh {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e1e6ef;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  display: flex;
  gap: 12px;
  min-width: 260px;
  padding: 14px;
}

.refresh-icon {
  align-items: center;
  background: #d7f9eb;
  color: #10b981;
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.refresh-details {
  display: grid;
  gap: 3px;
}

.refresh-details span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.refresh-details strong {
  font-size: 13px;
}

.home-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.home-card {
  --card-accent: #60a5fa;
  --card-rgb: 96, 165, 250;
  --card-start: #1d4ed8;
  --card-end: #38bdf8;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
  background:
    linear-gradient(145deg, var(--card-start), var(--card-end)),
    radial-gradient(circle at 92% 10%, rgba(var(--card-rgb), 0.34), transparent 34%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  min-height: 218px;
  overflow: hidden;
  padding: 24px 24px 22px 28px;
  position: relative;
  text-decoration: none;
}

.home-card::before {
  background: var(--card-accent);
  content: "";
  left: 0;
  opacity: 1;
  position: absolute;
  top: 0;
  height: 100%;
  width: 4px;
}

.demand-card {
  --card-accent: #facc15;
  --card-rgb: 250, 204, 21;
  --card-start: #d97706;
  --card-end: #facc15;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.outstanding-card {
  --card-accent: #22c55e;
  --card-rgb: 34, 197, 94;
  --card-start: #047857;
  --card-end: #22c55e;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.npa-card {
  --card-accent: #ef4444;
  --card-rgb: 239, 68, 68;
  --card-start: #991b1b;
  --card-end: #ef4444;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.closer-card {
  --card-accent: #06b6d4;
  --card-rgb: 6, 182, 212;
  --card-start: #0e7490;
  --card-end: #06b6d4;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.disbursed-card {
  --card-accent: #a855f7;
  --card-rgb: 168, 85, 247;
  --card-start: #6d28d9;
  --card-end: #a855f7;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.portfolio-card {
  --card-accent: #14b8a6;
  --card-rgb: 20, 184, 166;
  --card-start: #0f766e;
  --card-end: #38bdf8;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.par-card {
  --card-accent: #f59e0b;
  --card-rgb: 245, 158, 11;
  --card-start: #92400e;
  --card-end: #f59e0b;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.recovery-card {
  --card-accent: #84cc16;
  --card-rgb: 132, 204, 22;
  --card-start: #3f6212;
  --card-end: #84cc16;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.installment-card {
  --card-accent: #f97316;
  --card-rgb: 249, 115, 22;
  --card-start: #9a3412;
  --card-end: #f97316;
  --card-accent-soft: rgba(var(--card-rgb), 0.2);
}

.home-card:hover {
  border-color: rgba(var(--card-rgb), 0.56);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(var(--card-rgb), 0.24);
  transform: translateY(-2px);
}

.home-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: flex-start;
}

.home-card-label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.home-card h2 {
  color: #ffffff;
  font-size: 23px;
  line-height: 1.12;
  margin: 0;
  max-width: 230px;
}

.home-card p {
  color: rgba(226, 232, 240, 0.82);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  max-width: 290px;
}

.home-card-data {
  border-top: 1px dashed rgba(255, 255, 255, 0.28);
  display: none;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 18px;
}

.data-item {
  background: transparent;
  border: 0;
  padding: 0;
}

.data-item span {
  color: rgba(255, 255, 255, 0.66);
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.data-item strong {
  color: #ffffff;
  display: block;
  margin-top: 6px;
}

.home-card-icon {
  align-items: center;
  align-self: start;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  font-size: 26px;
  font-weight: 900;
  height: 50px;
  justify-content: center;
  width: 50px;
}

.is-hidden {
  display: none;
}

.filters {
  align-items: end;
  background: #fff;
  border: 1px solid #e1e6ef;
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(130px, 1fr)) auto;
  margin-bottom: 6px;
  padding: 8px 10px;
}

.closure-filters {
  grid-template-columns: minmax(180px, 260px) 180px;
  justify-content: center;
}

label {
  color: #516070;
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 4px;
}

input,
select {
  border: 1px solid #cdd5e0;
  color: #172033;
  font: 12px Arial, Helvetica, sans-serif;
  min-height: 34px;
  padding: 6px 9px;
  width: 100%;
}

.summary {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  font-size: 13px;
  gap: 10px;
  justify-content: space-between;
  margin: 0 0 6px;
}

.closure-kpis {
  display: grid;
  flex: 0 0 auto;
  gap: 16px;
  grid-template-columns: repeat(8, minmax(138px, 1fr));
  margin: 0 0 18px;
}

.closure-kpi {
  --closure-card-color: #4eb5a8;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid #d5dce7;
  border-radius: 7px;
  box-shadow: 9px 11px 16px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: 27px 37px 32px;
  min-height: 96px;
  overflow: hidden;
}

.closure-kpi span {
  align-items: center;
  background: var(--closure-card-color);
  color: #ffffff;
  display: flex;
  font-size: 12px;
  line-height: 1.1;
  min-width: 0;
  padding: 5px 7px;
  white-space: nowrap;
}

.closure-kpi strong {
  align-items: center;
  background: #f8fafc;
  color: #020617;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 7px;
}

.closure-kpi:nth-child(1) { --closure-card-color: #4eb5a8; }
.closure-kpi:nth-child(2) { --closure-card-color: #60a5fa; }
.closure-kpi:nth-child(3) { --closure-card-color: #f59e0b; }
.closure-kpi:nth-child(4) { --closure-card-color: #ef4444; }
.closure-kpi:nth-child(5) { --closure-card-color: #8b5cf6; }
.closure-kpi:nth-child(6) { --closure-card-color: #22c55e; }
.closure-kpi:nth-child(7) { --closure-card-color: #ec4899; }
.closure-kpi:nth-child(8) { --closure-card-color: #06b6d4; }

.closure-kpi em {
  align-items: center;
  background: #f8fafc;
  color: #020617;
  display: flex;
  font-size: 13px;
  font-style: normal;
  padding: 6px 7px;
}

.summary-meta {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 14px;
  min-width: 0;
}

#pageStatus {
  color: #64748b;
  font-weight: 700;
}

.error {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: #8a1f11;
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
}

.report-panel {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 8px;
  position: relative;
  width: 100%;
}

.portfolio-page {
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.88), rgba(248, 250, 252, 0.95)),
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.14), transparent 26%),
    radial-gradient(circle at 88% 20%, rgba(20, 184, 166, 0.14), transparent 24%);
  height: auto !important;
  min-height: calc(100dvh - 76px);
  overflow: visible !important;
  padding-bottom: 34px;
}

.portfolio-filters {
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
}

.portfolio-dashboard {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: visible;
  position: relative;
}

.portfolio-loader {
  align-items: center;
  background: rgba(248, 250, 252, 0.72);
  bottom: 0;
  display: none;
  justify-content: center;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 20;
}

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

.portfolio-kpi {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  color: #ffffff;
  min-height: 94px;
  padding: 18px;
}

.portfolio-kpi span {
  color: rgba(219, 234, 254, 0.82);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.portfolio-kpi strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.portfolio-chart-slider {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  min-width: 0;
}

.portfolio-slider-btn {
  align-items: center;
  aspect-ratio: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  padding: 0;
  transition: background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
  width: 42px;
}

.portfolio-slider-btn:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.portfolio-slider-btn:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.portfolio-slider-btn svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  width: 22px;
}

.portfolio-chart-grid {
  display: flex;
  gap: 18px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 12px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: #8aa0bd #eef3f8;
  scrollbar-width: thin;
}

.portfolio-chart-grid::-webkit-scrollbar {
  height: 10px;
}

.portfolio-chart-grid::-webkit-scrollbar-track {
  background: #eef3f8;
  border-radius: 999px;
}

.portfolio-chart-grid::-webkit-scrollbar-thumb {
  background: #8aa0bd;
  border-radius: 999px;
}

.portfolio-chart-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
  flex: 0 0 min(760px, calc(100% - 4px));
  overflow: hidden;
  padding: 18px;
  scroll-snap-align: start;
}

.portfolio-chart-card header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portfolio-chart-card header span {
  color: #2563eb;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portfolio-chart-card h2 {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.15;
  margin: 6px 0 0;
}

.chart-total {
  color: #0f766e;
  font-size: 18px;
  white-space: nowrap;
}

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

.portfolio-chart-body canvas {
  height: 260px;
  width: 260px;
}

.portfolio-legend {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.legend-row {
  align-items: center;
  color: #334155;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.legend-row i {
  border-radius: 999px;
  display: block;
  height: 10px;
  width: 10px;
}

.legend-color-0 { background: #2563eb; }
.legend-color-1 { background: #16a34a; }
.legend-color-2 { background: #f59e0b; }
.legend-color-3 { background: #dc2626; }
.legend-color-4 { background: #7c3aed; }
.legend-color-5 { background: #0891b2; }
.legend-color-6 { background: #db2777; }
.legend-color-7 { background: #65a30d; }
.legend-color-8 { background: #ea580c; }
.legend-color-9 { background: #475569; }

.legend-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row strong {
  color: #0f172a;
}

.legend-empty {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.portfolio-table-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 420px;
  overflow: hidden;
  padding: 14px;
}

.portfolio-table-panel .table-wrap {
  flex: 0 0 auto;
  height: min(520px, 58vh);
  min-height: 320px;
}

.table-wrap {
  background: #fff;
  border: 1px solid #e1e6ef;
  flex: 1 1 0;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow-x: scroll;
  overflow-y: auto;
  scrollbar-color: #8aa0bd #eef3f8;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  width: 100%;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #eef3f8;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #9fb0c8, #64748b);
  border: 2px solid #eef3f8;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7890ad, #475569);
}

.table-wrap::-webkit-scrollbar-corner {
  background: #eef3f8;
}

table {
  border-collapse: collapse;
  min-width: 100%;
  width: max-content;
}

th,
td {
  border-bottom: 1px solid #edf1f6;
  font-size: 11px;
  padding: 6px 9px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #eef3f8;
  color: #334155;
  font-size: 11px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.empty {
  color: #64748b;
  padding: 28px;
  text-align: center;
}

.pager {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 0;
}

.pager button:disabled {
  background: #dde4ee;
  border: 0;
  color: #748094;
  cursor: not-allowed;
  font-weight: 700;
  padding: 10px 14px;
}

.pbi-loader-overlay {
  position: absolute;
  inset: 34px 0 0;
  display: none;
  min-height: 360px;
  place-items: center;
  background: rgba(248, 250, 252, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5;
}

.pbi-loader-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
  min-width: 320px;
  padding: 30px;
  text-align: center;
}

.pbi-loader-card strong {
  color: #0f172a;
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin-top: 18px;
}

.pbi-loader-card span {
  color: #64748b;
  display: block;
  font-size: 14px;
  margin-top: 8px;
}

.pbi-progress-bar {
  background: #e2e8f0;
  height: 8px;
  margin-top: 22px;
  overflow: hidden;
}

.pbi-progress-fill {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(90deg, #2563eb, #1b6b4f, #2563eb);
  background-size: 200% 100%;
  height: 100%;
  transition: width 0.3s ease-out;
  width: 0%;
}

.pbi-progress-text {
  color: #2563eb;
  font-size: 18px;
  font-weight: 800;
  margin-top: 12px;
}

.pbi-progress-meta {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.pbi-spinner {
  animation: pbi-spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  border: 4px solid rgba(37, 99, 235, 0.15);
  border-radius: 50%;
  border-right-color: #1b6b4f;
  border-top-color: #2563eb;
  height: 48px;
  margin: 0 auto;
  width: 48px;
}

body.login-page {
  background: #030d4b;
  font-family: Manrope, Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.login-shell {
  align-items: stretch;
  background: url("images/login_bg.jpg") center center / cover no-repeat;
  background-color: #030d4b;
  display: flex;
  justify-content: flex-end;
  min-height: 100vh;
}

.login-right {
  align-items: center;
  background: transparent;
  display: flex;
  flex: 0 0 min(46vw, 620px);
  justify-content: center;
  overflow: hidden;
  padding: 48px 56px;
  position: relative;
}

.login-card {
  backdrop-filter: blur(2px);
  background: rgba(6, 16, 92, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  color: #ffffff;
  margin: 0;
  padding: 40px 34px 38px;
  position: relative;
  width: min(100%, 440px);
  z-index: 1;
}

.login-brand {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: -12px 0 22px;
}

.login-brand img {
  display: block;
  height: 58px;
  max-width: 220px;
  object-fit: contain;
  width: auto;
}

.login-error {
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 130, 130, 0.35);
  border-radius: 10px;
  color: #ffd1d1;
  margin: 0 0 14px;
  padding: 12px 14px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.login-field input {
  background: rgba(240, 245, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  color: #0f172a;
  font-size: 0.98rem;
  height: 50px;
  outline: none;
  padding: 0 16px;
  width: 100%;
}

.password-control {
  display: block;
  position: relative;
}

.password-control input {
  padding-right: 52px;
}

.password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #334155;
  cursor: pointer;
  display: flex;
  height: 40px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 6px;
  top: 5px;
  width: 40px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(15, 23, 42, 0.08);
  outline: none;
}

.password-eye {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 22px;
}

.password-eye-closed,
.password-toggle.is-visible .password-eye-open {
  display: none;
}

.password-toggle.is-visible .password-eye-closed {
  display: block;
}

.login-field input:focus {
  border-color: #ffbf4d;
  box-shadow: 0 0 0 3px rgba(255, 191, 77, 0.16);
}

.login-links {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 4px;
}

.login-links a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  text-decoration: underline;
}

.login-submit {
  background: #ffbc3f;
  border: none;
  border-radius: 3px;
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  height: 50px;
  margin-top: 10px;
}

.login-submit:hover {
  background: #ffaf14;
}

.login-powered {
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 34px;
}

.login-powered strong {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 6px;
  color: #1f2937;
  padding: 4px 10px;
}

.no-access-panel {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-weight: 700;
  margin-top: 22px;
  padding: 18px;
}

@keyframes pbi-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 1100px) {
  body:not(.login-page):not(.home-page) {
    height: auto;
    overflow: auto;
    padding-top: 0;
  }

  body.home-page {
    padding-top: 0;
  }

  .app-navbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
    position: static;
  }

  .page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-brand,
  .app-user {
    min-width: 0;
  }

  .app-nav-links {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid #e1e6ef;
    border-right: 0;
  }

  .home-head {
    flex-direction: column;
  }

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

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

  .portfolio-kpis,
  .closure-kpis,
  .portfolio-chart-grid {
    grid-template-columns: 1fr;
  }

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

  .portfolio-legend {
    width: 100%;
  }

  .login-shell {
    justify-content: center;
  }

  .login-right {
    flex-basis: 100%;
    padding: 32px 20px;
  }
}
