:root {
  color-scheme: dark;
  /* Redizayn 2026: "Aurora Obsidian" — chuqurroq fon, binafsha-indigo urg'u */
  --bg: #05070f;
  --bg-elevated: #0c1020;
  --surface: rgba(18, 24, 44, 0.86);
  --surface-solid: #10152a;
  --surface-strong: #171d38;
  --surface-soft: #1e2648;
  --border: rgba(160, 172, 210, 0.14);
  --border-strong: rgba(160, 172, 210, 0.30);
  --text: #f6f8ff;
  --text-soft: #c6cee6;
  --muted: #8590b0;
  --blue: #7c8cff;
  --blue-strong: #5b6bf5;
  --violet: #b28bff;
  --green: #3ddc97;
  --amber: #ffc24b;
  --red: #ff7086;
  --shadow: 0 26px 70px rgba(2, 4, 12, 0.5);
  --radius-xl: 26px;
  --radius-lg: 19px;
  --radius-md: 14px;
  --sidebar-width: 272px;
  --mobile-nav-height: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 84% -12%, rgba(124, 140, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 4% 70%, rgba(178, 139, 255, 0.10), transparent 30rem),
    radial-gradient(circle at 50% 120%, rgba(61, 220, 151, 0.06), transparent 30rem),
    var(--bg);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #fff;
  background: rgba(91, 140, 255, 0.48);
}

:focus-visible {
  outline: 3px solid rgba(91, 140, 255, 0.7);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #fff;
  background: var(--blue-strong);
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.noscript-message {
  position: fixed;
  inset: 12px 12px auto;
  z-index: 2500;
  padding: 14px 18px;
  color: #fff;
  background: #a63240;
  border-radius: 12px;
  text-align: center;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-lockup-centered {
  justify-content: center;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #6c9cff, #806cf2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  box-shadow: 0 10px 26px rgba(78, 110, 237, 0.32);
  font-size: 20px;
}

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

.brand-lockup strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-lockup small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.access-state {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
}

.access-card {
  width: min(100%, 480px);
  padding: 36px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(145deg, rgba(18, 34, 56, 0.96), rgba(10, 22, 38, 0.96)),
    var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.access-card::before {
  position: absolute;
  width: 230px;
  height: 230px;
  top: -160px;
  left: 50%;
  content: "";
  background: rgba(91, 140, 255, 0.28);
  border-radius: 50%;
  filter: blur(60px);
  transform: translateX(-50%);
  pointer-events: none;
}

.state-visual {
  display: grid;
  width: 80px;
  height: 80px;
  margin: 32px auto 22px;
  place-items: center;
  color: var(--blue);
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.24);
  border-radius: 50%;
  font-size: 32px;
}

.state-visual.is-denied {
  color: var(--red);
  background: rgba(255, 107, 120, 0.1);
  border-color: rgba(255, 107, 120, 0.25);
}

.state-visual.is-error {
  color: var(--amber);
  background: rgba(249, 184, 75, 0.1);
  border-color: rgba(249, 184, 75, 0.25);
}

.state-visual.is-ready {
  color: var(--green);
  background: rgba(53, 212, 154, 0.1);
  border-color: rgba(53, 212, 154, 0.25);
}

.state-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(91, 140, 255, 0.22);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.access-card h1 {
  margin: 0;
  font-size: clamp(23px, 6vw, 30px);
  letter-spacing: -0.035em;
}

.access-card > p {
  margin: 12px auto 0;
  color: var(--text-soft);
}

.access-card .button {
  margin-top: 22px;
}

.state-footnote {
  max-width: 370px;
  padding-top: 22px;
  color: var(--muted) !important;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.config-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
  text-align: left;
}

.config-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
}

.config-list li::before {
  color: var(--amber);
  content: "•";
}

.admin-app {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  display: flex;
  width: var(--sidebar-width);
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  flex-direction: column;
  padding: 24px 18px;
  background: rgba(8, 18, 32, 0.9);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px);
}

.sidebar > .brand-lockup {
  padding: 0 10px 22px;
}

.admin-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.1), rgba(155, 124, 255, 0.06));
  border: 1px solid rgba(91, 140, 255, 0.16);
  border-radius: 15px;
}

.identity-avatar,
.mobile-avatar,
.result-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #416fdc, #795bd8);
  border-radius: 12px;
  font-weight: 800;
}

.identity-copy {
  min-width: 0;
}

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

.identity-copy strong {
  font-size: 13px;
}

