:root {
  --bg: #f2efe6;
  --surface: #fffdf8;
  --surface-soft: #ece8dd;
  --ink: #171717;
  --muted: #69645b;
  --line: #171717;
  --accent: #ffd13b;
  --blue: #8ed8f8;
  --green: #a9eba6;
  --red: #ff8178;
  --shadow: 4px 4px 0 var(--line);
  --shadow-small: 2px 2px 0 var(--line);
  --radius: 14px;
  --sidebar-width: 224px;
}

[data-theme="dark"] {
  --bg: #151515;
  --surface: #242424;
  --surface-soft: #303030;
  --ink: #f6f0e5;
  --muted: #b9b1a3;
  --line: #f6f0e5;
  --accent: #f2c83c;
  --blue: #74c7ea;
  --green: #91d78e;
  --red: #ef756d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  max-width: 100%;
  color: inherit;
  font: inherit;
}

button {
  touch-action: manipulation;
}

[hidden],
.hidden {
  display: none !important;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

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

.muted-text {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: var(--accent);
  box-shadow: var(--shadow);
  color: #171717;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.07em;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: var(--shadow-small);
  font-size: 13px;
}

.primary-button,
.secondary-button,
.danger-button,
.light-button,
.text-button,
.icon-button,
.password-toggle,
.modal-close,
.nav-item,
.action-tile,
.mini-button,
.page-button {
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 850;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}

.primary-button,
.secondary-button,
.danger-button,
.light-button {
  min-height: 40px;
  padding: 8px 13px;
}

.primary-button {
  background: var(--accent);
  box-shadow: var(--shadow-small);
  color: #171717;
}

.secondary-button {
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.danger-button {
  background: var(--red);
  box-shadow: var(--shadow-small);
  color: #171717;
}

.light-button {
  background: #fff;
  box-shadow: var(--shadow-small);
  color: #171717;
}

.text-button {
  min-height: 34px;
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.light-button:hover,
.icon-button:hover,
.action-tile:hover,
.mini-button:hover,
.page-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--line);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.light-button:active,
.icon-button:active,
.action-tile:active,
.mini-button:active,
.page-button:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
  transform: none !important;
  box-shadow: none !important;
}

.full-button {
  width: 100%;
}

.field-label {
  display: block;
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 850;
}

.field-input,
.field-select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 11px;
  border: 2px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-small);
}

.field-input:focus,
.field-select:focus {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--line);
}

.field-select.compact {
  width: auto;
  min-width: 140px;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.language-control select {
  min-height: 34px;
  padding: 5px 8px;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(23, 23, 23, .05) 50%, transparent 51%) 0 0 / 30px 30px,
    linear-gradient(transparent 49%, rgba(23, 23, 23, .05) 50%, transparent 51%) 0 0 / 30px 30px,
    var(--bg);
}

.login-shell {
  width: min(940px, 100%);
  min-width: 0;
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 7px 7px 0 var(--line);
}

.login-brand-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  padding: 42px;
  border-inline-end: 3px solid var(--line);
  background: var(--blue);
  color: #171717;
}

.login-brand-panel .eyebrow {
  color: #393939;
}

.login-brand-panel h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 58px);
  line-height: .98;
  letter-spacing: -.055em;
}

.login-lead {
  max-width: 520px;
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 650;
}

.login-card-wrap {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 38px;
}

.login-card {
  width: min(380px, 100%);
  min-width: 0;
}

.login-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--green);
  color: #171717;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.login-card h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.035em;
}

.login-card > p {
  margin: 7px 0 22px;
  color: var(--muted);
}

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

.password-field {
  position: relative;
}

.password-field .field-input {
  padding-inline-end: 74px;
}

.password-toggle {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  min-height: 30px;
  padding: 4px 9px;
  background: var(--surface-soft);
}

.login-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.login-footnote {
  margin-top: 18px !important;
  font-size: 11px;
}

.app-layout {
  min-width: 0;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-inline-end: 3px solid var(--line);
  background: var(--surface);
}

[dir="rtl"] .sidebar {
  inset: 0 0 0 auto;
}

.sidebar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px;
  border-bottom: 3px solid var(--line);
}

.sidebar-brand > div:last-child {
  min-width: 0;
}

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

.sidebar-brand strong {
  font-size: 15px;
}

.sidebar-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.side-nav {
  display: grid;
  gap: 7px;
  padding: 14px;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  text-align: start;
}

