:root {
  color-scheme: light;
  --green: #2f7527;
  --teal: #24b2aa;
  --ink: #1b2228;
  --muted: #67727e;
  --line: #d8e1e7;
  --paper: #ffffff;
  --bg: #eaf8f8;
  --blue: #2468a9;
  --red: #b8272f;
  --gold: #d69b19;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 400;
}

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

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
}

.table-sort-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
  font-weight: inherit;
  padding: 0;
}

.table-sort-button.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.filter-checks {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.announcement-panel,
.announcement-settings {
  border-left: 4px solid var(--teal);
}

.announcement-list,
.announcement-admin-list {
  display: grid;
  gap: 10px;
}

.announcement-item,
.announcement-edit {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, var(--teal));
  padding: 12px;
  border-radius: 6px;
}

.announcement-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.announcement-item p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.announcement-edit {
  display: grid;
  gap: 10px;
}

.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;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
}

.simple-steps {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.7;
}

.telegram-link-panel {
  align-content: start;
}

.telegram-qr-card {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin: 8px 0 12px;
}

.telegram-qr-card img {
  display: block;
  width: min(220px, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.order-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
}

.admin-form .order-item,
.order-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7fbfc;
  color: var(--ink);
  font-weight: 400;
  cursor: grab;
  user-select: none;
  align-self: center;
}

.admin-form .order-item:active,
.order-item:active {
  cursor: grabbing;
}

.admin-form .order-item.dragging,
.order-item.dragging {
  opacity: 0.45;
}

.drag-handle {
  color: var(--muted);
  letter-spacing: 1px;
}

.input-order-select {
  width: min(100%, 420px);
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.account-order-control .input-order-select {
  width: 100%;
}

.settings-grid {
  align-items: start;
}

.settings-grid .admin-form {
  align-content: start;
}

.index2d-settings-form {
  grid-column: 1 / -1;
}

.index2d-settings-form table input[type="time"] {
  width: 100%;
  min-width: 92px;
}

.compact-check {
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: start;
}

.admin-form .form-actions button {
  width: auto;
  min-width: 110px;
}

.admin-form .secondary-button,
.secondary-button {
  background: #6d7884;
  color: #ffffff;
}

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

.export-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(25, 55, 70, 0.12);
}

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

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.report-toolbar button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #0f172a;
  border-radius: 3px;
  background: #111827;
  color: #ffffff;
}

.report-toolbar button.active {
  background: var(--blue);
  border-color: var(--blue);
}

.strike-report-title {
  margin: 4px 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.strike-report-wrap {
  border: 1px solid var(--line);
}

.strike-winning-summary {
  margin: 0 0 12px;
  border: 1px solid var(--line);
}

.strike-report-table {
  min-width: 1120px;
  border-collapse: collapse;
}

.strike-report-table th {
  background: #111111;
  color: #ffffff;
  border-color: #ffffff;
  text-align: center;
}

.strike-report-table td {
  text-align: right;
}

.strike-report-table td:first-child,
.strike-report-table td:nth-child(2),
.strike-report-table td:nth-child(3),
.strike-report-table td:nth-child(4),
.strike-report-table td:nth-child(5) {
  text-align: center;
}

.strike-report-table tbody tr:nth-child(even) {
  background: #fdeade;
}

.strike-hit {
  color: #005bff;
  font-weight: 600;
}

.strike-total-row td {
  background: #d0d0d0;
  font-weight: 600;
}

.notice-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 24px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at bottom right, rgba(36, 104, 169, 0.12), rgba(36, 104, 169, 0) 32%),
    linear-gradient(180deg, #eef8ff 0%, #eaf8f8 100%);
}

.login-shell {
  width: min(390px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
}

.login-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(31, 122, 224, 0.14);
  backdrop-filter: blur(10px);
}

.login-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.login-site {
  display: grid;
  gap: 3px;
}

.login-site strong {
  color: #10233b;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.login-site span {
  color: var(--muted);
  font-size: 12px;
}

.login-language-button,
.login-topline button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 500;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--blue);
  font-size: 54px;
  line-height: 1;
  text-shadow: 1px 2px 0 rgba(0, 0, 0, 0.18);
}

.brand-mark .ring {
  width: 96px;
  height: 96px;
  border: 10px solid var(--blue);
  border-top-color: #ffffff;
  border-right-color: var(--green);
  border-bottom-color: #7b4faf;
  border-left-color: #d4b323;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f9ffff;
}

.brand-mark .ring span {
  font-size: 37px;
  font-weight: 500;
}

.brand-mark strong {
  font-size: 46px;
  letter-spacing: 0;
}

.notice-card,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(25, 55, 70, 0.12);
}

.login-panel {
  display: grid;
  gap: 15px;
  padding: 0;
  align-self: center;
}

.login-panel h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.login-demo {
  margin: 0 0 2px;
  color: var(--red);
  font-size: 14px;
  text-align: center;
  font-weight: 600;
}

.login-panel label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #384650;
  font-weight: 500;
}

.login-panel input,
.login-panel button {
  width: 100%;
  min-height: 50px;
  border-radius: 10px;
}

.login-panel input {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 0 14px;
}

.login-panel input:focus {
  border-color: rgba(36, 104, 169, 0.55);
  outline: 4px solid rgba(36, 104, 169, 0.15);
  background: #ffffff;
}

.login-panel button,
.notice-card button,
.panel-head button,
.bet-row button {
  background: var(--teal);
  color: white;
  border: 0;
  padding: 9px 18px;
  border-radius: 4px;
  font-weight: 500;
}

.login-panel button {
  margin-top: 2px;
  font-size: 15px;
  box-shadow: 0 14px 26px rgba(36, 178, 170, 0.18);
}

.notice-card {
  max-width: 760px;
  padding: 28px;
  line-height: 1.55;
}

.notice-card h1 {
  margin-top: 0;
}

.notice-demo {
  margin: 16px 0 0;
  color: var(--red);
  text-align: center;
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.actions .secondary {
  background: #7c8794;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 14px 0 30px rgba(14, 43, 72, 0.18);
}

.side-brand {
  display: block;
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.side-brand strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.side-brand span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.3;
}

.mobile-menu-button {
  display: none;
}

.side-time {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 400;
}

.side-nav {
  padding: 10px 10px 96px;
}

.side-section {
  margin-bottom: 10px;
}

.side-section-title {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

.side-section-title:hover {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.side-section:not(.collapsed) .side-section-title {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 18%, transparent);
  color: #ffffff;
}

.side-section-caret {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  letter-spacing: 0;
}

.side-section-items {
  display: grid;
  gap: 2px;
}

.side-section.collapsed .side-section-items {
  display: none;
}

.side-link {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px 8px 18px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.side-link:hover,
.side-link.active {
  background: var(--paper);
  color: var(--blue);
}

.side-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 0%, transparent), var(--blue) 24%);
}

