:root {
  color-scheme: light;
  --page: #eeeef3;
  --surface: #fff;
  --subtle: #f5f5f9;
  --line: #e2e2ea;
  --ink: #15142b;
  --muted: #5b5d6e;
  --title: #25255e;
  --focus: #6e6bf0;
  --active: #e3e3fc;
  --button: #0b0b12;
  --button-ink: #fff;
  --error: #a5222a;
  --error-bg: #fbedee;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #26262c;
  --surface: #32313a;
  --subtle: #3b3a44;
  --line: #45444f;
  --ink: #f2f2f5;
  --muted: #b7b6c5;
  --title: #ededf7;
  --focus: #9a97f7;
  --active: #3c3b62;
  --button: #f2f2f5;
  --button-ink: #15142b;
  --error: #ffc1c3;
  --error-bg: #4a2c34;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --page: #26262c;
    --surface: #32313a;
    --subtle: #3b3a44;
    --line: #45444f;
    --ink: #f2f2f5;
    --muted: #b7b6c5;
    --title: #ededf7;
    --focus: #9a97f7;
    --active: #3c3b62;
    --button: #f2f2f5;
    --button-ink: #15142b;
    --error: #ffc1c3;
    --error-bg: #4a2c34;
  }
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0; }
h1 { color: var(--title); font-size: 24px; font-weight: 650; line-height: 1.25; }
h2 { font-size: 17px; line-height: 1.35; }
a { color: var(--title); }
textarea { color: inherit; font: inherit; resize: vertical; }
button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden], .jqi-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0; }
.jqi-disabled, [aria-disabled="true"] { pointer-events: none; opacity: .55; }
.jqi-busy { cursor: progress; }
.muted, .build-status { color: var(--muted); }
.build-status { font-size: 12px; overflow-wrap: anywhere; }
.application-version { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.brand { color: var(--title); font-size: 17px; font-weight: 700; white-space: nowrap; }
.controls { display: flex; align-items: center; gap: 8px; }
.quiet, .theme, .primary {
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface);
}
:where(.quiet, .theme):hover:not(:disabled) { background: var(--subtle); border-color: var(--muted); }
.primary { min-height: 40px; padding: 0 16px; border: 0; border-radius: 11px;
  background: var(--button); color: var(--button-ink); font-size: 14.5px; font-weight: 500; line-height: 1.2; }
.form-alert { padding: 10px 12px; border-radius: 9px; background: var(--error-bg); color: var(--error); }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }

.login { display: grid; grid-template-rows: 64px 1fr 64px; min-height: 100dvh; align-items: center; }
.login-chrome { align-self: stretch; display: flex; justify-content: space-between; align-items: center;
  padding: 0 clamp(16px, 4vw, 46px); background: var(--surface); border-bottom: 1px solid var(--line); }
.login-foot { display: grid; justify-content: center; align-content: center; }
.auth-card {
  display: grid; gap: 14px; width: min(440px, calc(100% - 32px)); margin: 32px auto;
  padding: clamp(24px, 5vw, 34px); border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); box-shadow: 0 24px 60px -28px #15142b32;
}
.credential-form { display: grid; gap: 15px; }
.form-row { display: grid; gap: 6px; color: var(--ink); }
.field { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--subtle); }
.back-link { justify-self: start; }
.manual-key { padding: 10px 12px; background: var(--subtle); border-radius: 10px;
  overflow-wrap: anywhere; font-family: ui-monospace, monospace; }

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; height: 100dvh; position: sticky; top: 0; padding: 0 12px 12px;
  border-right: 1px solid var(--line); background: var(--surface); }
.side-brand { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding-left: 9px; border-bottom: 1px solid var(--line); }
.tenant { display: flex; align-items: center; gap: 9px; padding: 12px 9px; font-weight: 600; }
.avatar { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 9px;
  background: var(--active); color: var(--title); }
.side-nav { flex: 1; overflow: auto; }
.nav-group { margin-bottom: 10px; }
.nav-heading { color: var(--muted); font-size: 12px; padding: 9px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 7px 10px;
  border: 0; border-radius: 10px; text-decoration: none; color: var(--ink); background: transparent; }
