/* Accounts page — extends dashboard shell */

:root {
  --acc-purple: var(--dash-accent);
  --acc-purple-soft: var(--dash-surface-hover);
  --acc-card-elevated: var(--dash-elevated);
  --acc-border: rgba(255, 255, 255, 0.08);
  --acc-text: #f4f4f5;
  --acc-yellow: #f59e0b;
  --acc-yellow-soft: rgba(245, 158, 11, 0.14);
  --acc-blue: #3b82f6;
  --acc-blue-soft: rgba(59, 130, 246, 0.14);
  --acc-right-w: 320px;
  --acc-focus-ring: var(--dash-accent-focus);
}

body.acc-page {
  --dash-purple: var(--acc-purple);
  --dash-purple-soft: var(--acc-purple-soft);
}


.acc-page .dash-new-btn,
.acc-page .dash-pro__btn {
  background: var(--acc-purple);
}

.acc-page .dash-search input:focus {
  border-color: var(--dash-border-strong);
  box-shadow: 0 0 0 3px var(--dash-surface-hover);
}

.acc-content {
  padding: var(--dash-content-y, 32px) var(--dash-page-x, 32px);
  padding-left: calc(var(--dash-page-x, 32px) + var(--dash-mobile-nav-gutter, 0px));
  padding-bottom: calc(var(--dash-content-y, 32px) + var(--dash-content-pad-bottom, 0px));
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  container-type: inline-size;
  container-name: acc-content;
}

.acc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, var(--acc-right-w));
  gap: var(--dash-island-gap);
  align-items: start;
}

.acc-main {
  display: flex;
  flex-direction: column;
  gap: var(--dash-island-gap);
  min-width: 0;
  container-type: inline-size;
  container-name: acc-main;
}

.acc-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.acc-head {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.acc-title {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--acc-text);
}

.acc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.acc-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.acc-chips::-webkit-scrollbar {
  display: none;
}

/* KPI — separate islands with 4px gap */
.acc-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.acc-summary__item {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  min-width: 0;
  background: var(--dash-card);
  border: none;
  border-radius: var(--dash-radius-card);
}

.acc-summary__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.acc-summary__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.acc-summary__icon--purple { background: var(--acc-purple-soft); color: var(--acc-purple); }
.acc-summary__icon--bank { background: var(--acc-purple-soft); color: var(--acc-purple); }
.acc-summary__icon--crypto { background: var(--acc-yellow-soft); color: var(--acc-yellow); }
.acc-summary__icon--card { background: var(--acc-blue-soft); color: var(--acc-blue); }

.acc-summary__label {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--dash-text-muted);
}

.acc-summary__value {
  margin: 0;
  font-weight: 600;
}

.acc-summary__meta {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}

.acc-summary__meta--up { color: var(--dash-green); }
.acc-summary__meta--muted { color: var(--dash-text-subtle); }

.acc-summary__spark {
  position: absolute;
  inset-inline-start: auto;
  inset-inline-end: 0;
  bottom: 12px;
  width: 56%;
  height: 28px;
  margin: 0;
  pointer-events: none;
}

.acc-summary__spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.acc-summary__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: auto;
}

.acc-summary__bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 150ms ease;
}

.acc-summary__bar-fill--purple { background: var(--acc-purple); }
.acc-summary__bar-fill--yellow { background: var(--acc-yellow); }
.acc-summary__bar-fill--blue { background: var(--acc-blue); }

.acc-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--dash-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--dash-transition), color var(--dash-transition);
}

.acc-chip:hover,
.acc-chip.is-active {
  background: var(--acc-card-elevated);
  color: var(--acc-text);
}

/* Table */
.acc-table-card {
  min-width: 0;
  background: var(--dash-card);
  border: none;
  border-radius: 20px;
  box-shadow: var(--dash-shadow);
  overflow: hidden;
  contain: inline-size;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.acc-table-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--dash-shadow-hover);
}