.side-actions button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 500;
}

.workspace {
  min-width: 0;
  padding-bottom: 32px;
}

.page-head,
.filters,
.metrics,
.profile-grid,
.bet-grid,
.admin-grid,
.table-section,
.panel {
  width: min(1440px, calc(100% - 24px));
  margin: 12px auto;
}

.page-head {
  padding: 16px 4px 4px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.page-head p,
.section-title span,
.metric span,
.metric small {
  color: var(--muted);
}

.profile-grid,
.bet-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 12px;
}

.profile-grid > *,
.bet-grid > *,
.admin-grid > * {
  min-width: 0;
}

.panel {
  padding: 16px;
  overflow-x: auto;
}

.profile-grid .panel,
.bet-grid .panel,
.admin-grid .panel {
  width: auto;
  margin: 0;
}

.results-admin-grid {
  grid-template-columns: 1fr;
}

.results-admin-grid .results-full-panel {
  grid-column: 1 / -1;
}

.result-save-form {
  gap: 12px;
}

.result-save-form h2 {
  margin-bottom: 2px;
}

.result-save-main {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(110px, 150px) repeat(3, minmax(120px, 1fr)) minmax(120px, 150px);
  gap: 10px;
  align-items: end;
}

.result-save-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}

.result-save-form textarea {
  min-height: 58px;
  resize: vertical;
}

.result-save-form button {
  width: auto;
  min-height: 38px;
}

.index2d-recent-wrap {
  max-height: 52vh;
}

.index2d-recent-table th,
.index2d-recent-table td {
  white-space: nowrap;
}

.index2d-recent-table td strong {
  display: block;
  color: var(--blue);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.index2d-recent-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.message {
  width: min(1440px, calc(100% - 24px));
  margin: 12px auto;
  padding: 10px 12px;
  border: 1px solid #9fc5e8;
  border-radius: 6px;
  background: #eef7ff;
  color: #174c7c;
  font-weight: 500;
}

.inline-message {
  margin: 10px 0 12px;
  padding: 8px 10px;
  border: 1px solid #9fc5e8;
  border-radius: 6px;
  background: #eef7ff;
  color: #174c7c;
}

.security-alert {
  width: min(1440px, calc(100% - 24px));
  margin: 12px auto;
  padding: 10px 12px;
  border: 1px solid #e1b45a;
  border-radius: 6px;
  background: #fff6da;
  color: #6f4300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.security-alert strong {
  display: block;
  font-weight: 500;
}

.security-alert span {
  display: block;
  margin-top: 2px;
  color: #775a22;
  font-size: 13px;
}

.security-alert button {
  border: 0;
  border-radius: 5px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  padding: 9px 12px;
  white-space: nowrap;
}

.panel-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title button {
  border: 0;
  border-radius: 4px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  padding: 8px 12px;
}

dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 14px;
  margin: 0;
}

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

dd {
  margin: 0;
  font-weight: 500;
}

.filters {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.filters label {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
  font-weight: 500;
}

.filter-range-note {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.filters input,
.filters select,
.bet-row input,
.bet-slip textarea {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 9px;
  background: white;
}

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

.member-home-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-home-content {
  width: min(1440px, calc(100% - 24px));
  margin: 12px auto;
}

.member-home-content .panel {
  width: auto;
  margin: 0;
}

.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  color: var(--blue);
  font-weight: 500;
}

.metric small {
  display: block;
  margin-top: 3px;
}

.table-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.section-title {
  padding: 14px 16px;
  margin: 0;
  background: #f5fafb;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  max-height: 62vh;
}

.market2d-matrix-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}

.market2d-market-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}

.index2d-entry {
  overflow: visible;
}

.index2d-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(250px, 1.1fr) minmax(320px, 1.4fr) minmax(120px, 150px) auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfb;
}

.index2d-toolbar label,
.index2d-date-group,
.index2d-market-group {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 500;
}

.index2d-toolbar select,
.index2d-toolbar input[type="number"] {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 6px 8px;
}

.index2d-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.index2d-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 5px 8px;
  font-weight: 400;
  line-height: 1.2;
}

.index2d-chip input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.index2d-chip.draw-closed {
  color: rgba(15, 23, 42, 0.55);
  background: #eef3f5;
}

.index2d-chip.draw-closed input {
  cursor: not-allowed;
}

.index2d-settings-form {
  display: grid;
  gap: 12px;
}

.index2d-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 12px;
}

.index2d-settings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.index2d-settings-card-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f5fafb;
  border-bottom: 1px solid var(--line);
}

.index2d-settings-card-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.index2d-settings-card-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.index2d-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.index2d-time-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.index2d-time-grid input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 7px;
}

.index2d-date-title {
  padding: 9px 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.index2d-admin-dates {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 6px;
  padding: 9px 12px 12px;
}

.index2d-date-chip {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  column-gap: 6px;
  row-gap: 2px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  padding: 5px 7px;
  color: var(--ink);
}

.index2d-date-chip input {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  margin: 0;
}

.index2d-date-weekday {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}

.index2d-date-value {
  font-size: 13px;
  line-height: 1.1;
}

.index2d-date-chip.is-closed {
  background: #f0f3f5;
  color: rgba(15, 23, 42, 0.58);
}

.index2d-submit,
.compact-button {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: var(--teal);
  color: #ffffff;
  padding: 7px 14px;
  font-weight: 500;
  white-space: nowrap;
}

.compact-button {
  background: #7c8794;
  padding-inline: 10px;
}

.market2d-selection-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.market2d-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px 14px 14px;
}

.market2d-check {
  display: grid;
  grid-template-columns: 17px 1fr;
  align-items: center;
  gap: 2px 7px;
  margin: 0;
  min-width: 0;
}

.market2d-check input {
  grid-row: span 2;
  width: 17px;
  height: 17px;
}

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

.market2d-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.market2d-tabs button {
  min-width: 86px;
  border: 1px solid #9bb9cf;
  border-radius: 4px;
  background: #ffffff;
  color: #0b3354;
  padding: 8px 18px;
}

.market2d-tabs button:hover,
.market2d-tabs button:focus,
.market2d-tabs button.active {
  background: #1f6fab;
  border-color: #1f6fab;
  color: #ffffff;
}

.index2d-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(100% - 32px, 100%);
  margin: 12px auto;
}

