/* BoticaSys Global Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* HSL Color System */
  --hue-primary: 162; /* Emerald Green/Mint */
  --hue-secondary: 215; /* Clean Steel Blue */
  
  /* Light Theme Colors */
  --bg-primary: hsl(var(--hue-secondary), 30%, 96%);
  --bg-secondary: #ffffff;
  --bg-tertiary: hsl(var(--hue-secondary), 25%, 90%);
  
  --text-primary: hsl(var(--hue-secondary), 40%, 15%);
  --text-secondary: hsl(var(--hue-secondary), 20%, 45%);
  --text-light: hsl(var(--hue-secondary), 15%, 70%);
  
  --primary: hsl(var(--hue-primary), 80%, 38%);
  --primary-hover: hsl(var(--hue-primary), 85%, 30%);
  --primary-glow: hsla(var(--hue-primary), 80%, 38%, 0.15);
  
  --accent: hsl(199, 95%, 42%); /* Sky blue for secondary actions */
  
  --success: hsl(142, 70%, 45%);
  --warning: hsl(38, 92%, 50%);
  --danger: hsl(350, 80%, 55%);
  --info: hsl(200, 80%, 50%);
  
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.4);
  --border-color: hsl(var(--hue-secondary), 20%, 88%);
  --input-bg: hsl(var(--hue-secondary), 20%, 98%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-filter: blur(16px);
}

/* Dark Mode Overrides */
body.dark-mode {
  --bg-primary: hsl(var(--hue-secondary), 28%, 10%);
  --bg-secondary: hsl(var(--hue-secondary), 25%, 13%);
  --bg-tertiary: hsl(var(--hue-secondary), 25%, 8%);
  
  --text-primary: hsl(var(--hue-secondary), 20%, 93%);
  --text-secondary: hsl(var(--hue-secondary), 15%, 70%);
  --text-light: hsl(var(--hue-secondary), 10%, 45%);
  
  --primary: hsl(var(--hue-primary), 75%, 45%);
  --primary-hover: hsl(var(--hue-primary), 80%, 50%);
  --primary-glow: hsla(var(--hue-primary), 75%, 45%, 0.25);
  
  --card-bg: rgba(24, 33, 47, 0.75);
  --card-border: rgba(255, 255, 255, 0.06);
  --border-color: hsl(var(--hue-secondary), 20%, 20%);
  --input-bg: hsl(var(--hue-secondary), 20%, 18%);
  
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* CSS Reset & General Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* App Container Layout */
#app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  min-width: 0;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Sidebar Styling */
aside {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  padding-left: 0.5rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-name {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: var(--transition);
}

.menu-item a:hover {
  background-color: var(--input-bg);
  color: var(--primary);
  transform: translateX(4px);
}

.menu-item.active a {
  background-color: var(--primary-glow);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-profile-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--primary);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  max-width: 140px;
}

.user-info-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Main Content Area */
main {
  margin-left: 260px;
  flex-grow: 1;
  padding: 2rem 3rem;
  min-height: 100vh;
  position: relative;
  transition: var(--transition);
  min-width: 0;
}

/* Header Navbar */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.page-title h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tenant-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme Switcher Toggle */
.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--input-bg);
  color: var(--primary);
  transform: translateY(-2px);
}

/* Glassmorphic Cards */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: var(--glass-filter);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Metric Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-color, var(--primary));
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--accent-bg, var(--primary-glow));
  color: var(--accent-color, var(--primary));
}

/* Dashboard Charts & Lists Section */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.chart-card {
  min-height: 350px;
  display: flex;
  flex-direction: column;
}

.chart-container {
  position: relative;
  flex-grow: 1;
  height: 280px;
  width: 100%;
}

/* Lists and Tables styling */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.list-header h3 {
  font-weight: 700;
  font-size: 1.15rem;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-meta {
  display: flex;
  flex-direction: column;
}

.list-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.list-item-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.list-item-value {
  font-weight: 700;
  font-size: 0.95rem;
}

/* POS Point of Sale Terminal Layout */
#pos-terminal {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  height: calc(100vh - 160px);
}

.pos-main-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
}

.pos-search-bar {
  display: flex;
  gap: 1rem;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.pos-search-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
}

.pos-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 0.5rem;
}

.product-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.product-item-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.product-item-card.low-stock {
  border-left: 3px solid var(--warning);
}

.product-item-card.expired {
  border-left: 3px solid var(--danger);
  opacity: 0.6;
}

.product-lab {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
}

.product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
}

