:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --primary: #2f6fed;
  --primary-soft: #e8f0ff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #d8e1ef;
  --success: #1f8f4f;
  --warning: #b7791f;
  --danger: #b83232;
  --shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #edf3ff 0%, var(--bg) 45%, #eef2f7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  padding: 24px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 24px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
}

.system-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.system-brand img {
  width: 52px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  object-fit: cover;
  transform: scale(1.06);
}

.system-brand span {
  display: grid;
  gap: 3px;
}

.system-brand strong {
  color: #164f3a;
  font-size: 15px;
}

.system-brand small {
  color: var(--text-muted);
  font-size: 11px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 10px;
  color: var(--text-muted);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-item img {
  width: 18px;
  height: 18px;
}

.nav-section-title {
  margin: 22px 12px 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-item span {
  display: grid;
  gap: 2px;
}

.nav-item strong {
  font-size: 14px;
}

.nav-item small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.main {
  padding: 24px;
}

.seller-shell {
  display: flex;
  align-items: stretch;
}

.seller-shell .sidebar {
  flex: 0 0 280px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.seller-main {
  flex: 1;
  min-width: 0;
}

.seller-content {
  display: grid;
  gap: 16px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}

.page-head h1 {
  font-size: clamp(20px, 1rem + 1vw, 24px);
  margin: 0;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn.danger {
  background: #fff4f4;
  border-color: #f6d2d2;
  color: var(--danger);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.card strong {
  font-size: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  min-height: 44px;
}

label {
  font-size: 13px;
  margin-bottom: 6px;
  display: inline-block;
  color: var(--text-muted);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 68px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  border: 0;
  border-radius: 7px;
  padding: 5px 7px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  background: var(--surface-soft);
}

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.form-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.store-cover {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.store-gallery {
  display: flex;
  align-items: center;
  gap: 5px;
}

.store-gallery img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.store-gallery-count {
  color: var(--text-muted);
  font-size: 12px;
}

.file-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

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

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 10px;
  font-size: 14px;
}

th {
  color: var(--text-muted);
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2f7;
  color: #334155;
}

.tag.success {
  background: #e7f8ee;
  color: var(--success);
}

.tag.warning {
  background: #fff5e7;
  color: var(--warning);
}

.tag.danger {
  background: #ffecec;
  color: var(--danger);
}

.message {
  margin-top: 10px;
  font-size: 13px;
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.auth-left {
  padding: 44px;
}

.auth-right {
  padding: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero {
  max-width: 620px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.2;
}

.hero p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.role-boxes {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.role-box {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
}

.role-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.role-box p {
  margin: 0;
  font-size: 13px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-card h2 {
  margin: 0 0 8px;
}

.auth-card .muted {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.login-page {
  min-height: 100vh;
  background: #f5f3ed;
}

.production-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.production-auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 54px clamp(42px, 6vw, 100px);
  background:
    radial-gradient(circle at 85% 12%, rgba(238, 189, 62, 0.24), transparent 25%),
    radial-gradient(circle at 8% 88%, rgba(116, 169, 91, 0.24), transparent 28%),
    linear-gradient(145deg, #0d3023 0%, #174b36 55%, #123b2b 100%);
  color: #fff;
}

.production-auth-brand::before,
.production-auth-brand::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.production-auth-brand::before {
  width: 520px;
  height: 520px;
  right: -230px;
  bottom: -170px;
}

.production-auth-brand::after {
  width: 330px;
  height: 330px;
  right: -115px;
  bottom: -75px;
}

.official-logo-card {
  position: relative;
  z-index: 1;
  width: 176px;
  height: 108px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.official-logo-card img,
.mobile-official-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.16);
}

.production-auth-hero {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: auto 0;
  padding: 80px 0;
}

.auth-eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #f1d77d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.production-auth-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.production-auth-hero p {
  max-width: 590px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.7;
}

.auth-feature-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-feature-row span {
  display: grid;
  min-width: 145px;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.auth-feature-row strong {
  color: #fff;
  font-size: 13px;
}

.auth-feature-row small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
}

.auth-copyright {
  position: relative;
  z-index: 1;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.production-auth-form {
  display: grid;
  place-items: center;
  padding: 42px;
  background:
    radial-gradient(circle at 100% 0%, rgba(232, 185, 55, 0.12), transparent 28%),
    #f7f6f2;
}

.mobile-official-logo {
  display: none;
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid rgba(18, 59, 43, 0.1);
  border-radius: 24px;
  padding: 38px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(18, 59, 43, 0.12);
}

.login-card-head {
  margin-bottom: 30px;
}

.login-card-kicker {
  display: block;
  margin-bottom: 9px;
  color: #b48716;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h2 {
  margin: 0 0 10px;
  color: #123b2b;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.login-card-head p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.login-field {
  margin-bottom: 18px;
}

.login-field label {
  margin-bottom: 8px;
  color: #34463e;
  font-weight: 600;
}

.login-field input {
  min-height: 48px;
  border-color: #dce3df;
  background: #fbfcfb;
}

.login-field input:focus {
  border-color: #2c7252;
  outline: 3px solid rgba(44, 114, 82, 0.1);
}

.login-card .password-toggle {
  color: #276747;
}

.login-card .password-toggle:hover {
  background: #edf5f0;
}

.login-submit {
  position: relative;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border-color: #174b36;
  background: #174b36;
  font-size: 14px;
  font-weight: 700;
}

.login-submit:hover {
  background: #123b2b;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.login-submit.loading::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: login-spin 0.75s linear infinite;
}

.login-message {
  min-height: 18px;
  margin: 14px 0 0;
  text-align: center;
}

.login-support {
  margin: 22px 0 0;
  border-top: 1px solid #e7ebe8;
  padding-top: 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

.muted {
  color: var(--text-muted);
}

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

.inline-actions input {
  min-width: 220px;
}

.inline-field {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-editor {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  margin: 12px 0;
  padding: 12px 0;
}

.inline-editor h3 {
  font-size: 15px;
  margin: 0 0 10px;
}

.field-grow {
  flex: 1;
}

.split {
  display: grid;
  grid-template-columns: minmax(460px, 1.35fr) minmax(240px, 0.65fr);
  gap: 14px;
}

.items-box {
  margin: 12px 0;
}

.items-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.items-head h3 {
  margin: 0;
  font-size: 15px;
}

.item-name-cell select {
  margin-bottom: 6px;
}

.btn.small {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 8px;
}

.summary-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 14px;
  height: fit-content;
}

.summary-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

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

.summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.summary-list span {
  color: var(--text-muted);
  font-size: 13px;
}

.summary-total {
  margin: 12px 0 6px;
  font-size: 16px;
}

.hint {
  font-size: 12px;
  margin: 0;
}

.row-selected td {
  background: #f3f7ff;
}

.order-detail {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fcfdff;
  padding: 12px;
}

.order-detail h3 {
  margin: 0 0 10px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px 12px;
  margin-bottom: 10px;
}

.detail-meta p {
  margin: 0;
  font-size: 14px;
}

.detail-return {
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.detail-return strong {
  display: inline-block;
  margin-bottom: 6px;
}

.detail-return ul {
  margin: 0;
  padding-left: 18px;
}

.assign-box {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.seller-search {
  width: min(360px, 100%);
}

.store-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.store-pick-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.store-pick-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(47, 111, 237, 0.12);
}

.store-pick-card img {
  width: 76px;
  height: 68px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-soft);
}

.store-pick-card span,
.product-card-body,
.cart-line > div:first-child {
  display: grid;
  gap: 4px;
}

.store-pick-card small,
.cart-line small {
  color: var(--text-muted);
}

.selected-store-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.selected-store-bar h2 {
  margin: 10px 0 3px;
}

.selected-store-bar p {
  margin: 0;
}

.selected-store-image {
  width: 108px;
  height: 76px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: cover;
}

.store-action-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.store-action-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.store-action-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  align-items: start;
}

.pos-catalog,
.pos-cart {
  margin-bottom: 0;
}

.pos-catalog .panel-head input {
  width: min(300px, 100%);
}

.product-catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.product-card {
  display: grid;
  grid-template-rows: 110px 1fr;
  overflow: hidden;
  min-height: 210px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.product-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: var(--surface-soft);
}

.product-card-body {
  padding: 10px;
}

.product-card-body small {
  color: var(--text-muted);
  font-size: 11px;
}

.product-card-body strong {
  line-height: 1.25;
}

.product-card-body span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.pos-cart {
  position: sticky;
  top: 112px;
}

.cart-lines {
  display: grid;
  gap: 8px;
  max-height: 45vh;
  overflow-y: auto;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 7px;
}

.qty-control button,
.cart-remove {
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 27px;
  height: 27px;
  background: var(--surface);
  cursor: pointer;
}

.cart-remove {
  border-color: #f6d2d2;
  color: var(--danger);
}

.empty-cart {
  display: grid;
  gap: 5px;
  padding: 28px 10px;
  color: var(--text-muted);
  text-align: center;
}

.cart-summary {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.cart-summary div {
  display: flex;
  justify-content: space-between;
}

.cart-summary .cart-total {
  margin-top: 5px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 18px;
}

.cart-confirm {
  width: 100%;
  margin-top: 12px;
}

.feature-placeholder {
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
}

.feature-placeholder p {
  max-width: 560px;
  margin: 0;
  color: var(--text-muted);
}

.receipt-sheet {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow-y: auto;
  padding: 32px max(20px, calc((100vw - 800px) / 2));
  background: rgba(31, 41, 55, 0.72);
}

.receipt-sheet[hidden] {
  display: none;
}

.receipt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

#receiptContent {
  min-height: 900px;
  padding: 44px;
  background: #fff;
  color: #111827;
  box-shadow: var(--shadow);
}

.receipt-header {
  margin-bottom: 24px;
  border-bottom: 2px solid #111827;
  padding-bottom: 14px;
  text-align: center;
}

.receipt-header h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.receipt-header p,
.receipt-meta p {
  margin: 4px 0;
}

.receipt-meta {
  margin-bottom: 20px;
}

.receipt-total {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  text-align: right;
}

.receipt-footer {
  margin-top: 70px;
}

hr.soft {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

@media (max-width: 1120px) {
  .cards {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .production-auth {
    grid-template-columns: minmax(390px, 0.9fr) minmax(420px, 1.1fr);
  }

  .production-auth-hero h1 {
    font-size: 46px;
  }

  .store-picker-grid,
  .product-catalog {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .pos-layout {
    grid-template-columns: 1fr;
  }

  .pos-cart {
    position: static;
  }
}

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

  .seller-shell {
    display: grid;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .seller-shell .sidebar {
    position: static;
    height: auto;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .inline-field,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .detail-meta {
    grid-template-columns: 1fr;
  }

  .role-boxes {
    grid-template-columns: 1fr;
  }

  .store-picker-grid,
  .product-catalog {
    grid-template-columns: 1fr;
  }

  .cart-line {
    grid-template-columns: minmax(100px, 1fr) auto auto;
  }

  .cart-line > strong {
    display: none;
  }

  .production-auth {
    display: block;
    min-height: 100vh;
  }

  .production-auth-brand {
    display: none;
  }

  .production-auth-form {
    min-height: 100vh;
    align-content: center;
    gap: 28px;
    padding: 28px 18px;
  }

  .mobile-official-logo {
    display: block;
    width: 164px;
    height: 104px;
    overflow: hidden;
    border: 1px solid rgba(18, 59, 43, 0.1);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(18, 59, 43, 0.1);
  }

  .login-card {
    padding: 28px 22px;
  }
}

/* Seller application shell */
.seller-app-page {
  --seller-green: #126b4b;
  --seller-green-dark: #0b4934;
  --seller-green-soft: #e9f6ef;
  --seller-orange: #ef7918;
  --seller-lime: #98d515;
  background: #f3f7f5;
}

.seller-app-page .seller-shell {
  min-height: 100vh;
}

.seller-app-page .seller-sidebar {
  display: flex;
  flex-direction: column;
  width: 292px;
  padding: 18px 14px;
  border-right: 1px solid #dbe8e1;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 8px 0 32px rgba(11, 73, 52, 0.04);
}

.seller-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e8efeb;
  padding: 2px 5px 18px;
}

.seller-brand img,
.seller-mobile-brand img {
  width: 54px;
  height: 46px;
  border: 1px solid #e5ece8;
  border-radius: 12px;
  object-fit: cover;
  transform: scale(1.08);
}

.seller-brand div {
  display: grid;
  gap: 3px;
}

.seller-brand strong {
  color: var(--seller-green-dark);
  font-size: 16px;
}

.seller-brand small {
  color: #819088;
  font-size: 11px;
}

.seller-app-page .seller-sidebar .nav-section-title {
  margin: 17px 11px 7px;
  color: #9aa8a1;
  font-size: 10px;
}

.seller-app-page .seller-sidebar .nav-list {
  gap: 4px;
}

.seller-app-page .seller-sidebar .nav-item {
  min-height: 54px;
  border-radius: 13px;
  padding: 9px 11px;
}

.seller-app-page .seller-sidebar .nav-item img {
  width: 20px;
  height: 20px;
  opacity: 0.58;
}

.seller-app-page .seller-sidebar .nav-item strong {
  color: #475850;
}

.seller-app-page .seller-sidebar .nav-item.active {
  background: var(--seller-green-soft);
  box-shadow: inset 3px 0 var(--seller-green);
}

.seller-app-page .seller-sidebar .nav-item.active img {
  opacity: 1;
}

.seller-app-page .seller-sidebar .nav-item.active strong {
  color: var(--seller-green-dark);
}

.seller-sidebar-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  margin-top: auto;
  border: 1px solid #e2ebe6;
  border-radius: 15px;
  padding: 10px;
  background: #f8fbf9;
}

.seller-sidebar-profile div,
.seller-header-profile div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.seller-sidebar-profile strong,
.seller-header-profile strong {
  overflow: hidden;
  color: #263b31;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-sidebar-profile small,
.seller-header-profile small {
  color: #8b9992;
  font-size: 10px;
}

.seller-user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--seller-lime), #65b83a);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.seller-icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #dfe9e4;
  border-radius: 11px;
  background: #fff;
  color: var(--seller-green);
  cursor: pointer;
  font-size: 17px;
}

.seller-icon-button:hover {
  border-color: #b8d5c6;
  background: var(--seller-green-soft);
}

.seller-app-page .seller-main {
  padding: 0 26px 32px;
}

.seller-app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 0 -26px 24px;
  border-bottom: 1px solid rgba(209, 225, 217, 0.9);
  padding: 15px 26px;
  background: rgba(243, 247, 245, 0.91);
  backdrop-filter: blur(16px);
}

.seller-mobile-brand {
  display: none;
}

.seller-header-title h1 {
  margin: 0;
  color: #19362a;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.seller-header-title p {
  margin: 4px 0 0;
  color: #819088;
  font-size: 12px;
}

.seller-header-actions,
.seller-header-profile {
  display: flex;
  gap: 9px;
  align-items: center;
}

.seller-header-profile {
  min-width: 156px;
  border: 1px solid #e0eae5;
  border-radius: 13px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.82);
}

.seller-logout-button {
  border-color: #e0e9e4;
  color: #61736a;
  padding: 9px 12px;
}

/* Mobile-only profile menu (mirrors admin) — restores the logout that the
   desktop header hides on small screens. Native <details>, no extra JS state. */
.seller-profile-menu {
  display: none;
}

.seller-app-page .seller-content {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
}

.seller-home-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  overflow: hidden;
  margin-bottom: 16px;
  border-radius: 22px;
  padding: 24px 26px;
  background:
    radial-gradient(circle at 88% 15%, rgba(152, 213, 21, 0.42), transparent 24%),
    linear-gradient(135deg, var(--seller-green-dark), var(--seller-green));
  color: #fff;
  box-shadow: 0 16px 40px rgba(11, 73, 52, 0.16);
}

.seller-home-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -125px;
  width: 280px;
  height: 280px;
  border: 35px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.seller-home-hero > * {
  position: relative;
  z-index: 1;
}

.seller-home-label {
  display: inline-block;
  margin-bottom: 8px;
  color: #cfe9d9;
  font-size: 11px;
  text-transform: capitalize;
}

.seller-home-hero h2 {
  margin: 0 0 7px;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.025em;
}

.seller-home-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.seller-primary-action {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 190px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  padding: 12px;
  background: #fff;
  color: var(--seller-green-dark);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.seller-primary-action > span:first-child {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--seller-orange);
  color: #fff;
  font-size: 23px;
}

.seller-primary-action > span:last-child {
  display: grid;
  gap: 3px;
}

.seller-primary-action small {
  color: #809087;
}

.seller-app-page .seller-cards {
  gap: 10px;
}

.seller-app-page .seller-cards .card {
  position: relative;
  overflow: hidden;
  border-color: #e0eae5;
  border-radius: 17px;
  padding: 17px;
  box-shadow: 0 8px 24px rgba(27, 70, 51, 0.06);
}

.seller-app-page .seller-cards .card::after {
  content: "";
  position: absolute;
  right: -12px;
  bottom: -18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--seller-green-soft);
}

.seller-app-page .seller-cards .card strong {
  color: var(--seller-green-dark);
  font-size: 24px;
}

.seller-app-page .panel {
  border-color: #e0eae5;
  border-radius: 19px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(27, 70, 51, 0.06);
}

.seller-app-page .panel h2 {
  color: #243c31;
}

.seller-app-page input,
.seller-app-page select,
.seller-app-page textarea {
  border-color: #dce8e2;
  background: #fbfdfc;
}

.seller-app-page input:focus,
.seller-app-page select:focus,
.seller-app-page textarea:focus {
  border-color: var(--seller-green);
  outline: 3px solid rgba(18, 107, 75, 0.1);
}

.seller-app-page .store-pick-card {
  border-color: #e0eae5;
  border-radius: 16px;
  padding: 11px;
  box-shadow: 0 6px 18px rgba(27, 70, 51, 0.04);
}

.seller-app-page .store-pick-card:hover {
  border-color: #8fc5aa;
  box-shadow: 0 12px 28px rgba(18, 107, 75, 0.12);
  transform: translateY(-2px);
}

.seller-app-page .store-pick-card img {
  border-radius: 12px;
}

.seller-app-page .selected-store-bar {
  border: 0;
  border-radius: 19px;
  background: linear-gradient(135deg, #fff, #eef8f2);
}

.seller-app-page .store-action-tab.active,
.seller-app-page .btn.primary {
  border-color: var(--seller-green);
  background: var(--seller-green);
}

.seller-app-page .product-card {
  border-color: #e0eae5;
  border-radius: 15px;
}

.seller-app-page .product-card:hover {
  border-color: #8fc5aa;
  box-shadow: 0 10px 26px rgba(18, 107, 75, 0.12);
}

.seller-app-page .product-card-body span {
  color: var(--seller-orange);
}

.seller-bottom-nav {
  display: none;
}

@media (min-width: 1500px) {
  .seller-app-page .store-picker-grid {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }

  .seller-app-page .product-catalog {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
  }
}

@media (max-width: 1120px) {
  .seller-app-page .seller-sidebar {
    width: 244px;
  }

  .seller-app-page .seller-sidebar .nav-item small {
    display: none;
  }

  .seller-app-page .pos-layout {
    grid-template-columns: 1fr;
  }

  .seller-app-page .pos-cart {
    position: static;
  }
}

@media (max-width: 900px) {
  .seller-app-page {
    padding-bottom: 82px;
  }

  .seller-app-page .seller-shell {
    display: block;
  }

  .seller-app-page .seller-sidebar {
    display: none;
  }

  .seller-app-page .seller-main {
    padding: 0 14px 24px;
  }

  .seller-app-header {
    top: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    /* Flush to the top, no floating gap below — frosted glass like admin. */
    margin: 0 -14px 0;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(220, 232, 226, 0.6);
    background: rgba(255, 255, 255, 0.68);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }

  .seller-mobile-brand {
    display: block;
  }

  .seller-header-title {
    flex: 1;
    min-width: 0;
  }

  .seller-header-title h1 {
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .seller-header-title p,
  .seller-header-profile,
  .seller-logout-button,
  #sellerRefreshBtn {
    display: none;
  }

  .seller-header-actions {
    gap: 5px;
  }

  /* Profile menu: native <details> dropdown holding identity + the logout
     that the desktop header hides on mobile. */
  .seller-profile-menu {
    position: relative;
    display: block;
  }

  .seller-profile-trigger {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    list-style: none;
  }

  .seller-profile-trigger::-webkit-details-marker {
    display: none;
  }

  .seller-profile-menu[open] .seller-profile-trigger {
    background: var(--seller-green-soft);
  }

  .seller-profile-dropdown {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 10px;
    width: min(244px, calc(100vw - 32px));
    border: 1px solid #dce8e2;
    border-radius: 16px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(11, 73, 52, 0.18);
  }

  .seller-profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #eef3f0;
    padding-bottom: 10px;
  }

  .seller-profile-card div {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .seller-profile-card strong {
    overflow: hidden;
    color: #243c31;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .seller-profile-card small {
    color: #8b9992;
    font-size: 11px;
  }

  .seller-profile-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 44px;
    border: 1px solid #f0d6cf;
    border-radius: 12px;
    padding: 0 14px;
    background: #fdf3f1;
    color: #c0432b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .seller-profile-action:hover {
    background: #fbe8e3;
  }

  .seller-home-hero {
    align-items: flex-start;
    border-radius: 18px;
    padding: 20px;
  }

  .seller-primary-action {
    min-width: auto;
    padding: 9px;
  }

  .seller-primary-action > span:last-child {
    display: none;
  }

  .seller-app-page .seller-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seller-app-page .seller-cards .card {
    padding: 14px;
  }

  .seller-app-page .seller-cards .card strong {
    font-size: 20px;
  }

  .seller-app-page .store-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seller-app-page .store-pick-card {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .seller-app-page .store-pick-card img {
    width: 100%;
    height: 105px;
  }

  .seller-app-page .store-pick-card small:last-child {
    display: none;
  }

  .seller-app-page .product-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seller-app-page .product-card {
    grid-template-rows: 90px 1fr;
    min-height: 180px;
  }

  .seller-app-page .product-card img {
    height: 90px;
  }

  .selected-store-image {
    width: 76px;
    height: 62px;
  }

  .seller-bottom-nav {
    position: fixed;
    z-index: 60;
    right: 10px;
    bottom: 8px;
    left: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    border: 1px solid #dce8e2;
    border-radius: 19px;
    padding: 7px 6px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 42px rgba(11, 73, 52, 0.18);
    backdrop-filter: blur(16px);
  }

  .seller-bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: #89968f;
    cursor: pointer;
    font-size: 9px;
  }

  .seller-bottom-nav button img {
    width: 19px;
    height: 19px;
    opacity: 0.58;
  }

  .seller-bottom-nav button.active {
    color: var(--seller-green);
    font-weight: 700;
  }

  .seller-bottom-nav button.active img {
    opacity: 1;
  }

  .seller-bottom-nav .seller-bottom-action {
    align-self: center;
    width: 48px;
    height: 48px;
    margin: -22px auto 0;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--seller-orange), #ff9b35);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 121, 24, 0.3);
    font-size: 28px;
  }
}

@media (max-width: 520px) {
  .seller-home-hero p {
    max-width: 240px;
    font-size: 12px;
  }

  .seller-home-hero h2 {
    font-size: 21px;
  }

  .seller-app-page .panel {
    border-radius: 16px;
    padding: 14px;
  }

  .seller-app-page .panel-head {
    gap: 9px;
  }

  .seller-app-page .store-action-tabs {
    margin-right: -14px;
    margin-left: -14px;
    padding: 0 14px 5px;
  }

  .seller-app-page .cart-line {
    grid-template-columns: minmax(80px, 1fr) auto auto;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .receipt-sheet,
  .receipt-sheet * {
    visibility: visible;
  }

  .receipt-sheet {
    position: absolute;
    inset: 0;
    overflow: visible;
    padding: 0;
    background: #fff;
  }

  #receiptContent {
    min-height: 0;
    padding: 0;
    box-shadow: none;
  }

  .no-print {
    display: none !important;
  }
}

/* ============================================================
   RESPONSIVE HARDENING — cross-device fixes
   Ladder: 900px (shell collapse) / 768px (tablet) / 480px (phone)
   ============================================================ */

/* Tables: width:100% (on `table`) fills wide screens; this min-width
   makes .table-wrap scroll horizontally instead of crushing columns. */
.table-wrap > table {
  min-width: 640px;
}

/* Safety net: no image can force horizontal scroll. */
img {
  max-width: 100%;
}

/* Keep in-table / secondary small buttons compact (override .btn min-height). */
.btn.small {
  min-height: 36px;
}

/* JS-injected receipt content must fit the on-screen sheet. */
#receiptContent {
  max-width: 100%;
}
#receiptContent table {
  width: 100%;
}
#receiptContent img {
  height: auto;
}

/* Delivery page is the only one on the bare .shell. On small screens turn
   its vertical sidebar into a compact, horizontally-scrollable top bar
   instead of a tall wall pushing the order tables down. */
@media (max-width: 900px) {
  .shell > .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 14px;
    background: var(--surface);
  }
  .shell > .sidebar .nav-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .shell > .sidebar .nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .shell > .main {
    padding: 16px 14px 28px;
  }
  /* Mobile-header icon buttons up to a 44px tap target. */
  .seller-icon-button {
    width: 44px;
    height: 44px;
  }
  /* Bottom-nav tabs: guarantee tappable height. */
  .seller-bottom-nav button {
    min-height: 48px;
  }
}

/* Tablet portrait: give seller + delivery panels the same edge-to-edge
   table scroll room the admin pages already have. */
@media (max-width: 768px) {
  .seller-app-page .table-wrap,
  .shell .panel .table-wrap {
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px;
  }
}

/* Phones: stack headers/actions, single-column cards, fit the modal. */
@media (max-width: 480px) {
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .btn,
  .panel-head .btn,
  .page-head .btn {
    width: 100%;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .seller-app-page .seller-cards {
    grid-template-columns: 1fr;
  }
  .selected-store-bar {
    flex-wrap: wrap;
  }
  .selected-store-bar > div {
    flex: 1 1 100%;
    min-width: 0;
  }
  .selected-store-image {
    width: 100%;
    height: 120px;
    order: -1;
  }
  .receipt-sheet {
    padding: 12px;
  }
  #receiptContent {
    min-height: 0;
    padding: 20px;
  }
  .receipt-actions {
    position: sticky;
    top: 0;
    flex-wrap: wrap;
    gap: 8px;
  }
  .receipt-actions .btn {
    flex: 1 1 140px;
  }
}

/* ============================================================
   Mobile data tables → stacked cards (seller + delivery views)
   Same pattern as admin.css: below 768px each row becomes a labelled
   card so 4–6 column tables don't force horizontal scrolling on phones.
   Labels come from each <td>'s data-label (set in the page render JS).
   Scoped to .table-wrap tables, so the seller receipt layout is untouched.
   ============================================================ */
@media (max-width: 768px) {
  .seller-app-page .table-wrap > table,
  .delivery-app-page .table-wrap > table {
    min-width: 0;
  }

  .seller-app-page .table-wrap > table thead,
  .delivery-app-page .table-wrap > table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }

  .seller-app-page .table-wrap > table,
  .seller-app-page .table-wrap > table tbody,
  .seller-app-page .table-wrap > table tr,
  .seller-app-page .table-wrap > table td,
  .delivery-app-page .table-wrap > table,
  .delivery-app-page .table-wrap > table tbody,
  .delivery-app-page .table-wrap > table tr,
  .delivery-app-page .table-wrap > table td {
    display: block;
    width: 100%;
  }

  .seller-app-page .table-wrap > table tr,
  .delivery-app-page .table-wrap > table tr {
    margin-bottom: 12px;
    border: 1px solid #e0eae5;
    border-radius: 14px;
    padding: 4px 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(27, 70, 51, 0.05);
  }

  .seller-app-page .table-wrap > table td,
  .delivery-app-page .table-wrap > table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border: 0;
    border-bottom: 1px solid #f0f4f2;
    padding: 11px 0;
    color: #2c3f36;
    font-size: 13px;
    text-align: right;
  }

  .seller-app-page .table-wrap > table td:last-child,
  .delivery-app-page .table-wrap > table td:last-child {
    border-bottom: 0;
  }

  .seller-app-page .table-wrap > table td::before,
  .delivery-app-page .table-wrap > table td::before {
    content: attr(data-label);
    flex: 0 0 36%;
    color: #76867d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: uppercase;
  }

  /* Action cells stack full-width beneath their label. */
  .seller-app-page .table-wrap > table td[data-label="Үйлдэл"],
  .delivery-app-page .table-wrap > table td[data-label="Үйлдэл"] {
    display: grid;
    gap: 8px;
    text-align: left;
  }

  .seller-app-page .table-wrap > table td[data-label="Үйлдэл"]::before,
  .delivery-app-page .table-wrap > table td[data-label="Үйлдэл"]::before {
    flex: none;
  }

  .seller-app-page .table-wrap > table td[data-label="Үйлдэл"] .btn,
  .delivery-app-page .table-wrap > table td[data-label="Үйлдэл"] .btn {
    width: 100%;
  }

  /* Empty-state rows ("... олдсонгүй") carry no data-label. */
  .seller-app-page .table-wrap > table td[colspan],
  .delivery-app-page .table-wrap > table td[colspan] {
    justify-content: center;
    text-align: center;
  }
  .seller-app-page .table-wrap > table td[colspan]::before,
  .delivery-app-page .table-wrap > table td[colspan]::before {
    content: none;
  }
}

