/* Giao diện riêng cho công cụ chốt size.
   File này chỉ được tải trên trang size; style.css vẫn là CSS dùng chung của trang chủ. */

.size-app-page {
  --size-primary: #00a0e9;
  --size-primary-dark: #0284c7;
  --size-cyan: #06b6d4;
  --size-amber: #f59e0b;
  --size-slate: #0f172a;
  --size-soft: #f1f5f9;
  --size-border: #e2e8f0;
  --size-muted: #64748b;
  --size-green: #16a34a;
  --size-red: #dc2626;
  margin: 0;
  min-height: 100vh;
  background: #f8fafc;
  color: #1e293b;
  -webkit-tap-highlight-color: transparent;
}

.size-app-page .size-brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.size-app-page .wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 112px 12px 60px;
}

.size-app-page .hero {
  background: linear-gradient(135deg, #0f172a, #075985);
  color: white;
  padding: 20px;
  border-radius: 24px;
  margin-bottom: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.size-app-page .hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
}

.size-app-page .hero p {
  margin: 0;
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.55;
}

.size-app-page .layout {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 14px;
  align-items: start;
}

.size-app-page .card {
  background: white;
  border: 1px solid var(--size-border);
  border-radius: 24px;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.size-app-page .card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--size-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
}

.size-app-page .card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-app-page .card-title i {
  color: var(--size-primary);
  font-size: 22px;
}

.size-app-page .panel {
  padding: 14px;
}

.size-app-page label {
  display: block;
  font-size: 12px;
  color: #475569;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.size-app-page input,
.size-app-page textarea {
  width: 100%;
  border: 2px solid var(--size-border);
  background: #f8fafc;
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 16px;
  outline: none;
  transition: 0.15s;
  font-weight: 700;
}

.size-app-page textarea {
  min-height: 58px;
  resize: vertical;
  font-weight: 600;
}

.size-app-page input:focus,
.size-app-page textarea:focus {
  border-color: var(--size-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 160, 233, 0.10);
}

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

.size-app-page input[type="number"] {
  -moz-appearance: textfield;
}

.size-app-page .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.size-app-page .btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  transition: 0.15s;
  min-height: 48px;
  white-space: nowrap;
}

.size-app-page .btn:active {
  transform: scale(0.98);
}

.size-app-page .btn-primary {
  background: var(--size-primary);
  color: white;
  box-shadow: 0 8px 18px rgba(0, 160, 233, 0.22);
}

.size-app-page .btn-primary:hover {
  background: var(--size-primary-dark);
}

.size-app-page .btn-dark {
  background: #0f172a;
  color: white;
}

.size-app-page .btn-dark:hover {
  background: #1e293b;
}

.size-app-page .btn-green {
  background: var(--size-green);
  color: white;
}

.size-app-page .btn-amber {
  background: var(--size-amber);
  color: white;
}

.size-app-page .btn-light {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.size-app-page .btn-red {
  background: #fee2e2;
  color: #b91c1c;
}

.size-app-page .row-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.size-app-page .result {
  border-radius: 22px;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  border: 1px solid #bae6fd;
  padding: 16px;
  text-align: center;
  margin-top: 12px;
}

.size-app-page .size-big {
  font-size: 58px;
  line-height: 1;
  font-weight: 1000;
  color: var(--size-primary);
  letter-spacing: -0.06em;
}

.size-app-page .advice {
  margin-top: 10px;
  background: white;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
  text-align: left;
}

.size-app-page .table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.size-app-page table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.size-app-page th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--size-border);
  white-space: nowrap;
}

.size-app-page td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
  vertical-align: middle;
}

.size-app-page td.size-cell {
  font-weight: 1000;
  color: #0284c7;
  font-size: 18px;
  text-align: center;
  background: #fff;
}

.size-app-page tr.row-flash td {
  animation: sizeRowFlash 1.4s ease-out;
}

@keyframes sizeRowFlash {
  0% { background: #dcfce7; }
  100% { background: transparent; }
}

.size-app-page .table-wrap th:first-child,
.size-app-page .table-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 1px 0 0 #e2e8f0;
}

.size-app-page .table-wrap th:first-child {
  background: #f8fafc;
  z-index: 3;
}

.size-app-page .qtyInput {
  max-width: 92px;
  padding: 10px 8px;
  text-align: center;
  border-radius: 12px;
  font-size: 18px;
  background: #fff;
}

.size-app-page .noteInput {
  min-width: 160px;
  padding: 10px 11px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.size-app-page .summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.size-app-page .pill {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
}

.size-app-page .mini {
  font-size: 12px;
  color: var(--size-muted);
  line-height: 1.45;
}

.size-app-page .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-app-page #captureArea {
  background: white;
}

.size-app-page .capture-title {
  display: none;
  padding: 16px 16px 0;
  align-items: center;
  gap: 12px;
}

.size-app-page .capture-title img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.size-app-page .capture-title h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 1000;
  color: #0f172a;
}

.size-app-page .capture-title p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.size-app-page #captureArea.is-exporting {
  width: max-content;
  min-width: 920px;
  max-width: none;
  overflow: visible;
  box-shadow: none;
}

.size-app-page #captureArea.is-exporting .table-wrap {
  overflow: visible;
}

.size-app-page #captureArea.is-exporting table {
  min-width: 920px;
}

.size-app-page .toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #0f172a;
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

.size-app-page .toast.show {
  opacity: 1;
  bottom: 28px;
}

.size-app-page .zalo-float {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #0f172a;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  text-decoration: none;
}

.size-app-page .zalo-float .z {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #0068ff;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 1000;
  font-size: 19px;
}

.size-app-page .zalo-float small {
  display: block;
  color: #64748b;
  font-size: 10px;
  line-height: 1;
  margin-bottom: 3px;
}

.size-app-page .zalo-float b {
  color: #0068ff;
  font-size: 13px;
  line-height: 1;
}

@media (max-width: 880px) {
  .size-app-page .layout {
    grid-template-columns: 1fr;
  }

  .size-app-page .calculator {
    order: -1;
  }

  .size-app-page .hero h2 {
    font-size: 20px;
  }

  .size-app-page .row-actions {
    grid-template-columns: 1fr;
  }

  .size-app-page .size-nav-actions a span,
  .size-app-page .size-nav-actions button span {
    display: none;
  }

  .size-app-page .size-nav-actions a,
  .size-app-page .size-nav-actions button {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
  }
}

@media (max-width: 520px) {
  .size-app-page .size-brand-title {
    max-width: 150px;
    font-size: 13px;
    line-height: 1.2;
  }

  .size-app-page .wrap {
    padding: 102px 8px 50px;
  }

  .size-app-page .hero {
    border-radius: 18px;
    padding: 14px;
  }

  .size-app-page .card {
    border-radius: 18px;
  }

  .size-app-page .grid2 {
    grid-template-columns: 1fr;
  }

  .size-app-page .card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .size-app-page .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .size-app-page .toolbar .btn {
    width: 100%;
  }

  .size-app-page .size-big {
    font-size: 52px;
  }

  .size-app-page table {
    min-width: 650px;
  }

  .size-app-page th,
  .size-app-page td {
    padding: 8px;
  }

  .size-app-page .zalo-float {
    right: 10px;
    bottom: 10px;
  }
}
