:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  background: #f4f7fb;
  color: #1f2937;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #f4f7fb 0%, #e6eef8 100%);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

.hero {
  background: #fff;
  color: #1f2937;
}

.site-footer {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 4px 0 20px;
  text-align: center;
}

.site-footer a,
.privacy-content a {
  color: #1d4ed8;
}

.privacy-content h2 {
  margin-top: 28px;
}

.privacy-content h2:first-child {
  margin-top: 0;
}

.privacy-content address {
  font-style: normal;
  line-height: 1.6;
}

.privacy-content li,
.privacy-content p {
  line-height: 1.6;
}

.privacy-date {
  color: #64748b;
  margin-top: 28px;
}

.admin-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.admin-heading h1 {
  margin-bottom: 0;
}

.admin-heading-actions,
.dialog-actions,
.dialog-heading {
  align-items: center;
  display: flex;
  gap: 10px;
}

.admin-heading-actions form {
  margin: 0;
}

.password-dialog,
.order-dialog,
.import-dialog {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
  color: #1f2937;
  max-width: 620px;
  padding: 24px;
  width: calc(100% - 32px);
}

.password-dialog::backdrop,
.order-dialog::backdrop,
.import-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
}

.order-dialog,
.import-dialog {
  max-height: calc(100vh - 48px);
  max-width: 900px;
  overflow-y: auto;
}

.import-dialog {
  max-width: 1200px;
}

.import-dialog .dialog-heading p {
  margin: 6px 0 0;
}

.import-dialog .purpose-cell {
  max-width: 320px;
  white-space: normal;
}

.manual-payment-form {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.manual-payment-form select {
  min-width: 240px;
}

.dialog-heading {
  justify-content: space-between;
  margin-bottom: 18px;
}

.dialog-heading h2 {
  margin: 0;
}

.dialog-close {
  background: transparent;
  border: 0;
  color: #4b5563;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  padding: 0 4px;
}

.dialog-actions {
  justify-content: flex-end;
}

.login-card {
  margin: 10vh auto 0;
  max-width: 440px;
}

.login-error {
  padding: 12px;
}

.hero-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-brand strong {
  font-size: 1.05rem;
}

.hero-logo {
  background: transparent;
  border-radius: 0;
  display: block;
  height: auto;
  max-width: 54px;
  padding: 0;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-list label {
  align-items: center;
  cursor: pointer;
  flex-direction: row;
  font-weight: 400;
  gap: 8px;
  line-height: 1.25;
}

.checkbox-list input[type="checkbox"] {
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  padding: 0;
  width: 16px;
}

input, select, button {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

button {
  cursor: pointer;
  border: none;
  background: #2563eb;
  color: #fff;
  margin-top: 12px;
}

.primary-btn,
.secondary-btn,
.delete-btn {
  align-items: center;
  border: 0;
  border-radius: 8px;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  line-height: 1.2;
  min-height: 42px;
  padding: 10px 14px;
  text-align: center;
  text-decoration: none;
}

.primary-btn {
  background: #2563eb;
}

.secondary-btn {
  background: #64748b;
}

.order-form .primary-btn,
.order-form .secondary-btn,
.delete-form .delete-btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

.primary-link {
  background: #2563eb;
  border-radius: 8px;
  color: #fff;
  display: inline-block;
  margin-top: 12px;
  padding: 12px 16px;
  text-decoration: none;
}

.product-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr minmax(120px, auto) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.select-with-swatch {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 28px minmax(0, 1fr);
}

.color-select-swatch {
  border: 1px solid #94a3b8;
  border-radius: 4px;
  box-sizing: border-box;
  display: block;
  height: 28px;
  width: 28px;
}

.color-select-swatch.empty {
  background:
    linear-gradient(45deg, transparent 46%, #cbd5e1 47%, #cbd5e1 53%, transparent 54%),
    #f8fafc;
}

.price-display,
.order-total {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
}

.price-display span,
.order-total span {
  color: #64748b;
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.price-display strong,
.order-total strong {
  display: block;
}

.order-total {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 12px 0 4px;
}

.order-total span {
  margin-bottom: 0;
}

.remove-btn {
  background: #dc2626;
}

.delete-btn {
  background: #dc2626;
}

.delete-form {
  margin-top: 12px;
}

.small-btn {
  font-size: 0.9rem;
  min-height: 34px;
  margin-top: 0;
  padding: 8px 10px;
}

.small-link {
  font-size: 0.9rem;
  min-height: 34px;
  padding: 8px 10px;
}

.button-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1rem;
}

.success {
  border-left: 6px solid #16a34a;
}

.error {
  border-left: 6px solid #dc2626;
}

.payment-details {
  background: #f8fafc;
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.payment-details p {
  margin: 6px 0;
}

.payment-qr-wrap {
  margin-top: 18px;
}

.payment-qr {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: block;
  height: auto;
  max-width: 220px;
  padding: 10px;
}

.payment-warning {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  margin-top: 16px;
  padding: 12px;
}

.models-list {
  display: grid;
  gap: 12px;
}

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

.model-gallery figure {
  margin: 0;
  text-align: center;
}

.model-gallery img {
  background: #f8fafc;
  border-radius: 10px;
  display: block;
  height: 280px;
  object-fit: contain;
  width: 100%;
}

.model-gallery figcaption {
  font-weight: 600;
  margin-top: 8px;
}

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

  .model-gallery img {
    height: 240px;
  }
}

.model-item {
  background: #f8fafc;
  padding: 14px;
  border-radius: 10px;
}

.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.admin-tabs a {
  background: #e2e8f0;
  border-radius: 8px;
  color: #1f2937;
  padding: 10px 14px;
  text-decoration: none;
}

.admin-tabs a.active {
  background: #2563eb;
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 4px;
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: #f8fafc;
}

.selected-row {
  background: #eff6ff;
}

.import-result-table .import-row-matched {
  background: #dcfce7;
}

.import-result-table .import-row-mismatched {
  background: #fee2e2;
}

.import-result-table .import-row-ignored {
  background: #f1f5f9;
  color: #475569;
}

.status-badge {
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  padding: 4px 8px;
}

.status-badge.open {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.paid {
  background: #dcfce7;
  color: #166534;
}

.status-badge.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.order-detail-grid {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-admin-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 16px;
}

.order-admin-actions .delete-form {
  align-self: end;
  margin-top: 0;
}

.import-form {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.admin-list-item,
.model-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.model-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.admin-list-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
}

.size-sort-form,
.size-sort-form label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.size-sort-form input {
  width: 80px;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  margin-right: 6px;
  vertical-align: middle;
}

@media (max-width: 700px) {
  .grid, .product-row {
    grid-template-columns: 1fr;
  }

  .admin-list-item,
  .model-actions,
  .order-admin-actions,
  .order-detail-grid {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }
}
