/* ==========================================================================
   Modern Unified Cafe & BBQ POS Design System (Light & Dark Mode + Khmer)
   ========================================================================== */

:root {
  --font-sans: 'Inter', 'Kantumruy Pro', 'Noto Sans Khmer', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg: #f5f3ef;
  --bg-elevated: #ffffff;
  --bg-subtle: #edeae4;
  --bg-hover: #f9f7f4;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-soft: #78716c;
  --border: #e5e0d8;
  --border-strong: #d6cfc4;
  --accent: #d94e1f;
  --accent-hover: #b83d14;
  --accent-soft: rgba(217, 78, 31, 0.12);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.14);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.16);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.13);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.12);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.12);
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 6px 20px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 18px 42px rgba(28, 25, 23, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg: #0f1116;
  --bg-elevated: #171a22;
  --bg-subtle: #202531;
  --bg-hover: #252b38;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;
  --border: #2a303e;
  --border-strong: #394152;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-soft: rgba(249, 115, 22, 0.18);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.18);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.2);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.18);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.18);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  max-width: 100vw;
  overflow-x: hidden;
}

body.pos-app {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Role badges */
.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-role-admin {
  background: var(--purple-soft);
  color: var(--purple);
}

.badge-role-manager {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-role-cashier {
  background: var(--green-soft);
  color: var(--green);
}

.badge-role-staff {
  background: var(--amber-soft);
  color: var(--amber);
}

/* Buttons */
.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.2;
  user-select: none;
}

.pbtn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}

.pbtn:active {
  transform: translateY(1px);
}

.pbtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.pbtn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.pbtn-success {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.pbtn-success:hover {
  filter: brightness(0.92);
  color: #fff;
}

.pbtn-warning {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}

.pbtn-warning:hover {
  filter: brightness(0.92);
  color: #fff;
}

.pbtn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.pbtn-danger:hover {
  filter: brightness(0.92);
  color: #fff;
}

.pbtn-ghost {
  background: transparent;
  border-color: transparent;
}

.pbtn-ghost:hover {
  background: var(--bg-subtle);
  border-color: transparent;
}

.pbtn-sm {
  padding: 6px 10px;
  font-size: 12.5px;
}

.pbtn-lg {
  padding: 12px 18px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.pbtn-block {
  width: 100%;
}

/* Inputs */
.pinput,
.pselect,
.ptextarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pinput:focus,
.pselect:focus,
.ptextarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Toast notifications */
.pos-toast-box {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.pos-toast {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  max-width: 340px;
}

.pos-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.pos-toast-success {
  border-left-color: var(--green);
}

.pos-toast-error {
  border-left-color: var(--red);
}

.pos-toast-warning {
  border-left-color: var(--amber);
}

/* ==========================================================================
   1. Modern Login Page (index.php & admin/login.php)
   ========================================================================== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, var(--accent-soft), transparent 42%),
    radial-gradient(circle at 88% 82%, var(--amber-soft), transparent 44%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 32px 30px;
  position: relative;
}

.login-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  background: #fff;
  margin-bottom: 12px;
}

.login-title {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.login-subtitle {
  margin: 4px 0 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

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

.login-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.login-error {
  display: none;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.login-role-hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

/* ==========================================================================
   2. Unified Cafe & BBQ POS Workspace (order.php)
   ========================================================================== */
.pos-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 60px;
  height: auto;
  width: 100%;
  max-width: 100%;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  gap: 8px 10px;
  box-shadow: var(--shadow-sm);
}

.pos-brand-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.pos-brand-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.pos-brand-logo {
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--border);
}

.pos-brand-name {
  font-size: 15.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-mode-switch {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.pos-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pos-mode-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.pos-top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.pos-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.pos-chip-open {
  background: var(--green-soft);
  border-color: transparent;
  color: var(--green);
  cursor: pointer;
}

.pos-chip-closed {
  background: var(--amber-soft);
  border-color: transparent;
  color: var(--amber);
  cursor: pointer;
}

.pos-workspace {
  display: grid;
  grid-template-columns: 1fr 410px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.pos-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
  gap: 12px;
}

.pos-right {
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Search & Category Bar */
.pos-menu-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pos-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pos-search-wrap {
  position: relative;
  flex: 1;
}

.pos-search-wrap input {
  padding-left: 36px;
}

.pos-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

.pos-cat-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.pos-cat-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-cat-pill:hover {
  border-color: var(--accent);
}

.pos-cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Product Grid */
.pos-grid-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
}

.pos-product-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.pos-product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pos-product-card:active {
  transform: scale(0.98);
}

.pos-product-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-subtle);
  overflow: hidden;
  position: relative;
}

.pos-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pos-product-type-tag {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(15, 17, 22, 0.72);
  color: #fff;
  backdrop-filter: blur(4px);
}

.pos-product-disc-tag {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  background: var(--red);
  color: #fff;
}

.pos-product-body {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.pos-product-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-product-prices {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding-top: 4px;
}

.pos-price-main {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

.pos-price-alt {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Floor Plan / Table Grid */
.pos-floor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.pos-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.pos-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot-avail {
  background: var(--green);
}

.dot-occ {
  background: var(--red);
}

.dot-billing {
  background: var(--amber);
}

.pos-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}

.pos-table-card {
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.pos-table-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pos-table-card.status-available {
  border-color: var(--green);
  background: var(--bg-elevated);
}

.pos-table-card.status-occupied {
  border-color: var(--red);
  background: var(--red-soft);
}

.pos-table-card.status-billing {
  border-color: #f59e0b;
  background: #fef3c7;
  animation: posBillCardPulse 1.35s ease-in-out infinite;
}

[data-theme="dark"] .pos-table-card.status-billing {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.22);
}

.pos-table-card.selected {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

@keyframes posBillCardPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.65);
    border-color: #f59e0b;
  }

  50% {
    box-shadow: 0 0 0 7px rgba(245, 158, 11, 0);
    border-color: #d97706;
  }
}

.pos-bill-flash-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.3px;
  background: #f59e0b;
  color: #111827;
  animation: posBillBlink 1.1s ease-in-out infinite;
}