.product-generic {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.product-stock {
  font-size: 0.75rem;
  background: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* POS Sidebar Cart */
.pos-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.pos-sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-sidebar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  background: var(--bg-primary);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.cart-item-meta {
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 700;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-val {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-delete-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0 0.25rem;
}

.pos-sidebar-summary {
  padding: 1.25rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.summary-row.total {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.pos-checkout-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  transition: var(--transition);
  margin-top: 0.75rem;
}

.pos-checkout-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Modals & Forms */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-weight: 700;
  font-size: 1.2rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-doc {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.75rem;
}

/* Tables and Datatables Layout */
.datatable-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.datatable-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.datatable-search-wrapper {
  flex-grow: 1;
  max-width: 320px;
  width: 100%;
}

.datatable-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

th {
  background: var(--bg-tertiary);
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--input-bg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: hsl(350, 75%, 45%);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Alerts and Pills Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: hsla(142, 70%, 45%, 0.15);
  color: var(--success);
}

.badge-warning {
  background: hsla(38, 92%, 50%, 0.15);
  color: var(--warning);
}

.badge-danger {
  background: hsla(350, 80%, 55%, 0.15);
  color: var(--danger);
}

/* Expiry alerts details on inventory list */
.exp-alert {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.25rem;
}
.exp-alert.danger {
  color: var(--danger);
}
.exp-alert.warning {
  color: var(--warning);
}
.exp-alert.ok {
  color: var(--text-light);
}

/* Toast Messages */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  color: var(--text-primary);
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Thermal Printer Receipt Layout */
.receipt-wrapper {
  background: #ffffff;
  color: #000000;
  padding: 20px;
  width: 80mm;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.3;
  margin: 0 auto;
  border: 1px solid #ddd;
  box-sizing: border-box;
}

.receipt-header {
  text-align: center;
  margin-bottom: 15px;
}

.receipt-title {
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
}

.receipt-divider {
  border-top: 1px dashed #000;
  margin: 10px 0;
}

.receipt-details-table {
  width: 100%;
  margin: 10px 0;
}

.receipt-details-table td {
  padding: 3px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
}

.receipt-totals {
  text-align: right;
  margin-top: 10px;
}

.receipt-totals td {
  text-align: right;
}

.receipt-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
}

/* El ticket se imprime en ventana dedicada — ver app.js printWin */

/* Mobile & Tablet Responsive Elements styling */
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none; /* Hidden on desktop */
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.mobile-menu-btn:hover {
  background: var(--input-bg);
  color: var(--primary);
  transform: translateY(-1px);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.pos-mobile-tabs {
  display: none; /* Hidden on desktop/tablet */
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.pos-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.pos-tab-btn.active {
  background: var(--primary-glow);
  color: var(--primary);
}

.pos-cart-badge {
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
  transition: transform 0.15s ease;
}

/* Tablet Responsiveness */
@media (max-width: 1024px) {
  aside {
    width: 80px;
    padding: 1.5rem 0.5rem;
    align-items: center;
  }
  .brand-name, .user-info-text, .menu-item-text {
    display: none;
  }
  main {
    margin-left: 80px;
    padding: 2rem 1.5rem;
  }
  #pos-terminal {
    grid-template-columns: 1fr 320px;
    height: calc(100vh - 160px);
  }
  .dashboard-grid,
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex; /* Show hamburger menu */
  }

  aside {
    transform: translateX(-100%);
    width: 260px; /* Expand aside back to full width for mobile overlay */
    height: 100vh;
    padding: 2rem 1.5rem;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
  }

  aside.open {
    transform: translateX(0);
  }

  .brand-name, .user-info-text, .menu-item-text {
    display: block; /* Show description texts again inside active overlay */
  }

  main {
    margin-left: 0;
    padding: 1rem 0.75rem;
    min-width: 0;
  }

  th, td {
    padding: 0.75rem 0.6rem !important;
    font-size: 0.85rem;
  }

  .datatable-actions {
    gap: 0.4rem;
  }

  td button.btn-sm {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.75rem !important;
  }

  .card {
    padding: 1rem;
  }

  /* Responsive Table Column Hiding */
  .col-hide-tablet {
    display: none !important;
  }

  /* POS Responsiveness under 768px */
  .pos-mobile-tabs {
    display: flex;
  }

  #pos-terminal {
    grid-template-columns: 1fr;
    height: auto;
  }

  #pos-catalog-panel, #pos-cart-panel {
    width: 100%;
  }

  /* Show/Hide active tab in POS terminal */
  #pos-terminal.active-tab-catalog #pos-catalog-panel {
    display: flex !important;
  }
  #pos-terminal.active-tab-catalog #pos-cart-panel {
    display: none !important;
  }

  #pos-terminal.active-tab-cart #pos-catalog-panel {
    display: none !important;
  }
  #pos-terminal.active-tab-cart #pos-cart-panel {
    display: flex !important;
  }

  /* Dashboard Adjustments */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  /* Datatables header adjustments */
  .datatable-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }

  .datatable-search-wrapper,
  .datatable-actions {
    max-width: 100%;
    width: 100%;
  }

  .datatable-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .datatable-actions .btn {
    width: 100%;
  }

  /* Modal Layout */
  .modal-content {
    width: 95%;
  }
  .modal-body {
    padding: 1.25rem;
    max-height: 70vh;
  }

  /* Header Layout Restructuring */
  header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
  }
  
  .header-left {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .header-actions {
    display: contents;
  }
  
  .tenant-badge {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
  }
  
  .theme-toggle-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .page-title h1 {
    font-size: 1.4rem;
  }
  .page-title p {
    font-size: 0.85rem;
  }
}

/* POS usability corrections: keep checkout visible and catalog compact */
#view-pos {
  min-height: 0;
}

#view-pos #pos-terminal {
  height: clamp(560px, calc(100dvh - 330px), 720px);
  min-height: 0;
  align-items: stretch;
}

#view-pos .pos-main-panel,
#view-pos .pos-sidebar {
  min-height: 0;
}

#view-pos .pos-catalog-grid {
  align-content: start;
  align-items: start;
  grid-auto-rows: minmax(150px, auto);
  min-height: 0;
}

#view-pos .product-item-card {
  min-height: 150px;
  height: auto;
  align-self: start;
  padding: 0.95rem;
}

#view-pos .product-name {
  height: auto;
  min-height: 2.35rem;
}

#view-pos .product-generic {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#view-pos .pos-sidebar {
  display: grid;
  grid-template-rows: auto minmax(92px, 1fr) auto;
}

#view-pos .cart-items-container {
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem;
}

#view-pos #cart-empty-msg {
  margin: auto !important;
  padding: 1.25rem 0;
}