/* ============================================================
   Delivery application header (delivery.html)
   Mirrors the seller header: a clean bar that turns frosted on mobile,
   with an avatar profile menu holding the logout. No refresh button.
   ============================================================ */
.delivery-app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 0 -24px 24px;
  border-bottom: 1px solid rgba(209, 225, 217, 0.9);
  padding: 15px 24px;
  background: rgba(243, 247, 245, 0.91);
  backdrop-filter: blur(16px);
}

.delivery-mobile-brand {
  display: none;
}

.delivery-header-title h1 {
  margin: 0;
  color: #19362a;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.delivery-header-title p {
  margin: 4px 0 0;
  color: #819088;
  font-size: 12px;
}

.delivery-header-actions,
.delivery-header-profile {
  display: flex;
  gap: 9px;
  align-items: center;
}

.delivery-header-profile {
  min-width: 156px;
  border: 1px solid #e0eae5;
  border-radius: 13px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.82);
}

.delivery-header-profile div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.delivery-header-profile strong {
  overflow: hidden;
  color: #263b31;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-header-profile small {
  color: #8b9992;
  font-size: 10px;
}

.delivery-user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, #ef7918, #ff9b35);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.delivery-logout-button {
  border-color: #e0e9e4;
  color: #61736a;
  padding: 9px 12px;
}

