:root {
  color: #1f2933;
  background: #f4f1eb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.surface-mobile .auth-panel {
  width: min(100%, 440px);
}

body.surface-mobile .workspace {
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}

#root,
#app {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.form-control,
.form-select {
  min-height: 44px;
  font-size: 16px;
}

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

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: #1f2933;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  color: #1f2933;
  border: 1px solid #c9d2dc;
  border-radius: 8px;
  background: #ffffff;
  font-size: 16px;
  line-height: 1.35;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

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

input::-webkit-search-decoration,
input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #1f2933;
  box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-out 0s;
}

select {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #52616f 50%), linear-gradient(135deg, #52616f 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

.nav-toggle,
.nav-backdrop {
  display: none;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  padding: clamp(16px, 3vw, 28px);
}

.app-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 14px 20px;
  color: #52616f;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  border-top: 1px solid #d7dde4;
  background: #ffffff;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  color: #f8fafc;
  background: #20313f;
}

.brand strong {
  overflow-wrap: anywhere;
}

.brand,
.auth-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar .brand-home {
  width: 100%;
  min-height: auto;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar .brand-home:hover,
.sidebar .brand-home:focus-visible {
  opacity: 0.92;
}

.brand small,
.topbar p,
.auth-heading p {
  display: block;
  margin: 4px 0 0;
  color: #718096;
}

.sidebar .brand small {
  color: #b8c4ce;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  color: #173042;
  font-weight: 800;
  border-radius: 8px;
  background: #f5c451;
  object-fit: cover;
}

.brand-mark-img {
  background: transparent;
  object-fit: contain;
  padding: 0;
}

.brand-logo {
  background: #ffffff;
}

.brand-lockup {
  display: block;
  width: min(100%, 360px);
  height: auto;
}

nav {
  display: grid;
  gap: 8px;
}

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

.subnav {
  display: grid;
  gap: 4px;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 1px solid #3d5363;
}

.subnav button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

nav button,
.ghost-button {
  justify-content: flex-start;
  color: #e8edf2;
  border-color: transparent;
  background: transparent;
}

nav button.active,
nav button:hover,
.ghost-button:hover {
  background: #314858;
}

.ghost-button {
  margin-top: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

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

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.entry-panel,
.preview-panel,
.table-panel,
.auth-panel {
  padding: 20px;
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(40, 53, 65, 0.08);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel-title span {
  color: #52616f;
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

.form-grid .full-row {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: #4a5563;
  font-size: 14px;
  font-weight: 700;
}

.choice-field {
  display: grid;
  gap: 6px;
  color: #4a5563;
  font-size: 14px;
  font-weight: 700;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
}

.radio-option {
  display: flex;
  flex: 1 1 120px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  font-weight: 700;
  border: 1px solid #c9d2dc;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.radio-option:has(input:checked),
.radio-option.is-selected {
  border-color: #20313f;
  background: #eef3f7;
}

.radio-option input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 2px solid #7b8794;
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.radio-option input:checked,
.radio-option.is-selected input {
  border-color: #20313f;
  background: radial-gradient(circle at center, #20313f 0 40%, #ffffff 45%);
}

.net-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  padding: 16px;
  color: #173042;
  border-radius: 8px;
  background: #f2d68a;
}

.net-box span {
  font-weight: 700;
}

.net-box strong {
  font-size: clamp(22px, 5vw, 28px);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row > button {
  flex: 1 1 160px;
}

.primary-button {
  color: #ffffff;
  border-color: #0f766e;
  background: #0f766e;
}

.link-button {
  min-height: auto;
  margin-top: 14px;
  padding: 0;
  color: #0f766e;
  border: 0;
  background: transparent;
}

.auth-links {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.auth-links .link-button {
  margin-top: 0;
  font-size: 13px;
}

.auth-reset-link {
  margin: 0;
  font-size: 14px;
}

.auth-reset-link a {
  color: #0f766e;
  font-weight: 600;
  word-break: break-all;
}

.tag-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px dashed #aab7c4;
  border-radius: 8px;
  background: #f7f9fb;
  padding: 18px 14px;
}

.print-tag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.5mm 18mm;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  color: #111827;
  font-family: "Arial Narrow", Arial, sans-serif;
  line-height: 1;
  background: transparent;
}

.tag-printable-face {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid #111827;
  border-radius: 1.5mm;
  background: #ffffff;
}

.tag-panel {
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
  height: 100%;
  padding: 0.8mm 1mm;
  overflow: hidden;
}

.tag-panel-left {
  padding-right: 2.8mm;
}

.tag-panel-right {
  padding-left: 2.8mm;
}

.tag-fold-mark {
  width: 0;
  align-self: stretch;
  border-left: 0.35mm dashed #111827;
  margin: 0 1.2mm;
}

.tag-neck {
  align-self: center;
  height: 55%;
  border-top: 1px solid #111827;
  border-bottom: 1px solid #111827;
  background: #ffffff;
}

.tag-tail {
  align-self: center;
  height: 40%;
  border-top: 1px solid #111827;
  border-bottom: 1px solid #111827;
  border-right: 1px solid #111827;
  background: #ffffff;
}

.tag-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0.3mm;
}

.tag-back-item,
.tag-back-number {
  max-width: 100%;
  overflow: hidden;
  font-size: 6pt;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tag-back-purity {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  font-size: 7pt;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tag-back-logo {
  flex: 0 0 auto;
  max-width: 100%;
  max-height: 5.5mm;
  width: auto;
  height: auto;
  object-fit: contain;
}

.purity-input {
  text-transform: uppercase;
}

.tag-weight-grid {
  display: grid;
  grid-template-columns: auto 2.2mm minmax(8mm, 1fr);
  align-items: baseline;
  column-gap: 0.5mm;
  row-gap: 0.5mm;
  width: 100%;
  max-width: 100%;
  font-weight: 800;
  letter-spacing: 0;
}

.tag-weight-grid span,
.tag-weight-grid strong {
  overflow: hidden;
  white-space: nowrap;
}

.tag-weight-grid strong {
  text-align: right;
}

.table-panel {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table,
.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e3e8ee;
  vertical-align: top;
}

td {
  white-space: normal;
  overflow-wrap: anywhere;
}

th {
  color: #52616f;
  font-size: 13px;
  white-space: nowrap;
}

.settings-panel {
  max-width: min(100%, 760px);
}

.logo-section {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e3e8ee;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.logo-preview {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #f8fafc;
}

.logo-preview.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
  font-size: 13px;
}

.logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-actions {
  margin-top: 18px;
}

.settings-stack {
  display: grid;
  gap: 22px;
  max-width: min(100%, 760px);
}

.settings-help {
  margin: 0 0 14px;
  color: #52616f;
}

.printer-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #f7f9fb;
}

.printer-info span {
  display: block;
  margin-bottom: 4px;
  color: #68737f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.printer-info strong {
  color: #1f2933;
  font-size: 14px;
  font-weight: 700;
}

.item-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.item-catalog {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
}

.item-catalog li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e3e8ee;
}

.item-catalog li:last-child {
  border-bottom: 0;
}

.item-catalog-actions {
  display: flex;
  gap: 8px;
}

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

.check-row input {
  width: 18px;
  min-height: 18px;
}

.auth-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background: #20313f;
}

.auth-layout .app-footer {
  width: 100%;
  color: #b8c4ce;
  border-top-color: #314858;
  background: transparent;
}

.admin-auth-layout {
  background: #18242f;
}

.auth-panel {
  width: min(100%, 480px);
  margin: auto;
}

.auth-heading {
  align-items: flex-start;
  margin-bottom: 24px;
  display: grid;
  gap: 12px;
}

.auth-heading .brand-lockup {
  margin: 0;
}

.auth-heading h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin: 6px 0 0;
  color: #0f766e;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
}

.auth-support {
  margin: 8px 0 0;
  color: #718096;
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-layout .brand-tagline {
  color: #5eead4;
}

.auth-layout .auth-support {
  color: #b8c4ce;
}

.auth-heading .auth-support {
  color: #718096;
  margin-top: 0;
}

.error-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
}

.success-message {
  align-self: center;
  color: #0f766e;
  font-weight: 700;
}

.success-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #0f766e;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #ecfdf5;
}

.billing-layout,
.admin-plan-list {
  display: grid;
  gap: 20px;
}

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

.billing-summary div,
.plan-card {
  padding: 18px;
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(40, 53, 65, 0.08);
}

.billing-summary span {
  display: block;
  color: #68737f;
  font-size: 13px;
  font-weight: 700;
}

.billing-summary strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(20px, 4vw, 24px);
}

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