#view-pos .pos-sidebar-header {
  min-height: 72px;
  padding: 1rem 1.1rem;
}

#view-pos .pos-sidebar-summary {
  flex-shrink: 0;
  gap: 0.35rem;
  padding: 0.95rem 1.1rem 1.05rem;
  border-top: 1px solid var(--border-color);
}

#view-pos .summary-row {
  line-height: 1.2;
}

#view-pos .summary-row.total {
  margin-top: 0.1rem;
  padding-top: 0.55rem;
  font-size: 1.35rem;
}

#view-pos .pos-sidebar-summary .form-group {
  margin-top: 0.25rem !important;
  margin-bottom: 0 !important;
  gap: 0.2rem;
}

#view-pos .pos-sidebar-summary label {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

#view-pos .pos-sidebar-summary .form-control {
  min-height: 38px;
  padding: 0.48rem 0.7rem !important;
}

#view-pos #pos-discount-input {
  min-height: 34px;
}

#view-pos .pos-checkout-btn {
  min-height: 46px;
  margin-top: 0.45rem;
  padding: 0.72rem;
}

#view-pos .cart-item {
  align-items: center;
  padding: 0.65rem;
}

#view-pos .cart-item-actions {
  gap: 0.35rem;
}

#view-pos .cart-qty-btn {
  width: 30px;
  height: 30px;
}

@media (min-width: 1440px) {
  #view-pos #pos-terminal {
    height: clamp(600px, calc(100dvh - 325px), 760px);
  }
}

@media (max-width: 1180px) {
  #view-pos #pos-terminal {
    height: clamp(560px, calc(100dvh - 360px), 690px);
  }
}

@media (max-width: 768px) {
  #view-pos #pos-terminal {
    height: auto;
  }

  #view-pos .pos-sidebar {
    min-height: 70dvh;
    max-height: none;
  }

  #view-pos .cart-items-container {
    min-height: 180px;
    max-height: 38dvh;
  }
}

/* Mobile Extra Small Responsiveness */
@media (max-width: 576px) {
  .col-hide-mobile {
    display: none !important;
  }

  th, td {
    padding: 0.5rem 0.35rem !important;
    font-size: 0.8rem;
  }

  /* Grid Forms stack automatically */
  #app-layout form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .form-row,
  .form-row-doc {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .datatable-actions.grid-2col-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .datatable-actions.grid-2col-mobile .btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .tenant-badge {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Professional visual refresh */
:root {
  --hue-primary: 168;
  --hue-secondary: 219;
  --bg-primary: #eef5f3;
  --bg-secondary: #fbfdfc;
  --bg-tertiary: #e7efec;
  --surface-muted: #f4f8f7;
  --text-primary: #0c1f1d;
  --text-secondary: #53645f;
  --text-light: #8a9893;
  --primary: #047867;
  --primary-hover: #035f52;
  --primary-glow: rgba(4, 120, 103, 0.14);
  --accent: #2563eb;
  --success: #0f9f6e;
  --warning: #c87905;
  --danger: #d7384d;
  --info: #1769d1;
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(15, 31, 29, 0.08);
  --border-color: rgba(28, 51, 48, 0.12);
  --input-bg: #f8fbfa;
  --shadow-sm: 0 1px 2px rgba(12, 31, 29, 0.05), 0 8px 22px rgba(12, 31, 29, 0.05);
  --shadow-md: 0 1px 2px rgba(12, 31, 29, 0.06), 0 18px 42px rgba(12, 31, 29, 0.08);
  --shadow-lg: 0 22px 60px rgba(12, 31, 29, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

body.dark-mode {
  --bg-primary: #0d1517;
  --bg-secondary: #121d20;
  --bg-tertiary: #172527;
  --surface-muted: #10191b;
  --text-primary: #eef7f5;
  --text-secondary: #a5b8b3;
  --text-light: #728681;
  --primary: #2dd4bf;
  --primary-hover: #5eead4;
  --primary-glow: rgba(45, 212, 191, 0.16);
  --accent: #7dd3fc;
  --card-bg: rgba(18, 29, 32, 0.9);
  --card-border: rgba(255, 255, 255, 0.08);
  --border-color: rgba(218, 245, 240, 0.12);
  --input-bg: #0d1719;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(4, 120, 103, 0.11), transparent 27rem),
    linear-gradient(180deg, var(--bg-primary), var(--surface-muted));
  letter-spacing: 0;
}

body.dark-mode {
  background:
    radial-gradient(circle at 16% 0%, rgba(45, 212, 191, 0.12), transparent 24rem),
    linear-gradient(180deg, var(--bg-primary), #091012);
}

aside {
  width: 284px;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, rgba(251, 253, 252, 0.98), rgba(242, 248, 246, 0.96));
  border-right: 1px solid var(--border-color);
  box-shadow: 16px 0 44px rgba(12, 31, 29, 0.06);
}

body.dark-mode aside {
  background:
    linear-gradient(180deg, rgba(18, 29, 32, 0.98), rgba(13, 21, 23, 0.98));
}

.brand {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.8rem;
  margin-bottom: 1.3rem;
  box-shadow: var(--shadow-sm);
}

.brand-icon,
.login-logo {
  background:
    linear-gradient(135deg, var(--primary), #0f9f6e 48%, var(--accent));
  border-radius: 12px;
  box-shadow: 0 16px 28px var(--primary-glow);
}

.brand-name {
  font-size: 1.18rem;
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text-primary);
}

.menu-list {
  gap: 0.25rem;
  padding: 0.35rem 0.1rem;
  overflow-y: auto;
}

.menu-item a {
  min-height: 44px;
  padding: 0.62rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 10px;
  gap: 0.72rem;
}

.menu-item-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--surface-muted);
  font-size: 0.95rem;
}

.menu-item a:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  transform: none;
  box-shadow: var(--shadow-sm);
}

.menu-item.active a {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 26px var(--primary-glow);
}

.menu-item.active .menu-item-icon {
  background: rgba(255, 255, 255, 0.18);
}

.sidebar-footer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.85rem;
}

.avatar {
  border-radius: 11px;
  background: var(--primary-glow);
}

main {
  margin-left: 284px;
  padding: 1.65rem clamp(1.25rem, 3vw, 2.7rem);
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: -1.65rem calc(clamp(1.25rem, 3vw, 2.7rem) * -1) 1.55rem;
  padding: 1.1rem clamp(1.25rem, 3vw, 2.7rem);
  background: rgba(238, 245, 243, 0.82);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(18px);
}

body.dark-mode header {
  background: rgba(13, 21, 23, 0.82);
}

.page-title h1 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  letter-spacing: -0.035em;
}