@keyframes posBillBlink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.68;
    transform: scale(1.04);
  }
}

/* Quick-Switch Active Tables Bar (above Product Search Bar) */
.pos-active-tables-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  flex-shrink: 0;
}

.pos-active-tables-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  padding-right: 2px;
}

.pos-active-table-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1.5px solid var(--red);
  background: var(--red-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
  flex-shrink: 0;
}

.pos-active-table-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pos-active-table-pill.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pos-active-table-pill.is-billing {
  background: #fde68a;
  border-color: #d97706;
  color: #78350f;
  animation: posBillBlink 1.05s ease-in-out infinite, posBillCardPulse 1.35s ease-in-out infinite;
}

.pos-active-table-pill.is-billing.is-current {
  background: #f59e0b;
  border-color: #b45309;
  color: #111827;
}

.pos-active-table-pax {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

.pos-table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-table-name {
  font-size: 18px;
  font-weight: 800;
}

.pos-table-zone {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.pos-table-status-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-available .pos-table-status-label {
  color: var(--green);
}

.status-occupied .pos-table-status-label {
  color: var(--red);
}

.status-billing .pos-table-status-label {
  color: var(--amber);
}

.pos-table-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.pos-table-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Cart Panel */
.pos-cart-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-cart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pos-cart-order-title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.pos-cart-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-cart-empty {
  margin: auto;
  text-align: center;
  color: var(--text-soft);
  padding: 24px;
}

.pos-cart-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-cart-row.is-void {
  opacity: 0.55;
}

.pos-cart-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.pos-cart-item-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.pos-cart-item-mod {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

.pos-cart-item-amt {
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}

.pos-cart-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pos-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.pos-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.pos-qty-btn:hover {
  background: var(--accent);
  color: #fff;
}

.pos-qty-val {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.pos-kstatus-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}

.ks-pending {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.ks-preparing {
  background: var(--amber-soft);
  color: var(--amber);
}

.ks-ready {
  background: var(--green-soft);
  color: var(--green);
}

.ks-served {
  background: var(--blue-soft);
  color: var(--blue);
}

.pos-cart-summary {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-sum-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.pos-sum-grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px dashed var(--border-strong);
}

.pos-sum-grand-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.pos-sum-grand-vals {
  text-align: right;
}

.pos-sum-grand-main {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
}

.pos-sum-grand-alt {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.pos-cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

/* ==========================================================================
   3. Custom Lightweight Modals (Zero Bootstrap jQuery version clashes)
   ========================================================================== */
.pmodal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 17, 22, 0.62);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pmodal-backdrop.open {
  display: flex;
}

.pmodal {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pmodal-lg {
  max-width: 680px;
}

.pmodal-sm {
  max-width: 390px;
}

.pmodal-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pmodal-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
}

.pmodal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.pmodal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pmodal-footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg);
}

/* Modifier Chips */
.mod-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mod-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mod-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.mod-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Quick Cash & PIN Keypads */
.cash-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.cash-btn {
  padding: 10px 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.cash-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.pay-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.pay-method-card {
  padding: 10px 8px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pay-method-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.change-banner {
  background: var(--green-soft);
  border: 1.5px solid var(--green);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.change-banner.insufficient {
  background: var(--red-soft);
  border-color: var(--red);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 12px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 260px;
  margin: 0 auto;
}

.pin-key {
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}

.pin-key:hover {
  background: var(--bg-subtle);
}

/* ==========================================================================
   4. Customer Dual Monitor (duamonitor.php)
   ========================================================================== */
.dual-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.dual-media {
  position: relative;
  background: #111318;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  overflow: hidden;
}

.dual-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.dual-slide-img.active {
  opacity: 1;
}

.dual-media-overlay {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(15, 17, 22, 0.75), rgba(15, 17, 22, 0.2) 45%, rgba(15, 17, 22, 0.85));
  position: absolute;
  inset: 0;
}

.dual-media-content {
  position: relative;
  z-index: 3;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.dual-khqr-panel {
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  border-radius: 18px;
  padding: 18px;
  max-width: 310px;
  align-self: center;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.dual-khqr-panel img {
  width: 220px;
  max-width: 100%;
  border-radius: 10px;
}

/* Dynamic KHQR Branded Card (POS Checkout Modal & Dual Customer Display) */
.khqr-card-frame {
  max-width: 270px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  text-align: center;
}
.khqr-card-banner {
  background: #e1232e;
  color: #ffffff;
  padding: 9px 14px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 2.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.khqr-card-inner {
  padding: 12px 16px 14px;
}
.khqr-card-merchant {
  font-size: 13.5px;
  font-weight: 800;
  color: #111827;
  line-height: 1.25;
}
.khqr-card-amount {
  font-size: 22px;
  font-weight: 900;
  color: #e1232e;
  margin-top: 2px;
  line-height: 1.15;
}
.khqr-card-alt {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 6px;
}
.khqr-card-svg-wrap {
  background: #ffffff;
  padding: 4px;
  border-radius: 10px;
  display: inline-block;
}
.khqr-card-svg-wrap svg.khqr-svg {
  width: 196px;
  height: 196px;
  max-width: 100%;
  display: block;
}
.khqr-poll-status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}
.khqr-poll-status.waiting {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.khqr-poll-status.paid {
  background: rgba(22, 163, 74, 0.16);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.45);
}
.khqr-poll-status.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.khqr-poll-status.err {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.45);
}
.khqr-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: khqrPulse 1.2s ease-in-out infinite;
}
@keyframes khqrPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.75); }
}

.dual-cart {
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   5. Modern Admin & Manager Dashboard Theme + Responsive Mobile Layout
   ========================================================================== */
html:has(body.admin-modern),
body.admin-modern {
  max-width: 100vw;
  overflow-x: hidden;
}

body.admin-modern {
  font-family: var(--font-sans) !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 85px;
}

html[lang="km"] body.admin-modern {
  line-height: 1.6;
}

body.admin-modern #wrapper {
  background: var(--bg);
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fix legacy sb-admin-2 .alert { display:none } hiding Bootstrap alerts */
body.admin-modern .alert {
  display: block;
  line-height: 1.5;
  word-break: break-word;
}

/* Sticky Modern Top Header Bar */
body.admin-modern .admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  background: var(--bg-elevated) !important;
  box-shadow: var(--shadow-sm);
  min-height: 56px;
}

body.admin-modern .admin-topbar-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  min-height: 56px;
  width: 100%;
}