.nav-item:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.nav-item.active {
  border-color: var(--line);
  background: var(--accent);
  box-shadow: var(--shadow-small);
  color: #171717;
}

.nav-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 8px;
  font-size: 9px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 11px;
  padding: 14px;
  border-top: 3px solid var(--line);
}

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

.sidebar-account > div:last-child {
  min-width: 0;
}

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

.sidebar-account span {
  color: var(--muted);
  font-size: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--blue);
  color: #171717;
  font-weight: 900;
}

.main-area {
  min-width: 0;
  min-height: 100vh;
  margin-inline-start: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 3px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(9px);
}

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

.topbar h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 21px;
  letter-spacing: -.025em;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.compact-language > span {
  display: none;
}

.coin-pill {
  min-width: 136px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--green);
  box-shadow: var(--shadow-small);
  color: #171717;
}

.coin-pill span,
.coin-pill strong {
  display: block;
}

.coin-pill span {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.coin-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.mobile-menu {
  display: none;
}

.content-area {
  width: 100%;
  min-width: 0;
  padding: 20px;
}

.view-panel {
  display: none;
  min-width: 0;
}

.view-panel.active {
  display: block;
  animation: reveal .18s ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.balance-card,
.panel-card,
.stat-card {
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.balance-card {
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background: var(--accent);
  color: #171717;
}

.balance-card .eyebrow {
  color: #363636;
}

.balance-card h2 {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  line-height: .95;
  letter-spacing: -.055em;
}

.balance-card span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 750;
}

.overview-stats {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.02em;
}

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

.stat-card {
  padding: 15px;
}

.stat-card span,
.stat-card strong,
.stat-card small {
  display: block;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stat-card strong {
  margin: 6px 0;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -.04em;
}

.stat-card small {
  color: var(--muted);
  font-size: 10px;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.section-grid.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.panel-card {
  padding: 18px;
}

.wide-card {
  min-height: calc(100vh - 112px);
}

.panel-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head > div {
  min-width: 0;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  letter-spacing: -.025em;
}

.panel-head h2 {
  font-size: 22px;
}

.panel-head h3 {
  font-size: 18px;
}

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

.action-tile {
  min-width: 0;
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px;
  background: var(--surface-soft);
  text-align: start;
}

.action-tile > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  margin-bottom: auto;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
}

.action-tile strong,
.action-tile small {
  display: block;
}

.action-tile strong {
  font-size: 13px;
}

.action-tile small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

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

.activity-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.activity-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--blue);
  color: #171717;
  font-weight: 900;
}

.activity-item > div:nth-child(2) {
  min-width: 0;
}

.activity-item strong,
.activity-item span,
.activity-item small {
  display: block;
}

.activity-item span,
.activity-item small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.activity-amount {
  text-align: end;
}

.activity-amount.negative strong {
  color: #b7332c;
}

.activity-amount.positive strong {
  color: #137a3b;
}

.button-row,
.filter-bar,
.modal-actions,
.dialog-actions,
.inline-field {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field .field-input {
  flex: 1;
}

.filter-bar {
  margin-bottom: 14px;
}

.search-field {
  min-width: 180px;
  min-height: 42px;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 7px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: 11px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 2px solid var(--line);
  text-align: start;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-soft);
  font-size: 10px;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.data-table td {
  font-size: 12px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--blue) 15%, transparent);
}

.member-cell {
  min-width: 0;
}

.member-cell strong,
.member-cell span {
  display: block;
}

.member-cell strong {
  overflow-wrap: anywhere;
}

.member-cell span {
  color: var(--muted);
  font-size: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 7px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #171717;
  font-size: 10px;
  font-weight: 850;
}

.badge.active {
  background: var(--green);
}

.badge.expired {
  background: var(--accent);
}

.badge.suspended {
  background: var(--red);
}

.badge.device-on {
  background: var(--blue);
}

.badge.device-off {
  background: var(--surface-soft);
  color: var(--ink);
}

.action-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-button {
  min-height: 30px;
  padding: 4px 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
}

.mini-button.primary {
  background: var(--accent);
  color: #171717;
}

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