.nav-item:hover { background: var(--subtle); }
.nav-item[aria-current="page"] { background: var(--active); color: var(--title); font-weight: 600; }
.nav-icon { flex: 0 0 20px; text-align: center; font-size: 18px; line-height: 1; }
.side-foot { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.topbar { height: 68px; display: flex; align-items: center; gap: 12px; padding: 0 clamp(16px, 3vw, 30px);
  border-bottom: 1px solid var(--line); background: var(--surface); }
.top-title { flex: 1; font-weight: 600; }
.main-area { min-width: 0; }
.content { display: grid; gap: 16px; max-width: 1320px; padding: 26px 30px 96px; margin: auto; }
.content.operations { max-width: 1520px; }
.empty-state { padding: 24px; color: var(--muted); }
.master-card { padding: 20px; min-width: 0; }
.master-card dl { display: grid; gap: 12px; }
.master-detail { display: grid; grid-template-columns: minmax(100px, 200px) minmax(0, 1fr); gap: 12px; }
.master-detail dt { color: var(--muted); }
.master-detail dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .master-detail { grid-template-columns: 1fr; gap: 2px; } }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.project-card { display: grid; align-content: start; gap: 8px; padding: 18px 20px; min-width: 0; }
.project-card h2 a { text-decoration: none; }
.project-card h2 a:hover { text-decoration: underline; }
.qr-container { display: grid; justify-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--subtle); text-align: center; }
.qr-wrap { padding: 8px; background: #fff; border-radius: 12px; }
.qr-wrap canvas { display: block; width: 160px; height: 160px; image-rendering: pixelated; }
:is(.operation-page, .staff-panel, .staff-results, .owner-overview, .owner-results) {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0;
}
.staff-toolbar, .staff-tabs, .staff-card-title, .staff-pagination { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.staff-toolbar .primary { margin-inline-start: auto; }
.staff-search { max-width: 400px; flex: 1 1 220px; }
.staff-state { width: auto; flex: 0 1 auto; }
.staff-block { padding: 16px; display: grid; gap: 10px; justify-items: start; }
.staff-block > * { max-width: 100%; }
.staff-block > .staff-toolbar, .staff-project-row { width: 100%; }
.staff-table-wrap { overflow-x: auto; }
.staff-table { width: 100%; border-collapse: collapse; }
.staff-table th, .staff-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.staff-table th { background: var(--subtle); font-weight: 600; }
.staff-table a, .staff-mobile-item a { font-weight: 650; text-decoration: none; }
.staff-table a:hover, .staff-mobile-item a:hover { text-decoration: underline; }
.staff-secondary, .staff-project-row p { overflow-wrap: anywhere; }
.treasury-value { overflow-wrap: anywhere; }
.treasury-row > .staff-toolbar { justify-content: flex-end; }
.owner-filters, .owner-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.owner-filters .staff-tabs { flex-wrap: wrap; margin: 0; }
.owner-period { width: auto; }
.overview-cards, .owner-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.overview-cards.refund-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.owner-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.overview-metric, .overview-recent, .owner-onboarding { min-width: 0; padding: 16px; }
.overview-metric h2 { color: var(--muted); font-size: 13px; font-weight: 600; }
.overview-metric.accent { border-color: var(--focus); }
.overview-amount { margin: 7px 0 3px; color: var(--title); font-size: clamp(18px, 2.15vw, 30px); font-weight: 700; overflow-wrap: anywhere; }
.overview-table { overflow-x: auto; }
.overview-recent .staff-table { min-width: 680px; }
.overview-recent .staff-table button, .overview-recent .staff-mobile-item button { text-align: left; overflow-wrap: anywhere; }
.owner-dim { text-decoration: line-through; color: var(--muted); }
.owner-operation-form, .owner-operation-options { display: grid; gap: 8px; }
.owner-operation-options > summary { cursor: pointer; }
.owner-operation-options > div { margin: 8px 0; }
.owner-page-size { width: 78px; }
.owner-payment-card { inset: 0 0 0 auto; margin: 0; width: min(560px, 100vw); max-width: 100%;
  height: 100dvh; max-height: 100dvh; padding: 20px; border: 0; background: var(--surface); color: var(--ink); }
.owner-payment-card::backdrop { background: rgb(16 15 33 / 55%); }
.owner-payment-body { display: grid; gap: 12px; padding-top: 12px; }
.owner-payment-facts { display: grid; grid-template-columns: minmax(115px, 36%) minmax(0, 1fr); gap: 8px 10px; }
.owner-payment-facts dt { color: var(--muted); }
.owner-payment-facts dd { margin: 0; overflow-wrap: anywhere; }
.owner-timeline { display: grid; gap: 10px; padding-left: 22px; overflow-wrap: anywhere; }
.owner-checkout-link { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.owner-checkout-link canvas { max-width: 148px; height: auto; }
@media (max-width: 900px) {
  .overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-table { display: none; }
}
@media (max-width: 600px) {
  .overview-cards.refund-cards { grid-template-columns: 1fr; }
  .owner-payment-card { width: 100vw; padding: 14px; }
  .owner-payment-facts { grid-template-columns: minmax(90px, 37%) minmax(0, 1fr); }
}
.staff-status { border-radius: 18px; background: var(--subtle); padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.staff-status[data-active="true"], .staff-tabs [aria-pressed="true"] { background: var(--active); color: var(--title); }
.staff-mobile-list { display: none; }
.staff-mobile-item, .staff-project-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-width: 0; }
.staff-mobile-item, .staff-project-row { border-top: 1px solid var(--line); padding: 10px 0; }
.staff-mobile-item { margin: 0 12px; }
.staff-mobile-item:first-child { border-top: 0; }
.staff-project-row > div, .staff-mobile-item > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.staff-pagination:not(:empty) { padding: 10px 14px; justify-content: flex-end; }
.staff-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 32px); color: var(--ink);
  padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.staff-dialog::backdrop { background: rgb(16 15 33 / 55%); }
.staff-dialog h2 { color: var(--title); margin-bottom: 14px; }
.dialog-fields, .dialog-form { display: grid; gap: 12px; }
.dialog-fields { margin: 0; border: 0; padding: 0; min-inline-size: 0; }
.dialog-fields h3 { font-size: 14px; margin: 4px 0 0; }
.dialog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr)); gap: 10px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.owner-developers .staff-toolbar { justify-content: space-between; }
.developer-project { display: flex; gap: 8px; align-items: center; max-width: 100%; }
.developer-project select { min-width: 0; }
.developer-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.developer-code { display: block; max-width: 100%; overflow: auto; padding: 12px; border-radius: 8px; background: var(--active); white-space: pre-wrap; overflow-wrap: anywhere; }
.developer-warning { color: var(--warning); }
.developer-break, .owner-developers .staff-table td code, .owner-developers .staff-mobile-item code { overflow-wrap: anywhere; }
.developer-status { display: grid; grid-template-columns: minmax(85px, 145px) minmax(0, 1fr); gap: 10px; }
.developer-status code { overflow-wrap: anywhere; }
.staff-operation-date { display: flex; align-items: center; gap: 6px; }
.staff-operation-filters input[name="merchant"] { width: 130px; }
.staff-operation-filters .staff-search { min-width: min(250px, 100%); }
.check-row { display: flex; gap: 8px; align-items: center; }
.temporary-password { display: block; padding: 12px; overflow-wrap: anywhere; background: var(--subtle); border-radius: 10px; user-select: all; }
@media (max-width: 660px) {
  .staff-table-wrap { display: none; }
  .staff-mobile-list { display: block; }
  .staff-project-row { flex-wrap: wrap; }
  .staff-project-row > div { flex-basis: 100%; }
}
.balance { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.approved-urls { margin: 0; padding-left: 16px; overflow-wrap: anywhere; }
.mobile-nav, .burger, .scrim { display: none; }
@media (min-width: 2200px) { .content { max-width: 1640px; } .content.operations { max-width: 1980px; } }
@media (min-width: 901px) {
  .shell[data-mini="true"] { grid-template-columns: 70px minmax(0, 1fr); }
  .shell[data-mini="true"] .sidebar :is(.nav-heading, .nav-caption) { display: none; }
  .shell[data-mini="true"] .side-foot .quiet { padding-inline: 0; font-size: 11px; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; width: min(280px, 84vw); visibility: hidden; transform: translateX(-100%); }
  .shell[data-drawer="true"] .sidebar { visibility: visible; transform: none; }
  .shell[data-drawer="true"] .scrim { display: block; position: fixed; z-index: 4; inset: 0; border: 0; background: #15142b55; }
  .mobile-nav { position: fixed; inset: auto 0 0; display: flex; z-index: 3; justify-content: space-around;
    padding: 4px 5px max(4px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .mobile-nav .nav-item { justify-content: center; flex-direction: column; gap: 2px; padding: 4px; min-width: 0; font-size: 11px; }
  .mobile-nav .nav-icon { flex: none; }
  .burger { display: block; }
  .collapse { display: none; }
  .topbar { height: 58px; padding: 0 12px; gap: 8px; }
  .topbar .theme, .topbar .language, .topbar .burger { padding-inline: 8px; }
  .top-title { font-size: 13px; }
  .content { padding: 20px 14px 85px; }
}
.payment-files { display: grid; gap: .6rem; min-width: 0; }
.payment-file-list { display: grid; gap: .5rem; min-width: 0; }
.payment-file { min-width: 0; }
.payment-file-row { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.payment-file-type { font-weight: 700; font-size: .75rem; }
.payment-file-name { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.payment-file-name p { margin: 0; }
.payment-file-preview { width: 100%; height: min(65vh, 36rem); border: 0; margin-top: .5rem; }
.cashier-login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.cashier-shell .tenant p { margin: 0; }
.cashier-shell .side-foot { align-items: stretch; }
.cashier-shell[data-mini="true"] .cashier-balance { overflow: hidden; text-overflow: ellipsis; }
.cashier-form, .cashier-qr { max-width: 620px; }
.cashier-form .form-row { margin: .7rem 0; }
.cashier-qr canvas { width: min(100%, 260px); height: auto; }
.cashier-timer { font-variant-numeric: tabular-nums; }
.cashier-timer[data-soon="true"] { color: var(--error); }
.cashier-unpaid { text-decoration: line-through; color: var(--muted); }
.owner-chart { display: block; width: 100%; height: auto; min-height: 120px; }
.owner-cashier-stats { list-style: none; padding: 0; margin: 0; }
.owner-cashier-stats li { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; }
.cashier-profile { position: relative; margin-left: auto; }
.cashier-profile summary { cursor: pointer; }
.cashier-profile-menu { position: absolute; right: 0; z-index: 8; min-width: 180px; max-width: 85vw; padding: 12px; }
.cashier-menu, .cashier-mobile-preferences { display: none; }
@media (max-width: 1179px) {
  .cashier-table th:nth-child(3), .cashier-table td:nth-child(3) { display: none; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .cashier-shell, .cashier-shell[data-mini="true"] { grid-template-columns: minmax(0, 1fr); }
  .cashier-shell .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 85vw); z-index: 12; transform: translateX(-100%); }
  .cashier-shell[data-drawer="true"] .sidebar { transform: none; }
  .cashier-shell[data-drawer="true"] .scrim { display: block; position: fixed; z-index: 11; inset: 0; border: 0; background: #15142b55; }
  .cashier-shell .collapse { display: none; }
}
@media (max-width: 1100px) { .cashier-menu { display: inline-flex; } }
@media (max-width: 900px) {
  .cashier-desktop-preferences { display: none; }
  .cashier-mobile-preferences { display: block; }
  .cashier-topbar { gap: .4rem; }
  .cashier-topbar > span { min-width: 0; overflow-wrap: anywhere; }
}