body.admin-modern .admin-topbar-brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  min-width: 0;
  flex: 1 1 auto;
}

body.admin-modern .admin-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.admin-modern .admin-menu-toggle:hover,
body.admin-modern .admin-menu-toggle:focus {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

body.admin-modern .admin-nav-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  padding: 6px 0 !important;
  margin: 0 !important;
  height: auto !important;
  float: none !important;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text) !important;
  text-decoration: none !important;
  min-width: 0;
  max-width: 100%;
}

body.admin-modern .admin-nav-brand img {
  height: 30px;
  width: 30px;
  min-width: 30px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #ffffff;
  flex-shrink: 0;
}

body.admin-modern .admin-brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  min-width: 0;
}

body.admin-modern .admin-topbar-quick,
body.admin-modern .admin-topbar-util {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

body.admin-modern .admin-tb-btn {
  padding: 6px 11px !important;
  min-height: 34px;
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}

body.admin-modern .admin-tb-role {
  flex-shrink: 0;
  line-height: 1.35;
}

body.admin-modern .admin-lang-dropdown {
  position: relative;
}

body.admin-modern .dropdown-menu {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  z-index: 1060;
}

body.admin-modern .dropdown-menu > li > a {
  color: var(--text);
  padding: 8px 14px;
  line-height: 1.5;
}

body.admin-modern .dropdown-menu > li > a:hover,
body.admin-modern .dropdown-menu > li > a:focus {
  background: var(--bg-subtle);
  color: var(--accent);
}

body.admin-modern .dropdown-menu .divider {
  background-color: var(--border);
}

body.admin-modern .navbar-default {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
}

/* Sidebar Navigation (Desktop Fixed >= 992px, Off-Canvas Drawer < 992px) */
body.admin-modern .admin-sidebar {
  background: var(--bg-elevated) !important;
  border-right: 1px solid var(--border) !important;
}

body.admin-modern .admin-sidebar ul li {
  border-bottom: 1px solid var(--border) !important;
}

body.admin-modern .admin-sidebar ul li a {
  color: var(--text-muted) !important;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  word-break: break-word;
  transition: background 0.15s ease, color 0.15s ease;
}

body.admin-modern .admin-sidebar ul li a i.fa {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

body.admin-modern .admin-sidebar ul li a:hover,
body.admin-modern .admin-sidebar ul li a.active {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

body.admin-modern .admin-sidebar-drawer-header {
  display: none;
}

body.admin-modern .admin-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

body.admin-modern .admin-drawer-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #ffffff;
  flex-shrink: 0;
}

body.admin-modern .admin-drawer-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

body.admin-modern .admin-drawer-brand-text strong {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-modern .admin-drawer-brand-text small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-modern .admin-sidebar-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

body.admin-modern .admin-sidebar-close:hover {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}

body.admin-modern .admin-sidebar-backdrop {
  display: none;
}

/* Desktop Sidebar + Content Geometry (>= 992px) */
@media (min-width: 992px) {
  body.admin-modern .admin-sidebar {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 250px !important;
    margin-top: 0 !important;
    z-index: 1010 !important;
    overflow-y: auto;
    transform: none !important;
    box-shadow: none !important;
  }

  body.admin-modern .admin-sidebar-scroll {
    display: block !important;
    height: auto !important;
    visibility: visible !important;
  }

  body.admin-modern #page-wrapper {
    margin: 0 0 0 250px !important;
    padding: 0 24px 36px !important;
    border-left: 1px solid var(--border) !important;
    min-height: calc(100vh - 104px);
  }

  body.admin-modern .admin-footer {
    margin-left: 250px !important;
  }
}

/* Off-Canvas Mobile & Tablet Drawer (< 992px) */
@media (max-width: 991px) {
  body.admin-modern .admin-menu-toggle {
    display: inline-flex !important;
  }

  body.admin-modern #page-wrapper {
    margin: 0 !important;
    padding: 0 16px 28px !important;
    border-left: none !important;
    width: 100% !important;
    min-width: 0;
  }

  body.admin-modern .admin-footer {
    margin-left: 0 !important;
    padding: 14px 16px !important;
  }

  body.admin-modern .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    margin: 0 !important;
    z-index: 1035 !important;
    display: flex !important;
    flex-direction: column;
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    box-shadow: none;
  }

  body.admin-modern.admin-sidebar-open {
    overflow: hidden !important;
  }

  body.admin-modern.admin-sidebar-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.34);
  }

  body.admin-modern .admin-sidebar-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    flex-shrink: 0;
  }

  body.admin-modern .admin-sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: block !important;
    height: auto !important;
    visibility: visible !important;
    padding-bottom: 24px;
  }

  body.admin-modern .admin-sidebar ul li a {
    padding: 12px 16px;
    min-height: 44px;
  }

  body.admin-modern .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(15, 17, 22, 0.56);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }

  body.admin-modern.admin-sidebar-open .admin-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.admin-modern .admin-topbar-bar {
    padding: 0 12px;
    gap: 6px;
  }

  body.admin-modern .admin-tb-btn {
    padding: 6px 9px !important;
    font-size: 12px;
  }
}

