:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d8dee8;
  --ink: #152033;
  --muted: #647083;
  --blue: #1f5fbf;
  --blue-dark: #174789;
  --green: #087f5b;
  --red: #b42318;
  --amber: #b86e00;
  --shadow: 0 16px 40px rgba(21, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 18px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

code,
pre {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  background: #111827;
  color: #f9fafb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #f4b860;
  color: #111827;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #aeb8c8;
  font-size: 0.82rem;
}

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

.nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  color: #d6dce7;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  background: #243044;
  color: #ffffff;
}

.logout-form {
  margin-top: auto;
}

.main-shell {
  min-height: 100vh;
  margin-left: 260px;
  padding: 28px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 24px;
  padding: 28px;
}

.login-brand-block {
  display: grid;
  gap: 10px;
}

.login-logo {
  display: block;
  width: min(220px, 100%);
  height: auto;
  margin-bottom: 4px;
  object-fit: contain;
}

.login-brand-block h1 {
  margin-bottom: 0;
  line-height: 1.08;
}

.login-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-header h1,
.panel h2,
.empty-state h3 {
  margin: 0;
  line-height: 1.15;
}

.page-header h1 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.panel h2 {
  font-size: 1.18rem;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.panel {
  margin-bottom: 20px;
  padding: 22px;
}

.portfolio-section {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-grid.single-row {
  grid-template-columns: minmax(220px, 1fr);
}

.metric-card {
  min-height: 112px;
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: 2rem;
  line-height: 1;
}

.metric-card.warning strong {
  color: var(--amber);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.content-grid.wide-left {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

label,
.field-block {
  display: grid;
  gap: 7px;
}

.field-group {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.field-group strong {
  color: #344154;
}

label span,
.field-block > span {
  color: #344154;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.15);
}

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

.checkline input {
  width: 18px;
  height: 18px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--blue);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--blue-dark);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.button.ghost {
  border-color: #36445c;
  background: transparent;
  color: #f9fafb;
}

.button.danger {
  background: var(--red);
  color: #ffffff;
}

.button.full {
  width: 100%;
}

.button.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delete-form {
  margin-top: 12px;
}

.pill,
.status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  word-break: break-word;
}

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

.status.bad,
.bad-text {
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
}

.opd-filters {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.opd-form-panel {
  min-width: 0;
}

.opd-table {
  min-width: 980px;
}

.opd-region-row td {
  background: #f8fafc;
}

.opd-unit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #344154;
  font-size: 0.86rem;
}

td {
  color: #243044;
}

td code {
  word-break: break-all;
}

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

.record {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.record summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.record summary::-webkit-details-marker {
  display: none;
}

.record summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  word-break: break-word;
}

.record[open] summary {
  margin-bottom: 14px;
}

.admin-combined-table th:nth-child(1) {
  width: 24%;
}

.admin-combined-table th:nth-child(2) {
  width: 16%;
}

.admin-combined-table th:nth-child(4) {
  width: 120px;
}

.table-muted {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.inline-record {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.inline-record summary {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #344154;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.inline-record summary::-webkit-details-marker {
  display: none;
}

.inline-record[open] summary {
  margin-bottom: 12px;
}

.compact-form {
  gap: 10px;
}

.compact-form input,
.compact-form select,
.compact-form textarea {
  padding: 8px 10px;
}

.account-stack {
  display: grid;
  gap: 10px;
  min-width: 360px;
}

.account-record {
  margin-top: 0;
  background: var(--surface-soft);
}

.add-account-record {
  border-style: dashed;
}

.empty-inline {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
}

.table-delete-form {
  margin-top: 0;
}

.directory-panel {
  padding: 24px;
}

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

.directory-head h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  line-height: 1.12;
}

.directory-primary-action {
  min-width: 164px;
  min-height: 48px;
  box-shadow: 0 18px 34px rgba(31, 95, 191, 0.22);
}

.directory-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.log-filters {
  grid-template-columns: minmax(180px, 260px) auto;
  justify-content: start;
}

.directory-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.directory-table {
  border-collapse: collapse;
  min-width: 920px;
}

.directory-table th {
  background: #f3f5fb;
  color: #687083;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.directory-table td {
  border-bottom: 1px solid #dde4ee;
  padding: 16px 12px;
}

.directory-table tbody > tr:not(.crud-panel-row):nth-child(4n + 1) {
  background: #f8f9fd;
}

.directory-table strong {
  display: block;
}

.account-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.mini-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: #edf4fb;
  color: #1f5fbf;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-pill.non-cif {
  background: #e8f1f3;
  color: #3d6f7e;
}

.action-stack {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.action-stack .button,
.action-stack form,
.action-stack form .button {
  width: 100%;
}

.crud-panel-row > td {
  background: #ffffff;
  padding: 0 12px 16px;
}

.crud-panel {
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(21, 32, 51, 0.07);
}

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

.crud-panel-head h2 {
  margin: 0;
  font-size: 1.12rem;
}

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

.detail-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 11px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.detail-grid strong {
  margin-top: 5px;
  word-break: break-word;
}

.nested-table {
  min-width: 760px;
}

.nested-table th {
  background: #f8fafc;
}

.nested-panel-row > td {
  padding: 10px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.row-actions form {
  margin: 0;
}

.directory-panel {
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  padding: 20px 10px 10px;
}

.directory-head {
  align-items: flex-start;
  margin-bottom: 20px;
}

.directory-head h1 {
  color: #202436;
  font-size: 1.48rem;
  font-weight: 900;
  letter-spacing: 0;
}

.directory-head .muted {
  margin: 10px 0 0;
  color: #76809a;
  font-size: 0.94rem;
}

.directory-panel .eyebrow {
  display: none;
}

.directory-panel .button.primary,
.directory-primary-action {
  border-color: #5365ee;
  border-radius: 12px;
  background: #5365ee;
  color: #ffffff;
}

.directory-panel .button.primary:hover,
.directory-primary-action:hover {
  background: #4858df;
}

.directory-primary-action {
  min-width: 165px;
  min-height: 43px;
  padding-inline: 20px;
  font-size: 0.92rem;
  box-shadow: 0 18px 34px rgba(83, 101, 238, 0.28);
}

.directory-filters {
  grid-template-columns: repeat(5, minmax(148px, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
}

.directory-filters label {
  gap: 8px;
}

.directory-filters label span {
  color: #4d5874;
  font-size: 0.78rem;
  font-weight: 900;
}

.directory-filters input,
.directory-filters select {
  min-height: 46px;
  border-color: #dfe6f2;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 14px;
  color: #242b3d;
  box-shadow: 0 14px 28px rgba(34, 45, 76, 0.03);
}

.directory-filters input::placeholder {
  color: #7e8491;
}

.directory-filter-actions {
  grid-column: 1 / -1;
  gap: 12px;
}

.directory-filter-actions .button {
  min-height: 42px;
  border-radius: 12px;
  padding-inline: 20px;
}

.directory-filter-actions .button.secondary {
  border-color: #dfe6f2;
  background: #ffffff;
  color: #202436;
}

.log-filters {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.log-filters .directory-filter-actions {
  grid-column: 1 / -1;
}

.directory-table {
  min-width: 866px;
}

.directory-table th {
  border-bottom-color: #e3e8f2;
  background: #f5f6fd;
  color: #798199;
  padding: 13px 13px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.directory-table td {
  border-bottom-color: #dde4ee;
  padding: 17px 13px;
  color: #252b3a;
}

.directory-table th:nth-child(1) {
  width: 18%;
}

.directory-table th:nth-child(2) {
  width: 28%;
}

.directory-table th:nth-child(3) {
  width: 26%;
}

.directory-table th:nth-child(4) {
  width: 28%;
}

.directory-table tbody > tr:not(.crud-panel-row) {
  background: #ffffff;
}

.directory-table tbody > tr:not(.crud-panel-row):nth-child(4n + 1) {
  background: #ffffff;
}

.directory-data-row.is-shaded {
  background: #f8f9ff;
}

.directory-table td > strong,
.directory-table td strong {
  color: #202436;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.35;
}

.directory-table .table-muted {
  color: #72809d;
  font-size: 0.78rem;
}

.action-stack {
  gap: 8px;
  min-width: 217px;
}

.action-stack .button {
  min-height: 43px;
  border-color: #dfe6f2;
  border-radius: 12px;
  background: #ffffff;
  color: #202436;
  font-weight: 900;
  box-shadow: none;
}

.action-stack .button:hover {
  border-color: #cdd6e7;
  background: #fbfcff;
}

.action-stack .button.danger,
.directory-panel .button.danger {
  border-color: #ffd3d8;
  background: #fff5f6;
  color: #a64250;
}

.action-stack .button.danger:hover,
.directory-panel .button.danger:hover {
  background: #ffedf0;
}

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.crud-panel-row > td {
  padding: 0 13px 16px;
}

.crud-panel {
  border-color: #e2e8f2;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(35, 44, 69, 0.07);
}

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

.data-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.data-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.data-grid strong {
  display: block;
  margin-top: 6px;
  word-break: break-word;
}

.sync-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

td form {
  margin: 0;
}

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

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.product-card h3 {
  margin: 6px 0 14px;
  font-size: 1rem;
}

.product-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.product-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.product-card dt {
  color: var(--muted);
  font-weight: 700;
}

.product-card dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
  word-break: break-word;
}

.product-meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.compact-empty {
  min-height: 112px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 1rem;
}

.endpoint-fields {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.endpoint-fields.active {
  display: grid;
}

.empty-state {
  display: grid;
  gap: 10px;
  place-items: start;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-soft);
}

.json-output,
.payload-grid pre {
  overflow: auto;
  max-height: 520px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e5edf8;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

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

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

.compact-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
}

.compact-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-filter select {
  min-width: 160px;
}

.flash-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.flash {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.flash.success {
  border-color: rgba(8, 127, 91, 0.35);
}

.flash.error {
  border-color: rgba(180, 35, 24, 0.35);
}

@media (max-width: 1040px) {
  .metric-grid,
  .metric-grid.single-row,
  .content-grid,
  .content-grid.wide-left,
  .product-grid,
  .directory-filters,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
  }

  .main-shell {
    margin-left: 0;
    padding: 18px;
  }

  .page-header,
  .panel-head,
  .directory-head,
  .crud-panel-head,
  .record summary {
    display: grid;
  }

  .metric-grid,
  .metric-grid.single-row,
  .content-grid,
  .content-grid.wide-left,
  .product-grid,
  .form-grid.two,
  .endpoint-fields,
  .data-grid,
  .payload-grid,
  .directory-filters,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .directory-filter-actions,
  .row-actions {
    display: grid;
  }

  .directory-primary-action,
  .directory-filter-actions .button,
  .row-actions .button,
  .row-actions form,
  .row-actions form .button {
    width: 100%;
  }
}

body.admin-app-layout {
  --admin-blue: #5365ee;
  --admin-ink: #202436;
  --admin-muted: #747d95;
  --admin-border: #e4e9f2;
  background: #f6f7fb;
  color: var(--admin-ink);
}

.admin-app-layout .sidebar {
  width: 254px;
  gap: 18px;
  border-right: 1px solid #edf0f6;
  background: #ffffff;
  color: var(--admin-ink);
  padding: 16px 14px;
  box-shadow: none;
}

.admin-app-layout .brand {
  min-height: 32px;
  padding: 0 8px 8px;
}

.admin-app-layout .brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--admin-blue);
  color: #ffffff;
  font-size: 0.78rem;
}

.admin-app-layout .brand strong {
  color: #202436;
  font-size: 0.9rem;
  line-height: 1;
}

.admin-app-layout .brand small {
  color: #747d95;
  font-size: 0.7rem;
}

.sidebar-profile {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
  box-shadow: 0 10px 24px rgba(32, 36, 54, 0.04);
}

.sidebar-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile strong {
  color: #202436;
  font-size: 0.76rem;
  line-height: 1.25;
}

.sidebar-profile small {
  color: #7d879b;
  font-size: 0.64rem;
}

.sidebar-profile-control {
  width: 8px;
  height: 8px;
  justify-self: center;
  border-right: 1.5px solid #7d879b;
  border-bottom: 1.5px solid #7d879b;
  transform: rotate(45deg) translateY(-2px);
}

.admin-app-layout .nav {
  gap: 5px;
}

.admin-app-layout .nav a {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #626a7d;
  padding: 7px 8px;
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-app-layout .nav a:hover,
.admin-app-layout .nav a.active {
  border-color: #e3e8f1;
  background: #ffffff;
  color: #202436;
  box-shadow: 0 8px 18px rgba(32, 36, 54, 0.04);
}

.nav-icon {
  position: relative;
  display: inline-grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  color: currentColor;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  border: 1.5px solid currentColor;
}

.nav-icon-dashboard::before {
  inset: 2px;
  border-radius: 3px;
}

.nav-icon-dashboard::after {
  width: 5px;
  height: 5px;
  border-radius: 999px;
}

.nav-icon-admin::before {
  width: 12px;
  height: 8px;
  border-radius: 2px;
}

.nav-icon-admin::after {
  width: 7px;
  height: 1.5px;
  border: 0;
  background: currentColor;
}

.nav-icon-portfolio::before {
  inset: 2px;
  border-radius: 999px;
}

.nav-icon-portfolio::after {
  width: 7px;
  height: 7px;
  border-top: 0;
  border-left: 0;
}

.nav-icon-wallet::before {
  inset: 3px 1px 3px 2px;
  border-radius: 2px;
}

.nav-icon-wallet::after {
  right: 2px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
}

.nav-icon-logs::before {
  inset: 1px 3px;
  border-radius: 2px;
}

.nav-icon-logs::after {
  width: 6px;
  height: 1.5px;
  border: 0;
  background: currentColor;
  box-shadow: 0 -4px 0 currentColor, 0 4px 0 currentColor;
}

.nav-icon-settings::before {
  inset: 2px;
  border-radius: 999px;
}

.nav-icon-settings::after {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.nav-icon-support::before {
  inset: 2px;
  border-radius: 2px;
}

.nav-icon-support::after {
  width: 6px;
  height: 1.5px;
  border: 0;
  background: currentColor;
  transform: rotate(-35deg);
}

.sidebar-progress {
  display: grid;
  gap: 9px;
  margin-top: auto;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.sidebar-progress-pill {
  display: flex;
  min-height: 33px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  background: var(--admin-blue);
  color: #ffffff;
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 850;
}

.sidebar-progress-pill strong {
  font-size: 0.72rem;
}

.sidebar-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e8fb;
}

.sidebar-progress-track span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: var(--admin-blue);
}

.sidebar-progress small {
  color: #747d95;
  font-size: 0.68rem;
  line-height: 1.4;
}

.admin-app-layout .logout-form {
  margin-top: 0;
}

.admin-app-layout .button.ghost {
  border-color: #e3e8f1;
  background: #ffffff;
  color: #525b70;
}

.admin-app-layout .button.ghost:hover {
  background: #f7f8fc;
  color: #202436;
}

.admin-app-layout .main-shell {
  margin-left: 254px;
  padding: 16px 18px 36px;
  background: #f6f7fb;
}

.admin-dashboard-page {
  display: grid;
  gap: 14px;
  max-width: 1180px;
}

.admin-page-head {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-page-head h1 {
  margin: 0;
  color: var(--admin-ink);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
}

.admin-page-head p {
  margin: 6px 0 0;
  color: #737d96;
  font-size: 0.84rem;
}

.live-dashboard {
  max-width: none;
  gap: 18px;
}

.dashboard-monitor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-monitor-head h1 {
  margin: 0;
  color: var(--admin-ink);
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  font-weight: 950;
  line-height: 1.1;
}

.dashboard-monitor-head p.muted {
  margin: 8px 0 0;
  max-width: 680px;
  color: #677189;
}

.dashboard-monitor-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: 520px;
}

.live-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid #bee7d2;
  border-radius: 999px;
  background: #ecfdf3;
  color: #087f5b;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 rgba(18, 183, 106, 0.5);
  animation: live-dot 1.5s ease-out infinite;
}

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

.dashboard-metric-card,
.dashboard-panel {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(32, 36, 54, 0.04);
}

.dashboard-metric-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 17px 16px;
}

.dashboard-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--metric-accent, var(--admin-blue));
}

.dashboard-metric-card span,
.dashboard-metric-card small {
  display: block;
  color: #6d768d;
}

.dashboard-metric-card span {
  font-size: 0.86rem;
}

.dashboard-metric-card strong {
  display: block;
  margin-top: 13px;
  color: var(--admin-ink);
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
  font-weight: 950;
  line-height: 1;
}

.dashboard-metric-card small {
  margin-top: 12px;
  font-size: 0.76rem;
}

.dashboard-metric-card.accent-blue {
  --metric-accent: #4f64f6;
}

.dashboard-metric-card.accent-teal {
  --metric-accent: #178a9e;
}

.dashboard-metric-card.accent-green {
  --metric-accent: #2f9e69;
}

.dashboard-metric-card.accent-navy {
  --metric-accent: #1d3557;
}

.dashboard-metric-card.accent-amber {
  --metric-accent: #b7791f;
}

.dashboard-metric-card.accent-amber strong {
  color: #a16207;
}

.dashboard-metric-card.accent-slate {
  --metric-accent: #64748b;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.dashboard-grid.bottom-grid {
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.35fr);
}

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

.dashboard-panel .panel-head {
  margin-bottom: 16px;
}

.dashboard-panel .panel-head.compact {
  margin-bottom: 14px;
}

.dashboard-panel h2 {
  margin: 0;
  color: var(--admin-ink);
  font-size: 1rem;
  font-weight: 950;
}

.dashboard-panel p.muted {
  margin: 7px 0 0;
  font-size: 0.82rem;
}

.dashboard-freshness {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f2f4f8;
  color: #667085;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.request-chart-frame {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid #e4e9f2;
  border-radius: 8px;
  background: #fbfcff;
}

.request-chart-frame svg {
  display: block;
  width: 100%;
  min-height: 280px;
}

.chart-bg {
  fill: #fbfcff;
}

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

.chart-axis-label {
  fill: #7a8499;
  font-size: 12px;
  font-weight: 700;
}

.request-bar.success {
  fill: #4f64f6;
}

.request-bar.failed {
  fill: #e25656;
}

.request-line {
  stroke: #172554;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  opacity: 0.78;
}

.request-point {
  fill: #ffffff;
  stroke: #4f64f6;
  stroke-width: 3;
}

.request-point.failed {
  stroke: #e25656;
}

.status-monitor {
  display: grid;
  gap: 18px;
  align-items: center;
  justify-items: center;
  min-height: 280px;
}

.status-ring {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  width: 174px;
  height: 174px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border-radius: 50%;
  background: conic-gradient(#2f9e69 var(--rate), #e25656 0);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.status-ring span,
.status-ring small {
  position: relative;
  z-index: 1;
}

.status-ring span {
  color: var(--admin-ink);
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.status-ring small {
  color: #667085;
  font-size: 0.76rem;
  font-weight: 850;
}

.status-ring::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #edf1f7;
  transform: translate(-50%, -50%);
}

.status-monitor-list {
  display: grid;
  width: 100%;
  gap: 8px;
}

.status-monitor-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #fbfcff;
  padding: 10px 12px;
}

.status-monitor-list span {
  color: #667085;
  font-size: 0.82rem;
}

.status-monitor-list strong {
  color: var(--admin-ink);
  font-size: 1rem;
  font-weight: 950;
}

.endpoint-stack {
  display: grid;
  gap: 11px;
}

.endpoint-row {
  display: grid;
  gap: 9px;
  border: 1px solid #e4e9f2;
  border-radius: 8px;
  background: #fbfcff;
  padding: 12px;
}

.endpoint-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.endpoint-title code {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 850;
  word-break: break-word;
}

.endpoint-title strong {
  flex: 0 0 auto;
  color: #4f64f6;
  font-size: 0.78rem;
  font-weight: 950;
}

.endpoint-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf7;
}

.endpoint-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4f64f6;
  transition: width 260ms ease;
}

.endpoint-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dashboard-text-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 900;
}

