.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.7;
  min-height: 39px;
  background: var(--accent);
  color: #fff;
  transition:
    background 0.18s,
    transform 0.18s;
}
.btn:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
[data-theme="dark"] .btn {
  color: #1b211b;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.btn.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn.secondary:hover {
  background: var(--soft);
}
.btn.ghost {
  background: none;
  color: var(--muted);
  border-color: transparent;
  padding: 8px;
}
.btn.ghost:hover {
  background: var(--soft);
  color: var(--text);
}
.btn.success {
  background: var(--green);
  color: var(--surface);
}
.btn.success:hover {
  filter: brightness(1.1);
}
.btn.danger {
  color: #b34432;
  background: #fcece6;
  border-color: #f2d3c8;
}
.icon-btn {
  background: transparent;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 6px;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.icon-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.favorite.active .icon {
  fill: var(--accent);
  stroke: var(--accent);
}
.favorite .icon {
  width: 16px;
  height: 16px;
}
.icon-btn.notification {
  position: relative;
}
.notification::after {
  position: absolute;
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
  top: 7px;
  right: 8px;
  border: 1px solid var(--surface);
  border-radius: 50%;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.9;
}
.badge.green {
  background: var(--green-soft);
  color: var(--green);
}
.badge.amber {
  background: #fbf3df;
  color: #967120;
}
.badge.blue {
  background: #edf2f7;
  color: #50758a;
}
.badge.red {
  background: #fcece6;
  color: #ad533c;
}
[data-theme="dark"] .badge.amber {
  background: #3e3827;
  color: #e9c670;
}
[data-theme="dark"] .badge.blue {
  background: #273a46;
  color: #b0ccdc;
}
[data-theme="dark"] .badge.red {
  background: #402d29;
  color: #eda891;
}
.view-switch {
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  padding: 2px;
  border-radius: 7px;
}
.view-switch .icon-btn {
  width: 27px;
  height: 27px;
  border-radius: 4px;
}
.view-switch .icon {
  width: 14px;
  height: 14px;
}
.switch-label {
  display: flex;
  gap: 7px;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
}
.switch-label input {
  appearance: none;
  flex-shrink: 0;
  background: var(--line);
  width: 27px;
  height: 15px;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  margin: 0;
}
.switch-label input::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  border-radius: 50%;
  width: 9px;
  height: 9px;
  background: #fff;
  transition: transform 0.15s;
}
.switch-label input:checked {
  background: var(--green);
}
.switch-label input:checked::after {
  transform: translateX(-12px);
}
.empty-state {
  text-align: center;
  padding: 55px 25px;
}
.empty-state > .icon {
  width: 40px;
  height: 40px;
  color: var(--muted);
  margin: 0 auto 15px;
}
.empty-state h3 {
  font-size: 15px;
  margin-bottom: 7px;
}
.empty-state p {
  font-size: 11px;
  color: var(--muted);
  max-width: 330px;
  margin: 0 auto 18px;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 16px;
  min-width: 0;
}
.field label {
  font-weight: 550;
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 12px;
  border-radius: 8px;
  width: 100%;
  font-size: 12px;
  min-height: 42px;
  min-width: 0;
}
.field input[dir="ltr"] {
  text-align: right;
}
.field textarea {
  resize: vertical;
  min-height: 90px;
}
.field small {
  font-size: 10px;
  color: var(--muted);
}
.field-error {
  font-size: 10px;
  color: #b74428;
  min-height: 0;
}
.field input[aria-invalid="true"] {
  border-color: #b74428;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.notice {
  display: flex;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--soft);
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0;
}
.notice > .icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--gold);
  margin-top: 3px;
}
.notice.success {
  background: var(--green-soft);
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 15%, var(--line));
}
.notice.success > .icon {
  color: var(--green);
}
.notice p + p {
  margin-top: 4px;
}
.link-btn {
  background: none;
  color: var(--accent);
  font-size: 11px;
  padding: 0;
}
.link-btn:hover {
  text-decoration: underline;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #15221b80;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  animation: fade-in 0.16s ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 100px #0003;
  width: min(100%, 640px);
  max-height: 90dvh;
  border-radius: 21px;
  overflow: auto;
  overscroll-behavior: contain;
}
.modal.wide {
  width: min(100%, 920px);
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.modal-header h2 {
  font-size: 17px;
}
.modal-body {
  padding: 23px 25px;
}
.modal-footer {
  display: flex;
  gap: 9px;
  justify-content: flex-start;
  border-top: 1px solid var(--line);
  padding: 17px 25px;
  flex-wrap: wrap;
}
.modal-body > .muted {
  font-size: 12px;
  margin-bottom: 18px;
}
.modal-body .data-table th,
.modal-body .data-table td {
  padding: 12px 10px;
}
.modal-body .data-table td {
  font-size: 10px;
}
.modal-body .data-table input {
  width: 110px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 11px;
}
.modal-body .data-table small {
  font-size: 9px;
}
.quote-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  background: var(--soft);
  padding: 17px;
  border-radius: 10px;
  margin: 15px 0 19px;
}
.quote-meta small {
  color: var(--muted);
  font-size: 10px;
}
.quote-meta p {
  font-size: 12px;
  margin-top: 2px;
}
.quote-total {
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quote-total strong {
  font-size: 23px;
  color: var(--green);
}
.timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-right: 9px;
  border-right: 1px solid var(--line);
}
.timeline > div {
  position: relative;
  padding-right: 15px;
}
.timeline > div::before {
  content: "";
  position: absolute;
  right: -13px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--green);
}
.timeline p {
  font-size: 11px;
}
.timeline small {
  color: var(--muted);
  font-size: 9px;
}
.shipping-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0 20px;
}
.radio-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 11px;
}
.radio-card:has(input:checked) {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}
.radio-card input {
  accent-color: var(--green);
}
.radio-card small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}
.checkbox-line {
  display: flex;
  gap: 8px;
  align-items: start;
  font-size: 11px;
  color: var(--muted);
  margin: 15px 0;
}
.checkbox-line input {
  accent-color: var(--green);
  margin-top: 6px;
  flex-shrink: 0;
}
.search-results {
  display: grid;
  gap: 8px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: right;
  width: 100%;
}
.search-result:hover {
  background: var(--soft);
}
.search-result img {
  width: 42px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
}
.search-result small {
  font-size: 10px;
  color: var(--muted);
  display: block;
}
.search-result > .icon {
  margin-inline-start: auto;
  color: var(--muted);
  width: 15px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 200;
  background: var(--text);
  color: var(--surface);
  padding: 13px 20px;
  border-radius: 12px;
  box-shadow: 0 6px 30px #0002;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: calc(100% - 30px);
  font-size: 12px;
  animation: toast-in 0.2s ease;
}
.toast > .icon {
  width: 17px;
  height: 17px;
}
.demo-mini {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
}
.demo-mini .live-dot {
  background: var(--accent);
}
.kbd {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 4px;
  padding: 1px 5px;
  direction: ltr;
  font-size: 10px;
}
.theme-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.theme-choice {
  border: 1px solid var(--line);
  padding: 13px 20px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 11px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.theme-choice.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}