.plan-grid.single-plan {
  grid-template-columns: minmax(0, 420px);
}

.plan-price small {
  margin-left: 4px;
  color: #52616f;
  font-size: 14px;
  font-weight: 600;
}

.plan-total {
  margin: 4px 0 8px;
  color: #1f2933;
  font-size: 15px;
}

.plan-card {
  display: grid;
  gap: 14px;
}

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

.plan-card p {
  min-height: 44px;
  margin: 0;
  color: #5f6c78;
}

.plan-price {
  color: #173042;
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 900;
}

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

.plan-card dt {
  color: #68737f;
  font-size: 12px;
  font-weight: 800;
}

.plan-card dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.admin-plan {
  display: grid;
  gap: 10px;
}

.admin-tenant-section {
  display: grid;
  gap: 18px;
}

.admin-tenant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.tenant-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.selected-row {
  background: #ecfdf5;
}

.admin-tenant-section tbody tr {
  cursor: pointer;
}

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

.admin-portal-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding:
    max(clamp(16px, 3vw, 28px), env(safe-area-inset-top, 0px))
    max(clamp(16px, 3vw, 28px), env(safe-area-inset-right, 0px))
    max(clamp(16px, 3vw, 28px), env(safe-area-inset-bottom, 0px))
    max(clamp(16px, 3vw, 28px), env(safe-area-inset-left, 0px));
  background: #f4f1eb;
}