.dashboard-text-pill.ok {
  background: #ecfdf3;
  color: #087f5b;
}

.dashboard-text-pill.bad {
  background: #fff1f3;
  color: #b42318;
}

.dashboard-text-pill.neutral {
  background: #f2f4f8;
  color: #59647a;
}

.live-log-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.live-log-window {
  position: relative;
  min-height: 420px;
  max-height: 520px;
  overflow: hidden;
  border: 1px solid #e4e9f2;
  border-radius: 8px;
  background: #0f172a;
  color: #e5e7eb;
}

.live-log-feed {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding: 14px;
}

.live-scan-line {
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  height: 70px;
  background: linear-gradient(180deg, rgba(79, 100, 246, 0), rgba(79, 100, 246, 0.2), rgba(79, 100, 246, 0));
  opacity: 0.85;
  animation: live-scan 2.8s linear infinite;
}

.live-log-entry {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-left: 4px solid #4f64f6;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.84);
  padding: 11px 12px;
}

.live-log-entry.ok {
  border-left-color: #2f9e69;
}

.live-log-entry.bad {
  border-left-color: #e25656;
}

.live-log-entry.is-new {
  animation: live-log-enter 720ms ease both;
}

.live-log-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.live-log-entry-head > span:last-child {
  margin-left: auto;
  color: #aab4c5;
  font-size: 0.76rem;
  font-weight: 850;
}

