/* manage-native.css - Một Sợi Trà Management Shell & Views */

/* Fallback variable bindings with milktea/orange defaults */
:root {
  --mt-bg: var(--bg, #f7f1ea);
  --mt-cream: var(--cream, #f3e7d8);
  --mt-panel: var(--panel, #fbf3e8);
  --mt-card: var(--card, #fffdfa);
  --mt-ink: var(--ink, #2a1c15);
  --mt-ink-2: var(--ink-2, #5c4638);
  --mt-muted: var(--muted, #8d7565);
  --mt-line: var(--line, #ecdcc9);
  --mt-line-strong: var(--line-strong, #d9c4a8);
  --mt-terra: var(--terra, #c05621);
  --mt-terra-dark: var(--terra-dark, #9e441a);
  --mt-price: var(--price, #b34114);
  --mt-primary: var(--primary, #c05621);
  --mt-nav: #2a1c15;
  --mt-nav-text: #f7f1ea;
  --mt-nav-muted: #b49c8c;
  --mt-nav-hover: rgba(255, 255, 255, 0.08);
  --mt-nav-active: var(--mt-terra, #c05621);
}

/* ==========================================================================
   Management Shell Layout
   ========================================================================== */
.mapp {
  width: 100%;
  height: 100%;
  display: flex;
  background: var(--mt-bg);
  overflow: hidden;
  color: var(--mt-ink);
}

/* --------------------------------------------------------------------------
   Sidebar (218px fixed dark sidebar)
   -------------------------------------------------------------------------- */
.msidebar {
  width: 218px;
  flex: 0 0 218px;
  background: var(--mt-nav);
  color: var(--mt-nav-text);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.mbrand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.mbrand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: var(--mt-terra);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  box-shadow: 0 4px 12px rgba(192, 86, 33, 0.35);
}

.mbrand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.mbrand-text b {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mbrand-text small {
  font-size: 11px;
  color: var(--mt-nav-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mnav-item {
  height: 46px;
  min-height: 46px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--mt-nav-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: none;
  user-select: none;
  width: 100%;
}

.mnav-item:hover {
  background: var(--mt-nav-hover);
  color: #fff;
}

.mnav-item.on,
.mnav-item.active {
  background: var(--mt-terra);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(192, 86, 33, 0.32);
}

.mnav-item:focus-visible {
  outline: 2px solid var(--mt-terra);
  outline-offset: 1px;
}

.mnav-ico {
  font-size: 18px;
  line-height: 1;
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}

.mnav-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mpos-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mt-nav-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, color 0.15s ease;
}

.mpos-link:hover {
  background: var(--mt-nav-hover);
  color: #fff;
}

.muser {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.mavatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.muser-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.muser-text b {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muser-text small {
  font-size: 11px;
  color: var(--mt-nav-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mver {
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--mt-nav-muted);
  opacity: 0.72;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mver[data-state="update"] {
  color: #ffd8a8;
  opacity: 1;
  white-space: normal;
}

.mlogout {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--mt-nav-muted);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mlogout:hover {
  background: rgba(192, 57, 43, 0.2);
  color: #ff8b7b;
}

/* --------------------------------------------------------------------------
   Work Area & Topbar
   -------------------------------------------------------------------------- */
.mwork {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--mt-bg);
}

.mtopbar {
  height: 76px;
  flex: 0 0 76px;
  background: var(--mt-card);
  border-bottom: 1px solid var(--mt-line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}

.mtopbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.meyebrow {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mt-muted);
}

.mtopbar h1,
.mtopbar-title h1,
#page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--mt-ink);
  line-height: 1.2;
}

#page-subtitle {
  font-size: 13px;
  color: var(--mt-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mtopbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.msync {
  font-size: 12px;
  color: var(--mt-muted);
  font-weight: 500;
}

/* Buttons */
.mbtn {
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--mt-line);
  background: var(--mt-card);
  color: var(--mt-ink);
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.mbtn:hover {
  background: var(--mt-cream);
  border-color: var(--mt-line-strong);
}

.mbtn:focus-visible {
  outline: 2px solid var(--mt-terra);
  outline-offset: 1px;
}

.mbtn-primary,
.mbtn.primary {
  background: var(--mt-terra);
  color: #fff;
  border-color: var(--mt-terra);
  box-shadow: 0 3px 10px rgba(192, 86, 33, 0.25);
}

.mbtn-primary:hover,
.mbtn.primary:hover {
  background: var(--mt-terra-dark);
  border-color: var(--mt-terra-dark);
}

.mbtn.small,
.mbtn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.mbtn.danger,
.mbtn-danger {
  background: #fff;
  color: #c0392b;
  border-color: #f0c6bf;
}

.mbtn.danger:hover,
.mbtn-danger:hover {
  background: #fdecea;
  border-color: #e5978f;
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.mcontent {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

/* ==========================================================================
   Management Views & Component Classes
   ========================================================================== */

/* Hero Banner */
.mhero {
  border-radius: 18px;
  padding: 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--mt-terra, #c05621) 0%, #3e1b0c 100%);
  box-shadow: 0 8px 24px rgba(62, 27, 12, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mhero-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.mhero-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.mhero-sub {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.4;
}

/* Stats Grid */
.mstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.mstat {
  background: var(--mt-card);
  border-radius: 14px;
  border: 1px solid var(--mt-line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.mstat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mt-muted);
}

.mstat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--mt-ink);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.mstat-note {
  font-size: 12px;
  color: var(--mt-muted);
}

.mstat[role="button"]:hover {
  border-color: var(--mt-line-strong, #c7d2fe);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
  transform: translateY(-1px);
  transition: all 0.15s ease;
}

/* Overview 7-day Column Chart */
.mov-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 180px;
  padding: 14px 4px 4px;
  box-sizing: border-box;
}

.mov-bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  cursor: pointer;
}

.mov-bar-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--mt-muted);
  margin-bottom: 6px;
  white-space: nowrap;
}

.mov-bar-track {
  flex: 1;
  width: 100%;
  max-width: 28px;
  background: rgba(79, 70, 229, 0.08);
  border-radius: 6px 6px 2px 2px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.mov-bar-fill {
  width: 100%;
  background: var(--report-series, #4f46e5);
  border-radius: 6px 6px 2px 2px;
  transition: height 0.3s ease;
}

.mov-bar-fill.current {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.mov-bar-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--mt-muted);
  margin-top: 6px;
  white-space: nowrap;
}

.mov-bar-lbl.current {
  color: #4f46e5;
  font-weight: 800;
}

/* Card Container */
.mcard {
  background: var(--mt-card);
  border-radius: 14px;
  border: 1px solid var(--mt-line);
  padding: 18px;
  box-sizing: border-box;
}

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

.mcard h2,
.mcard h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--mt-ink);
  margin: 0;
}

.mcard-sub {
  font-size: 13px;
  color: var(--mt-muted);
  margin-top: 2px;
}

/* List & Rows */
.mlist {
  display: flex;
  flex-direction: column;
}

.mrow {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--mt-line);
}

.mrow:last-child {
  border-bottom: 0;
}

.mgrow {
  flex: 1;
  min-width: 0;
}

.mrank {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: rgba(192, 86, 33, 0.12);
  color: var(--mt-terra);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

/* Tables */
.mtable-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--mt-line);
  background: var(--mt-card);
}

.mtable {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.mtable th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mt-muted);
  background: #f6f9fa;
  padding: 10px 12px;
  border-bottom: 1px solid var(--mt-line);
  white-space: nowrap;
}

.mtable td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--mt-line);
  font-size: 13.5px;
  color: var(--mt-ink);
  vertical-align: middle;
}

.mtable tbody tr:last-child td {
  border-bottom: 0;
}

.mtable tbody tr:hover {
  background: var(--mt-cream);
}

.mtable .right,
.right {
  text-align: right;
}

.mtable .center,
.center {
  text-align: center;
}

/* Badges */
.mbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
  background: var(--mt-cream);
  color: var(--mt-ink-2);
}

.mbadge.warn {
  background: #fef3c7;
  color: #92400e;
}

.mbadge.danger,
.mbadge.returned {
  background: #fdecea;
  color: #c0392b;
}

.mbadge.ok,
.mbadge.success {
  background: #eef4ea;
  color: #276738;
}

/* Toolbars & Search */
.mtoolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.msearch {
  flex: 1;
  min-width: 220px;
  height: 42px;
  background: var(--mt-card);
  border: 1px solid var(--mt-line);
  border-radius: 11px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  box-sizing: border-box;
}

.msearch:focus-within {
  border-color: var(--mt-terra);
  background: #fff;
}

.msearch input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--mt-ink);
  min-width: 0;
}

.msearch input::placeholder {
  color: var(--mt-muted);
}

.mfilter {
  height: 42px;
  border: 1px solid var(--mt-line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--mt-card);
  color: var(--mt-ink);
  font-size: 13px;
  font-weight: 600;
  box-sizing: border-box;
  outline: none;
}

.mfilter:focus {
  border-color: var(--mt-terra);
}

/* Forms */
.mform {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.mfield {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mfield label {
  font-size: 12px;
  font-weight: 700;
  color: var(--mt-ink-2);
}

.mfield input,
.mfield select,
.mfield textarea,
.mform input,
.mform select,
.mform textarea {
  height: 44px;
  border: 1px solid var(--mt-line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
  color: var(--mt-ink);
  box-sizing: border-box;
  width: 100%;
}

.mfield textarea,
.mform textarea {
  height: auto;
  min-height: 74px;
  padding: 10px 12px;
  line-height: 1.4;
  resize: vertical;
}

.mfield input:focus,
.mfield select:focus,
.mfield textarea:focus,
.mform input:focus,
.mform select:focus,
.mform textarea:focus {
  border-color: var(--mt-terra);
  outline: none;
}

.mform-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.form-error {
  color: #c0392b;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

/* Helpers */
.mempty {
  padding: 28px;
  text-align: center;
  color: var(--mt-muted);
  font-size: 13.5px;
}

.mtag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--mt-cream);
  color: var(--mt-ink-2);
}

.mqr {
  max-width: 200px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--mt-line);
  background: #fff;
  padding: 6px;
}

.mqr-empty {
  width: 160px;
  height: 160px;
  border: 1px dashed var(--mt-line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--mt-muted);
  text-align: center;
}

.mqr-status {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.mqr-status.ok { color: #2e7d32; }
.mqr-status.error { color: #c62828; }
.mqr-status.busy { color: var(--mt-muted); }

.mreceipt-logo {
  display: block;
  margin: 0 auto 6px;
  border-radius: 10px;
}

.mreceipt-qr-wrap {
  margin-top: 8px;
  text-align: center;
}

.mreceipt-qr {
  width: 140px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.mreceipt-qr-cap {
  font-size: 10px;
  color: #444;
  margin-top: 2px;
}

.mreceipt-thanks {
  margin-top: 8px;
  text-align: center;
  font-size: 11.5px;
  font-style: italic;
}

.mreceipt.rcpt-58 {
  max-width: 219px;
  font-size: 11px;
}

/* Modal form constraints */
.modal-card .mform {
  width: 100%;
  max-width: 640px;
}

/* --------------------------------------------------------------------------
   Receipt Styling (80mm print block)
   -------------------------------------------------------------------------- */
.mreceipt {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  background: #fff;
  color: #000;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 4px;
  box-sizing: border-box;
}

.mreceipt-store {
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}

.mreceipt-meta {
  text-align: center;
  font-size: 11px;
  color: #444;
  margin-bottom: 8px;
}

.mreceipt-sep {
  border: 0;
  border-top: 1px dashed #777;
  margin: 8px 0;
}

.mreceipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0;
}

.mreceipt-items {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
}

.mreceipt-items th,
.mreceipt-items td {
  padding: 4px 2px;
  font-size: 11.5px;
  vertical-align: top;
}

.mreceipt-items th {
  border-bottom: 1px dashed #777;
  text-align: left;
}

.mreceipt-total {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #000;
}

/* --------------------------------------------------------------------------
   Scrollbar & Focus Polish
   -------------------------------------------------------------------------- */
.mcontent::-webkit-scrollbar,
.msidebar::-webkit-scrollbar,
.mtable-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.mcontent::-webkit-scrollbar-thumb,
.msidebar::-webkit-scrollbar-thumb,
.mtable-wrap::-webkit-scrollbar-thumb {
  background: var(--mt-line-strong);
  border-radius: 3px;
}

.mcontent::-webkit-scrollbar-track,
.msidebar::-webkit-scrollbar-track,
.mtable-wrap::-webkit-scrollbar-track {
  background: transparent;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Tablet & Medium Screen (<900px) */
@media (max-width: 899.98px) {
  body:not(.mm) .msidebar {
    width: 64px;
    flex: 0 0 64px;
    padding: 14px 8px;
  }

  body:not(.mm) .mbrand {
    justify-content: center;
    padding: 0 0 14px;
  }

  body:not(.mm) .mbrand-text,
  body:not(.mm) .muser-text,
  body:not(.mm) .mver,
  body:not(.mm) .mnav-item span:last-child {
    display: none !important;
  }

  body:not(.mm) .mnav-item {
    justify-content: center;
    padding: 0;
    height: 44px;
  }

  body:not(.mm) .mnav-ico {
    margin: 0;
  }

  body:not(.mm) .mpos-link {
    justify-content: center;
    padding: 8px 0;
    font-size: 0;
  }

  body:not(.mm) .mpos-link::before {
    content: "←";
    font-size: 15px;
  }

  body:not(.mm) .muser {
    justify-content: center;
  }

  body:not(.mm) .mlogout {
    display: none;
  }

  body:not(.mm) .mtopbar {
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  body:not(.mm) .mcontent {
    padding: 14px;
  }

  body:not(.mm) .mstats {
    grid-template-columns: 1fr;
  }

  body:not(.mm) .mtable th,
  body:not(.mm) .mtable td {
    font-size: 12px;
    padding: 8px 6px;
  }
}

/* Mobile Screen (<700px) — chỉ áp dụng cho desktop thu nhỏ, không đè giao diện trang mobile (.mm) */
@media (max-width: 699.98px) {
  body:not(.mm) .mapp {
    flex-direction: column;
  }

  body:not(.mm) .msidebar {
    width: 100%;
    flex: 0 0 56px;
    height: 56px;
    flex-direction: row;
    align-items: center;
    padding: 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
  }

  body:not(.mm) .mbrand {
    margin: 0;
    padding: 0;
    border-bottom: 0;
    flex-shrink: 0;
  }

  body:not(.mm) .mbrand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 13px;
    border-radius: 8px;
  }

  body:not(.mm) .mnav {
    flex-direction: row;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    gap: 4px;
  }

  body:not(.mm) .mnav-item {
    width: auto;
    flex: 0 0 auto;
    padding: 0 12px;
    height: 38px;
    min-height: 38px;
    border-radius: 8px;
  }

  body:not(.mm) .mnav-item span:last-child {
    display: inline !important;
    font-size: 12.5px;
  }

  body:not(.mm) .mnav-foot {
    display: none;
  }

  body:not(.mm) .mwork {
    min-height: 0;
    flex: 1;
  }

  body:not(.mm) .mtopbar {
    height: auto;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 8px;
  }

  body:not(.mm) .mtopbar-title {
    width: 100%;
  }

  body:not(.mm) .mtopbar h1,
  body:not(.mm) .mtopbar-title h1,
  body:not(.mm) #page-title {
    font-size: 18px;
  }

  body:not(.mm) #page-subtitle {
    display: none;
  }

  body:not(.mm) .mtopbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  body:not(.mm) .mtopbar-actions .msync {
    width: 100%;
    margin-bottom: 2px;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    overflow: visible !important;
  }

  .mapp,
  .toast,
  #modal-root,
  .modal {
    display: none !important;
  }

  #print-area {
    display: block !important;
    width: 80mm !important;
    margin: 0 auto !important;
    padding: 2mm 0 !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: #000 !important;
    background: #fff !important;
  }

  #print-area.w58 {
    width: 58mm !important;
  }

  #print-area .mreceipt {
    max-width: none !important;
    width: 100% !important;
  }

  #print-area * {
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* Checkbox & Table Area styles */
.mcheck-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 0;
}
.mcheck-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.mcheck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  background: var(--mt-card);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--mt-line);
}
.mtables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.mtable-card {
  background: var(--mt-card);
  border: 1px solid var(--mt-line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mtable-card.occupied {
  border-left: 4px solid var(--mt-terra);
}
.mtable-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.mtable-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--mt-ink);
  margin: 0;
}
.mtable-card-area {
  font-size: 12px;
  color: var(--mt-muted);
}
.mtable-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--mt-line);
}

/* Product group picker with an inline add-group control (Hàng hóa & kho). */
.mfield-inline {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.mfield-inline select {
  flex: 1;
  min-width: 0;
}
.mfield-inline .mbtn {
  white-space: nowrap;
}
.mcategory-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.mcategory-add input {
  flex: 1;
  min-width: 0;
}
.mhint {
  margin: 5px 0 0;
  color: var(--mt-muted);
  font-size: 12px;
}

/* Table icon from the approved mockup (default / per table). */
.mtable-card-icon {
  width: 64px;
  height: 44px;
  margin: 0 auto;
  color: var(--mt-muted);
}
.mtable-card-icon svg {
  width: 64px;
  height: 44px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.mtable-card-icon svg .top {
  fill: var(--mt-card);
}
.mtable-card-icon svg .inn {
  stroke: var(--mt-line);
  stroke-width: 1.1;
  opacity: .55;
}
.mtable-card.occupied .mtable-card-icon {
  color: var(--mt-terra);
}
.mtable-card.occupied .mtable-card-icon svg .top {
  fill: var(--mt-terra);
}
.mtable-card.occupied .mtable-card-icon svg .inn {
  stroke: #fbe7da;
  opacity: .85;
}
.mtable-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.mtable-icon-opt {
  width: 88px;
  height: 92px;
  border-radius: 12px;
  border: 1.5px solid var(--mt-line);
  background: var(--mt-card);
  color: var(--mt-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  cursor: pointer;
  font: inherit;
}
.mtable-icon-opt.on {
  border-color: var(--mt-terra);
  background: var(--mt-soft);
  color: var(--mt-terra);
  font-weight: 700;
}
.mtable-icon-opt:disabled {
  opacity: .55;
  cursor: wait;
}
.mtable-icon-svg {
  width: 42px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mtable-icon-svg svg {
  width: 42px;
  height: 34px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mtable-icon-svg svg .top {
  fill: var(--mt-card);
}
.mtable-icon-opt.on .mtable-icon-svg svg .top {
  fill: var(--mt-soft);
}
.mtable-icon-label {
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
}
/* ==========================================================================
   Image Upload UI inside Product Modal (Desktop & Mobile)
   ========================================================================== */
.mimage-upload {
  border: 2px dashed var(--mt-line, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--mt-card, #ffffff);
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 14px;
  margin-bottom: 14px;
}

.mimage-preview {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  border-radius: 10px;
  background: #f7fafc;
  border: 1px solid var(--mt-line, #e2e8f0);
  overflow: hidden;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 64px !important;
  font-size: 18px;
  font-weight: 700;
  color: var(--mt-muted, #718096);
}

.mimage-preview img {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  object-fit: cover !important;
  display: block;
}

.mimage-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mimage-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--mt-ink, #1a202c);
}

.mimage-hint {
  font-size: 11px;
  color: var(--mt-muted, #718096);
  line-height: 1.3;
}

.mimage-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