.admin-portal-shell .app-footer {
  margin-left: calc(-1 * clamp(16px, 3vw, 28px));
  margin-right: calc(-1 * clamp(16px, 3vw, 28px));
  margin-bottom: calc(-1 * clamp(16px, 3vw, 28px));
}

.admin-portal-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  color: #f8fafc;
  border-radius: 8px;
  background: #20313f;
}

.admin-portal-topbar h1,
.admin-portal-topbar p {
  margin: 0;
}

.admin-portal-topbar p {
  margin-top: 4px;
  color: #b8c4ce;
}

@media (max-width: 1100px) {
  .billing-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .nav-toggle {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    z-index: 120;
    display: inline-flex;
    min-height: 44px;
    padding: 0 14px;
    color: #f8fafc;
    border-color: #314858;
    background: #20313f;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24);
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: min(88vw, 320px);
    max-width: 100%;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translate3d(-105%, 0, 0);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.2);
  }

  .app-shell.nav-open .sidebar {
    transform: translate3d(0, 0, 0);
  }

  .workspace {
    padding-top: calc(64px + env(safe-area-inset-top, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
  }

  nav {
    grid-template-columns: 1fr;
  }

  .subnav {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .ghost-button {
    margin-top: 0;
  }

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

  h1 {
    font-size: clamp(24px, 6vw, 30px);
  }

  .work-grid,
  .form-grid.compact,
  .billing-summary,
  .plan-grid,
  .plan-grid.single-plan,
  .admin-tenant-grid,
  .tenant-summary,
  .plan-card dl,
  .item-add-row {
    grid-template-columns: 1fr;
  }

  .button-row > button,
  .button-row > a.btn {
    flex: 1 1 100%;
  }

  .logo-preview {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .item-catalog-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .admin-portal-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-portal-topbar .button-row {
    width: 100%;
  }

  .admin-portal-topbar .button-row > button,
  .admin-portal-topbar .button-row > a.btn {
    flex: 1 1 auto;
  }

  .table-panel {
    margin-left: -4px;
    margin-right: -4px;
  }

  .table,
  table {
    min-width: 560px;
  }

  .tag-stage {
    justify-items: start;
    padding: 14px 10px;
  }
}

@media (max-width: 480px) {
  .entry-panel,
  .preview-panel,
  .table-panel,
  .auth-panel,
  .plan-card,
  .billing-summary div {
    padding: 16px;
  }

  .auth-panel {
    width: 100%;
    border-radius: 10px;
  }

  .net-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .panel-title span {
    width: 100%;
  }

  .table,
  table {
    min-width: 480px;
    font-size: 13px;
  }

  .nav-toggle span {
    display: none;
  }

  .nav-toggle {
    min-width: 44px;
    padding: 0 12px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .sidebar {
    width: min(70vw, 280px);
  }

  .workspace {
    padding-top: calc(56px + env(safe-area-inset-top, 0px));
  }

  .auth-layout {
    justify-content: flex-start;
  }

  .auth-panel {
    margin-top: 12px;
    margin-bottom: 12px;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .work-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.print-offscreen {
  position: absolute;
  left: -9999px;
  top: 0;
}

/* Dedicated print surface — keeps browser print to one label page */
#print-root {
  display: none;
}

@media print {
  @page {
    size: 80mm 18mm;
    margin: 0;
  }

  html,
  body {
    width: 80mm !important;
    height: 18mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }

  body * {
    display: none !important;
  }

  #print-root,
  #print-root * {
    display: revert !important;
  }

  #print-root {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 80mm !important;
    height: 18mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
  }

  #print-root .print-tag {
    display: grid !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  #print-root .tag-printable-face {
    display: grid !important;
  }

  #print-root .tag-panel,
  #print-root .tag-weight-grid {
    display: grid !important;
  }

  #print-root .tag-back {
    display: flex !important;
  }

  #print-root .tag-neck,
  #print-root .tag-tail {
    display: block !important;
  }

  #print-root .tag-back-logo {
    display: block !important;
    max-width: 100%;
    max-height: 7mm;
    object-fit: contain;
  }
}