.live-log-entry code {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
  word-break: break-word;
}

.live-log-entry p {
  margin: 0;
  color: #bec7d6;
  font-size: 0.78rem;
  line-height: 1.45;
}

.dashboard-empty {
  border: 1px dashed #d5dce8;
  border-radius: 8px;
  color: #717b90;
  padding: 14px;
  text-align: center;
}

.live-log-window .dashboard-empty {
  border-color: rgba(226, 232, 240, 0.18);
  color: #cbd5e1;
}

.is-live-paused .live-badge {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

@keyframes live-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.44);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(18, 183, 106, 0);
  }
}

@keyframes live-scan {
  0% {
    transform: translateY(-80px);
  }
  100% {
    transform: translateY(520px);
  }
}

@keyframes live-log-enter {
  0% {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.54);
    background: rgba(79, 100, 246, 0.28);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.admin-total-card,
.admin-bill-card,
.admin-activity-panel {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(32, 36, 54, 0.035);
}

.admin-total-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.admin-total-card > div:first-child {
  min-width: min(100%, 520px);
}

.admin-total-card span,
.admin-bill-card span {
  display: block;
  color: #828a9b;
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-total-card strong {
  display: block;
  margin-top: 4px;
  color: var(--admin-ink);
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.25;
  word-break: break-word;
}

.admin-total-card small,
.admin-bill-card small {
  display: block;
  margin-top: 5px;
  color: #7b8498;
  font-size: 0.72rem;
}

.admin-settings-panel {
  width: 100%;
  margin-top: 2px;
}

.admin-dialog {
  width: min(1040px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--admin-ink);
  padding: 0;
}

.admin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.admin-dialog-card {
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.admin-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--admin-border);
  background: #ffffff;
  padding: 20px 24px;
}

.admin-dialog-head h2 {
  margin: 0;
  color: #202436;
  font-size: 1.1rem;
  font-weight: 950;
}

.admin-dialog-head p {
  margin: 7px 0 0;
  color: #747d95;
}

.admin-dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  background: #ffffff;
  color: #202436;
  cursor: pointer;
  font-weight: 900;
}

.admin-dialog-close:hover {
  background: #f6f7fb;
}

.admin-dialog-body {
  max-height: calc(100vh - 142px);
  overflow: auto;
  padding: 22px 24px 24px;
}

.confirm-dialog {
  width: min(460px, calc(100vw - 36px));
}

.confirm-dialog-body {
  display: grid;
  gap: 18px;
  max-height: none;
}

.confirm-dialog-body p {
  margin: 0;
  color: #747d95;
}

.confirm-delete-button {
  border-color: #b42318;
  background: #b42318;
  color: #ffffff;
}

.confirm-delete-button:hover {
  background: #971d14;
}

.admin-dialog-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.credential-reset-group {
  gap: 14px;
}

.credential-status {
  display: grid;
  gap: 4px;
  border: 1px solid var(--admin-border, var(--line));
  border-radius: 8px;
  background: #ffffff;
  padding: 11px 12px;
}

.credential-status span {
  color: #747d95;
  font-size: 0.78rem;
  font-weight: 900;
}

.credential-status strong {
  color: #202436;
  font-weight: 950;
}

.credential-status small {
  color: #747d95;
  line-height: 1.35;
}

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

.secret-field.compact {
  margin-top: 6px;
}

.secret-field input[readonly] {
  background: #ffffff;
  color: #202436;
  cursor: default;
}

.secret-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--admin-border, var(--line));
  border-radius: 8px;
  background: #ffffff;
  color: #5365ee;
  cursor: pointer;
}

.secret-toggle:hover:not(:disabled),
.secret-toggle.is-visible {
  border-color: #5365ee;
  background: #f4f6ff;
}

.secret-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.eye-icon {
  position: relative;
  width: 19px;
  height: 13px;
  border: 1.7px solid currentColor;
  border-radius: 999px 999px 999px 999px / 75% 75% 75% 75%;
}