.mobile-card-list {
  display: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.page-button {
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
}

.page-button.active {
  background: var(--accent);
  box-shadow: var(--shadow-small);
  color: #171717;
}

.empty-state {
  padding: 22px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.profile-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border: 3px solid var(--line);
  border-radius: 20px;
  background: var(--blue);
  box-shadow: var(--shadow);
  color: #171717;
  font-size: 29px;
  font-weight: 950;
}

.profile-summary h2 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.profile-summary > p {
  margin: 4px 0 17px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.profile-meta {
  width: 100%;
  display: grid;
  gap: 7px;
}

.profile-meta div {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 11px;
}

.profile-meta strong {
  overflow-wrap: anywhere;
}

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

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 11px;
}

.field-group {
  min-width: 0;
}

.field-group.full,
.modal-actions.full,
.cost-preview.full {
  grid-column: 1 / -1;
}

.field-group small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.check-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  cursor: pointer;
  font-weight: 800;
}

.check-card input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.modal-layer,
.dialog-layer,
.loading-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(4px);
}

.dialog-layer {
  z-index: 140;
}

.loading-layer {
  z-index: 180;
}

.modal-card,
.dialog-card,
.loading-card {
  width: min(480px, calc(100vw - 28px));
  min-width: 0;
  max-height: calc(100dvh - 28px);
  overflow: auto;
  border: 3px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--line);
}

.modal-card {
  padding: 18px;
}

.large-modal {
  width: min(650px, calc(100vw - 28px));
}

.modal-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head > div {
  min-width: 0;
}

.modal-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.025em;
}

.modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  background: var(--red);
  color: #171717;
  font-size: 20px;
  line-height: 1;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 5px;
}

.cost-preview {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--green);
  color: #171717;
}

.cost-preview div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cost-preview span {
  font-size: 10px;
  font-weight: 750;
}

.cost-preview strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.member-summary-box {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.member-summary-box span {
  color: var(--muted);
  font-size: 11px;
}

.manual-duration-group {
  padding: 10px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.renew-member-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.renew-member-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}

.renew-member-primary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.renew-member-primary span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.renew-member-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.renew-member-grid > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.renew-member-grid > div.full {
  grid-column: 1 / -1;
}

.renew-member-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.renew-member-grid strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.dialog-card {
  padding: 22px;
  text-align: center;
}

.dialog-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border: 3px solid var(--line);
  border-radius: 15px;
  background: var(--blue);
  box-shadow: var(--shadow-small);
  color: #171717;
  font-size: 22px;
  font-weight: 950;
}

.dialog-symbol.success {
  background: var(--green);
}

.dialog-symbol.error {
  background: var(--red);
}

.dialog-symbol.warning {
  background: var(--accent);
}

.dialog-card h3 {
  margin: 0;
  font-size: 20px;
}

.dialog-card p {
  margin: 8px 0 17px;
  color: var(--muted);
  white-space: pre-line;
}

.dialog-actions {
  justify-content: center;
}

.loading-card {
  width: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 17px;
}

.spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid var(--surface-soft);
  border-top-color: var(--line);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

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

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, .55);
}

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td,
[dir="rtl"] .nav-item,
[dir="rtl"] .action-tile {
  text-align: right;
}

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

  .profile-grid {
    grid-template-columns: minmax(220px, .75fr) minmax(0, 1fr);
  }

  .profile-grid > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 940px) {
  .sidebar {
    width: min(270px, 84vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
  }

  [dir="rtl"] .sidebar {
    transform: translateX(105%);
  }

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

  .main-area {
    margin-inline-start: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .table-wrap {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 9px;
  }

  .mobile-data-card {
    min-width: 0;
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
  }

  .mobile-data-card .card-top,
  .mobile-data-card .card-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-data-card .card-top > *,
  .mobile-data-card .card-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-data-card .card-row {
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-data-card .card-row strong {
    color: var(--ink);
    text-align: end;
  }

  .mobile-data-card .action-menu {
    padding-top: 8px;
    border-top: 2px solid var(--line);
  }
}

@media (max-width: 760px) {
  .login-body {
    display: block;
    padding: 12px;
  }

  .login-shell {
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 16px;
    box-shadow: 5px 5px 0 var(--line);
  }

  .login-brand-panel {
    gap: 18px;
    padding: 24px;
    border-inline-end: 0;
    border-bottom: 3px solid var(--line);
  }

  .login-brand-panel h1 {
    font-size: 37px;
  }

  .login-lead {
    margin-top: 10px;
    font-size: 13px;
  }

  .login-card-wrap {
    padding: 24px;
  }

  .login-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-toolbar .language-control {
    width: 100%;
    justify-content: space-between;
  }

  .topbar {
    min-height: 64px;
    padding: 10px 12px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h1 {
    max-width: 145px;
    font-size: 18px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .compact-language select {
    width: 53px;
    min-height: 38px;
    padding-inline: 5px;
  }

  .topbar-actions > .icon-button:not(.mobile-menu) {
    display: none;
  }

  .coin-pill {
    min-width: 0;
    max-width: 120px;
    padding: 5px 8px;
  }

  .coin-pill span {
    display: none;
  }

  .coin-pill strong {
    font-size: 12px;
  }

  .content-area {
    padding: 12px;
  }

  .balance-card {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .balance-card h2 {
    font-size: clamp(33px, 12vw, 44px);
  }

  .balance-card .light-button {
    width: 100%;
  }

  .stats-grid,
  .section-grid,
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-grid > :last-child {
    grid-column: auto;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card strong {
    font-size: 25px;
  }

  .panel-card {
    padding: 14px;
  }

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

  .responsive-head,
  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .responsive-head .button-row,
  .responsive-head > button,
  .filter-bar > button,
  .filter-bar > select {
    width: 100%;
  }

  .button-row {
    width: 100%;
  }

  .button-row > * {
    flex: 1;
  }

  .search-field,
  .field-select.compact {
    width: 100%;
  }

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

  .action-tile {
    min-height: 84px;
  }

  .activity-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .activity-amount {
    grid-column: 2;
    text-align: start;
  }

  .form-grid,
  .cost-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-group.full,
  .modal-actions.full,
  .cost-preview.full {
    grid-column: auto;
  }

  .renew-member-primary {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .renew-member-grid > div.full {
    grid-column: auto;
  }

  .inline-field {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .topbar h1 {
    max-width: 100px;
  }

  .compact-language {
    display: none;
  }

  .coin-pill {
    max-width: 105px;
  }

  .modal-layer,
  .dialog-layer,
  .loading-layer {
    padding: 8px;
  }

  .modal-card,
  .dialog-card,
  .loading-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

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

.reseller-actions,
.reseller-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-button.deposit {
  background: var(--green);
  color: #171717;
}

.reseller-mobile-card {
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.reseller-card-summary {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 0;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}

.reseller-card-summary > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reseller-card-summary strong,
.reseller-card-summary small {
  overflow-wrap: anywhere;
}

.reseller-card-summary small {
  color: var(--muted);
  font-size: 10px;
}

.reseller-card-chevron {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 950;
  transition: transform .16s ease;
}

.reseller-mobile-card.expanded .reseller-card-chevron {
  transform: rotate(180deg);
}

.reseller-card-details {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 2px solid var(--line);
}

.reseller-card-details .card-row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.reseller-card-details .card-row strong {
  max-width: 65%;
  color: var(--ink);
  text-align: end;
  overflow-wrap: anywhere;
}

.reseller-card-actions {
  padding-top: 9px;
  border-top: 2px solid var(--line);
}

.deposit-modal {
  width: min(760px, calc(100vw - 28px));
}

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

.deposit-package-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--blue);
  box-shadow: var(--shadow-small);
  color: #171717;
  text-align: start;
  cursor: pointer;
}

.deposit-package-card:nth-child(even) {
  background: var(--green);
}

.deposit-package-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--line);
}

.deposit-price {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .05em;
}

.deposit-package-card strong {
  overflow-wrap: anywhere;
  font-size: 19px;
}

.deposit-package-card small {
  font-weight: 800;
}

.deposit-package-card > span:last-child {
  margin-top: 5px;
  padding-top: 7px;
  border-top: 2px solid rgba(23, 23, 23, .7);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  height: 2px;
  flex: 1;
  background: var(--line);
  content: "";
}

.currency-field {
  position: relative;
}

.currency-field > span {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  font-weight: 950;
}

.currency-field .field-input {
  padding-inline-start: 30px;
}

.deposit-quote {
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.deposit-quote strong,
.deposit-quote span,
.deposit-quote small {
  overflow-wrap: anywhere;
}

.deposit-quote small {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 940px) {
  .reseller-card-actions .mini-button {
    flex: 1 1 90px;
  }
}

@media (max-width: 760px) {
  .balance-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .balance-actions button {
    width: 100%;
  }

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

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

  .deposit-quote small {
    grid-column: auto;
  }
}


.register-login-link {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  text-align: center;
  text-decoration: none;
}
.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.neo-select {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 4;
}

.neo-select.open {
  z-index: 260;
}

.neo-select.compact {
  width: auto;
  min-width: 140px;
}

.neo-select-trigger {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border: 2px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  font-weight: 850;
  text-align: start;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.neo-select-trigger:hover,
.neo-select-trigger:focus-visible,
.neo-select.open .neo-select-trigger {
  transform: translate(-1px, -1px);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--line);
}

.neo-select-trigger:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.neo-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.neo-select-arrow {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--blue);
  color: #171717;
  font-size: 16px;
  line-height: 1;
  transition: transform .18s ease;
}

.neo-select.open .neo-select-arrow {
  transform: rotate(180deg);
}

.neo-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  max-height: min(300px, 48vh);
  display: none;
  overflow: auto;
  padding: 7px;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--line);
}

.neo-select.open .neo-select-menu {
  display: grid;
  gap: 5px;
  animation: neoSelectOpen .16s ease both;
}

@keyframes neoSelectOpen {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.neo-select-option {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: start;
}

.neo-select-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.neo-select-option b {
  visibility: hidden;
  color: #171717;
}

.neo-select-option:hover,
.neo-select-option:focus-visible,
.neo-select-option.selected {
  border-color: var(--line);
  background: var(--accent);
  color: #171717;
  outline: 0;
}

.neo-select-option.selected b {
  visibility: visible;
}

.neo-select-option:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.field-group > .neo-select,
.filter-bar > .neo-select {
  align-self: stretch;
}

.language-control .neo-select {
  width: auto;
  min-width: 66px;
}

.language-control .neo-select-trigger {
  min-height: 36px;
  padding: 5px 7px;
  border-radius: 9px;
}

.language-control .neo-select-arrow {
  width: 21px;
  height: 21px;
  font-size: 14px;
}

.language-control .neo-select-menu {
  min-width: 150px;
  inset-inline-start: auto;
  inset-inline-end: 0;
}

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

.topbar-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: grid;
}

.theme-toggle span {
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.progress-card {
  width: min(370px, calc(100vw - 28px));
  overflow: visible;
  padding: 22px;
  text-align: center;
  background: var(--surface);
}

.progress-visual {
  width: 104px;
  height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
}

.progress-visual span {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-radius: 7px;
  box-shadow: 2px 2px 0 var(--line);
  animation: progressBlocks 1s ease-in-out infinite;
}

.progress-visual span:nth-child(1) {
  background: var(--accent);
}

.progress-visual span:nth-child(2) {
  background: var(--blue);
  animation-delay: .12s;
}

.progress-visual span:nth-child(3) {
  background: var(--green);
  animation-delay: .24s;
}

@keyframes progressBlocks {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.progress-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  text-align: start;
}

.progress-copy span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--accent);
  color: #171717;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 2px 2px 0 var(--line);
}

.progress-track {
  height: 18px;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: 2px 2px 0 var(--line);
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .35) 0 8px, transparent 8px 16px),
    var(--blue);
  transition: width .16s ease;
  animation: progressStripes .7s linear infinite;
}

@keyframes progressStripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 23px 0;
  }
}