.page-title p {
  max-width: 72ch;
}

.tenant-badge,
.theme-toggle-btn,
.mobile-menu-btn {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.tenant-badge {
  color: var(--text-primary);
}

.card,
.datatable-wrapper,
.pos-sidebar,
.pos-search-bar,
.product-item-card,
.modal-content,
.login-card {
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card:hover,
.product-item-card:hover {
  box-shadow: var(--shadow-md);
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.stat-card {
  min-height: 128px;
  padding: 1.1rem;
  background:
    linear-gradient(135deg, var(--card-bg), rgba(255, 255, 255, 0.7));
}

body.dark-mode .stat-card {
  background:
    linear-gradient(135deg, var(--card-bg), rgba(23, 37, 39, 0.7));
}

.stat-card::before {
  width: 100%;
  height: 3px;
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  letter-spacing: -0.045em;
}

.stat-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.dashboard-grid,
.grid-2col {
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.list-header h3 {
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.list-item {
  min-height: 58px;
  border-bottom-color: rgba(28, 51, 48, 0.09);
}

.datatable-wrapper {
  background: var(--bg-secondary);
  border-radius: 14px;
}

.datatable-header {
  background: linear-gradient(180deg, var(--bg-secondary), var(--surface-muted));
  padding: 1rem;
}

th {
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

td {
  vertical-align: middle;
}

tr:hover td {
  background: rgba(4, 120, 103, 0.045);
}

.btn,
.pos-checkout-btn {
  min-height: 40px;
  border-radius: 9px;
  letter-spacing: 0;
}

.btn-primary,
.pos-checkout-btn {
  background: linear-gradient(135deg, var(--primary), #0f9f6e);
  box-shadow: 0 10px 24px var(--primary-glow);
}

.btn-primary:hover,
.pos-checkout-btn:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
}

.btn-secondary {
  background: var(--bg-secondary);
}

.form-control,
.pos-search-input,
select,
textarea,
input {
  min-height: 42px;
}

.form-control {
  border-radius: 9px;
}

.form-control:focus {
  box-shadow: 0 0 0 4px var(--primary-glow);
}

#pos-terminal {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
  gap: 1rem;
}

.pos-search-bar {
  align-items: center;
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
}

.pos-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.85rem;
}

.product-item-card {
  min-height: 152px;
  border-radius: 13px;
  background: var(--bg-secondary);
}

.product-item-card:hover {
  transform: translateY(-2px);
}

.product-lab {
  color: var(--primary);
  letter-spacing: 0.08em;
}

.product-price {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.product-stock {
  border: 1px solid var(--border-color);
  background: var(--surface-muted);
}

.pos-sidebar {
  border-radius: 14px;
}

.pos-sidebar-header,
.pos-sidebar-summary {
  background: var(--surface-muted);
}

.cart-item {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.summary-row.total {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.badge {
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.modal-overlay {
  background: rgba(9, 16, 18, 0.56);
}

.modal-content {
  border-radius: 16px;
}

#toast-container {
  right: 1.25rem;
  bottom: 1.25rem;
}

.toast {
  border-radius: 12px;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.login-card {
  background:
    linear-gradient(180deg, var(--bg-secondary), var(--surface-muted));
}

.login-title {
  letter-spacing: -0.035em;
}

.operations-strip,
.pos-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(4, 120, 103, 0.1), transparent 45%),
    linear-gradient(180deg, var(--bg-secondary), var(--surface-muted));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.operations-strip::after,
.pos-command-bar::after {
  content: '';
  position: absolute;
  inset: auto -8% -70% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14), transparent 65%);
  pointer-events: none;
}

.operations-copy,
.pos-command-bar > div:first-child {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.ops-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.35rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.operations-strip h2,
.pos-command-bar h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.operations-strip p {
  margin: 0.45rem 0 0;
  max-width: 68ch;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.operations-actions,
.pos-command-steps {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

body.dark-mode .ops-action {
  background: rgba(18, 29, 32, 0.78);
}

.ops-action:hover,
.ops-action:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.ops-action-icon {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.pos-command-steps span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.72rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 800;
}

.app-view {
  animation: viewEnter 220ms ease-out both;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:focus-visible {
  outline: 3px solid var(--primary-glow);
  outline-offset: 2px;
}

.btn:disabled,
.pos-checkout-btn:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

td code,
.list-item-value,
.stat-value,
.product-price,
.summary-row.total span {
  font-variant-numeric: tabular-nums;
}

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

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .operations-strip,
  .pos-command-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .operations-actions,
  .pos-command-steps {
    justify-content: flex-start;
  }
}

@media (max-width: 1024px) {
  aside {
    width: 84px;
  }

  main {
    margin-left: 84px;
  }

  .brand {
    padding: 0.65rem;
  }

  .sidebar-footer {
    padding: 0.7rem;
  }
}

@media (max-width: 768px) {
  aside {
    width: min(86vw, 300px);
    padding: 1rem;
  }

  main {
    margin-left: 0;
    padding: 1rem;
  }

  header {
    margin: -1rem -1rem 1rem;
    padding: 0.9rem 1rem;
  }

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

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

  .pos-search-input {
    flex-basis: 100%;
  }

  .pos-sidebar {
    min-height: 72vh;
  }

  .operations-actions,
  .ops-action,
  .pos-command-steps {
    width: 100%;
  }

  .ops-action {
    justify-content: flex-start;
  }

  .pos-command-steps span {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

/* Final product-grade pass: icon system, POS, tables, and dashboard polish */
.brand-icon,
.login-logo {
  position: relative;
}

.brand-icon::before,
.brand-icon::after,
.login-logo::before,
.login-logo::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  background: #ffffff;
  border-radius: 2px;
}

.brand-icon::before,
.login-logo::before {
  width: 20px;
  height: 7px;
}

.brand-icon::after,
.login-logo::after {
  width: 7px;
  height: 20px;
}

.menu-item-icon,
.btn-icon,
.search-icon,
.toast-icon,
.cart-empty-icon {
  position: relative;
  color: currentColor;
}

.menu-item-icon::before,
.btn-icon::before,
.search-icon::before,
.toast-icon::before,
.cart-empty-icon::before {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.icon-dashboard::before {
  width: 18px;
  height: 14px;
  border-top: 0;
  border-left-width: 3px;
  border-right-width: 3px;
  box-shadow: inset 5px 0 0 transparent, inset -5px 0 0 transparent;
}

.icon-pos::before {
  width: 18px;
  height: 14px;
  border-top: 0;
  transform: skewX(-7deg);
}

.icon-pos::after {
  content: '';
  position: absolute;
  left: 8px;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 10px 0 0 currentColor;
}

.icon-inventory::before,
.icon-tenants::before {
  border-radius: 4px;
  transform: rotate(45deg);
}

.icon-category::before,
.icon-license::before {
  width: 18px;
  height: 12px;
  border-radius: 999px;
}

.icon-customers::before,
.icon-users::before {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 9px 5px 0 -4px currentColor;
}

.icon-suppliers::before {
  width: 20px;
  height: 12px;
  border-radius: 3px;
}

.icon-sales::before,
.icon-plans::before,
.icon-audit::before,
.icon-settings::before {
  width: 16px;
  height: 18px;
  border-radius: 3px;
}

.icon-cash::before {
  width: 19px;
  height: 13px;
  border-radius: 4px;
}

.icon-logout::before {
  width: 15px;
  height: 13px;
  border-left: 0;
  border-radius: 2px;
}

.icon-tenant::before {
  width: 15px;
  height: 17px;
  border-radius: 3px;
}

.icon-add::before {
  border: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 99px;
}

.icon-add::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 2px;
  height: 16px;
  translate: -50% -50%;
  background: currentColor;
  border-radius: 99px;
}

.icon-alert::before,
.inline-alert::before {
  border: 0;
  width: 0;
  height: 0;
  background: transparent;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 17px solid currentColor;
  border-radius: 0;
}

.icon-edit::before {
  width: 16px;
  height: 5px;
  border-radius: 99px;
  transform: rotate(-35deg);
}

.icon-delete::before {
  width: 16px;
  height: 2px;
  border: 0;
  border-radius: 99px;
  background: currentColor;
  transform: rotate(45deg);
}

.icon-delete::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 16px;
  height: 2px;
  translate: -50% -50%;
  border-radius: 99px;
  background: currentColor;
  transform: rotate(-45deg);
}

.icon-print::before {
  width: 18px;
  height: 13px;
  border-radius: 3px;
}

.icon-print::after {
  content: '';
  position: absolute;
  left: 6px;
  bottom: 4px;
  width: 14px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: var(--bg-secondary);
}

.inline-alert {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--warning);
  vertical-align: middle;
}

.btn-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
}

.icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0 !important;
}

.stat-icon-wrapper {
  position: relative;
}

.stat-icon-wrapper::before,
.stat-icon-wrapper::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  color: var(--accent-color, var(--primary));
}

.stat-icon-wrapper::before {
  width: 22px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.stat-icon-sales::before,
.stat-icon-cash::before {
  border-radius: 4px;
}

.stat-icon-cart::before {
  border-top: 0;
  transform: skewX(-7deg);
}

.stat-icon-alert::before {
  width: 0;
  height: 0;
  border: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid currentColor;
  border-radius: 0;
}

.stat-icon-balance::before {
  width: 22px;
  height: 2px;
  border: 0;
  background: currentColor;
  box-shadow: 0 -8px 0 -1px currentColor, 0 8px 0 -1px currentColor;
}

.stat-icon-building::before {
  width: 18px;
  height: 22px;
  border-radius: 3px;
}

.stat-icon-user::before {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.theme-toggle-btn::before,
.mobile-menu-btn::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  display: block;
}

.theme-toggle-btn::before {
  border-radius: 50%;
  box-shadow: inset -6px -2px 0 currentColor;
}

body.dark-mode .theme-toggle-btn::before {
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.16);
  background: currentColor;
}

.mobile-menu-btn::before {
  height: 12px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: 0 5px 0 -3px currentColor;
}

.search-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--primary);
}

.search-icon::before {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.search-icon::after {
  content: '';
  position: absolute;
  left: 21px;
  top: 21px;
  width: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(45deg);
}

.toast-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: var(--success);
}

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

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast-icon::before {
  border-radius: 50%;
}

#view-pos .pos-command-bar {
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
}

#view-pos .pos-command-bar h2 {
  font-size: clamp(1rem, 1.5vw, 1.3rem);
}