.eye-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  inset: 50% auto auto 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.detail-secret-block strong {
  display: none;
}

.password-reset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.password-reset-row .button {
  min-height: 43px;
  white-space: nowrap;
}

.generated-password-field input {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

.account-check-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.account-check-row .button {
  min-height: 43px;
  white-space: nowrap;
}

.account-check-message {
  grid-column: 1 / -1;
  min-height: 38px;
  border: 1px solid var(--admin-border, var(--line));
  border-radius: 8px;
  background: #ffffff;
  color: #747d95;
  padding: 10px 12px;
  font-weight: 800;
}

.account-check-message:empty {
  display: none;
}

.account-check-message[data-state="loading"] {
  border-color: #d8defe;
  background: #f6f7ff;
  color: #5365ee;
}

.account-check-message[data-state="success"] {
  border-color: #caead8;
  background: #f3fbf6;
  color: #087f5b;
}

.account-check-message[data-state="warning"] {
  border-color: #ffe0a8;
  background: #fff9ef;
  color: #9a5b00;
}

.account-check-message[data-state="error"] {
  border-color: #ffd3d8;
  background: #fff7f8;
  color: #a64250;
}

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

.admin-bill-card {
  min-height: 98px;
  padding: 14px 16px;
}

.admin-bill-card strong {
  display: block;
  margin-top: 6px;
  color: var(--admin-ink);
  font-size: 1.18rem;
  font-weight: 950;
  line-height: 1;
}

.admin-bill-card::after {
  content: "";
  display: block;
  width: 34px;
  height: 34px;
  margin-top: 12px;
  border: 4px solid #e2e8ff;
  border-top-color: var(--admin-blue);
  border-radius: 999px;
}

.admin-bill-card:nth-child(2)::after {
  border-color: #e5f7ee;
  border-top-color: #4fb477;
}

.admin-bill-card:nth-child(3)::after {
  border-color: #f7e9f0;
  border-top-color: #a64250;
}

.admin-app-layout .directory-panel {
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.admin-app-layout .directory-head {
  margin: 0;
  padding: 16px 16px 14px;
}

.admin-app-layout .directory-head h1 {
  font-size: 0.98rem;
}

.admin-app-layout .directory-head .muted {
  margin-top: 6px;
  font-size: 0.84rem;
}

.admin-app-layout .directory-filters {
  margin: 0;
  padding: 0 16px 16px;
}

.admin-app-layout .directory-filters input,
.admin-app-layout .directory-filters select,
.admin-app-layout .button,
.admin-app-layout .crud-panel {
  border-radius: 8px;
}

.admin-app-layout .directory-panel .button.primary,
.admin-app-layout .directory-primary-action,
.admin-app-layout .button.primary {
  border-color: var(--admin-blue);
  background: var(--admin-blue);
  color: #ffffff;
}

.admin-app-layout .directory-primary-action {
  min-height: 40px;
  min-width: 166px;
  box-shadow: 0 14px 28px rgba(83, 101, 238, 0.24);
}

.admin-app-layout .directory-table {
  min-width: 900px;
}

.admin-app-layout .log-table {
  min-width: 1120px;
}

.admin-app-layout .log-table th:nth-child(1) {
  width: 15%;
}

.admin-app-layout .log-table th:nth-child(2) {
  width: 22%;
}

.admin-app-layout .log-table th:nth-child(3) {
  width: 24%;
}

.admin-app-layout .log-table th:nth-child(4) {
  width: 21%;
}

.admin-app-layout .log-table th:nth-child(5) {
  width: 18%;
}

.admin-app-layout .directory-table th {
  background: #f4f6fc;
  color: #788198;
  padding: 13px 14px;
  font-size: 0.72rem;
}

.admin-app-layout .directory-table td {
  padding: 15px 14px;
}

.admin-app-layout .directory-data-row.is-shaded {
  background: #f7f8fe;
}

.admin-app-layout .action-stack {
  min-width: 205px;
}

.admin-app-layout .action-stack .button {
  min-height: 40px;
}

.admin-app-layout .crud-panel-row > td {
  background: #ffffff;
  padding: 0 14px 14px;
}

.admin-app-layout .crud-panel {
  border-color: var(--admin-border);
  box-shadow: 0 12px 26px rgba(32, 36, 54, 0.05);
}

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

.log-payload-card {
  min-width: 0;
  border: 1px solid var(--admin-border, var(--line));
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.log-payload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--admin-border, var(--line));
  background: #f6f7fc;
  padding: 10px 12px;
}

.log-payload-head h3 {
  margin: 0;
  color: #202436;
  font-size: 0.86rem;
  font-weight: 900;
}

.log-payload-head span {
  color: #747d95;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.log-payload-card pre {
  overflow: auto;
  max-height: 360px;
  margin: 0;
  border: 0;
  border-radius: 0;
  white-space: pre;
}

.log-payload-card .empty-inline {
  margin: 12px;
}

.log-error-box {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border: 1px solid #ffd3d8;
  border-radius: 8px;
  background: #fff7f8;
  color: #a64250;
  padding: 12px;
}

.log-error-box strong {
  color: #8f3341;
  font-size: 0.82rem;
}

.log-error-box span {
  word-break: break-word;
}

@media (max-width: 1040px) {
  .dashboard-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-grid.bottom-grid {
    grid-template-columns: 1fr;
  }

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

  .log-payload-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-app-layout .sidebar {
    width: 100%;
  }

  .admin-app-layout .main-shell {
    margin-left: 0;
    padding: 14px;
  }

  .admin-page-head,
  .dashboard-monitor-head,
  .admin-total-card,
  .admin-bill-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-monitor-meta {
    justify-content: flex-start;
  }

  .dashboard-metric-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-panel {
    padding: 16px;
  }

  .request-chart-frame,
  .request-chart-frame svg {
    min-height: 240px;
  }

  .status-monitor {
    min-height: 0;
  }

  .live-log-window {
    min-height: 360px;
  }

  .endpoint-title,
  .dashboard-panel .panel-head {
    display: grid;
    justify-content: stretch;
  }

  .admin-dialog {
    width: min(100vw - 20px, 1040px);
  }

  .admin-dialog-head,
  .admin-dialog-body {
    padding: 16px;
  }

  .admin-dialog-head,
  .password-reset-row,
  .account-check-row,
  .admin-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-app-layout .log-filters {
    grid-template-columns: 1fr;
  }

  .admin-page-head .directory-primary-action {
    width: 100%;
  }
}

.portfolio-shell {
  min-height: 100vh;
  padding: 18px 24px 44px;
  background:
    linear-gradient(180deg, rgba(18, 121, 168, 0.08), rgba(255, 255, 255, 0) 340px),
    #f6f8fb;
  color: #0d1b2f;
}

.portfolio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.portfolio-brand-panel {
  display: flex;
  min-width: 420px;
  align-items: center;
  gap: 18px;
}

.portfolio-logo {
  width: 184px;
  height: 58px;
  object-fit: contain;
  border: 1px solid rgba(18, 121, 168, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px;
  box-shadow: 0 14px 28px rgba(18, 121, 168, 0.11);
}

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

.portfolio-eyebrow,
.portfolio-section-kicker {
  margin: 0;
  color: #1279a8;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portfolio-title h1 {
  margin: 4px 0 0;
  color: #0d1b2f;
  font-size: clamp(1.65rem, 2.5vw, 2.2rem);
  line-height: 1.05;
}

.portfolio-title small {
  display: block;
  margin-top: 7px;
  color: #687488;
  font-size: 1rem;
  font-weight: 800;
}

.portfolio-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.portfolio-tab {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7dbdf;
  border-radius: 8px;
  background: #ffffff;
  color: #0d1b2f;
  padding: 11px 18px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.04);
}

.portfolio-tab:hover,
.portfolio-tab.active {
  border-color: rgba(18, 121, 168, 0.38);
  background: #e9f6fb;
  color: #1279a8;
}

.portfolio-refresh-form,
.portfolio-logout-form {
  margin: 0;
}

.portfolio-refresh {
  border-color: rgba(236, 66, 72, 0.26);
  background: #ec4248;
  color: #ffffff;
  cursor: pointer;
}

.portfolio-refresh:hover {
  border-color: #c7232f;
  background: #c7232f;
  color: #ffffff;
}

.portfolio-user {
  display: inline-flex;
  min-height: 44px;
  max-width: 340px;
  align-items: center;
  border-radius: 999px;
  background: #e6f2ee;
  color: #3d7b6a;
  padding: 9px 16px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-logout {
  cursor: pointer;
}

.portfolio-overview,
.portfolio-status-strip,
.portfolio-metric,
.savings-chart-panel,
.portfolio-customer-panel,
.statement-panel {
  border: 1px solid #d8dde2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(23, 32, 51, 0.05);
}

.portfolio-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px 22px;
}

.portfolio-overview h2 {
  margin: 5px 0 0;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  line-height: 1.1;
}

.last-update-pill,
.chart-period-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border-radius: 999px;
  background: #fff4d9;
  color: #8a651a;
  padding: 8px 14px;
  font-weight: 900;
  white-space: nowrap;
}