.index2d-result-market {
  margin: 0;
}

.index2d-result-market .filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.index2d-result-market .filters label,
.index2d-result-market .filters button {
  min-width: 0;
  width: 100%;
}

.market2d-matrix-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto 1fr;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
}

.market2d-matrix-toolbar label {
  margin: 0;
}

.market2d-number-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(42px, 1fr));
  gap: 6px;
  padding: 0 14px 14px;
}

.market2d-number-cell {
  min-height: 40px;
  border: 1px solid #b9c9d7;
  border-radius: 5px;
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  touch-action: manipulation;
}

.market2d-number-cell:hover,
.market2d-number-cell:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(36, 108, 170, 0.14);
}

.market2d-number-cell.selected {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.winloss-wrap {
  max-height: calc(100vh - 270px);
}

.winloss-table {
  width: 100%;
  table-layout: fixed;
}

.winloss-drillbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7fbfc;
  color: var(--muted);
}

.winloss-drillbar button,
.winloss-account-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font: inherit;
  text-align: left;
}

.winloss-drillbar button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.winloss-account-link:hover,
.winloss-drillbar button:hover {
  text-decoration: underline;
}

.winloss-table th,
.winloss-table td {
  white-space: nowrap;
  padding: 6px 5px;
  font-size: 12px;
}

.winloss-table thead th {
  text-align: center;
  vertical-align: middle;
}

.winloss-table td:nth-child(1),
.winloss-table td:nth-child(2) {
  background: #edf6fb;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winloss-table th[rowspan] {
  background: #d8eaf4;
  color: #102235;
}

.winloss-group {
  background: #bfd7ac;
  color: #102235;
}

.group-current {
  background: #2468a9;
  color: #ffffff;
}

.group-seller,
.winloss-table tbody td:nth-child(n+4):nth-child(-n+7) {
  background: #dceac9;
}

.winloss-table tbody td:nth-child(n+8):nth-child(-n+12) {
  background: #efe59b;
}

.winloss-table tbody td:nth-child(n+13):nth-child(-n+16) {
  background: #dceac9;
}

.winloss-table tbody td:nth-child(7),
.winloss-table tbody td:nth-child(11),
.winloss-table tbody td:nth-child(16) {
  background: #e6c07b;
}

.winloss-winning {
  color: #1f58ff;
}

.danger-text {
  color: var(--red);
}

.winloss-total-row td {
  border-top: 2px solid var(--line);
}

.winloss-table thead .winloss-group,
.winloss-table thead th[rowspan] {
  color: #102235 !important;
}

.winloss-table thead .group-current {
  color: #ffffff !important;
}

.eat-map-panel {
  width: calc(100% - 12px);
  max-width: none;
  padding: 0;
}

.eat-map-toolbar {
  position: sticky;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f5fafb;
  border-bottom: 1px solid var(--line);
}

.eat-map-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 180px;
  color: var(--muted);
  font-weight: 500;
}

.eat-map-toolbar select,
.eat-map-input {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.eat-map-toolbar select {
  padding: 8px 9px;
}

.eat-map-toolbar span {
  color: var(--muted);
  font-weight: 500;
  padding: 8px 0;
}

.eat-map-toolbar button {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: var(--teal);
  color: #ffffff;
  padding: 8px 18px;
  font-weight: 600;
}

.eat-map-wrap {
  max-height: calc(100vh - 220px);
  overflow-x: hidden;
}

.eat-map-helper {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.eat-map-helper summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  background: #f5fafb;
}

.eat-map-helper summary::-webkit-details-marker {
  display: none;
}

.eat-map-helper summary span {
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
}

.eat-map-helper summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.eat-map-helper-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  padding: 12px;
}

.eat-map-helper[open] .eat-map-helper-grid,
.eat-map-helper:hover .eat-map-helper-grid,
.eat-map-helper:focus-within .eat-map-helper-grid {
  display: grid;
}

.eat-map-helper-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fbfdfe;
}

.eat-map-helper-grid span {
  display: block;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
}

.eat-map-helper-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.eat-map-table {
  width: auto;
  min-width: 0;
  table-layout: fixed;
}

.eat-map-table th,
.eat-map-table td {
  width: 60px;
  min-width: 60px;
  padding: 4px 3px;
  vertical-align: top;
  font-weight: 500;
}

.eat-map-banker {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 54px;
  min-width: 54px;
  background: #f7fbfc;
  color: var(--ink);
  text-align: left;
}

.eat-map-table thead th:first-child {
  width: 54px;
  min-width: 54px;
}

thead .eat-map-banker,
.eat-map-table thead th:first-child {
  z-index: 3;
}

.eat-map-head-label,
.eat-map-head-meta {
  display: block;
  line-height: 1.15;
}

.eat-map-head-meta {
  margin-top: 2px;
  color: #dfefff;
  font-size: 10px;
  font-weight: 400;
}

.eat-map-category-head {
  position: relative;
  cursor: help;
  outline: none;
}

.eat-map-banker span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.eat-map-input {
  width: 48px;
  padding: 3px 4px;
  text-align: right;
  font-weight: 400;
}

.eat-map-total-input {
  width: 62px;
}

.eat-map-disabled {
  background: #f4f7f8;
}

.eat-map-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.eat-map-meta.danger,
.eat-map-number {
  color: var(--red);
  font-weight: 500;
}

.eat-map-number {
  margin-top: 3px;
  font-size: 11px;
}

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

th,
td {
  border-bottom: 1px solid #e8eef2;
  border-right: 1px solid #e8eef2;
  padding: 8px;
  text-align: center;
  white-space: nowrap;
  font-weight: 400;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--blue);
  color: white;
}

th button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 500;
}

td button {
  border: 0;
  border-radius: 4px;
  padding: 6px 10px;
  background: var(--red);
  color: white;
  font-weight: 500;
}

.num {
  font-weight: 500;
  background: #f6f8fa;
}

.negative {
  color: #b00020;
  background: #fff1f3;
}

.high {
  background: #ffe5e8;
  color: var(--red);
  font-weight: 500;
}

.medium {
  background: #fff4c2;
  color: #8b5a00;
  font-weight: 500;
}

.low {
  background: #e5f5e8;
  color: #1e7132;
}

.empty {
  color: #a0a8b0;
}

.hot .num {
  background: #ffdda0;
}

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