#view-pos .pos-command-steps span {
  min-height: 34px;
  padding: 0.35rem 0.62rem;
  font-size: 0.74rem;
}

#view-pos .pos-search-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  gap: 0.7rem;
}

#view-pos #pos-close-cash-btn {
  margin-left: 0 !important;
}

#view-pos .pos-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  padding: 0.1rem 0.35rem 0.4rem 0;
}

#view-pos .product-item-card {
  gap: 0.6rem;
  border-left: 4px solid transparent;
}

#view-pos .product-item-card.low-stock,
#view-pos .product-item-card.expiring-soon {
  border-left-color: var(--warning);
}

#view-pos .product-item-card.expired,
#view-pos .product-item-card.expired-date {
  border-left-color: var(--danger);
}

.product-card-top,
.product-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.product-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.product-status.is-success {
  background: rgba(15, 159, 110, 0.12);
  color: var(--success);
}

.product-status.is-warning {
  background: rgba(200, 121, 5, 0.13);
  color: var(--warning);
}

.product-status.is-danger {
  background: rgba(215, 56, 77, 0.13);
  color: var(--danger);
}

.product-meta-row {
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 0.73rem;
}

#view-pos .product-footer {
  margin-top: 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-color);
}

#view-pos .pos-sidebar {
  background: linear-gradient(180deg, var(--bg-secondary), var(--surface-muted));
  border-color: rgba(4, 120, 103, 0.18);
}