.theme-choice .icon {
  width: 17px;
  height: 17px;
}
.form-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.status-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  scrollbar-width: none;
}
.status-tabs .category {
  font-size: 10px;
}
.summary-mini {
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
}
.summary-mini strong {
  color: var(--green);
  margin-right: 5px;
}
.mobile-overlay {
  display: none;
}
#print-root {
  display: none;
}
.inline-error {
  font-size: 10px;
  color: #b4432c;
  background: #fcece6;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.storage-warning {
  margin-bottom: 18px;
}
.price-mini {
  font-size: 10px;
  color: var(--green);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.variant-add {
  background: none;
  border: 0;
  color: var(--green);
  padding: 0;
  font-size: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.variant-add .icon {
  width: 10px;
  height: 10px;
}
.variant-add:hover {
  text-decoration: underline;
}
.product-card .variant-controls {
  flex-wrap: wrap;
}
.product-card .variant-add {
  width: 100%;
}
@media (max-width: 660px) {
  .product-row .variant-controls {
    flex-wrap: wrap;
  }
  .product-row .variant-add {
    width: 100%;
    font-size: 9px;
    margin-top: 3px;
  }
}
.mobile-order-bar {
  display: none;
}
.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar > .brand,
.sidebar > .org-switch {
  flex-shrink: 0;
}
@media (max-width: 660px) {
  .mobile-order-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 28;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -5px 25px #162b1d0c;
  }
  .mobile-order-bar small {
    display: block;
    color: var(--muted);
    font-size: 9px;
  }
  .mobile-order-bar strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--green);
  }
  .mobile-order-bar strong > span {
    font-size: 9px;
    font-weight: 400;
  }
  .mobile-order-bar .btn {
    font-size: 11px;
  }
  .main:has(.mobile-order-bar) {
    padding-bottom: 105px;
  }
  #summary {
    scroll-margin-top: 80px;
  }
  .summary-bottom {
    padding-bottom: 25px;
  }
}
.org-switch > div:not(.avatar) {
  min-width: 0;
}
.org-switch strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}
.profile strong {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 660px) {
  .hero h2 {
    max-width: 100%;
    font-size: 20px;
  }
}