@media (max-width: 940px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 9px;
  }

  .mobile-menu {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-title {
    grid-column: 2;
    grid-row: 1;
  }

  .coin-pill {
    grid-column: 3;
    grid-row: 1;
  }

  .topbar-tools {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 2px solid var(--line);
  }

  .topbar-tools .theme-toggle {
    display: grid !important;
  }

  .compact-language {
    display: flex !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 0;
    padding: 9px 10px;
  }

  .topbar h1 {
    max-width: none;
  }

  .topbar-tools {
    min-height: 44px;
  }

  .language-control {
    min-width: 0;
  }

  .compact-language .neo-select {
    min-width: 72px;
  }

  .coin-pill {
    max-width: 112px;
  }

  .filter-bar > .neo-select,
  .field-select.compact + .neo-select,
  .neo-select.compact {
    width: 100%;
  }

  .neo-select-menu {
    max-height: 42vh;
  }
}

@media (max-width: 380px) {
  .compact-language {
    display: flex !important;
  }

  .topbar h1 {
    max-width: 116px;
  }

  .coin-pill {
    max-width: 102px;
  }

  .progress-card {
    width: calc(100vw - 16px);
    padding: 18px;
  }
}
.modal-card:has(.neo-select.open) {
  overflow: visible;
}

.loading-card.progress-card {
  display: block;
  align-items: initial;
  gap: 0;
}