.file-list article {
  display: grid;
  grid-template-columns: 1fr 120px 120px 120px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.inbox-output {
  width: min(1440px, calc(100% - 24px));
  margin: 12px auto;
}

.login-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.login-error {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 13px;
  text-align: center;
}

.admin-form,
.agent-card {
  display: grid;
  gap: 10px;
}

.compact-create-form {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  align-items: end;
}

.compact-create-form .section-title {
  grid-column: 1 / -1;
}

.compact-create-form button {
  min-height: 36px;
}

.form-span {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 84px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.compact-checks input[type="checkbox"] {
  width: auto;
}

.password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.agent-card input,
.agent-card select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 9px;
  background: white;
}

.admin-form button,
.agent-card button,
.filters button {
  border: 0;
  border-radius: 4px;
  padding: 9px 14px;
  background: var(--teal);
  color: white;
  font-weight: 500;
}

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

.check-row input[type="checkbox"] {
  width: auto;
}

.table-pre {
  max-width: 520px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
}

.link-management-table input,
.link-management-table select {
  width: 100%;
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 6px;
  background: #ffffff;
}

.link-management-table td {
  vertical-align: top;
}

.link-management-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.link-management-table button {
  border: 0;
  border-radius: 4px;
  padding: 6px 10px;
  background: var(--teal);
  color: #ffffff;
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.mini-check input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

.agent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.inline-filters {
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.agent-table-wrap {
  max-height: calc(100vh - 330px);
  overflow: auto;
}

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

.agent-table th,
.agent-table td {
  padding: 4px 6px;
  white-space: nowrap;
}

.table-link {
  border: 0;
  background: transparent;
  color: #003cff;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}

.table-link:hover,
.table-link:focus {
  text-decoration: underline;
}

.agent-table td:nth-child(3),
.agent-table td:nth-child(8) {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-table .num {
  text-align: right;
}

.agent-table .selected-row td {
  background: #eaf5ff;
}

.agent-actions {
  display: flex;
  gap: 4px;
}

.agent-actions button,
.agent-card .secondary-button,
.secondary-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 12px;
}

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

.agent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfefe;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 42px 16px;
  background: rgba(12, 24, 32, 0.32);
}

.agent-edit-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 84px);
  overflow: auto;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(10, 28, 40, 0.28);
}

.agent-edit-modal .agent-card {
  margin: 0;
}

.agent-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.agent-card-head strong,
.agent-card-head span {
  display: block;
}

.agent-card-tools,
.account-v2-shortcuts,
.account-v2-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.agent-card label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 500;
}

.account-v2-form {
  gap: 12px;
}

.account-v2-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.account-v2-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.account-v2-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.account-v2-grid .field-hint {
  margin-top: 2px;
}

.compact-order-list {
  margin: 2px 0 6px;
}

.account-order-control .order-item {
  min-height: 32px;
  padding: 5px 8px;
}

.account-v2-shortcuts button {
  min-height: 32px;
}

.member-home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.member-home-top h1 {
  margin: 0;
  font-size: 24px;
}

.member-home-top p {
  margin: 4px 0 0;
  color: var(--muted);
}

.member-home-top .account-v2-shortcuts {
  padding: 0;
}

.member-home-top button {
  min-width: 110px;
}

@media (max-width: 700px) {
  .member-home-top {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .member-home-top .account-v2-shortcuts {
    width: 100%;
  }

  .member-home-top button {
    flex: 1 1 120px;
  }
}

.agent-meta {
  color: var(--muted);
  font-size: 12px;
}

.whatsapp-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 12px;
  width: min(1440px, calc(100% - 24px));
  margin: 12px auto;
}

.whatsapp-layout .panel {
  width: auto;
  margin: 0;
}

.whatsapp-message-form textarea {
  min-height: 132px;
  resize: vertical;
}

.whatsapp-log {
  display: grid;
  gap: 12px;
}

.chat-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfefe;
}

.chat-row.rejected {
  border-color: #f2b7bd;
  background: #fff8f8;
}

.chat-meta {
  color: var(--muted);
  font-size: 12px;
}

.chat-bubble {
  display: grid;
  gap: 4px;
  max-width: 760px;
}

.chat-bubble span {
  color: var(--muted);
  font-size: 11px;
}

.chat-bubble pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #f3f8fb;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.chat-bubble.reply {
  justify-self: end;
}

.chat-bubble.reply pre {
  background: #e7fbf8;
  border-color: #a7e5df;
}

.package-form {
  display: grid;
  gap: 12px;
}

.package-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px 90px 130px;
  gap: 10px;
}

.package-form input,
.package-form select,
.package-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 8px;
  background: white;
}

.package-form textarea {
  min-height: 70px;
  resize: vertical;
}

.package-table-wrap {
  max-height: 68vh;
}

.package-list-wrap {
  max-height: 68vh;
}

.package-compact-table {
  min-width: 1180px;
}

.package-compact-table th,
.package-compact-table td {
  white-space: nowrap;
}

.package-compact-table th:first-child,
.package-compact-table td:first-child {
  min-width: 120px;
  text-align: left;
}

.package-compact-table input {
  width: 72px;
}

.package-compact-form .package-head {
  grid-template-columns: minmax(220px, 1fr) 90px 90px 130px;
}

.package-detail-form {
  width: min(1900px, calc(100% - 24px));
}

.package-detail-form .section-title {
  padding: 0 0 8px;
  background: transparent;
}

.package-group {
  display: grid;
  gap: 6px;
}

.package-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #f5fafb;
}

.package-group-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.package-group-title span {
  color: var(--muted);
  font-size: 12px;
}

.package-detail-table {
  min-width: 980px;
}

.package-detail-table th,
.package-detail-table td {
  white-space: nowrap;
}

.package-detail-table th:first-child,
.package-detail-table td:first-child {
  min-width: 120px;
  text-align: left;
}

.package-detail-table input {
  width: 88px;
  padding: 5px 6px;
  text-align: right;
}

.package-rate-row {
  cursor: pointer;
}

.package-rate-row:hover {
  background: #f5fafb;
}

.package-rate-row td,
.package-edit-row td {
  height: 44px;
}

.package-table-wrap input {
  width: 90px;
  text-align: right;
}

.package-edit-row input {
  min-width: 88px;
}

.package-form button {
  justify-self: start;
  border: 0;
  border-radius: 4px;
  padding: 9px 14px;
  background: var(--teal);
  color: white;
  font-weight: 500;
}

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

.member-payout-panel {
  width: min(1200px, calc(100% - 24px));
}

.member-payout-panel .section-title {
  background: #f8eadf;
}

.member-payout-panel .muted {
  margin: 8px 0 12px;
}

.member-payout-wrap {
  max-height: none;
}

.member-payout-table {
  min-width: 760px;
}

.member-payout-table th {
  background: #f8eadf;
  color: var(--ink);
}