/* Main Content Surfaces, Panels, Tables, Forms & Modals */
body.admin-modern #page-wrapper {
  background: var(--bg) !important;
  border-left-color: var(--border) !important;
  min-width: 0;
}

body.admin-modern .admin-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  background: var(--bg);
}

body.admin-modern .page-header {
  border-bottom-color: var(--border) !important;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
  margin-top: 20px;
  margin-bottom: 18px;
}

body.admin-modern .panel {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: visible;
}

body.admin-modern .panel > .panel-heading {
  border-top-left-radius: calc(var(--radius-md) - 1px);
  border-top-right-radius: calc(var(--radius-md) - 1px);
  line-height: 1.5;
  word-break: break-word;
}

body.admin-modern .panel > .panel-heading::after {
  content: "";
  display: table;
  clear: both;
}

body.admin-modern .panel > .panel-footer {
  border-bottom-left-radius: calc(var(--radius-md) - 1px);
  border-bottom-right-radius: calc(var(--radius-md) - 1px);
}

body.admin-modern .panel-default > .panel-heading {
  background: var(--bg-subtle) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
  font-weight: 700;
}

body.admin-modern label {
  line-height: 1.5;
  word-break: break-word;
}

/* Global Responsive Table Wrapper (Admin, Manager & Cashier POS) */
.table-responsive,
body.admin-modern .table-responsive,
body.pos-app .table-responsive {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: none !important;
  margin-bottom: 0;
}

.table-responsive.pos-dt-outer-unclip {
  overflow-x: visible !important;
}

.table-responsive.pos-dt-scroll-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 6px 0;
}

body.admin-modern .panel,
body.admin-modern .panel-body,
body.admin-modern .dataTables_wrapper,
body.admin-modern .dataTables_wrapper > .row,
body.admin-modern .dataTables_wrapper [class*="col-"] {
  min-width: 0;
  max-width: 100%;
}

body.admin-modern .table {
  color: var(--text);
  margin-bottom: 0;
}

body.admin-modern .table-bordered,
body.admin-modern .table-bordered > thead > tr > th,
body.admin-modern .table-bordered > tbody > tr > td,
body.admin-modern .table-bordered > tfoot > tr > td {
  border-color: var(--border) !important;
}

body.admin-modern .table > thead > tr > th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border) !important;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.5;
}

body.admin-modern .table > tbody > tr > td {
  border-top-color: var(--border) !important;
  vertical-align: middle;
  line-height: 1.5;
}

body.admin-modern .table td .btn,
body.admin-modern .table td .btn-group,
body.admin-modern .table td .label,
body.admin-modern .table td .badge-role,
body.admin-modern .table td.admin-actions-cell {
  white-space: nowrap;
}

body.admin-modern .table > tbody > tr > td:has(> .btn),
body.admin-modern .table > tbody > tr > td:has(> a.btn) {
  white-space: nowrap;
}

body.admin-modern .table img {
  max-width: 180px;
  height: auto;
  border-radius: 6px;
}

body.admin-modern .table-striped > tbody > tr:nth-of-type(odd) {
  background: var(--bg-hover) !important;
}

body.admin-modern .table-hover > tbody > tr:hover {
  background: var(--accent-soft) !important;
}

body.admin-modern .form-control {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  line-height: 1.5;
  height: auto;
  min-height: 36px;
}

body.admin-modern .form-control.input-sm {
  min-height: 32px;
  height: auto;
}