.acc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  margin-bottom: 0;
}

.acc-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.acc-card__link {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--dash-text-subtle);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease;
}

.acc-card__link:hover {
  color: var(--acc-purple);
}

.acc-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow: auto hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  contain: inline-size;
}

.acc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.acc-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--dash-text-subtle);
  border-bottom: 1px solid var(--acc-border);
  white-space: nowrap;
}

.acc-table tbody tr {
  transition: background 150ms ease;
}

.acc-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.acc-row-link {
  cursor: pointer;
}

.acc-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.acc-table :is(th, td):nth-child(1) { width: 28%; }
.acc-table :is(th, td):nth-child(2) { width: 17%; }
.acc-table :is(th, td):nth-child(3) { width: 10%; }
.acc-table :is(th, td):nth-child(4) { width: 16%; }
.acc-table :is(th, td):nth-child(5) { width: 13%; }
.acc-table :is(th, td):nth-child(6) { width: 10%; }
.acc-table :is(th, td):nth-child(7) { width: 6%; }

.acc-table thead th:nth-child(4),
.acc-table thead th:nth-child(5),
.acc-table tbody td:nth-child(4),
.acc-table tbody td:nth-child(5) {
  text-align: left;
}

.acc-table tbody tr:last-child td { border-bottom: none; }

.acc-account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.acc-account__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.acc-account__icon--eu { background: var(--dash-blue-soft); color: var(--dash-blue); }
.acc-account__icon--us { background: var(--acc-blue-soft); color: #60a5fa; }
.acc-account__icon--usdt { background: rgba(38, 161, 123, 0.14); color: #26a17b; }
.acc-account__icon--btc { background: rgba(245, 158, 11, 0.14); color: var(--acc-yellow); }
.acc-account__icon--visa { background: var(--acc-purple-soft); color: var(--acc-purple); }
.acc-account__icon--mc { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.acc-account__icon--paypal { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

.acc-account__icon img,
.acc-account__icon svg {
  display: block;
}

.acc-account__icon--flag {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.acc-account__icon--flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acc-account__icon--crypto {
  background: rgba(38, 161, 123, 0.14);
}

.acc-account__icon--crypto img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.acc-account__icon--card {
  background: var(--acc-blue-soft);
  color: var(--acc-blue);
}

.acc-account__icon--mastercard {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
}

.acc-account__icon--mastercard::before,
.acc-account__icon--mastercard::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.acc-account__icon--mastercard::before {
  left: 9px;
  background: #ef4444;
}

.acc-account__icon--mastercard::after {
  right: 9px;
  background: #f59e0b;
  opacity: 0.9;
}

.acc-account__icon--external {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
}

.acc-account__title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: break-word;
}

.acc-account__sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--dash-text-subtle);
  overflow-wrap: anywhere;
}

.acc-type {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.acc-type__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--dash-text-muted);
}

.acc-type__badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--acc-purple);
}

.acc-type__sub {
  margin: 0 0 0 16px;
  font-size: 12px;
  color: var(--dash-text-subtle);
}

.acc-table tbody tr:nth-child(1) .acc-type__badge::before,
.acc-table tbody tr:nth-child(2) .acc-type__badge::before {
  background: #6d4aff;
}

.acc-table tbody tr:nth-child(3) .acc-type__badge::before {
  background: #26a17b;
}

.acc-table tbody tr:nth-child(4) .acc-type__badge::before {
  background: var(--acc-yellow);
}

.acc-table tbody tr:nth-child(5) .acc-type__badge::before,
.acc-table tbody tr:nth-child(6) .acc-type__badge::before {
  background: var(--acc-blue);
}

.acc-table tbody tr:nth-child(7) .acc-type__badge::before {
  background: var(--dash-text-subtle);
}

.acc-currency {
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-text-muted);
}

.acc-balance__primary {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.acc-balance__secondary {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--dash-text-subtle);
}

.acc-balance__avail {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--dash-green);
}