#view-pos .pos-sidebar-header h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

#pos-cart-title-count {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
}

.cart-empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.25rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 1.4rem;
}

.cart-empty-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  color: var(--text-light);
  border-radius: 16px;
  background: var(--bg-secondary);
  box-shadow: inset 0 0 0 1px var(--border-color);
}

.cart-empty-icon::before {
  width: 24px;
  height: 18px;
  border-top: 0;
}

.cart-empty-state p {
  margin: 0.5rem 0 0;
  color: var(--text-primary);
  font-weight: 800;
}

.cart-empty-state small {
  max-width: 28ch;
  color: var(--text-secondary);
}

#view-pos .cart-item {
  grid-template-columns: minmax(0, 1fr) auto;
  border-radius: 12px;
}

.cart-item-detail {
  display: block;
  margin-top: 0.16rem;
  color: var(--text-light);
  font-size: 0.72rem;
}

.cart-item-price small {
  color: var(--text-light);
  font-weight: 600;
}

.cart-delete-btn {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: rgba(215, 56, 77, 0.1);
}

.cart-delete-btn::before,
.cart-delete-btn::after {
  content: '';
  position: absolute;
  width: 13px;
  height: 2px;
  border-radius: 99px;
  background: var(--danger);
}

.cart-delete-btn::before {
  transform: rotate(45deg);
}

.cart-delete-btn::after {
  transform: rotate(-45deg);
}

#view-pos .pos-sidebar-summary {
  background: #f8fbfa;
  box-shadow: 0 -12px 30px rgba(12, 31, 29, 0.05);
}

body.dark-mode #view-pos .pos-sidebar-summary {
  background: #10191b;
}

#view-pos .pos-checkout-btn {
  background: linear-gradient(135deg, #036756, #0f9f6e);
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.datatable-wrapper table {
  min-width: 920px;
}

.datatable-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.datatable-wrapper tbody tr {
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.datatable-wrapper tbody tr:hover {
  box-shadow: inset 3px 0 0 var(--primary);
}

.modal-header {
  background: linear-gradient(180deg, var(--bg-secondary), var(--surface-muted));
}

.modal-footer {
  background: var(--surface-muted);
}

@media (max-width: 1200px) {
  #view-pos .pos-search-bar {
    grid-template-columns: auto minmax(180px, 1fr) auto;
  }

  #view-pos #pos-close-cash-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  #view-pos .pos-command-bar {
    display: none;
  }

  #view-pos .pos-search-bar {
    grid-template-columns: auto 1fr;
  }

  #view-pos .pos-search-bar .btn {
    width: 100%;
  }

  #view-pos #pos-clear-search-btn,
  #view-pos #pos-close-cash-btn {
    grid-column: 1 / -1;
  }
}

/* Icon refinement: clean semantic badges instead of overdrawn custom glyphs */
.menu-item-icon,
.btn-icon,
.stat-icon-wrapper,
.theme-toggle-btn,
.mobile-menu-btn,
.search-icon,
.cart-empty-icon {
  isolation: isolate;
}

.menu-item-icon::before,
.menu-item-icon::after,
.btn-icon::before,
.btn-icon::after,
.stat-icon-wrapper::before,
.stat-icon-wrapper::after,
.theme-toggle-btn::before,
.theme-toggle-btn::after,
.mobile-menu-btn::before,
.mobile-menu-btn::after,
.search-icon::before,
.search-icon::after,
.cart-empty-icon::before,
.cart-empty-icon::after {
  content: none;
}

.menu-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #eef6f4;
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(4, 120, 103, 0.08);
}

.menu-item-icon::before {
  content: attr(data-label);
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
}