.delivery-profile-menu {
  display: none;
}

/* Delivery is a simple centered column with a fixed footer nav (2 pages:
   assigned + history), instead of the admin/seller sidebar. */
.delivery-main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 104px;
}

.delivery-bottom-nav {
  position: fixed;
  z-index: 60;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 6px;
  width: min(440px, calc(100vw - 28px));
  border: 1px solid #dce8e2;
  border-radius: 18px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 42px rgba(11, 73, 52, 0.18);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.delivery-bottom-nav a {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 13px;
  color: #89968f;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.delivery-bottom-nav img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.delivery-bottom-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.delivery-bottom-nav a.active img {
  opacity: 1;
}

@media (max-width: 900px) {
  /* Header flush at the top; leave room at the bottom for the fixed footer nav. */
  .delivery-main {
    padding: 0 14px 104px;
  }

  .delivery-app-header {
    top: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    margin: 0 -14px 0;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(220, 232, 226, 0.6);
    background: rgba(255, 255, 255, 0.68);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }

  .delivery-mobile-brand {
    display: block;
    flex: 0 0 auto;
  }

  .delivery-mobile-brand img {
    width: 40px;
    height: 40px;
    border: 1px solid #e2ebe6;
    border-radius: 11px;
    object-fit: cover;
  }

  .delivery-header-title {
    flex: 1;
    min-width: 0;
  }

  .delivery-header-title h1 {
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .delivery-header-title p,
  .delivery-header-profile,
  .delivery-logout-button {
    display: none;
  }

  .delivery-header-actions {
    gap: 5px;
  }

  .delivery-profile-menu {
    position: relative;
    display: block;
  }

  .delivery-profile-trigger {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    list-style: none;
  }

  .delivery-profile-trigger::-webkit-details-marker {
    display: none;
  }

  .delivery-profile-menu[open] .delivery-profile-trigger {
    background: #e9f6ef;
  }

  .delivery-profile-dropdown {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 10px;
    width: min(244px, calc(100vw - 32px));
    border: 1px solid #dce8e2;
    border-radius: 16px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(11, 73, 52, 0.18);
  }

  .delivery-profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #eef3f0;
    padding-bottom: 10px;
  }

  .delivery-profile-card div {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .delivery-profile-card strong {
    overflow: hidden;
    color: #243c31;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .delivery-profile-card small {
    color: #8b9992;
    font-size: 11px;
  }

  .delivery-profile-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 44px;
    border: 1px solid #f0d6cf;
    border-radius: 12px;
    padding: 0 14px;
    background: #fdf3f1;
    color: #c0432b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .delivery-profile-action:hover {
    background: #fbe8e3;
  }
}
