html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #07111f;
  color: #e2e8f0;
  overscroll-behavior-y: contain;
}

.ios-refresh-indicator {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 2000;
  transform: translate(-50%, -72px);
  opacity: 0;
  border: 1px solid #2563eb;
  border-radius: 999px;
  background: #101d2e;
  color: #bfdbfe;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  pointer-events: none;
}

.ios-refresh-indicator.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ios-refresh-indicator.ready {
  border-color: #14b8a6;
  color: #5eead4;
}

.ios-refresh-indicator.loading::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border: 2px solid rgba(94, 234, 212, 0.28);
  border-top-color: #5eead4;
  border-radius: 50%;
  animation: iosRefreshSpin 0.7s linear infinite;
}

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

.navbar, .footer {
  background: #ffffff;
}

.page-head {
  margin: 26px 0 20px;
}

.split-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.insert-head {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.page-head h1 {
  color: #ffffff;
  font-weight: 800;
  margin: 0;
}

.page-head p, .muted {
  color: #94a3b8;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  border: 1px solid #22344d;
  border-left: 4px solid var(--metric-color);
  border-radius: 8px;
  background: #101d2e;
  padding: 16px;
}

.metric-card div {
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--metric-color);
  font-size: 28px;
}

.owner-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.owner-metric-card {
  min-height: 104px;
  border: 1px solid #22344d;
  border-radius: 8px;
  background: #101d2e;
  padding: 14px;
}

.owner-metric-card span {
  display: block;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
}

.owner-metric-card strong {
  display: block;
  color: #5eead4;
  font-size: 24px;
  line-height: 1.1;
  margin-top: 8px;
}

.owner-metric-card small {
  display: block;
  color: #94a3b8;
  margin-top: 8px;
}

.owner-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.owner-list-panel {
  min-height: 130px;
}

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

.summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #22344d;
  padding: 7px 0;
}

.summary-list span {
  color: #cbd5e1;
}

.summary-list strong {
  color: #5eead4;
  white-space: nowrap;
}

.owner-table .secondary-link {
  min-width: auto;
  min-height: 28px;
  padding: 4px 10px;
}

.owner-screen-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.72);
  padding: 24px;
}

.owner-screen-box {
  width: min(1180px, 96vw);
  max-height: 92vh;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #07111f;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.owner-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #101d2e;
  border-bottom: 1px solid #22344d;
  padding: 12px 16px;
}

.owner-screen-head strong {
  color: #ffffff;
}

.owner-screen-head button {
  border: 1px solid #315c91;
  border-radius: 4px;
  background: #17243a;
  color: #ffffff;
  font-weight: 800;
  padding: 6px 12px;
}

.owner-screen-body {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 14px;
}

.owner-screen-body img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border: 1px solid #22344d;
  background: #000000;
}

.owner-receipt-box {
  width: min(600px, 96vw);
  max-height: 92vh;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #07111f;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.owner-receipt-body {
  max-height: 78vh;
  overflow: auto;
  padding: 22px;
  display: grid;
  place-items: start center;
}

.receipt-paper {
  width: min(390px, 100%);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #020617;
  padding: 26px 22px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  font-family: Arial, Helvetica, sans-serif;
}

.receipt-logo {
  color: #2563eb;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.receipt-copy-title {
  color: #020617;
  font-size: 13px;
  font-weight: 900;
  margin: 8px 0 14px;
  text-align: center;
}