body.admin-modern input[type="file"].form-control {
  padding: 6px 10px;
  height: auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-modern .form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

body.admin-modern .modal-dialog {
  max-width: 95vw;
}

body.admin-modern .modal-content {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

body.admin-modern .modal-header,
body.admin-modern .modal-footer {
  border-color: var(--border) !important;
}

body.admin-modern .modal-header .close {
  color: var(--text);
  opacity: 0.75;
  text-shadow: none;
}

body.admin-modern .modal-title {
  line-height: 1.45;
  word-break: break-word;
  padding-right: 26px;
}

body.admin-modern .modal-body {
  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.admin-modern .btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

body.admin-modern .btn-default {
  background: var(--bg-subtle) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

body.admin-modern .stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

body.admin-modern .stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1.5;
  word-break: break-word;
}

body.admin-modern .stat-value {
  font-size: 24px;
  font-weight: 900;
  margin-top: 4px;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

body.admin-modern .ui-datepicker {
  z-index: 1065 !important;
}

/* Shared helper classes for admin responsive panels & forms */
body.admin-modern .admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

body.admin-modern .admin-page-head h2,
body.admin-modern .admin-page-head h3 {
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
}

body.admin-modern .admin-page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.admin-modern .admin-panel-head-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

body.admin-modern .admin-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

body.admin-modern .admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ==========================================================================
   5b. Admin Mobile Breakpoints (< 768px and < 480px)
   ========================================================================== */
@media (max-width: 767px) {
  /* Compact 2-tier Mobile Top Bar (Zero Overlap / Zero Broken Wrapping) */
  body.admin-modern .admin-topbar-bar {
    flex-wrap: wrap;
    padding: 0;
    gap: 0;
    min-height: 0;
  }

  body.admin-modern .admin-topbar-brand-group {
    order: 1;
    flex: 1 1 0%;
    min-width: 0;
    padding: 6px 8px 6px 10px;
    min-height: 52px;
  }

  body.admin-modern .admin-topbar-util {
    order: 2;
    flex: 0 0 auto;
    padding: 6px 10px 6px 4px;
    min-height: 52px;
    gap: 5px;
  }

  body.admin-modern .admin-topbar-quick {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    padding: 6px 10px;
    gap: 6px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  body.admin-modern .admin-topbar-quick::-webkit-scrollbar {
    display: none;
  }

  body.admin-modern .admin-topbar-quick .admin-tb-role {
    margin-left: auto;
  }

  body.admin-modern .admin-nav-brand {
    font-size: 14.5px;
    gap: 7px;
  }

  body.admin-modern .admin-nav-brand img {
    height: 28px;
    width: 28px;
    min-width: 28px;
  }

  body.admin-modern .admin-tb-btn {
    min-height: 36px;
    padding: 6px 10px !important;
    font-size: 12.5px;
  }

  body.admin-modern .admin-topbar-quick .admin-tb-btn {
    min-height: 32px;
    padding: 5px 10px !important;
    font-size: 12px;
  }

  /* Page Wrapper & Card Padding (85px bottom clearance for mobile browser bars) */
  body.admin-modern #page-wrapper {
    padding: 0 12px 85px !important;
  }

  body.admin-modern .admin-footer {
    padding: 12px !important;
  }

  body.admin-modern .page-header {
    font-size: 19px;
    margin: 14px 0 14px;
    padding-bottom: 8px;
  }

  body.admin-modern .admin-page-head {
    flex-direction: column;
    align-items: stretch;
    padding-top: 12px;
    margin-bottom: 14px;
  }

  body.admin-modern .admin-page-head h2 {
    font-size: 19px;
  }

  body.admin-modern .admin-page-head-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  body.admin-modern .admin-page-head-actions > .btn,
  body.admin-modern .admin-page-head-actions > a.btn,
  body.admin-modern .admin-page-head-actions > label,
  body.admin-modern .dbm-tier-card .btn {
    width: 100%;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    padding: 9px 14px;
  }

  /* Single-Column Card, KPI, Settings & Danger Zone Grids */
  body.admin-modern .dbm-kpis,
  body.admin-modern .dbm-danger-grid,
  body.admin-modern .khqr-grid,
  body.admin-modern .admin-mode-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body.admin-modern .dbm-kpi,
  body.admin-modern .dbm-tier-card,
  body.admin-modern .khqr-card,
  body.admin-modern .stat-card {
    padding: 14px !important;
    margin-bottom: 12px;
  }

  body.admin-modern .panel-heading {
    padding: 12px 14px;
  }

  body.admin-modern .panel-body {
    padding: 14px;
  }

  body.admin-modern .panel-body.admin-table-flush {
    padding: 0 !important;
  }

  body.admin-modern .panel-heading .pull-right,
  body.admin-modern .panel-heading .btn-group.pull-right {
    float: none !important;
    margin-top: 10px !important;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.admin-modern .panel-heading .btn,
  body.admin-modern .panel-heading .btn-group > .btn {
    flex: 1 1 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: normal;
    line-height: 1.4;
  }

  body.admin-modern .admin-panel-head-flex {
    flex-direction: column;
    align-items: stretch;
  }

  body.admin-modern .admin-panel-head-flex .btn,
  body.admin-modern .admin-panel-head-flex form,
  body.admin-modern .admin-panel-head-flex select {
    width: 100%;
    min-height: 42px;
  }

  /* Full-Width Touch-Friendly Inputs, Selects, Uploaders & Action Buttons */
  body.admin-modern #page-wrapper .form-control,
  body.admin-modern #page-wrapper select.form-control,
  body.admin-modern #page-wrapper input[type="file"].form-control,
  body.admin-modern .modal-body .form-control {
    width: 100% !important;
    max-width: 100%;
    min-height: 42px;
    height: auto;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Keep inline selects inside data tables compact */
  body.admin-modern #page-wrapper table select.form-control {
    width: auto !important;
    min-width: 118px;
    min-height: 36px;
    padding: 5px 8px;
    font-size: 13px;
  }

  body.admin-modern #page-wrapper form.form-inline {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100%;
  }

  body.admin-modern #page-wrapper form.form-inline .form-group {
    width: 100%;
    margin: 0 !important;
  }

  body.admin-modern #page-wrapper form.form-inline .btn,
  body.admin-modern #page-wrapper form.form-inline input[type="submit"],
  body.admin-modern #page-wrapper form .btn:not(.btn-xs),
  body.admin-modern #page-wrapper form button[type="submit"]:not(.btn-xs),
  body.admin-modern #page-wrapper form input[type="submit"],
  body.admin-modern .admin-form-actions > .btn,
  body.admin-modern .admin-form-actions > a.btn {
    width: 100% !important;
    min-height: 42px;
    float: none !important;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    padding: 9px 14px;
  }

  /* Reset inline top padding helpers on stacked submit columns */
  body.admin-modern .admin-submit-col {
    padding-top: 4px !important;
  }

  /* Stack Bootstrap .input-group cleanly on phones */
  body.admin-modern #page-wrapper .input-group:not(.input-group-keep-inline) {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  body.admin-modern #page-wrapper .input-group:not(.input-group-keep-inline) .form-control {
    border-radius: var(--radius-sm) !important;
    float: none;
  }

  body.admin-modern #page-wrapper .input-group:not(.input-group-keep-inline) .input-group-btn {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  body.admin-modern #page-wrapper .input-group:not(.input-group-keep-inline) .input-group-btn > .btn {
    flex: 1 1 130px;
    min-height: 42px;
    margin-left: 0 !important;
    border-radius: var(--radius-sm) !important;
    white-space: normal;
  }

  body.admin-modern #page-wrapper .input-group.input-group-keep-inline {
    display: flex;
    align-items: stretch;
    width: 100%;
  }

  body.admin-modern #page-wrapper .input-group.input-group-keep-inline .form-control {
    flex: 1 1 auto;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  body.admin-modern #page-wrapper .input-group.input-group-keep-inline .input-group-btn {
    width: auto;
    display: flex;
  }

  body.admin-modern #page-wrapper .input-group.input-group-keep-inline .input-group-btn > .btn {
    width: 44px !important;
    min-height: 42px;
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }

  /* KHQR Card Actions & Meta Rows on Phones */
  body.admin-modern .khqr-meta-row {
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
  }

  body.admin-modern .khqr-meta-row > :last-child {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  body.admin-modern .khqr-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  body.admin-modern .khqr-actions > form {
    display: block !important;
    width: 100%;
  }

  body.admin-modern .khqr-actions .btn {
    width: 100% !important;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    padding: 7px 10px;
  }

  /* Danger Zone & Settings Toggle Card Headers */
  body.admin-modern .dbm-tier-card > div:first-child > div:first-child,
  body.admin-modern .admin-toggle-card {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body.admin-modern .admin-toggle-options {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.admin-modern .admin-toggle-options > label {
    flex: 1 1 130px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    text-align: center;
  }

  /* Campus QR Card Responsive Layout */
  body.admin-modern .admin-campus-qr-flex {
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px !important;
  }

  body.admin-modern .admin-campus-qr-box {
    margin: 0 auto;
  }

  body.admin-modern .admin-campus-qr-details {
    min-width: 0 !important;
    width: 100%;
  }

  /* Tables & DataTables on Mobile (< 768px): Touch Scroll + Crisp Non-Squashed Action Cells */
  body.admin-modern .table-responsive,
  body.pos-app .table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.admin-modern .table-responsive > table,
  body.pos-app .table-responsive > table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
    border-collapse: collapse;
  }

  body.admin-modern .table > thead > tr > th,
  body.admin-modern .table-responsive table th,
  body.pos-app .table-responsive table th {
    white-space: nowrap !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    line-height: 1.35;
  }

  body.admin-modern .table > tbody > tr > td,
  body.admin-modern .table-responsive table td,
  body.pos-app .table-responsive table td {
    padding: 8px 10px !important;
    font-size: 13px !important;
    line-height: 1.4;
    vertical-align: middle;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  body.admin-modern .table-responsive table td.pos-td-action,
  body.admin-modern .table-responsive table td.admin-actions-cell,
  body.admin-modern .table-responsive table td:has(> .btn),
  body.admin-modern .table-responsive table td:has(> a.btn),
  body.admin-modern .table-responsive table td:has(> a[onclick]),
  body.pos-app .table-responsive table td.pos-td-action,
  body.pos-app .table-responsive table td:has(> .btn),
  body.pos-app .table-responsive table td:has(> button) {
    white-space: nowrap !important;
  }

  body.admin-modern .table-responsive table td.pos-td-wrap,
  body.pos-app .table-responsive table td.pos-td-wrap {
    white-space: normal !important;
    min-width: 180px;
    max-width: 280px;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  body.admin-modern .table td a,
  body.pos-app .table-responsive table td a {
    white-space: nowrap;
  }

  body.admin-modern .table td .btn,
  body.admin-modern .table td .btn-xs,
  body.pos-app .table-responsive table td .btn,
  body.pos-app .table-responsive table td button {
    width: auto !important;
    min-height: 30px;
    padding: 4px 9px !important;
    margin: 2px 3px 2px 0;
    font-size: 12.5px !important;
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  body.admin-modern .dataTables_wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.admin-modern .dataTables_wrapper .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  body.admin-modern .dataTables_wrapper [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    float: none !important;
  }

  body.admin-modern .dataTables_wrapper .dataTables_length,
  body.admin-modern .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    width: 100%;
    margin-bottom: 10px;
  }

  body.admin-modern .dataTables_wrapper .dataTables_length label,
  body.admin-modern .dataTables_wrapper .dataTables_filter label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    font-weight: 600;
  }

  body.admin-modern .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
    min-height: 40px;
  }

  body.admin-modern .dataTables_wrapper .dataTables_length select {
    width: auto !important;
    min-width: 72px;
    min-height: 38px;
  }

  body.admin-modern .dataTables_wrapper > .row:nth-child(2) > [class*="col-"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.admin-modern .dataTables_wrapper .dataTables_paginate {
    text-align: center !important;
    margin-top: 8px;
  }

  body.admin-modern .dataTables_wrapper .pagination {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
  }

  /* Sales Report Filter Dropdown Fit Viewport */
  body.admin-modern .admin-adv-dropdown {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 14px !important;
    left: 0 !important;
    right: 0 !important;
  }

  /* Responsive Modals (<= 95vw with Scrollable Body) */
  body.admin-modern .modal-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 12px auto !important;
  }

  body.admin-modern .modal-content {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.admin-modern .modal-header,
  body.admin-modern .modal-footer {
    flex-shrink: 0;
    padding: 12px 14px;
  }

  body.admin-modern .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    padding: 14px;
  }

  body.admin-modern .modal-footer {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }

  body.admin-modern .modal-footer .btn {
    width: 100% !important;
    min-height: 42px;
    margin: 0 !important;
    white-space: normal;
    line-height: 1.4;
  }

  body.admin-modern .modal-body .form-horizontal .control-label {
    text-align: left !important;
    display: block;
    width: 100%;
    padding: 4px 0 4px 0;
    float: none;
  }

  body.admin-modern .modal-body .form-horizontal [class*="col-"] {
    width: 100%;
    float: none;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 6px;
  }

  body.admin-modern .modal-body button[type="submit"],
  body.admin-modern .modal-body input[type="submit"] {
    width: 100% !important;
    min-height: 42px;
  }

  body.admin-modern .modal-header .pull-right {
    float: none !important;
    margin: 8px 0 0 0 !important;
    display: block;
  }

  /* Dashboard Year Select Alignment */
  body.admin-modern .admin-year-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  body.admin-modern .admin-year-bar .pull-right {
    float: none !important;
    width: 100%;
  }
}

/* Extra-Small Phones (< 480px) */
@media (max-width: 479px) {
  body.admin-modern .admin-theme-label {
    display: none;
  }

  body.admin-modern .admin-theme-btn {
    min-width: 36px;
    padding: 6px 8px !important;
  }

  body.admin-modern .admin-nav-brand {
    font-size: 13.5px;
    gap: 6px;
  }

  body.admin-modern .admin-nav-brand img {
    width: 26px;
    height: 26px;
    min-width: 26px;
  }

  body.admin-modern .admin-menu-toggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 18px;
  }

  body.admin-modern .admin-topbar-quick {
    padding: 5px 8px;
    gap: 5px;
  }

  body.admin-modern .admin-topbar-quick .admin-tb-btn {
    padding: 5px 8px !important;
    font-size: 11.5px;
  }

  body.admin-modern .admin-topbar-quick .admin-tb-role {
    font-size: 11px;
    padding: 3px 8px;
  }

  body.admin-modern #page-wrapper {
    padding: 0 10px 85px !important;
  }

  body.admin-modern .panel-body {
    padding: 12px;
  }

  body.admin-modern .dbm-kpi,
  body.admin-modern .dbm-tier-card,
  body.admin-modern .khqr-card,
  body.admin-modern .stat-card {
    padding: 12px !important;
  }

  body.admin-modern .stat-value,
  body.admin-modern .dbm-kpi-val {
    font-size: 20px;
  }

  body.admin-modern .khqr-actions {
    grid-template-columns: 1fr;
  }

  body.admin-modern .table img {
    max-width: 110px;
  }

  /* Login Card Polish on Small Phones */
  .login-shell {
    padding: 12px;
  }

  .login-card {
    padding: 22px 16px;
    border-radius: 16px;
  }

  .login-title {
    font-size: 20px;
  }
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Mobile POS + Manager)
   ========================================================================== */