.acc-change {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.acc-change--up { color: var(--dash-green); }
.acc-change--down { color: var(--dash-red); }
.acc-change--muted { color: var(--dash-text-subtle); }

.acc-status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.acc-status--active {
  background: var(--dash-green-soft);
  color: var(--dash-green);
}

.acc-status--inactive {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dash-text-muted);
}

.acc-row-action {
  min-width: 32px;
  min-height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dash-text-subtle);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease, color 150ms ease;
}

.acc-row-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--acc-text);
}

/* Pagination */
.acc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--acc-border);
}

.acc-pagination__info {
  margin: 0;
  font-size: 13px;
  color: var(--dash-text-subtle);
}

/* Right panel */
.acc-panel {
  background: var(--dash-card);
  border: none;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--dash-shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.acc-panel:hover {
  transform: translateY(-1px);
  box-shadow: var(--dash-shadow-hover);
}

.acc-panel__title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
}

.acc-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.acc-panel__head .acc-panel__title {
  margin-bottom: 0;
}

/* Donut */
.acc-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.acc-donut-figure {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.acc-donut {
  width: 100%;
  height: 100%;
}

.acc-donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.acc-donut__total {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.acc-donut__value {
  color: var(--acc-text);
  font-family: var(--font-numeric, "Inter", sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
}

.acc-donut__label {
  margin-top: 3px;
  color: var(--dash-text-subtle);
  font-size: 10px;
  line-height: 1;
}

.acc-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acc-legend__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.acc-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.acc-legend__dot--purple { background: var(--acc-purple); }
.acc-legend__dot--yellow { background: var(--acc-yellow); }
.acc-legend__dot--blue { background: var(--acc-blue); }

.acc-legend__label {
  flex: 1;
  color: var(--dash-text-muted);
}

.acc-legend__pct {
  font-weight: 600;
}

.acc-link-btn {
  width: fit-content;
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--acc-purple);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.acc-link-btn:hover {
  filter: brightness(1.1);
}

.acc-link-btn svg {
  flex-shrink: 0;
}

/* Quick actions */
.acc-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.acc-action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 10px;
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--dash-text-muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.acc-action-tile:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--acc-text);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.acc-action-tile svg { color: var(--acc-purple); }

/* Activity */
.acc-activity {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: none;
}

.acc-activity:first-of-type { padding-top: 0; }
.acc-activity:last-of-type { padding-bottom: 0; }

.acc-activity__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 11px;
  font-weight: 700;
}

.acc-activity__icon svg {
  display: block;
}

.acc-activity__icon--eu { background: var(--dash-blue-soft); color: var(--dash-blue); }
.acc-activity__icon--usdt { background: rgba(38, 161, 123, 0.14); color: #26a17b; }
.acc-activity__icon--visa { background: var(--acc-purple-soft); color: var(--acc-purple); }

.acc-activity__account {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.acc-activity__desc {
  margin: 0;
  font-size: 12px;
  color: var(--dash-text-subtle);
}

.acc-activity__amount {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}

.acc-activity__amount--in { color: var(--dash-green); }
.acc-activity__amount--out { color: var(--dash-red); }

@container acc-content (max-width: 1040px) {
  .acc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .acc-aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

@container acc-main (max-width: 860px) {
  .acc-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container acc-content (max-width: 760px) {
  .acc-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .acc-chips {
    width: 100%;
  }

  .acc-aside {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container acc-content (max-width: 520px) {
  .acc-title {
    font-size: 28px;
  }

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

@media (max-width: 760px) {
  body.acc-page {
    overflow-x: clip;
  }

  .acc-content {
    padding: 24px 16px;
  }
}

.acc-page :where(
  .acc-chip,
  .acc-row-action,
  .acc-card__link,
  .acc-link-btn,
  .acc-action-tile,
  .dash-new-btn
):focus-visible {
  outline: 2px solid var(--acc-focus-ring);
  outline-offset: 2px;
}