.portfolio-status-strip {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 18px;
  color: #6c7380;
  font-size: 1.12rem;
}

.portfolio-status-strip strong {
  color: #172033;
}

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

.portfolio-metric {
  position: relative;
  overflow: hidden;
  min-height: 144px;
  padding: 22px 20px;
}

.portfolio-metric-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.portfolio-metric-link:hover,
.portfolio-metric-link:focus-visible {
  border-color: rgba(18, 121, 168, 0.34);
  box-shadow: 0 18px 42px rgba(23, 32, 51, 0.11);
  transform: translateY(-2px);
}

.portfolio-metric-link:focus-visible {
  outline: 3px solid rgba(18, 121, 168, 0.22);
  outline-offset: 3px;
}

.metric-cash {
  --metric-color: #1279a8;
  --metric-text: #1279a8;
}

.metric-loan {
  --metric-color: #ec4248;
  --metric-text: #c7232f;
}

.metric-non-cif {
  --metric-color: #4f7c8a;
  --metric-text: #3d6f7e;
}

.metric-deposit {
  --metric-color: #3d7b6a;
  --metric-text: #2f6f5e;
}

.metric-cif {
  --metric-color: #3d7b6a;
  --metric-text: #3d7b6a;
}

.portfolio-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--metric-color, #1279a8);
}


.portfolio-metric span,
.customer-field span {
  display: block;
  color: #6a7280;
  font-size: 0.95rem;
  font-weight: 800;
}

.portfolio-metric strong {
  display: block;
  margin-top: 12px;
  color: var(--metric-text, #1279a8);
  font-size: clamp(1.75rem, 2.2vw, 2rem);
  line-height: 1.05;
}


.metric-cash::before {
  background: #1279a8;
}

.metric-non-cif::before {
  background: #4f7c8a;
}

.metric-deposit::before {
  background: #3d7b6a;
}

.metric-loan::before {
  background: #ec4248;
}

.metric-cif::before {
  background: #3d7b6a;
}

.metric-cash strong {
  color: #1279a8;
}

.metric-non-cif strong {
  color: #3d6f7e;
}

.metric-deposit strong {
  color: #2f6f5e;
}

.metric-loan strong {
  color: #c7232f;
}

.metric-cif strong {
  color: #3d7b6a;
}

.portfolio-metric p {
  margin: 9px 0 0;
  color: #6a7280;
}

.savings-chart-panel {
  margin-bottom: 22px;
  padding: 22px;
}

.portfolio-panel-title.compact {
  align-items: center;
}

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

.chart-card {
  min-width: 0;
  border: 1px solid #d8dde2;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
  padding: 16px;
}

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

.chart-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.chart-card-head span {
  color: #687488;
  font-weight: 800;
  white-space: nowrap;
}

.chart-frame {
  position: relative;
  width: 100%;
  min-height: 300px;
}

.savings-chart {
  display: block;
  max-width: 100%;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 3px;
  min-width: 164px;
  max-width: min(260px, calc(100% - 16px));
  padding: 10px 12px;
  border: 1px solid rgba(18, 27, 47, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(21, 32, 51, 0.16);
  color: #0d1b2f;
  pointer-events: none;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip-title {
  color: #687488;
  font-size: 0.78rem;
  font-weight: 800;
}

.chart-tooltip-value {
  font-size: 0.96rem;
  line-height: 1.25;
}

.transaction-chart-panel {
  margin-top: -6px;
}

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

.transaction-directions .transaction-chart-card {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid #d9e2ec;
}

.transaction-directions .transaction-tier-list {
  grid-template-columns: minmax(0, 1fr);
}

.statement-balances,
.statement-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.statement-balances strong {
  display: block;
  margin-top: 4px;
}

@media (max-width: 1000px) {
  .transaction-directions {
    grid-template-columns: minmax(0, 1fr);
  }
}

.transaction-chart-title {
  gap: 18px;
}

.savings-filter,
.transaction-filter {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.savings-filter label,
.transaction-filter label {
  display: grid;
  gap: 6px;
  min-width: 154px;
  color: #687488;
  font-size: 0.78rem;
  font-weight: 800;
}

.savings-filter input,
.transaction-filter input,
.chart-account-picker select {
  min-height: 38px;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #152033;
  font-weight: 750;
}

.portfolio-panel-title.chart-panel-heading {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.chart-panel-heading h2 {
  font-size: 1.4rem;
}

.chart-panel-heading form {
  justify-content: flex-start;
  min-width: 0;
}

.chart-panel-heading .chart-account-picker {
  flex: 1 1 300px;
  min-width: 0;
  max-width: 460px;
}

.chart-account-picker select {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

.chart-panel-heading form[aria-busy="true"] button {
  cursor: wait;
  opacity: 0.7;
}

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

.transaction-summary div {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.transaction-summary span,
.transaction-tier-list em {
  display: block;
  color: #687488;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.transaction-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 1.08rem;
}

.transaction-count-button {
  display: block;
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: #152033;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.transaction-count-button:hover {
  color: #285f84;
  text-decoration: underline;
}

.transaction-count-button:focus-visible,
.transaction-tier-detail:focus-visible {
  outline: 2px solid #285f84;
  outline-offset: 3px;
}

.transaction-chart {
  display: block;
  max-width: 100%;
}

.transaction-tier-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.transaction-tier-list li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid #edf1f6;
}

.transaction-tier-list li {
  display: block;
}

.transaction-tier-detail {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.transaction-tier-detail:hover {
  background: #edf4f8;
}

.transaction-detail-dialog {
  --admin-border: #dce4eb;
  --admin-ink: #182331;
  width: min(1240px, calc(100vw - 32px));
  overflow: hidden;
}

.transaction-detail-dialog [hidden] {
  display: none !important;
}

.transaction-detail-card {
  display: flex;
  flex-direction: column;
  height: min(760px, calc(100dvh - 36px));
  min-height: 0;
}

.transaction-detail-dialog .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 20px;
}

.transaction-detail-dialog .admin-dialog-head > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.transaction-detail-toolbar,
.transaction-detail-summary,
.transaction-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 20px;
}

.transaction-detail-account {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 280px;
  overflow-wrap: anywhere;
}

.transaction-detail-account span {
  color: #657385;
  font-size: 0.85rem;
}

.transaction-detail-exports,
.transaction-detail-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transaction-detail-summary {
  border-block: 1px solid #dce4eb;
  background: #f3f7fa;
}

.transaction-detail-status {
  margin: 20px;
  color: #526577;
}

.transaction-detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.transaction-detail-table {
  table-layout: fixed;
  width: 100%;
  min-width: 950px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.transaction-detail-table th,
.transaction-detail-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8ef;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.transaction-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf0f5;
  color: #435b70;
  text-align: left;
}

.transaction-detail-table th:nth-child(1) { width: 5%; }
.transaction-detail-table th:nth-child(2) { width: 12%; }
.transaction-detail-table th:nth-child(3) { width: 16%; }
.transaction-detail-table th:nth-child(4) { width: 31%; }
.transaction-detail-table th:nth-child(5),
.transaction-detail-table th:nth-child(6) { width: 18%; }
.transaction-detail-table td:nth-child(n+5),
.transaction-detail-table th:nth-child(n+5) { text-align: right; font-variant-numeric: tabular-nums; }
.transaction-detail-table tbody tr:nth-child(even) { background: #f8fafc; }

.transaction-detail-money-negative {
  color: #c7232f;
  font-weight: 900;
}

.transaction-detail-footer {
  margin-top: auto;
  border-top: 1px solid #dce4eb;
  justify-content: flex-end;
}

.detail-page-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #dce4eb;
  border-radius: 6px;
  background: white;
  color: #285f84;
  font-size: 20px;
  cursor: pointer;
}

.detail-page-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.tier-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tier-color);
}

.tier-label {
  min-width: 0;
  color: #152033;
  font-size: 0.84rem;
  font-weight: 800;
}

.transaction-tier-list strong {
  color: #0d1b2f;
  font-size: 0.84rem;
  text-align: right;
  white-space: nowrap;
}

.transaction-tier-list em {
  grid-column: 2 / 4;
}


.recent-transactions-panel .portfolio-panel-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.48fr);
  align-items: start;
  gap: 22px;
}

.recent-transactions-account {
  margin: 8px 0 0;
  color: #0f1f35;
  font-size: 1rem;
  font-weight: 650;
}

.recent-transactions-tools {
  display: grid;
  gap: 8px;
  min-width: 0;
  justify-self: end;
  width: min(586px, 100%);
}

.recent-transactions-updated {
  color: #0f1f35;
  font-weight: 750;
  text-align: left;
}

.recent-transactions-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.recent-transactions-filter .chart-account-picker {
  min-width: 0;
}

.recent-transactions-filter .chart-account-picker span {
  display: block;
  margin-bottom: 6px;
  color: #233348;
  font-size: 0.84rem;
  font-weight: 900;
}

.recent-transactions-filter select {
  width: 100%;
  min-height: 50px;
  font-size: 0.95rem;
}

.recent-transactions-filter .statement-button {
  min-height: 50px;
  min-width: 94px;
}

.recent-transactions-scroll {
  overflow: auto;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  scrollbar-gutter: stable;
}

.recent-transactions-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.recent-transactions-table th,
.recent-transactions-table td {
  padding: 14px 14px;
  overflow-wrap: normal;
  word-break: normal;
}

.recent-transactions-table th {
  position: static;
  background: #e9eef4;
  color: #34445a;
  white-space: nowrap;
  vertical-align: middle;
}

.recent-transactions-table th:nth-child(1),
.recent-transactions-table td:nth-child(1) { width: 112px; white-space: nowrap; }
.recent-transactions-table th:nth-child(2),
.recent-transactions-table td:nth-child(2) { width: 160px; white-space: nowrap; }
.recent-transactions-table th:nth-child(3),
.recent-transactions-table td:nth-child(3) { width: auto; overflow-wrap: anywhere; }
.recent-transactions-table th:nth-child(4),
.recent-transactions-table td:nth-child(4),
.recent-transactions-table th:nth-child(5),
.recent-transactions-table td:nth-child(5),
.recent-transactions-table th:nth-child(6),
.recent-transactions-table td:nth-child(6) { width: 180px; white-space: nowrap; }

.recent-transactions-table .recent-debit,
.recent-transactions-table .recent-credit,
.recent-transactions-table .recent-balance {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.recent-transactions-table .recent-debit.is-negative {
  color: #b42318;
  font-weight: 850;
}

@media (max-width: 920px) {
  .recent-transactions-panel .portfolio-panel-title {
    grid-template-columns: 1fr;
  }

  .recent-transactions-tools {
    justify-self: stretch;
    width: 100%;
  }

  .recent-transactions-filter {
    grid-template-columns: 1fr;
  }
}

.portfolio-customer-panel {
  margin-bottom: 28px;
  padding: 22px 24px;
  scroll-margin-top: 18px;
}

.portfolio-panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.portfolio-panel-title h2 {
  margin: 8px 0 0;
  font-size: clamp(1.55rem, 2vw, 1.9rem);
  line-height: 1.08;
}

.cif-badge,
.bank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e6f2ee;
  color: #3d7b6a;
  font-weight: 900;
}

.cif-badge {
  min-height: 38px;
  padding: 8px 14px;
}

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

.customer-field {
  min-height: 78px;
  border: 1px solid #d8dde2;
  border-radius: 8px;
  padding: 15px 14px;
}

.customer-field strong {
  display: block;
  margin-top: 8px;
  font-size: 1.03rem;
  word-break: break-word;
}

.bank-section {
  margin: 0 0 28px;
  scroll-margin-top: 18px;
}

.bank-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  margin-bottom: 14px;
}