.icon-dashboard { --label: "DB"; }
.icon-pos { --label: "POS"; }
.icon-inventory { --label: "INV"; }
.icon-category { --label: "CAT"; }
.icon-customers { --label: "CLI"; }
.icon-suppliers { --label: "PRO"; }
.icon-sales { --label: "VEN"; }
.icon-cash { --label: "S/"; }
.icon-tenants { --label: "BOT"; }
.icon-plans { --label: "PLA"; }
.icon-license { --label: "LIC"; }
.icon-audit { --label: "AUD"; }
.icon-settings { --label: "CFG"; }
.icon-users { --label: "USR"; }

.menu-item-icon.icon-dashboard::before,
.btn-icon.icon-dashboard::before { content: "DB"; }
.menu-item-icon.icon-pos::before,
.btn-icon.icon-pos::before { content: "POS"; }
.menu-item-icon.icon-inventory::before,
.btn-icon.icon-inventory::before { content: "INV"; }
.menu-item-icon.icon-category::before,
.btn-icon.icon-category::before { content: "CAT"; }
.menu-item-icon.icon-customers::before,
.btn-icon.icon-customers::before { content: "CLI"; }
.menu-item-icon.icon-suppliers::before,
.btn-icon.icon-suppliers::before { content: "PRO"; }
.menu-item-icon.icon-sales::before,
.btn-icon.icon-sales::before { content: "VEN"; }
.menu-item-icon.icon-cash::before,
.btn-icon.icon-cash::before { content: "S/"; }
.menu-item-icon.icon-tenants::before,
.btn-icon.icon-tenants::before { content: "BOT"; }
.menu-item-icon.icon-plans::before,
.btn-icon.icon-plans::before { content: "PLA"; }
.menu-item-icon.icon-license::before,
.btn-icon.icon-license::before { content: "LIC"; }
.menu-item-icon.icon-audit::before,
.btn-icon.icon-audit::before { content: "AUD"; }
.menu-item-icon.icon-settings::before,
.btn-icon.icon-settings::before { content: "CFG"; }
.menu-item-icon.icon-users::before,
.btn-icon.icon-users::before { content: "USR"; }

.menu-item.active .menu-item-icon {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.btn-icon {
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.btn-icon.icon-add::before {
  content: "+";
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
}

.btn-icon.icon-add::after {
  content: none;
}

.btn-icon.icon-alert::before {
  content: "!";
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
}

.btn-icon.icon-edit::before {
  content: "ED";
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  transform: none;
}

.btn-icon.icon-delete::before {
  content: "X";
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  transform: none;
}

.btn-icon.icon-delete::after {
  content: none;
}

.btn-icon.icon-print::before {
  content: "PR";
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
}

.btn-icon.icon-print::after {
  content: none;
}

.icon-btn .btn-icon {
  background: transparent;
}

.theme-toggle-btn::before {
  content: '';
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  box-shadow: inset 0 0 0 2px currentColor;
}

body.dark-mode .theme-toggle-btn::before {
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.12);
}

.mobile-menu-btn::before {
  content: '';
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.search-icon::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 7px;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: '';
  position: absolute;
  left: 21px;
  top: 21px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.stat-icon-wrapper {
  color: var(--accent-color, var(--primary));
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.stat-icon-wrapper::before {
  content: "KPI";
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
}

.stat-icon-sales::before { content: "S/"; }
.stat-icon-cart::before { content: "POS"; }
.stat-icon-alert::before { content: "!"; }
.stat-icon-expired::before { content: "VCT"; }
.stat-icon-cash::before { content: "CAJ"; }
.stat-icon-balance::before { content: "="; }
.stat-icon-building::before { content: "BOT"; }
.stat-icon-user::before { content: "USR"; }

.cart-empty-icon::before {
  content: "POS";
  position: static;
  translate: none;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--primary);
}

/* POS cart panel polish */
#view-pos .pos-sidebar {
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

#view-pos .pos-sidebar-header {
  min-height: 84px;
  background: linear-gradient(180deg, #ffffff, var(--surface-muted));
}

body.dark-mode #view-pos .pos-sidebar-header {
  background: linear-gradient(180deg, #121d20, #10191b);
}

#view-pos .pos-sidebar-header .ops-kicker {
  margin-bottom: 0.18rem;
  font-size: 0.68rem;
}

#view-pos .pos-sidebar-header h3 {
  font-size: 1.15rem;
  line-height: 1.1;
}

#view-pos #pos-clear-cart-btn {
  min-width: 64px;
  border-color: rgba(215, 56, 77, 0.24);
  color: var(--danger) !important;
  background: rgba(215, 56, 77, 0.06);
}

#view-pos #pos-clear-cart-btn:hover {
  background: rgba(215, 56, 77, 0.12);
}

#view-pos .cart-items-container {
  background:
    linear-gradient(180deg, rgba(4, 120, 103, 0.035), transparent 38%),
    var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  max-height: 160px;
  min-height: 0;
  padding: 0.7rem;
}

.cart-empty-state {
  min-height: 96px;
  grid-template-columns: auto 1fr;
  place-items: center start;
  align-content: center;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  text-align: left;
  border: 1px dashed rgba(4, 120, 103, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

body.dark-mode .cart-empty-state {
  background: rgba(18, 29, 32, 0.62);
}

.cart-empty-icon.material-symbols-rounded {
  width: 48px;
  height: 48px;
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 25px;
  box-shadow: none;
}

.cart-empty-icon.material-symbols-rounded::before,
.cart-empty-icon.material-symbols-rounded::after {
  content: none !important;
}

.cart-empty-state p {
  margin: 0;
  font-size: 0.95rem;
}

.cart-empty-state small {
  display: block;
  margin-top: 0.15rem;
  max-width: 30ch;
  font-size: 0.78rem;
  line-height: 1.35;
}

#view-pos .pos-sidebar-summary {
  padding: 0.72rem 1.15rem 0.85rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), #f7fbfa);
}