.member-payout-table th,
.member-payout-table td {
  white-space: nowrap;
}

.member-payout-table td:nth-child(n+4),
.member-payout-table th:nth-child(n+4) {
  text-align: right;
}

.member-payout-table tbody tr:nth-child(even) td {
  background: #fbede2;
}

.bet-slip textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: Consolas, monospace;
}

.phone-bet {
  width: min(1440px, calc(100% - 24px));
  margin: 12px auto;
}

.phone-bet-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 140px minmax(280px, 1.2fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: end;
}

.old-phone-toolbar {
  grid-template-columns: minmax(220px, 1fr) 140px minmax(280px, 1.2fr) minmax(260px, 1fr);
}

.phone-bet-toolbar label,
.phone-pane {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 500;
}

.phone-bet-toolbar input,
.phone-bet-toolbar select,
.phone-pane textarea {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 9px;
  background: white;
}

.phone-bet-grid,
.old-phone-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.old-phone-grid {
  grid-template-columns: 1fr 1fr 1fr;
}

.phone-pane textarea {
  min-height: 360px;
  resize: vertical;
  font-family: Consolas, monospace;
  color: var(--ink);
}

.phone-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.bet-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.bet-row label,
.bet-slip label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 500;
}

.bet-slip input,
.bet-slip select,
.bet-slip textarea,
.settle-form input,
.settle-form select {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 9px;
  background: white;
}

.entry-wrap {
  max-height: none;
  margin: 12px 0;
}

.entry-table input {
  width: 110px;
  min-width: 0;
}

.ticket-entry {
  width: min(1900px, calc(100% - 24px));
  margin: 12px auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.bet-draw-board {
  width: min(1900px, calc(100% - 24px));
  margin: 10px auto 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.bet-draw-board table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.bet-draw-board th,
.bet-draw-board td {
  padding: 7px 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

.bet-draw-board thead th {
  color: #06213b;
  background: #dbeaf2;
}

.bet-draw-board tbody th {
  color: #ffffff;
  background: #0f6d92;
}

.bet-draw-board th span {
  margin-left: 4px;
  color: inherit;
  opacity: 0.72;
}

.bet-draw-board .banker-m { background: #fff200; color: #0f172a; }
.bet-draw-board .banker-p { background: #0617d8; color: #ffffff; }
.bet-draw-board .banker-t { background: #d90000; color: #ffffff; }
.bet-draw-board .banker-s { background: #4e98cf; color: #ffffff; }
.bet-draw-board .banker-c { background: #064f18; color: #ffffff; }
.bet-draw-board .banker-b { background: #e81c25; color: #ffffff; }
.bet-draw-board .draw-closed {
  color: rgba(15, 23, 42, 0.55);
  background: #d6dde4;
}

.ticket-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfb;
}

.ticket-toolbar .bet-row {
  margin: 0;
  grid-template-columns: minmax(320px, auto) minmax(260px, 1fr) auto;
}

.draw-checks {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 500;
}

.draw-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  align-items: center;
}

.draw-check-list label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: auto;
  color: var(--ink);
  font-weight: 400;
}

.draw-check-list input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.ticket-totals,
.column-total {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.cutoff-note {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff7e0;
  color: #7a4c00;
  font-weight: 500;
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px;
  overflow-x: auto;
}

.entry-grid.single-entry-grid {
  grid-template-columns: minmax(740px, 1fr);
}

.entry-panel {
  min-width: 740px;
}

.entry-table th,
.entry-table td {
  padding: 4px;
}

.entry-table thead th {
  position: static;
  background: #f5fafb;
  color: var(--ink);
}

.entry-table td:first-child {
  display: grid;
  grid-template-columns: 26px auto 1fr;
  gap: 4px;
  align-items: center;
}

.entry-table td:first-child:not(.number-cell) {
  grid-template-columns: 26px 1fr;
}

.row-no {
  font-weight: 500;
  text-align: right;
}

.lucky-row-button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
}

.lucky-row-button:hover,
.lucky-row-button:focus {
  border-color: var(--blue);
  background: #eef7ff;
}

.ticket-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ticket-mode-tabs button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 4px;
  padding: 8px 12px;
}

.ticket-mode-tabs button.active {
  border-color: var(--blue);
  background: #eaf4ff;
  color: var(--blue);
}

.entry-table input[type="number"],
.entry-table input[inputmode="numeric"] {
  width: 100%;
  height: 30px;
  padding: 4px 6px;
}

.entry-table select {
  width: 70px;
  height: 30px;
}

.banker-head,
.banker-cell {
  min-width: 252px;
  width: 252px;
}

.banker-head {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  gap: 4px;
}

.banker-cell {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: center;
  gap: 4px;
}

.banker-head label,
.banker-cell label {
  min-width: 0;
  width: 100%;
  display: grid;
  place-items: center;
  gap: 2px;
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

.banker-head label {
  grid-template-rows: auto 22px;
}

.banker-head span {
  line-height: 1;
}

.banker-head input,
.banker-cell input {
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
}

.column-total {
  padding: 8px 2px 2px;
}

.ticket-footer-fields {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr);
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--line);
}

.ticket-footer-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 500;
}

.submit-result-panel {
  width: min(1900px, calc(100% - 24px));
  margin: 12px auto;
}

.submit-result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: stretch;
}

.submit-result-table table {
  font-size: 13px;
}

.submit-result-table th,
.submit-result-table td {
  padding: 5px 7px;
}

.submit-receipt-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  color: var(--muted);
  font-weight: 500;
}

.submit-receipt-pane textarea {
  width: 100%;
  min-height: 250px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  line-height: 1.45;
}

.submit-result-actions {
  justify-content: center;
  margin-top: 12px;
}

.slip-history-filters {
  width: min(1900px, calc(100% - 24px));
  grid-template-columns: minmax(180px, 1.1fr) repeat(3, minmax(130px, .8fr)) minmax(140px, .8fr) auto;
}

.slip-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #f8f8f8;
  color: var(--muted);
  font-size: 13px;
}

.slip-history-meta button {
  width: auto;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 4px;
}

.slip-history-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-top: 0;
}

.slip-history-row {
  display: grid;
  grid-template-columns: 44px 58px minmax(260px, .72fr) minmax(300px, 1fr) minmax(300px, 1fr) 145px;
  gap: 0;
  min-height: 190px;
  border-top: 1px solid var(--line);
  background: #f1f1f1;
}

.slip-history-row:nth-child(even) {
  background: #e7e7e7;
}

.slip-history-row > * {
  padding: 10px;
  border-left: 1px solid var(--line);
}

.slip-history-row > *:first-child {
  border-left: 0;
}