.bank-section-head.split {
  justify-content: space-between;
}

.bank-section-head h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.product-section-cash .bank-section-head h2 {
  color: #1279a8;
}

.product-section-non-cif .bank-section-head h2 {
  color: #3d6f7e;
}

.product-section-deposit .bank-section-head h2 {
  color: #2f6f5e;
}

.product-section-loan .bank-section-head h2 {
  color: #c7232f;
}

.bank-section-head p {
  margin: 0;
  color: #687488;
  font-weight: 800;
}

.bank-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 482px));
  gap: 18px;
  align-items: stretch;
}

.bank-card {
  position: relative;
  min-height: 244px;
  border: 1px solid #d8dde2;
  border-top: 4px solid #1279a8;
  border-radius: 8px;
  background: #ffffff;
  padding: 22px 20px 20px;
  box-shadow: 0 16px 36px rgba(23, 32, 51, 0.08);
}

.bank-card h3 {
  max-width: calc(100% - 72px);
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.22;
  text-transform: uppercase;
}

.deposit-info-fallback-form,
.loan-info-fallback-form {
  margin: 16px 0 0;
}

.bank-card-info-button {
  margin-top: 0;
  border: 1px solid #bed1ca;
  border-radius: 7px;
  background: #edf7f3;
  color: #2f6f5e;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.bank-card-info-button:hover,
.bank-card-info-button:focus-visible {
  border-color: #2f6f5e;
  outline: none;
}

.bank-card-info-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.deposit-info-panel {
  margin-top: 12px;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.deposit-info-status {
  margin: 0;
  color: #4f5c6f;
  font-size: 0.9rem;
  font-weight: 750;
}

.deposit-info-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #dbe4ea;
  border-radius: 7px;
  background: #ffffff;
}

.loan-info-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #dbe4ea;
  border-radius: 7px;
  background: #ffffff;
}

.deposit-info-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.loan-info-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.deposit-info-table th,
.deposit-info-table td,
.loan-info-table th,
.loan-info-table td {
  border-bottom: 1px solid #e6edf3;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.deposit-info-table th,
.loan-info-table th {
  background: #eef4f1;
  color: #34445a;
  font-weight: 900;
  white-space: nowrap;
}

.deposit-info-status.error {
  color: #b42318;
}

.deposit-info-table td:nth-child(5),
.deposit-info-table td:nth-child(10) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.loan-info-table td:nth-child(5),
.loan-info-table td:nth-child(6),
.loan-info-table td:nth-child(11) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bank-number {
  margin: 10px 0 0;
  color: #6a7280;
  font-weight: 900;
}

.bank-amount {
  display: block;
  margin-top: 16px;
  color: #1279a8;
  font-size: clamp(1.55rem, 2.3vw, 1.85rem);
  line-height: 1.05;
}

.bank-card-deposit {
  border-top-color: #3d7b6a;
}

.bank-card-deposit .bank-amount {
  color: #2f6f5e;
}

.bank-card-non-cif {
  border-top-color: #4f7c8a;
}

.bank-card-non-cif .bank-amount {
  color: #3d6f7e;
}

.bank-card-non-cif .bank-card-action {
  border-color: rgba(79, 124, 138, 0.24);
  background: #e8f1f3;
  color: #3d6f7e;
}

.bank-card-loan {
  border-top-color: #ec4248;
}

.bank-card-loan .bank-amount {
  color: #c7232f;
}

.bank-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 56px;
  height: 56px;
  font-size: 0.92rem;
}

.bank-details {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.bank-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bank-details dt {
  color: #6a7280;
}

.bank-details dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
  word-break: break-word;
}

.bank-card-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  border: 1px solid rgba(18, 121, 168, 0.24);
  border-radius: 8px;
  background: #e5f2f7;
  color: #1279a8;
  padding: 9px 16px;
  font-weight: 900;
  text-decoration: none;
}

.portfolio-empty {
  display: flex;
  min-height: 116px;
  width: min(100%, 482px);
  align-items: flex-start;
  border: 1px solid #d8dde2;
  border-radius: 8px;
  background: #ffffff;
  color: #6a7280;
  padding: 24px;
  font-size: 1.12rem;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.05);
}

.product-empty {
  align-items: center;
}

.statement-panel {
  min-height: 514px;
  padding: 24px 20px;
}

.statement-panel h2 {
  margin: 8px 0 14px;
  font-size: 1.45rem;
}

.statement-form {
  border: 1px solid #d8dde2;
  border-radius: 8px;
  padding: 22px 20px;
}

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

.statement-grid label {
  gap: 9px;
}

.statement-grid label span {
  color: #6a7280;
  font-size: 0.95rem;
  font-weight: 900;
}

.statement-grid input,
.statement-grid select {
  min-height: 56px;
  border-color: #d8dde2;
  background: #ffffff;
  font-size: 1.12rem;
}

.statement-account {
  grid-column: span 1;
}