body.dark-mode #view-pos .pos-sidebar-summary {
  background: linear-gradient(180deg, rgba(18, 29, 32, 0.96), #10191b);
}

#view-pos .summary-row {
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.84rem;
  min-height: 20px;
}

#view-pos .summary-row span:last-child {
  color: var(--text-primary);
  font-weight: 700;
}

#view-pos .summary-row.total {
  margin-top: 0.25rem;
  padding-top: 0.48rem;
  border-top: 1px solid rgba(4, 120, 103, 0.18);
}

#view-pos .summary-row.total span:first-child {
  color: var(--text-primary);
  font-size: 1.05rem;
}

#view-pos .summary-row.total span:last-child {
  color: var(--primary);
  font-size: 1.5rem;
}

#view-pos #pos-discount-input {
  width: 70px !important;
  text-align: right;
  border-radius: 8px !important;
  background: var(--bg-secondary) !important;
}

#view-pos .pos-sidebar-summary .form-group {
  margin-top: 0.32rem !important;
}

#view-pos .pos-sidebar-summary label {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

#view-pos .pos-sidebar-summary select.form-control {
  min-height: 36px;
  border-color: rgba(28, 51, 48, 0.14);
  background: var(--bg-secondary);
  font-weight: 600;
  padding-top: 0.42rem !important;
  padding-bottom: 0.42rem !important;
}

#view-pos .pos-checkout-btn {
  min-height: 42px;
  border-radius: 12px;
  margin-top: 0.5rem;
  padding: 0.55rem 0.85rem;
  box-shadow: 0 14px 28px rgba(4, 120, 103, 0.2);
}

#view-pos .pos-checkout-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(4, 120, 103, 0.24);
}

#view-pos .pos-checkout-btn:disabled {
  background: #78bfae;
  color: rgba(255, 255, 255, 0.82);
}

.chart-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-muted);
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-card-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.chart-card-header p {
  margin: 0.2rem 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-filter-tabs-muted .chart-filter-btn.active {
  background: var(--text-primary);
}

.chart-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chart-summary-row > div {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-muted);
}

.chart-summary-row span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chart-summary-row strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.chart-filter-btn {
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transition: var(--transition);
}

.chart-filter-btn:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

.chart-filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 18px var(--primary-glow);
}

.chart-filter-tabs-muted .chart-filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-secondary);
  box-shadow: 0 8px 18px rgba(12, 31, 29, 0.14);
}

.chart-filter-btn:active {
  transform: scale(0.97);
}

@media (max-width: 640px) {
  .chart-card-header {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  .chart-controls {
    justify-content: stretch;
  }

  .chart-filter-tabs {
    width: 100%;
  }

  .chart-filter-btn {
    flex: 1;
  }

  .chart-summary-row {
    grid-template-columns: 1fr;
  }
}

.pos-cash-warning {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(200, 121, 5, 0.26);
  border-radius: 12px;
  background: rgba(255, 247, 230, 0.86);
  color: #805000;
}

body.dark-mode .pos-cash-warning {
  background: rgba(120, 74, 0, 0.18);
  color: #f7c46a;
}

.pos-cash-warning .material-symbols-rounded {
  font-size: 22px;
}

.pos-cash-warning strong {
  display: block;
  color: inherit;
  font-size: 0.86rem;
  line-height: 1.1;
}

.pos-cash-warning p {
  margin: 0.1rem 0 0;
  color: inherit;
  font-size: 0.76rem;
  line-height: 1.2;
}

.pos-cash-warning .btn {
  min-height: 32px;
  padding: 0.25rem 0.65rem;
  box-shadow: none;
}

#view-pos .cart-item {
  padding: 0.48rem 0.6rem;
}

#view-pos .cart-item-name {
  font-size: 0.82rem;
}

#view-pos .cart-item-detail,
#view-pos .cart-item-price {
  font-size: 0.72rem;
}

#view-pos .cart-qty-btn,
#view-pos .cart-delete-btn {
  width: 28px;
  height: 28px;
}

/* Google Material Symbols icon layer */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.menu-item-icon.material-symbols-rounded,
.btn-icon.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
}

.menu-item-icon.material-symbols-rounded::before,
.menu-item-icon.material-symbols-rounded::after,
.btn-icon.material-symbols-rounded::before,
.btn-icon.material-symbols-rounded::after {
  content: none !important;
}

.menu-item-icon.material-symbols-rounded {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 22px;
  box-shadow: none;
}

.menu-item a:hover .menu-item-icon.material-symbols-rounded {
  color: var(--primary);
  background: var(--primary-glow);
}

.menu-item.active .menu-item-icon.material-symbols-rounded {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.btn-icon.material-symbols-rounded {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 20px;
  box-shadow: none;
}

.tenant-badge .btn-icon.material-symbols-rounded {
  font-size: 19px;
  color: var(--primary);
}

.icon-btn .btn-icon.material-symbols-rounded {
  width: 22px;
  height: 22px;
  font-size: 21px;
}

.cart-delete-btn {
  color: var(--danger);
  font-size: 20px;
}

.cart-delete-btn::before,
.cart-delete-btn::after {
  content: none;
}

.cart-delete-btn .material-symbols-rounded {
  font-size: 20px;
}