@media (max-width: 1024px) {
  .pos-workspace {
    grid-template-columns: 1fr 340px;
  }

  .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  }
}

@media (max-width: 991px) {
  .pos-topbar {
    height: auto !important;
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
  }

  .pos-brand-group {
    flex: 1 1 100%;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pos-brand-identity {
    flex: 1 1 auto;
    min-width: 0;
  }

  .pos-brand-name {
    display: block !important;
    font-size: 14.5px;
  }

  .pos-top-right {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 820px) {
  body.pos-app {
    padding-bottom: 85px !important;
  }

  .pos-workspace {
    grid-template-columns: 1fr;
    height: auto !important;
    min-height: calc(100vh - 110px);
    overflow: visible !important;
  }

  .pos-left {
    overflow: visible !important;
    padding: 10px;
    min-width: 0;
  }

  #viewTables,
  #viewMenu {
    height: auto !important;
    overflow: visible !important;
  }

  .pos-grid-scroll {
    overflow-y: visible;
    padding-right: 0;
  }

  .pos-right {
    border-left: none;
    border-top: 2px solid var(--border);
    height: auto !important;
    overflow: visible !important;
    min-width: 0;
  }

  .pos-cart-items {
    max-height: 46vh;
    overflow-y: auto;
  }

  .dual-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .cash-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .pos-topbar {
    padding: 8px 10px;
    gap: 8px;
  }

  .pos-brand-logo {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .pos-brand-name {
    display: block !important;
    font-size: 14px;
    max-width: 46vw;
  }

  .pos-mode-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .pos-top-right .pos-chip,
  .pos-top-right .pbtn {
    padding: 5px 9px;
    font-size: 12px;
    min-height: 32px;
    flex: 0 0 auto;
  }

  .pos-hide-xs {
    display: none !important;
  }

  .pos-search-row {
    flex-wrap: wrap;
  }

  .pos-search-wrap {
    min-width: 180px;
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .pos-cart-tools {
    flex-wrap: wrap;
    gap: 6px;
  }

  .pos-cart-actions {
    gap: 8px;
  }

  .pos-cart-actions .pbtn-lg {
    padding: 10px 10px;
    font-size: 13.5px;
  }

  .pmodal {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh;
    max-height: 92dvh;
  }

  .pmodal-header,
  .pmodal-body,
  .pmodal-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pos-toast-box {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .pos-toast {
    max-width: 100%;
  }

  .mgr-wrap {
    padding: 12px 10px 85px !important;
  }
}

/* ==========================================================================
   Dynamic Table QR Sessions & Live Guest Service Alerts
   ========================================================================== */
.pos-alert-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--amber-soft);
  border-bottom: 1px solid var(--amber);
  overflow-x: auto;
  flex-wrap: nowrap;
}

@media (min-width: 821px) {
  body.has-guest-alerts .pos-workspace {
    height: calc(100vh - 104px);
  }
}

.pos-alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: pointer;
  animation: posAlertPulse 1.6s ease-in-out infinite;
}

.pos-alert-chip.alert-call_waiter {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

.pos-alert-chip.alert-request_bill {
  background: #fee2e2;
  color: #991b1b;
  border-color: #ef4444;
}

.pos-alert-chip.alert-new_guest_order {
  background: #dbeafe;
  color: #1e40af;
  border-color: #3b82f6;
}

.pos-alert-chip.alert-item_rejected {
  background: #fee2e2;
  color: #991b1b;
  border-color: #dc2626;
}

.pos-alert-chip.alert-order_ready {
  background: #dcfce7;
  color: #166534;
  border-color: #16a34a;
}

.pos-alert-chip.alert-campus_order {
  background: #ffedd5;
  color: #9a3412;
  border-color: #ea580c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.22);
}

.pos-campus-accept-btn {
  border: none;
  background: #16a34a;
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
  margin-left: 4px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.32);
}

.pos-campus-accept-btn:hover {
  background: #15803d;
}

.pos-chip-campus-pending {
  background: #ea580c !important;
  color: #ffffff !important;
  border-color: #c2410c !important;
  animation: posAlertPulse 1.4s ease-in-out infinite;
}

.pos-alert-dismiss {
  border: none;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

@keyframes posAlertPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.025);
  }
}