.slip-history-no {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.slip-history-void {
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 12px;
}

.slip-history-info h3,
.slip-history-text span {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.slip-history-info dl {
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 3px 8px;
  font-size: 13px;
}

.slip-history-info dt,
.slip-history-info dd {
  padding: 0;
}

.slip-history-text {
  display: grid;
  grid-template-rows: auto 1fr;
}

.slip-history-text textarea {
  width: 100%;
  min-height: 145px;
  resize: vertical;
  border: 1px solid #aaa;
  border-radius: 2px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
}

.slip-history-actions {
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 8px;
}

.slip-history-actions button {
  border-radius: 4px;
  padding: 7px 10px;
}

.slip-history-table-wrap {
  border-top: 0;
}

.slip-history-table {
  min-width: 1180px;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.slip-history-table th,
.slip-history-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  vertical-align: top;
}

.slip-history-table thead th {
  background: #eef7fa;
  color: var(--ink);
  font-weight: 500;
  text-align: center;
}

.slip-history-table tbody tr:nth-child(even) {
  background: #f4f4f4;
}

.slip-history-table .void-row {
  color: var(--muted);
  background: #f7eeee;
}

.slip-history-table .slip-history-info {
  min-width: 220px;
}

.slip-history-table .slip-history-info dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 2px 7px;
  margin: 0;
}

.slip-history-table .slip-history-info dt,
.slip-history-table .slip-history-info dd {
  margin: 0;
  padding: 0;
}

.slip-history-table .slip-history-text {
  min-width: 280px;
}

.slip-history-table .slip-history-text textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid #aaa;
  border-radius: 2px;
  padding: 7px;
  background: #fff;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
}

.slip-history-table .slip-history-actions {
  min-width: 118px;
}

.slip-history-table .slip-history-actions button {
  width: 100%;
  margin-bottom: 6px;
}

.receipt-detail-block {
  margin-top: 14px;
  border: 1px solid var(--line);
}

.receipt-detail-title {
  padding: 8px 10px;
  background: #f4f4f4;
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.receipt-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.receipt-detail-meta span {
  padding: 7px 10px;
  border-left: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
}

.receipt-detail-meta span:first-child {
  border-left: 0;
}

.receipt-detail-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.receipt-detail-table {
  width: 100%;
  min-width: 1180px;
  font-size: 11px;
  table-layout: fixed;
}

.receipt-detail-table th {
  color: var(--blue);
  background: #f8fbff;
}

.receipt-detail-table th,
.receipt-detail-table td {
  padding: 4px 5px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.receipt-detail-total td {
  font-weight: 600;
  background: #f6f6f6;
}

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

.ticket-footer-fields input {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 9px;
}

.settle-form {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 10px;
  margin-bottom: 12px;
}

.settle-form button,
.bet-slip button,
.phone-actions button,
.phone-bet-toolbar button {
  border: 0;
  border-radius: 4px;
  padding: 9px 14px;
  background: var(--teal);
  color: white;
  font-weight: 500;
}

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

.allocation-cell {
  min-width: 260px;
  max-width: 420px;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}

.price-table th {
  color: var(--ink);
  background: #eef6f7;
  position: static;
}

.red-number-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.red-number {
  min-width: 68px;
  padding: 9px 12px;
  border: 1px solid #f0b8bd;
  border-radius: 4px;
  background: #fff3f4;
  color: var(--red);
  text-align: center;
  font-weight: 500;
}

.red-number-inline {
  display: inline-block;
  min-width: 44px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff3f4;
  color: var(--red);
  font-weight: 500;
}

.red-row td {
  background: #fff8f8;
}

.red-entry-warning {
  min-height: 18px;
  color: var(--red);
  font-weight: 500;
}

code {
  background: #edf3f5;
  padding: 2px 5px;
  border-radius: 4px;
}

.receipt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 18, 32, 0.42);
}

.receipt-card {
  width: min(1440px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.25);
}

.receipt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
}

.receipt-print {
  padding: 20px;
}

.receipt-print-meta {
  display: none;
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 2px solid #111827;
}

.receipt-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.receipt-head span {
  font-weight: 500;
}

.receipt-meta,
.receipt-totals {
  display: grid;
  grid-template-columns: 140px 1fr 140px 1fr;
  gap: 6px 12px;
  margin: 0 0 14px;
}

.receipt-meta dt,
.receipt-totals dt {
  color: var(--muted);
  font-weight: 500;
}

.receipt-meta dd,
.receipt-totals dd {
  margin: 0;
  font-weight: 500;
}

.mini-permission {
  display: inline-block;
  margin: 2px;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 12px;
}

.permission-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfefe;
  font-weight: 500;
}

strong,
b {
  font-weight: 500;
}

.permission-grid input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.sub-user-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.sub-user-card + .sub-user-card {
  margin-top: 12px;
}

.sub-user-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.sub-user-card h3,
.admin-form h3 {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 500;
}

.operation-permissions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

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

.color-choice span {
  width: 34px;
  height: 24px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
}

.help-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--blue);
  font-size: 11px;
  line-height: 1;
  vertical-align: middle;
}

.header-help {
  cursor: help;
  outline: none;
}

.site-tooltip {
  position: fixed;
  z-index: 100;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  padding: 8px 9px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  pointer-events: none;
  white-space: normal;
}

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

.manual-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 18, 32, 0.45);
}

.manual-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.25);
}

.manual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
}

.manual-head h2 {
  margin: 0;
}

.manual-head span {
  color: var(--muted);
}

.manual-head button {
  min-width: 84px;
  border: 0;
  border-radius: 4px;
  padding: 8px 12px;
  background: var(--teal);
  color: #ffffff;
}

.manual-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.manual-body h3 {
  margin: 0 0 8px;
}

.manual-body p {
  margin: 6px 0;
  line-height: 1.45;
}

.manual-fields {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 14px;
  margin: 0;
}

.manual-fields dt {
  color: var(--muted);
}