.identity-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.verified-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #071a12;
  background: var(--green);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-link {
  display: grid;
  width: 100%;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  text-align: left;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-link svg,
.icon-button svg,
.search-field svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transform: translateX(2px);
}

.nav-link.is-active {
  color: #eef4ff;
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.18), rgba(91, 140, 255, 0.07));
  border-color: rgba(91, 140, 255, 0.18);
}

.nav-link.is-active svg {
  color: #79a3ff;
}

.nav-badge {
  min-width: 20px;
  padding: 2px 6px;
  color: #241701;
  background: var(--amber);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.sidebar-security {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-top: auto;
  color: var(--text-soft);
  background: rgba(53, 212, 154, 0.055);
  border: 1px solid rgba(53, 212, 154, 0.13);
  border-radius: 13px;
}

.sidebar-security strong,
.sidebar-security small {
  display: block;
}

.sidebar-security strong {
  font-size: 11px;
}

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

.security-pulse {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(53, 212, 154, 0.1);
}

.mobile-header,
.mobile-nav {
  display: none;
}

.workspace {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px clamp(24px, 4vw, 56px) 64px;
  margin-left: var(--sidebar-width);
}

.workspace-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 1480px;
  margin: 0 auto 28px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #7da5ff;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.workspace-header h1 {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.045em;
}