.statement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.statement-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 900;
}

.statement-button.primary {
  background: #3d7b6a;
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(61, 123, 106, 0.18);
}

.statement-button.secondary {
  border-color: rgba(61, 123, 106, 0.24);
  background: #e6f2ee;
  color: #3d7b6a;
}

.statement-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}


.statement-sync-progress {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #d8dde2;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px 20px;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.05);
}

.statement-sync-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.statement-sync-heading strong {
  font-size: 1.02rem;
}

.statement-sync-heading span {
  border-radius: 999px;
  background: #f3f7fa;
  color: #3b5068;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.statement-sync-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sync-step;
}

.statement-sync-steps li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d8dde2;
  border-radius: 999px;
  background: #f8fafc;
  color: #526577;
  padding: 7px 11px;
  font-size: 0.9rem;
  font-weight: 800;
  counter-increment: sync-step;
}

.statement-sync-steps li::before {
  content: counter(sync-step);
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e6edf3;
  color: #526577;
  font-size: 0.78rem;
}

.statement-sync-steps li.is-current {
  border-color: rgba(61, 123, 106, 0.28);
  background: #e8f2ee;
  color: #2f6f5e;
}

.statement-sync-steps li.is-current::before {
  background: #3d7b6a;
  color: #ffffff;
}

.statement-sync-progress progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e6edf3;
  appearance: none;
}

.statement-sync-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e6edf3;
}

.statement-sync-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: #3d7b6a;
}

.statement-sync-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: #3d7b6a;
}

.statement-sync-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.statement-sync-status p,
.statement-sync-batches {
  margin: 0;
  color: #152033;
  font-weight: 700;
}

.statement-sync-status span {
  color: #152033;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.statement-sync-batches {
  color: #526577;
  font-size: 0.95rem;
}

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

.statement-sync-actions .statement-button {
  min-height: 42px;
  padding: 9px 14px;
}

@media (max-width: 680px) {
  .statement-sync-progress {
    padding: 16px;
  }

  .statement-sync-steps {
    display: grid;
  }

  .statement-sync-actions .statement-button {
    width: 100%;
  }
}

.statement-report-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #d8dde2;
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.05);
}

.statement-report-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 16px;
  border-bottom: 4px solid #003366;
  padding: 6px 10px 12px;
}

.statement-report-brand img {
  display: block;
  width: min(260px, 100%);
  height: auto;
  object-fit: contain;
}

.statement-report-head h2 {
  margin: 0;
  color: #003366;
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  font-weight: 950;
  text-align: right;
}

.statement-report-meta {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 0.8fr);
  gap: 18px;
  background: #f3f3f3;
  padding: 16px 18px;
}

.statement-report-meta span,
.statement-report-meta b,
.statement-report-meta strong {
  display: block;
}

.statement-report-meta span {
  color: #003366;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.statement-report-meta strong {
  margin-top: 4px;
  color: #050b18;
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1.05;
}

.statement-report-meta b {
  margin-top: 2px;
  color: #050b18;
}

.statement-report-meta dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.statement-report-meta dl div {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 8px;
}

.statement-report-meta dt,
.statement-report-meta dd {
  margin: 0;
}

.statement-report-meta dt {
  color: #5e6470;
  text-align: right;
}

.statement-report-meta dd {
  color: #050b18;
  font-weight: 900;
}

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

.statement-report-actions span {
  margin-right: auto;
  color: #667085;
  font-weight: 850;
}

.statement-table-wrap {
  overflow: auto;
  border: 1px solid #cccccc;
  border-radius: 8px;
}