.manual-fields dd {
  margin: 0;
  line-height: 1.4;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  html,
  body {
    margin: 0;
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .receipt-print,
  .receipt-print * {
    visibility: visible;
  }

  .receipt-backdrop,
  .receipt-card {
    position: static;
    inset: auto;
    display: block;
    width: 100%;
    max-height: none;
    padding: 0;
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .receipt-actions {
    display: none;
  }

  .receipt-print {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0;
  }

  .receipt-print .table-wrap,
  .receipt-print .receipt-detail-wrap {
    max-height: none;
    overflow: visible;
  }

  .receipt-print table,
  .receipt-print .receipt-detail-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .receipt-print th,
  .receipt-print td {
    padding: 3px 4px;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }

  .receipt-print-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 6px;
    color: #111827;
    font-size: 12px;
    line-height: 1.2;
  }

  .receipt-print-meta span:nth-child(2) {
    text-align: center;
  }

  .receipt-print-meta span:nth-child(3) {
    text-align: right;
  }
}

@media (max-width: 1100px) {
  .index2d-settings-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    max-height: 56vh;
    box-shadow: 0 10px 28px rgba(14, 43, 72, 0.2);
  }

  .side-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
  }

  .side-brand strong {
    font-size: 22px;
  }

  .side-brand span {
    margin-top: 2px;
  }

  .side-time {
    padding: 7px 12px;
    font-size: 11px;
  }

  .side-nav {
    max-height: 38vh;
    overflow: auto;
    padding: 8px 8px 10px;
  }

  .side-section {
    margin-bottom: 4px;
  }

  .side-section-title {
    min-height: 36px;
    padding: 8px 10px;
  }

  .side-section-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .side-link {
    min-height: 38px;
    padding: 8px 10px;
    text-align: center;
  }

  .side-actions {
    position: static;
    padding: 8px;
  }

  .workspace {
    padding-bottom: 18px;
  }

  .page-head,
  .filters,
  .metrics,
  .profile-grid,
  .bet-grid,
  .admin-grid,
  .table-section,
  .panel,
  .phone-bet,
  .ticket-entry,
  .whatsapp-layout,
  .message,
  .security-alert,
  .inbox-output {
    width: min(100% - 16px, 100%);
    margin: 8px auto;
  }

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

  .page-head {
    padding: 10px 2px 2px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .panel {
    padding: 12px;
  }

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

  .result-save-lists {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .section-title {
    padding: 10px 12px;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .filters label,
  .filters button {
    min-width: 0;
    width: 100%;
  }

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

  .member-home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .member-home-content {
    width: min(100% - 16px, 100%);
    margin: 8px auto;
  }

  .member-home-metrics .metric {
    padding: 10px;
  }

  .member-home-metrics .metric strong {
    font-size: 22px;
  }

  .profile-grid,
  .bet-grid,
  .admin-grid,
  .index2d-result-grid,
  .whatsapp-layout {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-height: 58vh;
  }

  .phone-bet-toolbar,
  .old-phone-toolbar,
  .phone-bet-grid,
  .old-phone-grid,
  .package-head,
  .ticket-footer-fields,
  .settle-form {
    grid-template-columns: 1fr;
  }

  .phone-pane textarea {
    min-height: 220px;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .entry-panel {
    min-width: 740px;
  }

  .submit-result-layout {
    grid-template-columns: 1fr;
  }

  .submit-receipt-pane textarea {
    min-height: 180px;
  }

  .slip-history-filters,
  .slip-history-row {
    grid-template-columns: 1fr;
  }

  .slip-history-row {
    min-height: 0;
  }

  .slip-history-row > * {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .slip-history-row > *:first-child {
    border-top: 0;
  }

  .slip-history-no,
  .slip-history-void {
    place-items: start;
  }

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

  .receipt-detail-meta span {
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .receipt-detail-meta span:first-child {
    border-top: 0;
  }

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

  .ticket-toolbar .bet-row,
  .bet-row {
    grid-template-columns: 1fr;
  }

  .market2d-matrix-toolbar {
    grid-template-columns: 1fr;
  }

  .index2d-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .index2d-chip-row {
    gap: 5px;
  }

  .index2d-chip {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 13px;
  }

  .index2d-submit {
    width: 100%;
  }

  .market2d-selection-tools {
    width: 100%;
    justify-content: space-between;
  }

  .market2d-check-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .market2d-number-grid {
    gap: 4px;
    grid-template-columns: repeat(10, minmax(28px, 1fr));
    padding: 0 8px 10px;
  }

  .market2d-number-cell {
    min-height: 34px;
    padding: 0;
    font-size: 13px;
  }

  .draw-check-list {
    gap: 6px;
  }

  .draw-check-list label {
    min-height: 30px;
  }

  .receipt-meta,
  .receipt-totals {
    grid-template-columns: 110px 1fr;
  }

  .manual-backdrop {
    align-items: stretch;
    padding: 8px;
  }

  .manual-card {
    max-height: calc(100vh - 16px);
  }

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

  .manual-head button {
    width: 100%;
  }

  .manual-fields {
    grid-template-columns: 1fr;
  }

  .receipt-card {
    max-height: calc(100vh - 16px);
  }
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .file-list article {
    grid-template-columns: 1fr;
  }

  dl {
    grid-template-columns: 100px 1fr;
  }

  .admin-form,
  .agent-card,
  .package-form {
    gap: 8px;
  }

  .compact-create-form {
    grid-template-columns: 1fr;
  }

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

  .agent-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-list {
    grid-template-columns: 1fr;
  }

  .eat-map-panel {
    width: calc(100% - 8px);
  }

  .eat-map-toolbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .eat-map-toolbar label,
  .eat-map-toolbar span,
  .eat-map-toolbar button {
    min-width: 0;
    width: 100%;
  }

  .eat-map-wrap {
    overflow-x: auto;
  }

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

@media (max-width: 640px) {
  .index2d-settings-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .index2d-time-grid {
    grid-template-columns: 1fr;
  }

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

  .account-v2-grid {
    grid-template-columns: 1fr;
  }

  .account-v2-section {
    padding: 10px;
  }

  body {
    font-size: 12px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    box-shadow: 0 4px 14px rgba(14, 43, 72, 0.18);
  }

  .side-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
  }

  .side-brand strong {
    font-size: 20px;
  }

  .side-brand span {
    margin-top: 2px;
    font-size: 11px;
  }

  .side-time {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
  }

  .sidebar.mobile-menu-closed .side-nav,
  .sidebar.mobile-menu-closed .side-actions {
    display: none;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    max-height: none;
    overflow: visible;
    padding: 4px;
  }

  .side-section {
    margin: 0;
  }

  .side-section:not(.collapsed) {
    grid-column: 1 / -1;
  }

  .side-section-title {
    min-height: 30px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: color-mix(in srgb, var(--blue) 86%, #000000);
    color: rgba(255, 255, 255, 0.78);
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .side-section:not(.collapsed) .side-section-title {
    border-color: var(--teal);
    background: color-mix(in srgb, var(--blue) 74%, #000000);
    color: #ffffff;
  }

  .side-section-caret {
    font-size: 12px;
    color: inherit;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .side-section-items {
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
    gap: 4px;
    margin-top: 3px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg) 72%, var(--paper));
  }

  .side-link {
    min-height: 32px;
    padding: 7px 9px;
    border: 1px solid #d4e1e8;
    border-radius: 4px;
    background: var(--paper);
    color: var(--blue);
    text-align: left;
    font-size: 13px;
  }

  .side-link:hover {
    border-color: var(--teal);
    background: color-mix(in srgb, var(--teal) 10%, var(--paper));
    color: var(--blue);
  }

  .side-link.active {
    border-color: var(--teal);
    background: var(--teal);
    color: #ffffff;
  }

  .side-actions {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.08);
  }

  .side-actions button {
    min-height: 32px;
    padding: 5px 4px;
    font-size: 13px;
  }

  .filters,
  .eat-map-toolbar {
    grid-template-columns: 1fr;
  }

  .page-head h1 {
    font-size: 22px;
  }

  .login-screen {
    padding: 10px;
  }

  .login-card {
    padding: 16px;
  }

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

  .login-topline button,
  .login-panel button,
  .actions button {
    width: 100%;
  }

  .actions,
  .phone-actions,
  .receipt-actions {
    flex-direction: column;
  }

  .phone-actions button,
  .receipt-actions button {
    width: 100%;
  }

  .notice-card {
    padding: 18px;
  }

  .permission-grid,
  .password-grid,
  .sub-user-fields,
  .color-grid {
    grid-template-columns: 1fr;
  }

  .receipt-backdrop {
    padding: 8px;
  }

  .receipt-print {
    padding: 12px;
  }

  .receipt-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-panel {
    min-width: 740px;
  }

  .winloss-table {
    min-width: 980px;
    table-layout: auto;
  }

  .eat-map-helper-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) and (max-height: 560px) {
  body {
    font-size: 12px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    max-height: none;
    overflow: visible;
    box-shadow: 0 4px 14px rgba(14, 43, 72, 0.18);
  }

  .side-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
  }

  .side-brand strong {
    font-size: 18px;
  }

  .side-brand span,
  .side-time {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    min-height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
  }

  .sidebar.mobile-menu-closed .side-nav,
  .sidebar.mobile-menu-closed .side-actions {
    display: none;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    max-height: calc(100vh - 92px);
    overflow: auto;
    padding: 4px;
  }

  .side-section {
    margin: 0;
  }

  .side-section:not(.collapsed) {
    grid-column: 1 / -1;
  }

  .side-section-title {
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: #123b63;
    color: rgba(255, 255, 255, 0.78);
    font-size: 10px;
  }

  .side-section:not(.collapsed) .side-section-title {
    border-color: rgba(42, 177, 170, 0.75);
    background: #0b2f52;
    color: #ffffff;
  }

  .side-section-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 4px;
    margin-top: 3px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: #eaf3f7;
  }

  .side-link {
    min-height: 30px;
    padding: 6px 8px;
    border: 1px solid #d4e1e8;
    border-radius: 4px;
    background: #ffffff;
    color: #143654;
    text-align: left;
    font-size: 12px;
  }

  .side-link.active {
    border-color: #2ab1aa;
    background: #2ab1aa;
    color: #ffffff;
  }

  .side-actions {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.08);
  }

  .side-actions button {
    min-height: 30px;
    padding: 4px;
    font-size: 12px;
  }

  .ticket-entry {
    width: calc(100% - 8px);
    margin: 4px auto;
  }

  .ticket-toolbar {
    padding: 6px;
  }

  .ticket-toolbar .bet-row,
  .bet-row,
  .entry-grid {
    grid-template-columns: 1fr;
  }

  .entry-grid {
    gap: 6px;
    padding: 4px;
  }

  .entry-panel {
    min-width: 740px;
  }

  .winloss-table {
    min-width: 980px;
    table-layout: auto;
  }

  .entry-table input[type="number"],
  .entry-table input[inputmode="numeric"] {
    height: 28px;
    padding: 3px 5px;
  }

  .banker-head,
  .banker-cell {
    min-width: 210px;
    width: 210px;
  }

  .banker-head,
  .banker-cell {
    gap: 2px;
  }

  .banker-head input,
  .banker-cell input {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 420px) {
  .page-head,
  .filters,
  .metrics,
  .profile-grid,
  .bet-grid,
  .admin-grid,
  .table-section,
  .panel,
  .phone-bet,
  .ticket-entry,
  .message,
  .security-alert,
  .inbox-output {
    width: calc(100% - 8px);
  }

  .side-brand {
    padding: 8px;
  }

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

  dl,
  .receipt-meta,
  .receipt-totals {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 6px;
  }
}

.number-position-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #44576a;
}

.number-position-head strong {
  color: #102033;
  font-weight: 600;
}

.number-position-wrap {
  width: 100%;
  overflow-x: hidden;
}

.number-position-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.15;
}

.number-position-table td {
  width: 10%;
  border: 1px solid #c8d5dc;
  padding: 2px 4px;
  height: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #162536;
}

.number-position-table .number-position-hit {
  background: #fff7ed;
  color: #071829;
}

.index2d-position-table td {
  height: 28px;
  font-size: 14px;
}

.copy-column-button {
  margin-left: 6px;
  min-width: 24px;
  width: 24px;
  height: 22px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
}

.copy-icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  width: 26px;
  height: 24px;
  margin-left: 5px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--blue);
  vertical-align: middle;
}

.copy-icon-button:hover,
.copy-icon-button:focus {
  border-color: var(--blue);
  background: #f2f8fd;
  outline: none;
}

.copy-icon {
  position: relative;
  width: 13px;
  height: 13px;
  display: inline-block;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background: #ffffff;
}

.copy-icon::before {
  left: 0;
  top: 3px;
  opacity: 0.62;
}

.copy-icon::after {
  left: 4px;
  top: 0;
}

.submit-result-actions .copy-icon-button,
.eat-map-toolbar .copy-icon-button {
  width: 38px;
  height: 34px;
  margin-left: 0;
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
}

.submit-result-actions .copy-icon-button .copy-icon::before,
.submit-result-actions .copy-icon-button .copy-icon::after,
.eat-map-toolbar .copy-icon-button .copy-icon::before,
.eat-map-toolbar .copy-icon-button .copy-icon::after {
  background: var(--teal);
}

.text-link,
.num-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #1168b3;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nested-report {
  margin-top: 14px;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.pager button {
  min-width: 72px;
  padding: 7px 10px;
}

@media (max-width: 700px) {
  .number-position-table {
    font-size: 10px;
  }

  .number-position-table td {
    padding: 2px;
    height: 18px;
  }
}