.workspace-header h1 + p {
  max-width: 650px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.request-state {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 11px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.request-state > span {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
}

.request-state.is-busy > span {
  background: var(--amber);
  animation: pulse 1s ease-in-out infinite;
}

.request-state.is-error > span {
  background: var(--red);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-button:hover {
  color: #fff;
  background: rgba(91, 140, 255, 0.1);
  border-color: rgba(91, 140, 255, 0.3);
}

.view-panel {
  max-width: 1480px;
  margin: 0 auto;
  animation: reveal 0.24s ease both;
}

.panel-card,
.kpi-card,
.section-callout {
  background: linear-gradient(145deg, rgba(17, 31, 50, 0.9), rgba(12, 25, 42, 0.9));
  border: 1px solid var(--border);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(16px);
}

.panel-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

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

.kpi-card {
  display: flex;
  min-height: 132px;
  gap: 15px;
  align-items: flex-start;
  padding: 20px;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-lg);
}

.kpi-card::after {
  position: absolute;
  width: 110px;
  height: 110px;
  right: -56px;
  bottom: -64px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.14;
}

.kpi-accent-blue { color: var(--blue); }
.kpi-accent-violet { color: var(--violet); }
.kpi-accent-green { color: var(--green); }
.kpi-accent-amber { color: var(--amber); }

.kpi-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 13px;
  font-size: 19px;
}

.kpi-card small,
.kpi-card strong,
.kpi-card div > span {
  display: block;
}

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

.kpi-card strong {
  margin-top: 7px;
  color: var(--text);
  font-size: clamp(22px, 2.3vw, 31px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.kpi-card div > span {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 11px;
}

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

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

.panel-heading h2,
.guidance-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-chip,
.count-pill {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 5px 10px;
  color: #bcd0ff;
  background: rgba(91, 140, 255, 0.09);
  border: 1px solid rgba(91, 140, 255, 0.18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.bar-chart {
  display: flex;
  height: 178px;
  gap: clamp(6px, 1.2vw, 14px);
  align-items: flex-end;
  padding-top: 22px;
  border-bottom: 1px solid var(--border);
}

.bar-column {
  display: flex;
  min-width: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
}

.bar-value {
  min-height: 17px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-fill {
  width: min(72%, 42px);
  min-height: 4px;
  margin: 3px auto 0;
  background: linear-gradient(180deg, #78a3ff, #416dd9);
  border-radius: 7px 7px 2px 2px;
  box-shadow: 0 5px 18px rgba(91, 140, 255, 0.16);
  transition: height 0.35s ease;
}

.bar-chart-green .bar-fill {
  background: linear-gradient(180deg, #51e7b0, #1f9f74);
  box-shadow: 0 5px 18px rgba(53, 212, 154, 0.14);
}

.bar-label {
  margin: 8px 0 -22px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.summary-strip > div {
  padding: 2px 18px;
  border-right: 1px solid var(--border);
}

.summary-strip > div:first-child {
  padding-left: 2px;
}

.summary-strip > div:last-child {
  border: 0;
}

.summary-strip small,
.summary-strip strong {
  display: block;
}

.summary-strip small {
  color: var(--muted);
  font-size: 11px;
}

.summary-strip strong {
  margin-top: 4px;
  font-size: 18px;
}

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

.search-field,
.select-field,
.input-prefix,
.money-input {
  display: flex;
  min-height: 44px;
  align-items: center;
  background: rgba(6, 16, 29, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-field {
  min-width: 260px;
  flex: 1;
  gap: 10px;
  padding: 0 13px;
  color: var(--muted);
}

.search-field-wide {
  max-width: 630px;
}

.search-field:focus-within,
.input-prefix:focus-within,
.money-input:focus-within {
  border-color: rgba(91, 140, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.08);
}

.search-field input,
.input-prefix input,
.money-input input {
  min-width: 0;
  flex: 1;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-field input::placeholder,
input::placeholder,
textarea::placeholder {
  color: #5f718a;
}

.select-field select {
  min-height: 44px;
  padding: 0 38px 0 13px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  outline: 0;
}

.table-meta,
.retention-note {
  color: var(--muted);
  font-size: 11px;
}

.table-meta {
  margin: 0 0 10px;
}

.data-region {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--text-soft);
  font-size: 12px;
}

.data-table tbody tr {
  transition: background 0.16s ease;
}

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

.cell-primary {
  display: block;
  color: var(--text);
  font-weight: 700;
}

.cell-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.status-badge,
.type-badge,
.audit-action {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-completed,
.status-approved {
  color: #7af0c3;
  background: rgba(53, 212, 154, 0.1);
  border: 1px solid rgba(53, 212, 154, 0.17);
}

.status-processing,
.status-pending {
  color: #ffd282;
  background: rgba(249, 184, 75, 0.1);
  border: 1px solid rgba(249, 184, 75, 0.17);
}

.status-failed,
.status-rejected {
  color: #ff9da6;
  background: rgba(255, 107, 120, 0.1);
  border: 1px solid rgba(255, 107, 120, 0.17);
}

.status-unknown {
  color: var(--text-soft);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
}

.type-stars {
  color: #ffd677;
  background: rgba(249, 184, 75, 0.08);
}

.type-premium {
  color: #c2afff;
  background: rgba(155, 124, 255, 0.1);
}

.load-more {
  display: block;
  margin: 18px auto 0;
}

.section-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
}

.callout-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--amber);
  background: rgba(249, 184, 75, 0.09);
  border-radius: 12px;
  font-size: 22px;
}

.section-callout strong {
  font-size: 13px;
}

.section-callout p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.payment-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 20px;
  background: linear-gradient(150deg, rgba(18, 33, 54, 0.94), rgba(11, 24, 40, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.payment-head,
.payment-meta-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.payment-head strong {
  color: var(--text);
  font-size: 14px;
}

.payment-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.payment-amount {
  color: var(--green);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.payment-meta {
  display: grid;
  gap: 9px;
  padding: 14px 0;
  margin: 15px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.payment-meta-row span:first-child {
  color: var(--muted);
  font-size: 10px;
}

.payment-meta-row span:last-child {
  max-width: 66%;
  color: var(--text-soft);
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.payment-card .button {
  width: 100%;
  margin-top: auto;
}

.form-card {
  min-width: 0;
}

.field-label,
.price-fields label > span {
  display: block;
  margin: 0 0 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.input-action-row {
  display: flex;
  gap: 9px;
}

.input-prefix {
  min-width: 0;
  flex: 1;
  gap: 7px;
  padding: 0 13px;
}

.input-prefix > span,
.money-input > span {
  color: var(--muted);
  font-size: 12px;
}

.field-help,
.textarea-meta {
  color: var(--muted);
  font-size: 10px;
}

.field-help {
  margin: 7px 0 0;
}

.user-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-top: 20px;
  background: rgba(91, 140, 255, 0.06);
  border: 1px solid rgba(91, 140, 255, 0.15);
  border-radius: 14px;
}

.user-result strong,
.user-result span {
  display: block;
}

.user-result > div:nth-child(2) strong {
  font-size: 13px;
}

.user-result > div:nth-child(2) span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.result-balance {
  text-align: right;
}

.result-balance small {
  color: var(--muted);
  font-size: 9px;
}

.result-balance strong {
  margin-top: 2px;
  color: var(--green);
  font-size: 14px;
}

.money-input {
  gap: 9px;
  padding: 0 13px;
}

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

.segmented-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(6, 16, 29, 0.55);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.segmented-control button {
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
}

.segmented-control button.is-active {
  color: #fff;
  background: var(--surface-soft);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.leader-list {
  display: grid;
  gap: 7px;
}

.leader-row {
  display: grid;
  grid-template-columns: 42px auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid transparent;
  border-radius: 12px;
}

.leader-row:hover {
  background: rgba(255, 255, 255, 0.028);
  border-color: var(--border);
}

.leader-rank {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.leader-rank.is-podium {
  font-size: 21px;
}

.leader-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #dce7ff;
  background: linear-gradient(145deg, #274a83, #4a387c);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

.leader-copy {
  min-width: 0;
}

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

.leader-copy strong {
  font-size: 12px;
}

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

.leader-total {
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.leader-total small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

textarea,
.large-input {
  width: 100%;
  color: var(--text);
  background: rgba(6, 16, 29, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
}

textarea {
  min-height: 120px;
  padding: 13px;
  line-height: 1.55;
  resize: vertical;
}

.large-input {
  min-height: 48px;
  padding: 0 14px;
  letter-spacing: 0.12em;
}

textarea:focus,
.large-input:focus {
  border-color: rgba(91, 140, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.08);
}

.textarea-meta {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 7px 0 14px;
}

.button-wide {
  width: 100%;
}

.form-layout-broadcast {
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
}

.guidance-card {
  color: var(--text-soft);
}

.guidance-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  place-items: center;
  color: #bcd0ff;
  background: rgba(91, 140, 255, 0.1);
  border-radius: 12px;
  font-weight: 800;
}

.guidance-card ul {
  display: grid;
  gap: 12px;
  padding-left: 18px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.price-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.audit-action {
  color: #bcd0ff;
  background: rgba(91, 140, 255, 0.09);
  border: 1px solid rgba(91, 140, 255, 0.14);
}

.audit-details {
  display: flex;
  max-width: 440px;
  flex-wrap: wrap;
  gap: 4px;
}

.audit-details span {
  padding: 3px 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 6px;
  font-size: 9px;
  overflow-wrap: anywhere;
}

.button {
  display: inline-flex;
  min-height: 42px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.button:not(:disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.button.is-busy {
  color: transparent;
  position: relative;
}

.button.is-busy::after {
  width: 17px;
  height: 17px;
  position: absolute;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.button-primary {
  color: #fff;
  background: linear-gradient(145deg, #5687f5, #4169d8);
  border-color: rgba(132, 171, 255, 0.3);
  box-shadow: 0 8px 24px rgba(65, 105, 216, 0.22);
}

.button-secondary {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border);
}

.button-success {
  color: #06251a;
  background: linear-gradient(145deg, #50e2ab, #29bb85);
  border-color: rgba(116, 240, 192, 0.25);
}

.button-danger-soft {
  color: #ffabb3;
  background: rgba(255, 107, 120, 0.08);
  border-color: rgba(255, 107, 120, 0.2);
}

.empty-state {
  padding: 42px 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  font-size: 12px;
  text-align: center;
}

.inline-loader {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  color: var(--muted);
  font-size: 12px;
}

.inline-loader > span {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(91, 140, 255, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.turnstile-host {
  width: min(92vw, 340px);
  position: fixed;
  z-index: 2100;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  overflow: hidden;
  border-radius: 12px;
}

.toast-region {
  display: grid;
  width: min(92vw, 380px);
  gap: 9px;
  position: fixed;
  z-index: 2200;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(15, 29, 48, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: toast-in 0.24s ease both;
  font-size: 12px;
}

.toast::before {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #071a12;
  background: var(--green);
  border-radius: 50%;
  content: "✓";
  font-weight: 900;
}

.toast.is-error::before {
  color: #fff;
  background: var(--red);
  content: "!";
}

.toast.is-warning::before {
  color: #261801;
  background: var(--amber);
  content: "i";
}

.modal {
  width: min(92vw, 700px);
  max-height: min(90vh, 900px);
  padding: 0;
  overflow: auto;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.58);
}

.modal::backdrop {
  background: rgba(2, 8, 17, 0.76);
  backdrop-filter: blur(8px);
}

.modal-shell {
  padding: 22px;
}

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

.modal-header h2,
.confirm-modal h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.modal-header .icon-button {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.receipt-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.receipt-summary > div {
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.receipt-summary small,
.receipt-summary strong {
  display: block;
}

.receipt-summary small {
  color: var(--muted);
  font-size: 9px;
}

.receipt-summary strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-frame {
  display: grid;
  min-height: 280px;
  max-height: 52vh;
  margin-bottom: 16px;
  overflow: auto;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.018) 75%),
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.018) 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.receipt-frame img {
  display: block;
  max-width: 100%;
  max-height: 50vh;
  object-fit: contain;
}

.receipt-frame .empty-state {
  width: calc(100% - 32px);
}

.modal-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 16px;
}

.confirm-modal {
  width: min(92vw, 430px);
  text-align: center;
}

.confirm-modal p {
  margin: 10px auto 0;
  color: var(--text-soft);
  font-size: 13px;
}

.confirm-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 2px auto 16px;
  place-items: center;
  color: #241701;
  background: rgba(249, 184, 75, 0.9);
  border-radius: 16px;
  font-size: 22px;
  font-weight: 900;
}

.confirm-icon.is-danger {
  color: #fff;
  background: rgba(255, 107, 120, 0.9);
}

.modal-actions-centered {
  justify-content: center;
  margin-top: 22px;
}

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

@keyframes pulse {
  50% { opacity: 0.35; }
}

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

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
    height: 68px;
    position: sticky;
    z-index: 30;
    top: 0;
    align-items: center;
    justify-content: space-between;
    padding: max(10px, env(safe-area-inset-top)) 18px 10px;
    background: rgba(7, 16, 29, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
  }

  .mobile-header .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .mobile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
  }

  .workspace {
    padding: 24px 18px calc(var(--mobile-nav-height) + 34px + env(safe-area-inset-bottom));
    margin-left: 0;
  }

  .mobile-nav {
    display: flex;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    gap: 3px;
    align-items: flex-start;
    padding: 7px 9px calc(7px + env(safe-area-inset-bottom));
    overflow-x: auto;
    background: rgba(8, 18, 32, 0.94);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(22px);
    scrollbar-width: none;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav button {
    display: grid;
    min-width: 67px;
    flex: 1 0 67px;
    gap: 2px;
    justify-items: center;
    padding: 6px 4px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 9px;
  }

  .mobile-nav button > span {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-nav button.is-active {
    color: #dce8ff;
    background: rgba(91, 140, 255, 0.12);
  }

  .workspace-header {
    margin-bottom: 22px;
  }

  .workspace-header h1 {
    font-size: 28px;
  }

  .request-state {
    display: none;
  }
}

@media (max-width: 680px) {
  .access-state {
    padding: 14px;
  }

  .access-card {
    padding: 28px 20px;
    border-radius: 22px;
  }

  .workspace {
    padding-inline: 12px;
  }

  .workspace-header {
    gap: 12px;
  }

  .workspace-header h1 {
    font-size: 24px;
  }

  .workspace-header h1 + p {
    font-size: 12px;
  }

  .kpi-grid,
  .overview-grid,
  .form-layout,
  .form-layout-broadcast,
  .payment-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    gap: 9px;
  }

  .kpi-card {
    min-height: 110px;
    padding: 16px;
  }

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

  .panel-card {
    padding: 16px;
    border-radius: 15px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 0;
  }

  .summary-strip > div {
    padding: 2px 12px;
  }

  .summary-strip > div:nth-child(2) {
    border-right: 0;
  }

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

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

  .select-field select {
    width: 100%;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 12px;
    padding: 7px 4px;
    border: 0;
    text-align: right;
  }

  .data-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
  }

  .cell-primary,
  .cell-secondary {
    text-align: right;
  }

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

  .section-callout .count-pill {
    grid-column: 2;
    width: fit-content;
  }

  .input-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .user-result {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .result-balance {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    text-align: left;
  }

  .split-actions,
  .price-fields {
    grid-template-columns: 1fr;
  }

  .panel-heading-wrap {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    overflow-x: auto;
  }

  .leader-row {
    grid-template-columns: 32px auto minmax(0, 1fr);
  }

  .leader-total {
    grid-column: 3;
    text-align: left;
  }

  .receipt-summary {
    grid-template-columns: 1fr;
  }

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

  .modal-shell {
    padding: 16px;
  }

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

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

  .toast-region {
    inset: max(10px, env(safe-area-inset-top)) 10px auto;
    width: auto;
  }

  .turnstile-host {
    right: 50%;
    bottom: calc(var(--mobile-nav-height) + 12px + env(safe-area-inset-bottom));
    transform: translateX(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