.statement-report-table {
  min-width: 1060px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.statement-report-table th {
  border-color: #cccccc;
  background: #e9eef4;
  color: #34445a;
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

.statement-report-table td {
  border-color: #cccccc;
  color: #111827;
  vertical-align: top;
}

.statement-report-table th:nth-child(1),
.statement-report-table td:nth-child(1) {
  width: 92px;
}

.statement-report-table th:nth-child(2),
.statement-report-table td:nth-child(2) {
  width: 150px;
}

.statement-report-table th:nth-child(4),
.statement-report-table td:nth-child(4),
.statement-report-table th:nth-child(5),
.statement-report-table td:nth-child(5),
.statement-report-table th:nth-child(6),
.statement-report-table td:nth-child(6) {
  width: 180px;
}

.statement-report-table tbody tr:nth-child(even) td {
  background: #f5f5f5;
}

.statement-report-table .number-cell {
  text-align: right;
  white-space: nowrap;
}

.statement-report-table .debit-cell {
  color: #b42318;
  font-weight: 850;
}

.statement-empty-row {
  color: #667085;
  font-weight: 850;
  text-align: center;
}

.statement-disclaimer {
  margin: 8px 10px 0;
  color: #777777;
  font-style: italic;
  line-height: 1.5;
}

.portfolio-shell {
  width: min(calc(100% - 32px), 1480px);
  margin: 0 auto;
  padding: 14px 0 34px;
  background:
    linear-gradient(180deg, rgba(18, 121, 168, 0.08), rgba(255, 255, 255, 0) 300px),
    transparent;
}

.portfolio-topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(18, 121, 168, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  box-shadow: 0 14px 34px rgba(21, 32, 51, 0.07);
}

.portfolio-brand-panel {
  min-width: 0;
  gap: 12px;
}

.portfolio-logo {
  width: 150px;
  height: 48px;
  flex: 0 0 auto;
  padding: 5px;
  box-shadow: none;
}

.portfolio-title h1 {
  margin-top: 2px;
  font-size: clamp(1.22rem, 1.5vw, 1.5rem);
}

.portfolio-title small {
  margin-top: 4px;
  font-size: 0.86rem;
}

.portfolio-eyebrow,
.portfolio-section-kicker {
  font-size: 0.72rem;
}

.portfolio-tabs {
  gap: 8px;
}

.portfolio-tab {
  min-height: 40px;
  padding: 8px 13px;
  font-size: 0.9rem;
}

.portfolio-refresh {
  position: relative;
  gap: 8px;
  min-width: 118px;
}

.portfolio-refresh.is-loading {
  padding-left: 36px;
  opacity: 0.9;
}

.portfolio-refresh.is-loading::before {
  content: "";
  position: absolute;
  left: 13px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: refresh-spin 0.8s linear infinite;
}

.refresh-progress {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(140px, 260px);
  align-items: center;
  justify-content: end;
  gap: 10px;
  color: #3d7b6a;
  font-size: 0.82rem;
  font-weight: 800;
}

.refresh-progress[hidden] {
  display: none;
}

.refresh-progress.is-error {
  color: #c7232f;
}

.refresh-progress-bar {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceee9;
}

.refresh-progress-bar span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1279a8, #3d7b6a, #f0b43a);
}

.refresh-progress.is-loading .refresh-progress-bar span {
  animation: refresh-bar 1.05s ease-in-out infinite;
}

.refresh-progress.is-success .refresh-progress-bar span {
  width: 100%;
  animation: none;
}

.portfolio-shell > .flash-stack {
  position: static;
  width: 100%;
  margin: 0 0 12px;
}

.portfolio-shell .flash {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  border-color: rgba(61, 123, 106, 0.28);
  background: #eef8f3;
  color: #245c50;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: none;
}

.portfolio-overview {
  margin-bottom: 12px;
  padding: 13px 16px;
}

.portfolio-overview h2 {
  margin-top: 3px;
  font-size: clamp(1.08rem, 1.5vw, 1.32rem);
}

.last-update-pill,
.chart-period-pill {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.84rem;
}

.portfolio-metrics {
  gap: 12px;
  margin-bottom: 14px;
}

.portfolio-metric {
  min-height: 108px;
  padding: 16px 16px 14px;
}

.portfolio-metric strong {
  margin-top: 8px;
  font-size: clamp(1.35rem, 1.8vw, 1.68rem);
}

.portfolio-metric p {
  margin-top: 7px;
}

.savings-chart-panel {
  margin-bottom: 16px;
  padding: 16px;
}

.chart-grid {
  gap: 12px;
}

.chart-card {
  padding: 14px;
}

.chart-card-head {
  margin-bottom: 8px;
}

.chart-card-head h3 {
  font-size: 0.94rem;
}

.chart-card-head span {
  font-size: 0.82rem;
}

.chart-frame {
  height: 220px;
  min-height: 220px;
}

.savings-chart {
  width: 100%;
  height: 220px;
}

.transaction-chart-card .chart-frame {
  height: 300px;
  min-height: 300px;
}

.transaction-chart {
  width: 100%;
  height: 300px;
}

.savings-filter .statement-button,
.transaction-filter .statement-button {
  min-height: 38px;
  padding: 8px 14px;
}

.portfolio-customer-panel {
  margin-bottom: 18px;
  padding: 16px;
}

.portfolio-panel-title {
  margin-bottom: 14px;
}

.portfolio-panel-title h2 {
  margin-top: 4px;
  font-size: clamp(1.2rem, 1.7vw, 1.55rem);
}

.customer-field-grid {
  gap: 10px;
}

.customer-field {
  min-height: 68px;
  padding: 12px;
}

.customer-field strong {
  margin-top: 5px;
  font-size: 0.94rem;
}

.bank-section {
  margin-bottom: 20px;
}

.bank-section-head {
  margin-bottom: 10px;
}

.bank-section-head h2 {
  font-size: 1.15rem;
}

.bank-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.bank-card {
  min-height: 202px;
  padding: 16px 15px 15px;
}

.bank-card h3 {
  max-width: calc(100% - 54px);
  font-size: 0.9rem;
}

.bank-number {
  margin-top: 7px;
  font-size: 0.86rem;
}

.bank-amount {
  margin-top: 12px;
  font-size: clamp(1.24rem, 1.6vw, 1.48rem);
}

.bank-badge {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  font-size: 0.78rem;
}

.bank-details {
  gap: 7px;
  margin-top: 14px;
  font-size: 0.86rem;
}

.bank-card-action {
  min-height: 36px;
  margin-top: 13px;
  padding: 7px 12px;
  font-size: 0.84rem;
}

.portfolio-empty {
  min-height: 82px;
  width: min(100%, 420px);
  padding: 18px;
  font-size: 0.95rem;
}

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

@keyframes refresh-bar {
  0% {
    transform: translateX(-105%);
  }
  55% {
    transform: translateX(85%);
  }
  100% {
    transform: translateX(260%);
  }
}

@media (max-width: 1120px) {
  .portfolio-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .portfolio-tabs {
    justify-content: flex-start;
  }

  .portfolio-metrics,
  .customer-field-grid,
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portfolio-shell {
    padding: 16px;
  }

  .portfolio-brand-panel {
    min-width: 0;
    align-items: flex-start;
  }

  .portfolio-logo {
    width: 110px;
    height: 52px;
  }

  .portfolio-tabs,
  .statement-actions {
    align-items: stretch;
  }

  .portfolio-tab,
  .portfolio-user,
  .portfolio-refresh-form,
  .portfolio-logout-form {
    width: 100%;
  }

  .portfolio-overview,
  .portfolio-status-strip,
  .portfolio-panel-title,
  .statement-report-head,
  .statement-report-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .statement-report-head h2 {
    text-align: left;
  }

  .statement-report-meta dl div {
    grid-template-columns: 1fr;
  }

  .statement-report-meta dt {
    text-align: left;
  }

  .portfolio-metrics,
  .customer-field-grid,
  .chart-grid,
  .transaction-summary,
  .transaction-tier-list,
  .statement-grid,
  .bank-card-grid {
    grid-template-columns: 1fr;
  }

  .transaction-chart-title,
  .savings-filter,
  .transaction-filter {
    display: grid;
    justify-content: stretch;
  }

  .savings-filter label,
  .transaction-filter label {
    min-width: 0;
  }

  .chart-panel-heading .chart-account-picker {
    max-width: none;
  }

  .savings-chart-panel .chart-card-head {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  .savings-chart-panel .chart-card-head span {
    white-space: normal;
    text-align: left;
  }

  .savings-filter .statement-button,
  .transaction-filter .statement-button {
    width: 100%;
  }

  .transaction-tier-list li {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .transaction-tier-detail {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .transaction-detail-toolbar,
  .transaction-detail-summary,
  .transaction-detail-footer {
    padding: 10px 14px;
  }

  .transaction-detail-dialog .admin-dialog-head {
    display: flex;
    padding: 14px;
  }

  .transaction-tier-list strong,
  .transaction-tier-list em {
    grid-column: 2;
    text-align: left;
  }

  .statement-account {
    grid-column: auto;
  }

  .bank-card {
    min-height: 0;
  }
}

.projection-input-panel {
  padding: 20px;
}

.projection-entry-form {
  align-items: end;
}

.projection-filters {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.projection-plan-table {
  min-width: 980px;
}

.projection-breakdown-table {
  min-width: 860px;
}

.projection-income {
  color: #087f5b;
  font-weight: 900;
}

.projection-expense {
  color: #b42318;
  font-weight: 900;
}

.projection-position {
  font-weight: 900;
}

.projection-position.positive {
  color: #087f5b;
}

.projection-position.negative {
  color: #b42318;
}

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

.projection-chart-panel {
  overflow: hidden;
}

.projection-bar-chart {
  display: grid;
  gap: 13px;
}

.projection-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(220px, 2fr) minmax(170px, 0.9fr);
  align-items: center;
  gap: 14px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.projection-bar-row:hover,
.projection-bar-row.is-selected {
  border-color: rgba(31, 95, 191, 0.4);
  box-shadow: 0 12px 28px rgba(31, 95, 191, 0.1);
}

.projection-bar-row:hover {
  transform: translateY(-1px);
}

.projection-bar-label,
.projection-bar-value {
  display: grid;
  gap: 4px;
}

.projection-bar-label span,
.projection-bar-value span {
  color: #68758b;
  font-size: 0.83rem;
  font-weight: 800;
}

.projection-bar-stack {
  display: grid;
  gap: 9px;
}

.projection-bar-line {
  display: grid;
  grid-template-columns: 112px minmax(120px, 1fr) minmax(130px, auto);
  align-items: center;
  gap: 10px;
}

.projection-bar-name {
  color: #68758b;
  font-size: 0.8rem;
  font-weight: 900;
}

.projection-bar-amount {
  color: #152033;
  font-size: 0.84rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.projection-bar-track {
  display: block;
  overflow: hidden;
  height: 11px;
  border-radius: 999px;
  background: #edf1f5;
}

.projection-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3d7b6a;
}

.projection-bar-line.income .projection-bar-track span {
  background: #3d7b6a;
}

.projection-bar-line.expense .projection-bar-track span {
  background: #c94c55;
}

.projection-bar-line.projected .projection-bar-track {
  height: 14px;
}

.projection-bar-line.projected .projection-bar-track span {
  background: #1f5fbf;
}

.projection-bar-value {
  text-align: right;
}

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

.projection-period-card {
  margin-bottom: 0;
}

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

.projection-period-head h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.projection-period-metrics {
  display: grid;
  gap: 9px;
  margin: 0;
}

.projection-period-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e4eaf1;
  padding-top: 9px;
}

.projection-period-metrics dt,
.projection-period-metrics dd {
  margin: 0;
}

.projection-period-metrics dt {
  color: #68758b;
  font-weight: 800;
}

.projection-period-metrics dd {
  text-align: right;
}

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

  .projection-bar-row {
    grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.4fr);
  }

  .projection-bar-value {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .projection-filters,
  .projection-summary-grid,
  .projection-period-grid,
  .projection-bar-row {
    grid-template-columns: 1fr;
  }

  .projection-bar-line {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .projection-bar-amount {
    text-align: left;
  }
}

.archive-note {
  margin: 0 0 18px;
  border: 1px solid #d9e4ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px 14px;
  color: #34445a;
}

.statement-archive-table {
  min-width: 1120px;
}

.statement-archive-table form {
  margin: 0;
}

.statement-archive-table .button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.deposit-info-dialog-card,
.loan-info-dialog-card {
  width: min(1540px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.deposit-info-frame,
.loan-info-frame {
  display: block;
  width: 100%;
  height: min(780px, calc(100vh - 142px));
  border: 0;
  background: #ffffff;
}

.deposit-dialog-body {
  margin: 0;
  background: #ffffff;
}

.deposit-dialog-content {
  padding: 20px;
}

.deposit-dialog-content h2 {
  margin: 4px 0 8px;
  font-size: 1.35rem;
}

.deposit-dialog-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  border-bottom: 2px solid #1f3d6d;
  padding-bottom: 14px;
}

.deposit-dialog-header img {
  width: 185px;
  height: auto;
  flex: 0 0 auto;
}

.deposit-export-date {
  margin: 4px 0 0;
  color: #647085;
  font-size: 0.88rem;
  font-weight: 800;
}

.deposit-dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.deposit-dialog-exports {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .deposit-dialog-header,
  .deposit-dialog-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .deposit-dialog-header img {
    width: 150px;
  }
}