.receipt-info {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 7px 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.receipt-info span,
.paper-totals span,
.paper-payments span {
  font-weight: 900;
}

.receipt-info strong {
  font-weight: 500;
  text-align: right;
}

.paper-lines {
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  padding: 12px 0;
}

.paper-line + .paper-line {
  margin-top: 12px;
}

.line-barcode {
  color: #64748b;
  font-size: 12px;
  margin-bottom: 3px;
}

.line-main,
.paper-totals div,
.paper-payments div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.line-main strong {
  color: #020617;
  font-size: 14px;
  font-weight: 900;
}

.line-main b {
  color: #020617;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.line-sub {
  color: #334155;
  font-size: 13px;
}

.line-sub span {
  margin-left: 10px;
}

.cancelled-line .line-main strong,
.cancelled-line .line-main b {
  color: #dc2626;
}

.cancelled-line .line-main strong {
  text-decoration: line-through;
}

.paper-totals {
  border-bottom: 1px solid #cbd5e1;
  padding: 12px 0;
}

.paper-totals div,
.paper-payments div {
  font-size: 14px;
  line-height: 1.45;
}

.paper-totals strong,
.paper-payments strong {
  font-weight: 900;
}

.danger-total {
  color: #dc2626;
}

.paper-payments {
  padding: 12px 0 10px;
}

.receipt-copy-note {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  text-align: center;
}

.receipt-copy-note strong {
  color: #020617;
  font-size: 14px;
}

.receipt-copy-note span {
  color: #475569;
  font-size: 12px;
}

.receipt-detail-button {
  border: 1px solid #315c91;
}

.panel {
  background: #101d2e;
  border: 1px solid #22344d;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}

.panel-title {
  color: #ffffff;
  font-weight: 800;
  margin-bottom: 12px;
}

.event-list {
  margin: 0;
  padding-left: 18px;
}

.event-list li {
  margin: 8px 0;
  color: #cbd5e1;
}

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

.data-table th,
.data-table td {
  border-bottom: 1px solid #22344d;
  padding: 10px;
  color: #e2e8f0;
}

.data-table th {
  color: #93c5fd;
  font-size: 13px;
}

.badge {
  background: #17243a;
  border: 1px solid #315c91;
  color: #bfdbfe;
  border-radius: 999px;
  padding: 4px 8px;
}

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

.quota-pill {
  border: 1px solid #22344d;
  border-radius: 8px;
  background: #071426;
  padding: 12px;
}

.quota-pill span,
.detail-grid span {
  color: #93c5fd;
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.quota-pill strong {
  display: block;
  color: #5eead4;
  font-size: 26px;
  line-height: 1.1;
  margin-top: 6px;
}

.quota-pill small {
  color: #94a3b8;
}

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

.detail-grid > div {
  min-height: 64px;
  border: 1px solid #22344d;
  border-radius: 8px;
  background: #071426;
  padding: 12px;
}

.detail-grid > .status-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 10px;
}

.status-tile span,
.status-tile strong {
  grid-column: 1;
}

.tile-action {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.tile-action form {
  margin: 0;
}

.detail-grid strong {
  color: #ffffff;
  display: block;
  margin-top: 5px;
}

.detail-grid .wide {
  grid-column: 1 / -1;
}

.business-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0 28px;
}

.summary-main {
  display: grid;
  gap: 0;
}

.summary-row,
.summary-address {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid #22344d;
  column-gap: 14px;
}

.summary-row span,
.summary-address span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
}

.summary-row strong,
.summary-address strong {
  color: #ffffff;
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-address {
  grid-column: 1 / -1;
  align-items: start;
  padding-top: 12px;
  border-bottom: 0;
}

.summary-action-row {
  align-items: center;
  padding-top: 8px;
}

.summary-section-title {
  grid-column: 1 / -1;
  color: #ffffff;
  font-weight: 800;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #22344d;
}

.single-panel-grid {
  grid-template-columns: 1fr;
}

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

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.compact-panel {
  padding: 16px;
}

.insert-panel {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

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

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

.form-grid input,
.form-grid select {
  min-height: 40px;
  border: 1px solid #335070;
  background: #071426;
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 4px;
}

.form-grid select:disabled {
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.72;
}

.form-grid input::placeholder {
  color: #7390b7;
}

.form-grid label {
  color: #bfdbfe;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid button,
.primary-action,
.primary-link,
.secondary-link,
.inline-form button {
  min-height: 40px;
  border: 1px solid #14b8a6;
  background: #0f766e;
  color: #ffffff;
  font-weight: 800;
  border-radius: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.form-actions button,
.form-actions .secondary-link {
  min-width: 130px;
}

.secondary-link {
  min-height: 34px;
  border-color: #315c91;
  background: #17243a;
  font-size: 13px;
}

.secondary-link:hover,
.primary-action:hover,
.primary-link:hover {
  color: #ffffff;
  filter: brightness(1.08);
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.inline-form {
  display: inline-block;
  margin-right: 6px;
}

.inline-form button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.license-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.license-actions form {
  margin: 0;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

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

.option-row {
  min-height: 48px;
  border: 1px solid #22344d;
  border-radius: 6px;
  background: #071426;
  padding: 10px 12px;
  justify-content: flex-start;
}

.option-row span {
  color: #ffffff;
}

.option-row em {
  margin-left: auto;
  color: #93c5fd;
  font-style: normal;
  font-size: 12px;
}

.option-row.is-active {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.16);
}

.danger-button {
  border-color: #be123c !important;
  background: rgba(159, 18, 57, 0.18) !important;
  color: #fecdd3 !important;
}

.subtle-action,
.modal-confirm-button,
.modal-link-button {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.modal-confirm-button {
  background: #9f1239 !important;
  color: #ffffff !important;
}

.partner-modal {
  background: #101d2e;
  border: 1px solid #315c91;
  color: #e2e8f0;
}

.partner-modal .modal-header,
.partner-modal .modal-footer {
  border-color: #22344d;
}

.partner-modal .modal-title {
  color: #ffffff;
  font-weight: 800;
}

.partner-modal .modal-body p {
  color: #cbd5e1;
  margin: 0;
}

.compact-panel hr {
  border-color: #22344d;
  opacity: 1;
  margin: 16px 0;
}

.alert {
  border-radius: 6px;
  font-weight: 700;
}

.data-table {
  min-width: 860px;
}

.panel:has(.data-table) {
  overflow-x: auto;
}

.auth-shell {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(420px, 100%);
  background: #101d2e;
  border: 1px solid #2563eb;
  border-radius: 8px;
  padding: 28px;
}

.auth-panel h1 {
  color: #ffffff;
  font-weight: 800;
}

.auth-panel p,
.auth-panel small {
  color: #94a3b8;
}

.auth-panel label {
  display: block;
  color: #bfdbfe;
  font-weight: 700;
  margin-top: 14px;
}

.auth-panel input:not([type="checkbox"]) {
  width: 100%;
  min-height: 42px;
  border: 1px solid #335070;
  background: #071426;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
}

.auth-panel button {
  width: 100%;
  min-height: 44px;
  margin: 18px 0 10px;
  border: 1px solid #14b8a6;
  background: #0f766e;
  color: #ffffff;
  font-weight: 800;
  border-radius: 4px;
}

.access-denied-shell {
  min-height: 68vh;
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.access-denied-card {
  width: min(620px, 100%);
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  background: #101d2e;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
  padding: 28px;
}

.access-denied-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #fb7185;
  border-radius: 999px;
  color: #fecdd3;
  background: #3f0f1c;
  font-size: 26px;
  font-weight: 900;
}

.access-denied-card h1 {
  color: #ffffff;
  font-weight: 900;
  margin: 18px 0 10px;
}

.access-denied-card p {
  color: #cbd5e1;
  margin-bottom: 18px;
}

.access-denied-url {
  border: 1px solid #22344d;
  border-radius: 6px;
  background: #071426;
  margin-bottom: 18px;
  padding: 12px;
}

.access-denied-url span {
  display: block;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
}

.access-denied-url strong {
  display: block;
  color: #e2e8f0;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

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

@media (max-width: 720px) {
  body {
    margin-bottom: 48px;
  }

  .container {
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-head {
    margin: 18px 0 14px;
  }

  .split-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .page-head h1 {
    font-size: 28px;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .page-head p {
    margin-bottom: 0;
  }

  .head-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .head-actions .primary-link,
  .head-actions .secondary-link,
  .head-actions .primary-action {
    width: 100%;
    min-width: 0;
  }

  .panel {
    padding: 12px;
    margin-bottom: 14px;
  }

  .business-summary {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .summary-row,
  .summary-address {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
    row-gap: 4px;
    padding: 10px 0;
  }

  .summary-address {
    border-bottom: 1px solid #22344d;
  }

  .business-summary > :last-child,
  .summary-main:last-child .summary-row:last-child {
    border-bottom: 0;
  }

  .summary-section-title {
    margin-top: 0;
    padding-top: 12px;
  }

  .detail-grid,
  .compact-detail,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid > .status-tile {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .tile-action {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .tile-action form,
  .tile-action button {
    width: 100%;
  }

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

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .primary-link,
  .form-actions .secondary-link,
  .form-actions button {
    width: 100%;
  }
}