.pos-qr-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
}

.pos-guest-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="dark"] .pos-guest-badge {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.pos-qr-preview-box {
  background: #ffffff;
  color: #000000;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  max-height: 56vh;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.pos-qr-preview-box .r80-sheet {
  margin: 0 auto;
  box-shadow: none;
  border: 1px dashed #cbd5e1;
}

/* ==========================================================================
   KDS Ticket Cards, Status Tabs, Rejected Banners & Sold Out Menu Overlays
   ========================================================================== */
.pos-kstatus-pill.ks-rejected {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
}

.pos-kstatus-pill.ks-served {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

[data-theme="dark"] .pos-kstatus-pill.ks-rejected {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.pos-reject-banner {
  background: #fef2f2;
  border: 1.5px solid #ef4444;
  color: #991b1b;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 10px;
}

[data-theme="dark"] .pos-reject-banner {
  background: rgba(239, 68, 68, 0.16);
  border-color: #ef4444;
  color: #fecaca;
}

.pos-product-card.is-sold-out {
  opacity: 0.62;
  position: relative;
}

.pos-product-card.is-sold-out .pos-product-img {
  filter: grayscale(85%);
}

.pos-soldout-ribbon {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pos-soldout-ribbon span {
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
}

.kds-status-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.kds-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kds-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.kds-tab-btn.tab-ready.active {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.kds-tab-btn.tab-served.active {
  background: #475569;
  border-color: #475569;
  color: #ffffff;
}

.kds-badge-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
}

.kds-badge-cnt.has-ready {
  background: #16a34a;
  color: #ffffff;
  animation: posAlertPulse 1.6s ease-in-out infinite;
}

.kds-tab-btn.active .kds-badge-cnt {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.kds-ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
  align-items: start;
}

.kds-ticket {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.kds-ticket.kt-active {
  border-color: var(--amber);
}

.kds-ticket.kt-urgent {
  border-color: var(--red);
}

.kds-ticket.kt-ready {
  border-color: var(--green);
}

.kds-ticket.kt-history {
  border-color: var(--border);
  opacity: 0.92;
}

.kds-ticket-head {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.kds-timer {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.kds-timer.warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

.kds-timer.late {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #ef4444;
  animation: posAlertPulse 1.4s ease-in-out infinite;
}

.kds-ticket-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kds-item-row {
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kds-item-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.kds-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.kds-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.kds-ticket-foot {
  padding: 9px 12px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

/* Collapsible Voided / Rejected Items Drawer inside Cashier Cart */
.pos-void-drawer {
  margin-top: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.pos-void-drawer>summary {
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.pos-void-drawer>summary::-webkit-details-marker {
  display: none;
}

.pos-void-drawer>summary::after {
  content: '▸';
  font-size: 12px;
  transition: transform 0.15s ease;
}

.pos-void-drawer[open]>summary::after {
  transform: rotate(90deg);
}

.pos-void-drawer-list {
  padding: 6px 10px 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-void-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.pos-toast-action-btn {
  border: none;
  border-radius: 7px;
  padding: 5px 10px;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.pos-toast-action-btn:hover {
  background: #f3f4f6;
}

.pos-alert-print-btn {
  border: none;
  border-radius: 999px;
  padding: 2px 8px;
  background: #1d4ed8;
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.pos-alert-print-btn:hover {
  background: #1e40af;
}


/* Active Shift -> Close Shift vs Open Shift Topbar Chip */
.pos-chip-closed {
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  color: #92400e;
  cursor: pointer;
  font-weight: 800;
}
[data-theme="dark"] .pos-chip-closed {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fcd34d;
}
.pos-chip-shift-close {
  background: #dcfce7;
  border: 1.5px solid #16a34a;
  color: #166534;
  cursor: pointer;
  font-weight: 800;
}
.pos-chip-shift-close:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}
[data-theme="dark"] .pos-chip-shift-close {
  background: rgba(22, 163, 74, 0.22);
  border-color: #22c55e;
  color: #86efac;
}
[data-theme="dark"] .pos-chip-shift-close:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}
