/* ================================================
   POS PRO MAX by WEMAKE – Main Stylesheet
   Color Palette:
     Primary  : #1E3A5F
     Secondary: #F5F7FA
     Accent   : #FF8C42
     Success  : #28C76F
     Danger   : #EA5455
================================================ */

/* -------- FONTS & ROOT VARIABLES -------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #1E3A5F;
  --primary-light: #2d5a8e;
  --primary-dark: #152c47;
  --secondary: #F5F7FA;
  --accent: #FF8C42;
  --accent-dark: #e06d1f;
  --success: #28C76F;
  --success-dark: #1a9e53;
  --danger: #EA5455;
  --danger-dark: #c83b3b;
  --warning: #FFB74D;
  --purple: #6f42c1;

  --bg: #F5F7FA;
  --bg-card: #ffffff;
  --bg-sidebar: #1E3A5F;
  --text-primary: #1a2332;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --sidebar-width: 240px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #0f172a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --secondary: #1e293b;
}

/* -------- RESET & BASE -------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.hidden { display: none !important; }
.active-view { display: block !important; }

/* -------- SCROLLBAR -------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================
   LOGIN SCREEN
================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E3A5F 0%, #152c47 50%, #0a1f35 100%);
  z-index: 9999;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  animation: slideUp 0.5s cubic-bezier(0.4,0,0.2,1);
}

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

.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo .logo-icon {
  width: 72px; height: 72px;
  background: #fff;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px; color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.login-logo h1 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.login-logo h1 span { color: var(--accent); }
.login-logo p { color: rgba(255,255,255,0.5); font-size: 13px; margin-top: 4px; }

.login-card .form-group { margin-bottom: 18px; }
.login-card .form-group label {
  display: block; color: rgba(255,255,255,0.7);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 8px;
}
.login-card .form-group label i { margin-right: 6px; }
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.login-card input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(255,140,66,0.15);
}
.login-card input::placeholder { color: rgba(255,255,255,0.3); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.toggle-pw {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 14px; padding: 4px;
}
.toggle-pw:hover { color: #fff; }

.login-roles { text-align: center; color: rgba(255,255,255,0.35); font-size: 11px; margin-bottom: 20px; }

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #ff6b1e);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(255,140,66,0.3);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,140,66,0.4); }
.btn-login:active { transform: translateY(0); }

.login-error {
  background: rgba(234,84,85,0.15);
  border: 1px solid rgba(234,84,85,0.3);
  border-radius: var(--radius-sm);
  color: #ff8a8a;
  padding: 10px 14px;
  font-size: 13px;
  text-align: center;
  margin-top: 14px;
}

.login-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-back-link:hover,
.login-back-link:focus-visible {
  color: #fff;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  line-height: 1.6;
}
.login-footer-tagline {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.login-footer-copy {
  margin-top: 4px;
}

/* ================================================
   MAIN APP LAYOUT
================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* -------- SIDEBAR -------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar.collapsed { width: 68px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: 72px;
  position: relative;
}
.logo-icon-sm {
  width: 38px; height: 38px; min-width: 38px;
  background: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.logo-text { overflow: hidden; white-space: nowrap; }
.logo-name { display: block; font-size: 15px; font-weight: 700; color: #fff; }
.logo-sub { display: block; font-size: 10px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-toggle {
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  padding: 6px;
  margin-left: auto;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.08); }

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; overflow-x: hidden; }
.nav-section-label {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1px;
  padding: 8px 24px 6px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-nav ul + .nav-section-label {
  margin-top: 16px;
}
/* When collapsed, make the logo icon act as the toggle button */
.sidebar.collapsed .logo-icon-sm {
  cursor: pointer;
}
.sidebar.collapsed .sidebar-toggle {
  opacity: 1;
  pointer-events: auto;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* Hide text and badges when collapsed, center icons */
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-info {
  display: none;
}
.sidebar.collapsed .nav-item {
  padding: 11px 0;
  justify-content: center;
  gap: 0;
}
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 16px 0;
}
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-item i {
  min-width: unset;
  font-size: 18px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin: 2px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 13.5px; font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-item i { font-size: 16px; min-width: 20px; text-align: center; flex-shrink: 0; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-item.active { color: #fff; background: rgba(255,255,255,0.1); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 4px;
}
.nav-indicator { display: none; }

.nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: auto;
  min-width: 20px;
  text-align: center;
}

.sidebar-user {
  position: relative;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.user-dropdown {
  display: none;
  position: fixed;
  background: #1e293b;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
  padding: 4px 0;
  z-index: 300;
  min-width: 160px;
}
.user-dropdown.active { display: block; }
.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  transition: background 0.15s;
}
.user-dropdown .dropdown-item:hover {
  background: rgba(234,84,85,0.15);
  color: #ff8a8a;
}
.user-avatar {
  width: 36px; height: 36px; min-width: 36px;
  background: linear-gradient(135deg, var(--accent), #ff6b1e);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.user-name { display: block; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; }
.user-role { display: block; font-size: 11px; color: rgba(255,255,255,0.4); white-space: nowrap; }

/* -------- MAIN CONTENT -------- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar.collapsed ~ .main-content { margin-left: 68px; }

/* -------- TOP HEADER -------- */
.top-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-left { flex: 1; max-width: 480px; }
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.branch-switcher {
  display: flex; align-items: center; gap: 8px;
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 10px; color: var(--primary);
}
.branch-switcher-text { display: flex; flex-direction: column; min-width: 130px; }
.branch-switcher-text > span { font-size: 10px; color: var(--text-muted); line-height: 1; }
.branch-switcher select { border: 0; background: transparent; color: var(--text-primary); font-size: 12px; font-weight: 700; outline: none; max-width: 180px; }
.checkout-branch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(30,58,95,0.06); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
}
.checkout-branch-row > div { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary); }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute; left: 14px;
  color: var(--text-muted); font-size: 13px;
  pointer-events: none;
}
.search-bar {
  width: 100%;
  background: var(--secondary);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 9px 40px 9px 38px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.search-bar:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,140,66,0.12); }
.search-bar::placeholder { color: var(--text-muted); }
.search-clear {
  position: absolute; right: 12px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 12px; padding: 4px;
  opacity: 0.6;
  transition: var(--transition);
}
.search-clear:hover { opacity: 1; color: var(--danger); }

.header-datetime {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
  font-size: 12.5px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  white-space: nowrap;
}
.header-datetime i { color: var(--accent); }
.datetime-text { display: flex; flex-direction: column; line-height: 1.2; }
.time-badge { font-weight: 700; font-size: 13px; color: var(--primary); }
[data-theme="dark"] .time-badge { color: var(--accent); }

.btn-dark-toggle {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: var(--transition);
}
.btn-dark-toggle:hover { color: var(--accent); border-color: var(--accent); }

.btn-new-sale {
  background: linear-gradient(135deg, var(--accent), #ff6b1e);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(255,140,66,0.25);
}
.btn-new-sale:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255,140,66,0.35); }

.header-user-info { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ================================================
   VIEWS
================================================ */
.view { display: none !important; padding: 24px; flex: 1; }
.view.active { display: block !important; }

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.view-header h2 {
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary);
}
.view-header h2 i { color: var(--accent); }

/* ================================================
   POS LAYOUT (DASHBOARD)
================================================ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  height: calc(100vh - 72px - 48px);
}

/* -------- CATEGORY TABS -------- */
.category-tabs-wrap {
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.category-tabs { display: flex; gap: 8px; white-space: nowrap; }

.cat-tab {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 7px;
  transition: var(--transition);
  flex-shrink: 0;
}
.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255,140,66,0.3);
}

/* -------- PRODUCT PANEL -------- */
.product-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Product/service selector inside the POS catalog. */
.catalog-mode-switch {
  display: flex;
  gap: 6px;
  padding: 10px 0 0;
  margin-bottom: 10px;
  background: transparent;
}

.catalog-mode-btn {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}

.catalog-mode-btn:hover,
.catalog-mode-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30, 58, 95, .2);
}

.service-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  color: var(--primary);
  font-size: 48px;
  background: linear-gradient(145deg, rgba(30, 58, 95, .08), rgba(255, 140, 66, .14));
}

.service-code-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #fff;
  background: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

.service-ptag,
.cart-service-badge {
  color: #6f42c1 !important;
  border-color: rgba(111, 66, 193, .35) !important;
  background: rgba(111, 66, 193, .08);
}

.cart-service-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  vertical-align: 1px;
}

.cart-service-meta {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  margin-top: 2px;
}

.service-availability-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.service-sale-summary {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 12px;
}

.service-sale-summary strong {
  color: var(--text-primary);
  font-size: 17px;
}

.service-price-input {
  font-size: 22px !important;
  font-weight: 800;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  grid-auto-rows: min-content;
  gap: 14px;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 8px;
  flex: 1;
  align-items: stretch;
}

/* -------- PRODUCT CARD -------- */
.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
  animation: cardIn 0.3s ease forwards;
  display: flex;
  flex-direction: column;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.product-card:active { transform: scale(0.97); }

.product-card.in-cart { border-color: var(--success); }
.product-card.in-cart::after {
  content: '✓ In Cart';
  position: absolute;
  top: 8px; right: 8px;
  background: var(--success);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}

.product-img-wrap {
  width: 100%;
  height: 120px;
  min-height: 120px;
  max-height: 120px;
  background: linear-gradient(135deg, var(--secondary), var(--border-light));
  overflow: hidden;
  position: relative;
  display: flex; 
  align-items: center; 
  justify-content: center;
  flex-shrink: 0;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
  display: block;
}
.product-card:hover .product-img-wrap img { transform: scale(1.08); }

.product-img-fallback {
  font-size: 40px;
  opacity: 0.5;
}

.product-tag-badge {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 10px; font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  color: #fff;
}
.tag-new { background: var(--primary-light); }
.tag-bestseller { background: var(--accent); }
.tag-sale { background: var(--danger); }

.product-body { 
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.product-name {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-cat {
  font-size: 11px; 
  color: var(--text-muted);
  text-transform: uppercase; 
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-tags { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 4px; 
  min-height: 20px;
  max-height: 40px;
  overflow: hidden;
}
.ptag {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.ptag.nic { background: rgba(30,58,95,0.1); color: var(--primary); border-color: rgba(30,58,95,0.2); }
.ptag.flavor { background: rgba(255,140,66,0.1); color: var(--accent-dark); border-color: rgba(255,140,66,0.2); }
[data-theme="dark"] .ptag.nic { background: rgba(30,58,95,0.3); color: #7aacdf; border-color: rgba(30,58,95,0.4); }
[data-theme="dark"] .ptag.flavor { background: rgba(255,140,66,0.15); color: var(--accent); }

.product-footer { 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}
.product-price {
  font-size: 17px; font-weight: 800;
  color: var(--primary);
}
[data-theme="dark"] .product-price { color: var(--accent); }

.btn-add-cart {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; gap: 5px;
  transition: var(--transition);
}
.btn-add-cart:hover { background: var(--accent); transform: scale(1.05); }

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results i { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.no-results p { font-size: 16px; font-weight: 600; }
.no-results span { font-size: 13px; }

/* -------- ORDER PANEL -------- */
.order-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.order-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.order-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.order-title h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.order-title h3 i { color: var(--accent); }
.order-number {
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

.order-meta { display: flex; flex-direction: column; gap: 6px; }
.order-meta-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.order-meta-item i { color: var(--accent); width: 14px; text-align: center; }
.btn-icon-sm {
  background: none; border: none;
  color: var(--text-muted); font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  transition: var(--transition);
}
.btn-icon-sm:hover { color: var(--accent); }

/* -------- CART ITEMS -------- */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%;
  min-height: 160px;
  color: var(--text-muted);
  text-align: center;
}
.cart-empty i { font-size: 40px; margin-bottom: 10px; opacity: 0.35; }
.cart-empty p { font-size: 14px; font-weight: 600; }
.cart-empty span { font-size: 12px; }

.cart-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  animation: slideInRight 0.22s ease;
  transition: var(--transition);
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.cart-item:hover { border-color: var(--accent); }

.cart-item-thumb {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-price { font-size: 12px; color: var(--text-secondary); }

.cart-item-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 26px; height: 26px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.qty-display { font-size: 13px; font-weight: 700; min-width: 22px; text-align: center; }
.qty-input {
  width: 45px;
  height: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 4px;
  transition: var(--transition);
  cursor: pointer;
}
.qty-input:hover {
  border-color: var(--accent);
  background: var(--secondary);
}
.qty-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}
/* Remove spinner arrows in Chrome, Safari, Edge */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Remove spinner arrows in Firefox */
.qty-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.btn-remove {
  background: none; border: none;
  color: var(--text-muted); font-size: 14px;
  padding: 4px; border-radius: 6px;
  transition: var(--transition);
}
.btn-remove:hover { color: var(--danger); background: rgba(234,84,85,0.1); }

/* -------- ORDER SUMMARY -------- */
.order-summary {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.summary-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.discount-row .discount-input-wrap {
  display: flex; align-items: center; gap: 4px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px; color: var(--text-secondary);
}
.discount-row .discount-input-wrap input {
  background: none; border: none; outline: none;
  width: 70px; font-size: 13px;
  color: var(--text-primary); text-align: right;
}
.summary-total {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 18px; font-weight: 800;
  margin-top: 10px;
}

/* -------- ORDER ACTIONS -------- */
.order-actions {
  padding: 14px 20px;
  display: flex; gap: 10px;
  border-top: 1px solid var(--border);
}
.btn-cancel, .btn-complete {
  flex: 1;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: var(--transition);
}
.btn-cancel {
  background: rgba(234,84,85,0.1);
  color: var(--danger);
  border: 1.5px solid rgba(234,84,85,0.25);
}
.btn-cancel:hover { background: var(--danger); color: #fff; }
.btn-complete {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: #fff;
  box-shadow: 0 3px 10px rgba(40,199,111,0.3);
}
.btn-complete:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(40,199,111,0.4); }
.btn-complete:active { transform: scale(0.98); }

/* ================================================
   DATA TABLES
================================================ */
.products-table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--secondary); }

.subscription-banner {
  position: fixed;
  left: 0;
  top: 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.subscription-banner.visible { opacity: 1; }
.subscription-banner i { color: var(--accent); margin-right: 4px; }
.subscription-banner strong { text-transform: capitalize; }
.subscription-banner.hidden { display: none; }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}
.table-pagination:empty { display: none; }
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination-page {
  min-width: 92px;
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
}
.btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-page:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-product-cell { display: flex; align-items: center; gap: 10px; }
.table-thumb {
  width: 38px; height: 38px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--secondary);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-product-name { font-weight: 600; }
.table-product-cat { font-size: 11px; color: var(--text-muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
}
.badge-primary { background: rgba(30,58,95,0.1); color: var(--primary); }
.badge-accent { background: rgba(255,140,66,0.15); color: var(--accent-dark); }
.badge-success { background: rgba(40,199,111,0.12); color: var(--success-dark); }
.badge-danger { background: rgba(234,84,85,0.12); color: var(--danger-dark); }
.badge-warning { background: rgba(255,140,66,0.15); color: #e06d1f; }
.badge-low { background: rgba(255,183,77,0.15); color: #b07000; }
.badge-muted { background: var(--secondary); color: var(--text-muted); }

[data-theme="dark"] .badge-primary { background: rgba(30,58,95,0.4); color: #7aacdf; }
[data-theme="dark"] .badge-warning { background: rgba(255,140,66,0.25); color: #FF8C42; }
[data-theme="dark"] .badge-low { background: rgba(255,183,77,0.25); color: #FFB74D; }

.table-actions { display: flex; gap: 6px; }
.btn-action {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.btn-action:hover { color: var(--accent); border-color: var(--accent); }
.btn-action.danger:hover { color: var(--danger); border-color: var(--danger); }

.items-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.items-list-btn i { color: var(--accent); }
.items-list-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 66, 0.08);
}
.order-items-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.compact-empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-muted);
}
.compact-empty i {
  display: block;
  margin-bottom: 10px;
  font-size: 30px;
  opacity: 0.35;
}

.no-orders-msg {
  text-align: center; padding: 60px;
  color: var(--text-muted);
}
.no-orders-msg i { font-size: 48px; margin-bottom: 12px; opacity: 0.4; display: block; }

/* ================================================
   REPORTS
================================================ */
.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.dashboard-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.dashboard-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.dashboard-section h3 i { color: var(--accent); margin-right: 6px; }
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}
.dashboard-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.dashboard-table td {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}
.dashboard-table tr:last-child td { border-bottom: none; }
.dashboard-table tr:hover td { background: var(--secondary); }
.dashboard-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
  text-align: center;
}
.dashboard-stock-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.dashboard-stock-badge.low { background: rgba(255,140,66,0.15); color: #FF8C42; }
.dashboard-stock-badge.out { background: rgba(234,84,85,0.15); color: #EA5455; }
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  flex-shrink: 0;
}
.stat-info {
  min-width: 0;
  flex: 1;
}
.stat-info h4 {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: visible;
  margin-bottom: 4px;
}
.stat-info p {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: visible;
}
.stat-subtext {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.audit-mini-card {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
}
.audit-mini-card span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.audit-mini-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  color: var(--text-primary);
}

.top-products-section { margin-top: 8px; }
.top-products-section h3 {
  font-size: 16px; font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.top-products-section h3 i { color: var(--accent); }
.top-products-list { display: flex; flex-direction: column; gap: 10px; }
.top-product-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.top-rank {
  width: 28px; height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
}
.top-rank.gold { background: linear-gradient(135deg, #f6c90e, #e0a800); }
.top-rank.silver { background: linear-gradient(135deg, #adb5bd, #868e96); }
.top-rank.bronze { background: linear-gradient(135deg, #cd7f32, #a0522d); }
.top-info { flex: 1; }
.top-info .name { font-size: 13px; font-weight: 700; }
.top-info .count { font-size: 12px; color: var(--text-muted); }
.top-revenue { font-size: 14px; font-weight: 700; color: var(--success); }

/* Analytics Filters */
.analytics-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.export-scope-select { min-width: 220px; }
.filter-select {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.filter-select:hover {
  border-color: var(--accent);
}
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.chart-card:hover {
  box-shadow: var(--shadow);
}
.chart-card-large {
  grid-column: span 2;
}
.chart-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.chart-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.chart-header h3 i {
  color: var(--accent);
}
.chart-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-container {
  position: relative;
  height: 280px;
}
.chart-card-large .chart-container {
  height: 320px;
}

/* ================================================
   SETTINGS
================================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.settings-card h3 {
  font-size: 14px; font-weight: 700;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.settings-card h3 i { color: var(--accent); }

.logo-preview-wrap {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 7px;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.setting-input {
  width: 100%;
  background: var(--secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.setting-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,140,66,0.1); }

.toggle-group { display: flex; align-items: center; justify-content: space-between; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ================================================
   BUTTONS
================================================ */
.btn-primary {
  background: var(--primary);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary {
  background: var(--secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #ff6b1e);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(255,140,66,0.25);
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255,140,66,0.35); }
.btn-danger {
  background: linear-gradient(135deg, #EA5455, #c73030);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(234,84,85,0.25);
}
.btn-danger:hover { 
  background: linear-gradient(135deg, #c73030, #a02020);
  transform: translateY(-1px); 
  box-shadow: 0 5px 16px rgba(234,84,85,0.35); 
}
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ================================================
   MODALS
================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,40,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-lg { max-width: 820px; }
.modal-receipt { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header.no-border { border-bottom: none; }
.modal-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-header h3 i { color: var(--accent); }
.modal-close {
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
  color: var(--text-muted); font-size: 14px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.modal-search {
  width: 100%;
  background: var(--secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  margin-bottom: 14px;
}
.modal-search:focus { border-color: var(--accent); }

.customer-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.customer-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
}
.customer-list-item:hover { border-color: var(--accent); background: rgba(255,140,66,0.04); }
.cust-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.cust-info .cust-name { font-size: 13px; font-weight: 600; }
.cust-info .cust-sub { font-size: 11px; color: var(--text-muted); }

/* -------- PAYMENT MODAL -------- */
.payment-summary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  color: #fff;
}
.payment-order-no { font-size: 12px; opacity: 0.7; margin-bottom: 6px; }
.payment-amount span { display: block; font-size: 12px; opacity: 0.7; }
.payment-amount strong { font-size: 36px; font-weight: 800; }

.payment-method-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.payment-methods { display: flex; gap: 10px; margin-bottom: 20px; }
.pay-method {
  flex: 1;
  background: var(--secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: var(--transition);
}
.pay-method:hover { border-color: var(--accent); color: var(--accent); }
.pay-method.active { border-color: var(--accent); background: rgba(255,140,66,0.08); color: var(--accent); }

.cash-input-section {
  background: var(--secondary);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.cash-input-section label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 8px; }
.cash-input {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
  outline: none;
  margin-bottom: 12px;
}
.cash-input:focus { border-color: var(--accent); }

.quick-cash-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.quick-cash-btn {
  flex: 1;
  min-width: 70px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
}
.quick-cash-btn:hover {
  border-color: var(--accent);
  background: rgba(255,140,66,0.08);
  color: var(--accent);
  transform: translateY(-1px);
}
.quick-cash-btn:active {
  transform: scale(0.95);
}
.quick-cash-exact {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: #fff;
}
.quick-cash-exact:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-color: var(--primary-dark);
  color: #fff;
}

.change-display {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.change-display span { color: var(--text-secondary); }
.change-display strong { font-size: 18px; font-weight: 800; color: var(--success); }

.btn-confirm-pay {
  width: 100%;
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(40,199,111,0.35);
}
.btn-confirm-pay:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(40,199,111,0.45); }
.btn-confirm-pay:active { transform: scale(0.98); }

/* ================================================
   RECEIPT MODAL – Redesigned to match reference
================================================ */
.rcpt-wrap {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  padding: 4px 0;
}

/* Header – shop name & address */
.rcpt-header { text-align: center; margin-bottom: 16px; }
.rcpt-shop-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.rcpt-shop-addr {
  font-size: 12px;
  color: var(--text-muted);
}

/* Dashed divider */
.rcpt-divider {
  border: none;
  border-top: 1.5px dashed var(--border);
  margin: 12px 0;
}

/* Order info grid – 2-column layout */
.rcpt-info-grid { margin-bottom: 4px; }
.rcpt-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.rcpt-info-row b { color: var(--text-primary); }

/* Items & totals rows */
.rcpt-items,
.rcpt-totals { display: flex; flex-direction: column; gap: 6px; }

.rcpt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--text-secondary);
}
.rcpt-row span:last-child {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  margin-left: 12px;
}

/* TOTAL row – bold, larger */
.rcpt-item-row > span:first-child {
  min-width: 0;
}

.rcpt-item-main {
  display: block;
}

.rcpt-return-note {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--danger);
}

.rcpt-return-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rcpt-return-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
}

.rcpt-return-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.rcpt-return-row span:first-child {
  min-width: 0;
}

.rcpt-return-row span:last-child,
.rcpt-deduction-row span:last-child,
.rcpt-net-line span {
  color: var(--danger);
}

.rcpt-total-line {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin-top: 2px;
}
.rcpt-total-line span {
  font-weight: 800 !important;
  color: var(--text-primary) !important;
}

.rcpt-net-line span {
  color: var(--warning) !important;
}

.rcpt-deduction-row span:last-child,
.rcpt-return-note,
.rcpt-return-row span:last-child {
  color: var(--danger) !important;
}

/* Footer italic text */
.rcpt-footer-text {
  text-align: center;
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.6;
}

/* Receipt modal box sizing */
.modal-receipt { max-width: 400px; }
.modal-receipt .modal-body { padding: 16px 24px 8px; }

/* Receipt footer buttons */
.receipt-actions {
  padding: 14px 24px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.btn-receipt-print {
  background: #fff;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  transition: var(--transition);
}
.btn-receipt-print:hover { border-color: var(--primary); color: var(--primary); }
[data-theme="dark"] .btn-receipt-print { background: var(--bg-card); }

.btn-receipt-done {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(30,58,95,0.25);
}
.btn-receipt-done:hover { background: var(--primary-light); transform: translateY(-1px); }


/* ================================================
   TOAST NOTIFICATIONS
================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.removing { opacity: 0; transform: translateX(100%); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--primary-light); }
.toast.warning .toast-icon { color: var(--warning); }
.toast-text { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.toast-msg { font-size: 12px; color: var(--text-secondary); }
.toast-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 12px; padding: 3px;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--danger); }

/* ================================================
   LICENSE LOCK SCREEN
================================================ */
.license-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1E3A5F 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.license-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 48px 40px 36px;
  max-width: 1040px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  animation: licenseIn 0.4s ease;
}
@keyframes licenseIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.license-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.license-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.license-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.license-activate-wrap {
  background: var(--bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.license-tabs {
  display: flex !important;
  gap: 8px;
  margin-bottom: 16px;
}

.license-tab {
  flex: 1;
  padding: 9px 12px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.license-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,140,66,0.08);
}

.license-footer {
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ================================================
   QRPH SUBSCRIPTION BILLING
================================================ */
.view-subtitle {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 13px;
}
.lock-billing-section { text-align: left; margin-bottom: 24px; }
.lock-billing-section h3 {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}
.lock-billing-section h3 i { color: var(--accent); }
.billing-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.billing-divider::before, .billing-divider::after { content: ''; height: 1px; background: var(--border); flex: 1; }
.billing-customer-fields,
.billing-checkout-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.billing-customer-fields { margin-bottom: 12px; }
.billing-checkout-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 22px;
  align-items: end;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(280px, 1.25fr);
}
.billing-checkout-details .form-group { margin: 0; }
.billing-qrph-note {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  padding: 10px 13px;
  color: #135f3a;
  background: rgba(40, 199, 111, .11);
  font-size: 12px;
  line-height: 1.45;
}
.billing-qrph-note i { font-size: 24px; color: var(--success); }
.billing-interval { min-width: 170px; }
.lock-billing-section .billing-interval { display: block; margin: 0 auto 14px; width: 190px; }
.billing-current-card {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--bg-card), rgba(255, 140, 66, .06));
  box-shadow: var(--shadow-sm);
}
.billing-current-card > div:nth-child(2) { flex: 1; }
.billing-current-card h3 { font-size: 20px; margin: 2px 0 6px; }
.billing-current-card h3 small { color: var(--text-muted); font-size: 13px; text-transform: capitalize; }
.billing-current-card p { color: var(--text-muted); font-size: 13px; margin: 0; }
.billing-current-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 140, 66, .12);
  color: var(--accent);
  font-size: 22px;
}
.billing-eyebrow { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.billing-loading { color: var(--text-muted); }
.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.billing-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.billing-plan-current { border: 2px solid var(--accent); padding: 21px 19px 17px; }
.billing-current-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  padding: 5px 10px;
  background: var(--accent);
  color: white;
  border-radius: 0 12px 0 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.billing-plan-heading h3 { font-size: 18px; margin: 0 0 7px; }
.billing-plan-heading p { font-size: 12px; line-height: 1.45; color: var(--text-muted); min-height: 52px; margin: 0; }
.billing-plan-price { margin: 16px 0 4px; display: flex; align-items: baseline; gap: 5px; }
.billing-plan-price strong { font-size: 25px; color: var(--text-primary); }
.billing-plan-price span { font-size: 11px; color: var(--text-muted); }
.billing-saving, .billing-saving-placeholder { min-height: 19px; color: var(--success); font-size: 11px; font-weight: 700; }
.billing-plan-card ul { list-style: none; padding: 14px 0; margin: 0; border-top: 1px solid var(--border); flex: 1; }
.billing-plan-card li { display: flex; gap: 7px; margin: 8px 0; color: var(--text-secondary); font-size: 12px; }
.billing-plan-card li i { color: var(--success); margin-top: 2px; }
.billing-limits { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 11px; margin-bottom: 14px; }
.billing-limits span { display: flex; align-items: center; gap: 5px; }
.billing-plan-button { width: 100%; min-height: 40px; justify-content: center; }
.billing-plan-button:disabled { opacity: .55; cursor: not-allowed; }
.billing-message { min-height: 0; margin: 0 0 14px; border-radius: 9px; font-size: 12px; }
.billing-message:not(:empty) { padding: 10px 12px; }
.billing-message-error { color: #9f2d31; background: rgba(234, 84, 85, .12); }
.billing-message-warning { color: #856000; background: rgba(255, 193, 7, .16); }
.billing-message-info { color: #185a8d; background: rgba(0, 145, 255, .11); }
.billing-history { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.billing-table-title { padding: 18px 20px; display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--border); }
.billing-table-title h3 { font-size: 15px; margin: 0; }
.billing-table-title span { color: var(--text-muted); font-size: 11px; }
.billing-status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.billing-status-active, .billing-status-paid { color: #167043; background: rgba(40, 199, 111, .14); }
.billing-status-pending { color: #856000; background: rgba(255, 193, 7, .16); }
.billing-status-failed, .billing-status-expired, .billing-status-restricted { color: #9f2d31; background: rgba(234, 84, 85, .13); }
.billing-status-cancelled, .billing-status-suspended { color: var(--text-muted); background: var(--bg); }

@media (max-width: 1100px) {
  .billing-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-checkout-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-qrph-note { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .license-card { padding: 30px 20px 24px; }
  .billing-plan-grid, .billing-customer-fields, .billing-checkout-details { grid-template-columns: 1fr; }
  .billing-qrph-note { grid-column: auto; }
  .billing-current-card { align-items: flex-start; flex-wrap: wrap; }
  .billing-current-card .billing-status { margin-left: 70px; }
}

/* ================================================
   NOTIFICATION BELL
================================================ */
.notif-wrap {
  position: relative;
}

.btn-notif {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 17px;
  transition: var(--transition);
}
.btn-notif:hover { background: var(--bg); color: var(--primary); }

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notifSlideIn 0.18s ease;
}
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.notif-clear-all {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.notif-clear-all:hover { background: var(--bg); color: var(--primary); }

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
  gap: 8px;
}
.notif-empty i { font-size: 28px; opacity: 0.4; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-icon.danger  { background: rgba(234,84,85,0.12);  color: var(--danger); }
.notif-icon.warning { background: rgba(255,183,77,0.15);  color: var(--warning); }
.notif-icon.info    { background: rgba(30,58,95,0.10);    color: var(--primary); }

.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0;
  transition: var(--transition);
}
.notif-item:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { background: var(--bg); color: var(--danger); }

/* ================================================
   PRINT STYLES
================================================ */
@media print {
  /* Hide everything except receipt */
  body { 
    background: #fff; 
    margin: 0;
    padding: 0;
  }
  
  /* Hide all main UI elements */
  .login-screen, 
  .sidebar, 
  .top-header, 
  .order-panel,
  .product-panel,
  .view,
  .toast-container,
  .category-tabs-wrap,
  .products-grid { 
    display: none !important; 
  }
  
  /* Show only receipt modal */
  #receipt-modal.modal-overlay {
    display: block !important;
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }
  
  #receipt-modal .modal-box {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    max-height: none !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  
  #receipt-modal .modal-header {
    display: none !important;
  }
  
  #receipt-modal .modal-body {
    padding: 20px !important;
  }
  
  #receipt-modal .receipt-actions {
    display: none !important;
  }
  
  .main-content { 
    margin-left: 0; 
    display: none !important;
  }
  
  /* Ensure receipt content is visible */
  #receipt-content { 
    display: block !important; 
  }
  
  /* Receipt specific styles for print */
  .rcpt-wrap {
    max-width: 80mm;
    margin: 0 auto;
    font-size: 11pt;
  }
  
  .rcpt-header {
    text-align: center;
    margin-bottom: 16px;
  }
  
  .rcpt-shop-name {
    font-size: 16pt;
    font-weight: bold;
    margin-bottom: 4px;
  }
  
  .rcpt-divider {
    border-top: 1px dashed #000;
    margin: 12px 0;
  }
  
  .rcpt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
  }

  .rcpt-item-main {
    display: block;
  }

  .rcpt-return-note {
    display: block;
    margin-top: 2px;
    font-size: 8.5pt;
    color: #b00020 !important;
  }

  .rcpt-return-block {
    margin-bottom: 4px;
  }

  .rcpt-return-title {
    font-size: 8.5pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .rcpt-return-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 8.5pt;
    margin-bottom: 3px;
  }

  .rcpt-return-row span:last-child,
  .rcpt-deduction-row span:last-child {
    color: #b00020 !important;
  }

  .rcpt-total-line {
    font-size: 14pt;
    font-weight: bold;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid #000;
  }
  
  .rcpt-footer-text {
    text-align: center;
    font-size: 9pt;
    color: #666;
    margin-top: 4px;
  }
}

/* ================================================
   RESPONSIVE
================================================ */

/* ── Tablet: 768px – 1024px ─────────────────── */
@media (max-width: 1024px) {
  /* Sidebar: icon-only collapsed by default on tablet */
  :root { --sidebar-width: 72px; }
  .sidebar {
    width: 72px;
    overflow: visible;
  }
  .sidebar .logo-text,
  .sidebar .nav-section-label,
  .sidebar .sidebar-toggle,
  .sidebar .user-info { display: none; }

  /* Nav items: center icon, hide label */
  .nav-item {
    justify-content: center;
    padding: 12px 0;
  }
  .nav-item .nav-label { display: none; }
  .nav-item i { margin: 0; font-size: 18px; }

  /* Badge on nav items */
  .nav-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 9px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
  }

  /* Main content fills remaining space */
  .main-content { margin-left: 72px; }

  /* POS layout: stack vertically on tablet */
  .pos-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: auto;
    min-height: calc(100vh - 60px);
  }

  /* Cart panel: fixed height at bottom */
  .cart-panel {
    max-height: 380px;
    border-top: 2px solid var(--border);
  }

  /* Header adjustments */
  .top-header { padding: 0 16px; gap: 10px; }
  .header-datetime { font-size: 12px; }

  /* View padding */
  .view { padding: 16px; }

  /* Tables: allow horizontal scroll */
  .products-table-wrap,
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Stat cards: 2 per row on tablet */
  .report-stats { grid-template-columns: repeat(2, 1fr); }

  /* Settings grid */
  .settings-grid { grid-template-columns: 1fr; }

  /* Charts */
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card-large { grid-column: span 1; }

  /* Modal: full width on tablet */
  .modal-box {
    width: 95vw;
    max-width: 95vw;
    margin: 16px auto;
  }

  /* Product grid: 3 columns on tablet */
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  /* Category tabs: scrollable */
  .cat-tabs-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cat-tabs-wrap::-webkit-scrollbar { display: none; }
  .cat-tab { white-space: nowrap; flex-shrink: 0; }
}

/* ── Step 2: Touch-Friendly Tap Targets (tablet ≤ 1024px) ── */
@media (max-width: 1024px) {

  /* ---- Minimum 44px tap target (Apple HIG standard) ---- */

  /* Category tabs */
  .cat-tab {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Add to cart button */
  .btn-add-cart {
    min-height: 40px;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 8px;
  }

  /* Quantity buttons in cart */
  .qty-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 8px;
  }

  /* Quantity input in cart */
  .qty-input {
    width: 52px;
    height: 36px;
    font-size: 15px;
    border-radius: 8px;
  }

  /* Table action buttons */
  .btn-action {
    min-height: 36px;
    min-width: 36px;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
  }
  .table-actions { gap: 8px; }

  /* Payment method buttons */
  .pay-method {
    min-height: 52px;
    padding: 14px 10px;
    font-size: 13px;
    border-radius: 10px;
  }

  /* Form inputs — larger touch area */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="password"],
  select,
  textarea {
    min-height: 44px;
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 8px;
  }

  /* Cash tendered input */
  .cash-input {
    min-height: 52px;
    font-size: 22px;
    padding: 12px 16px;
  }

  /* Quick cash buttons */
  .quick-cash-btn {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
  }

  /* Primary buttons */
  .btn-primary,
  .btn-success,
  .btn-danger,
  .btn-secondary {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 10px;
  }

  /* Complete sale / confirm payment buttons */
  .btn-complete-sale,
  #btn-confirm-payment {
    min-height: 52px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* Remove item button in cart */
  .btn-remove {
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
    border-radius: 8px;
  }

  /* Nav items — larger tap area */
  .nav-item {
    min-height: 48px;
  }

  /* Checkbox and radio — larger */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
  }

  /* Scrollable areas — momentum scrolling */
  .cart-items,
  .products-grid,
  .data-table-wrap,
  .products-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* Product cards — slightly larger for easier tap */
  .product-card {
    cursor: pointer;
  }
  .product-card .product-footer {
    gap: 8px;
  }
}


@media (max-width: 1100px) {
  .pos-layout { grid-template-columns: 1fr 320px; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 68px; }
  .sidebar { width: 68px; }
  .sidebar .logo-text,
  .sidebar .nav-section-label,
  .sidebar .sidebar-toggle,
  .sidebar .user-info { display: none; }
  .product-panel { overflow: hidden; }
  .pos-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 360px;
    height: auto;
  }
}

/* ── Step 3: POS Cart Panel & Product Grid (tablet ≤ 1024px) ── */
@media (max-width: 1024px) {

  /* POS layout: product grid top, cart panel bottom */
  .pos-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 12px;
    height: auto;
    min-height: calc(100vh - 60px);
  }

  /* Product panel fills available height */
  .product-panel {
    min-height: 0;
    max-height: calc(100vh - 60px - 420px);
    overflow: hidden;
  }

  /* Products grid: 3 columns on tablet */
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    max-height: calc(100vh - 60px - 480px);
    overflow-y: auto;
  }

  /* Product card: slightly more padding for touch */
  .product-card .product-body {
    padding: 10px 12px;
  }
  .product-name { font-size: 13px; }
  .product-price { font-size: 15px; }

  /* Cart / Order panel: fixed height at bottom */
  .order-panel {
    max-height: 420px;
    display: flex;
    flex-direction: column;
  }

  /* Cart items area: scrollable */
  .cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: 180px;
    padding: 10px;
  }

  /* Cart item row: more spacing for touch */
  .cart-item {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 8px;
  }
  .cart-item-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .cart-item-name { font-size: 13px; }
  .cart-item-price { font-size: 12px; }

  /* Cart controls: bigger gap */
  .cart-item-controls { gap: 8px; }

  /* Order summary: compact */
  .order-summary {
    padding: 10px 16px;
  }
  .summary-row {
    font-size: 13px;
    margin-bottom: 6px;
  }
  .summary-total {
    padding: 12px 14px;
    font-size: 17px;
    margin-top: 8px;
  }

  /* Order actions: full-width buttons */
  .order-actions {
    padding: 10px 16px;
    gap: 10px;
  }
  .order-actions .btn-danger,
  .order-actions .btn-success {
    flex: 1;
    min-height: 48px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
  }

  /* Order header: compact */
  .order-header { padding: 12px 16px; }
  .order-title h3 { font-size: 14px; }
  .order-meta-item { font-size: 12px; }

  /* Discount input row */
  .discount-row .discount-input-wrap input {
    width: 80px;
    font-size: 14px;
  }
}

/* ── Step 3 continued: restore 640px overrides ── */
@media (max-width: 640px) {
  .top-header { padding: 0 14px; gap: 8px; }
  .header-datetime { display: none; }
  .header-user-info { display: none; }
  .branch-switcher { padding: 5px 7px; }
  .branch-switcher-text { min-width: 0; }
  .branch-switcher-text > span { display: none; }
  .branch-switcher select { max-width: 105px; }
  .analytics-filters { width: 100%; }
  .analytics-filters .filter-select,
  .analytics-filters .btn-accent { flex: 1 1 100%; width: 100%; }
  .view { padding: 14px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .report-stats { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .payment-methods { flex-direction: column; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card-large { grid-column: span 1; }
}

/* ================================================
   ICON PICKER
================================================ */
.icon-selector-btn {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--text-primary);
}

.icon-selector-btn:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.icon-selector-btn i:first-child {
  font-size: 20px;
  color: var(--accent);
}

.icon-selector-btn span {
  flex: 1;
  text-align: left;
  font-family: monospace;
}

.icon-selector-btn i:last-child {
  font-size: 12px;
  color: var(--text-muted);
}

.icon-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 9999;
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

.icon-picker-dropdown.hidden {
  display: none;
}

.icon-picker-search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.icon-picker-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
}

.icon-picker-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 10px;
  overflow-y: auto;
  max-height: 240px;
}

.icon-picker-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
  font-size: 20px;
  color: var(--text-primary);
}

.icon-picker-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.1);
  z-index: 1;
}

.icon-picker-item.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.2);
}

.icon-picker-grid::-webkit-scrollbar {
  width: 8px;
}

.icon-picker-grid::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.icon-picker-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.icon-picker-grid::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.form-group {
  position: relative;
}


/* -------- CONSIGNMENT PAYMENT -------- */
.consignment-input-section {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.consignment-info-box {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 140, 66, 0.1);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 20px;
}

.consignment-info-box i {
  color: var(--accent);
  font-size: 20px;
  margin-top: 2px;
}

.consignment-info-box strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 14px;
}

.consignment-info-box p {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

.consignment-summary {
  margin-top: 20px;
  padding: 16px;
  background: var(--secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.consignment-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.consignment-summary-row:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.consignment-summary-row strong {
  font-size: 18px;
  color: var(--text-primary);
}


/* -------- CONSIGNMENT FILTERS -------- */
.consignment-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 66, 0.05);
}

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

.filter-tab i {
  font-size: 12px;
}

/* -------- PAYMENT INFO SUMMARY -------- */
.payment-info-summary {
  background: var(--secondary);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
}

.payment-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}

.payment-info-row:last-child {
  margin-bottom: 0;
}

.payment-info-row span {
  color: var(--text-secondary);
}

.payment-info-row strong {
  color: var(--text-primary);
  font-size: 15px;
}


/* ================================================
   STEP 4 — Tables, Modals & Forms (Tablet ≤ 1024px)
================================================ */
@media (max-width: 1024px) {

  /* ---- DATA TABLES ---- */

  /* Wrap tables in horizontal scroll container */
  .data-table-wrap,
  .products-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }

  /* Table cells: more padding for touch */
  .data-table th,
  .data-table td {
    padding: 12px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Table header: slightly larger */
  .data-table th {
    font-size: 11px;
    padding: 10px 14px;
  }

  /* Table product cell */
  .table-product-cell {
    gap: 10px;
  }
  .table-thumb {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
  }
  .table-product-name { font-size: 13px; }
  .table-product-sub  { font-size: 11px; }

  /* ---- MODALS ---- */

  /* Modal overlay: full screen on tablet */
  .modal-overlay {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modal box: full width, max height with scroll */
  .modal-box {
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
    border-radius: 16px;
  }

  /* Modal header */
  .modal-header {
    padding: 16px 20px;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
    border-radius: 16px 16px 0 0;
  }
  .modal-header h3 { font-size: 16px; }

  /* Modal body */
  .modal-body {
    padding: 16px 20px;
  }

  /* Modal footer: sticky at bottom */
  .modal-footer {
    padding: 14px 20px;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 10px;
  }
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary,
  .modal-footer .btn-danger {
    flex: 1;
    min-height: 48px;
    font-size: 14px;
    font-weight: 700;
  }

  /* ---- FORMS ---- */

  /* Form groups: more spacing */
  .form-group {
    margin-bottom: 16px;
  }
  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
  }

  /* Form grid: single column on tablet */
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Select dropdowns */
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
  }

  /* ---- PAYMENT MODAL ---- */

  /* Payment methods: 2x2 grid on tablet */
  .payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .pay-method {
    min-height: 56px;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
  }
  .pay-method i { font-size: 18px; }

  /* Quick cash buttons: 2 per row */
  .quick-cash-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .quick-cash-btn {
    min-height: 44px;
    font-size: 13px;
    font-weight: 700;
  }

  /* Change amount display */
  .change-display {
    font-size: 20px;
    padding: 12px 16px;
  }

  /* ---- CONSIGNMENT TABLE ---- */
  #consignment-table-body td {
    font-size: 13px;
    padding: 12px 10px;
  }

  /* ---- SETTINGS ---- */
  .settings-section {
    padding: 16px;
    margin-bottom: 16px;
  }
  .settings-section h3 {
    font-size: 15px;
    margin-bottom: 14px;
  }

  /* ---- FILTER TABS (Orders, Consignment) ---- */
  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 40px;
    padding: 8px 16px;
    font-size: 13px;
  }

  /* ---- BADGES ---- */
  .badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  /* ---- SEARCH BAR ---- */
  .search-bar {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 40px;
  }
  .search-wrap .search-icon {
    font-size: 15px;
  }
}


/* ================================================
   STEP 5 — Sidebar Tooltips, Scroll Polish &
             Final Touch Fixes (Tablet ≤ 1024px)
================================================ */

/* ── 5a: Sidebar tooltip labels on hover (icon-only mode) ── */
@media (max-width: 1024px) {

  /* Position nav-item as tooltip anchor */
  .nav-item {
    position: relative;
  }

  /* Tooltip: show nav label on hover when sidebar is collapsed */
  .nav-item .nav-label {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-sidebar);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(-50%) translateX(-4px);
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    /* Arrow pointing left */
    display: block !important;
  }
  .nav-item .nav-label::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--bg-sidebar);
  }
  .nav-item:hover .nav-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  /* ── 5b: Smooth scrolling everywhere ── */
  html {
    scroll-behavior: smooth;
  }
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* ── 5c: Prevent text selection on buttons (accidental long-press) ── */
  button,
  .btn-action,
  .btn-add-cart,
  .qty-btn,
  .cat-tab,
  .nav-item,
  .pay-method,
  .product-card {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* ── 5d: Active state feedback for touch (replaces hover) ── */
  .btn-action:active,
  .btn-add-cart:active,
  .qty-btn:active,
  .cat-tab:active,
  .pay-method:active,
  .product-card:active {
    transform: scale(0.96);
    opacity: 0.85;
    transition: transform 0.08s ease, opacity 0.08s ease;
  }

  /* ── 5e: Scrollbar styling for tablet ── */
  .cart-items::-webkit-scrollbar,
  .products-grid::-webkit-scrollbar,
  .data-table-wrap::-webkit-scrollbar,
  .modal-box::-webkit-scrollbar,
  .sidebar-nav::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
  .cart-items::-webkit-scrollbar-track,
  .products-grid::-webkit-scrollbar-track,
  .data-table-wrap::-webkit-scrollbar-track,
  .modal-box::-webkit-scrollbar-track,
  .sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
  }
  .cart-items::-webkit-scrollbar-thumb,
  .products-grid::-webkit-scrollbar-thumb,
  .data-table-wrap::-webkit-scrollbar-thumb,
  .modal-box::-webkit-scrollbar-thumb,
  .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(128,128,128,0.35);
    border-radius: 99px;
  }

  /* ── 5f: Header improvements ── */
  .top-header {
    padding: 0 16px;
    height: 56px;
  }
  .header-search-wrap {
    max-width: 280px;
  }
  .header-search-wrap input {
    font-size: 14px;
    min-height: 38px;
  }

  /* ── 5g: View padding ── */
  .view {
    padding: 16px;
  }

  /* ── 5h: Page titles ── */
  .page-title {
    font-size: 20px;
  }
  .page-subtitle {
    font-size: 13px;
  }

  /* ── 5i: Toast notifications — larger on tablet ── */
  .toast-container {
    top: 16px;
    right: 16px;
    max-width: 320px;
  }
  .toast {
    padding: 14px 16px;
    font-size: 13px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  }
  .toast-title { font-size: 14px; }

  /* ── 5j: Login screen — centered on tablet ── */
  .login-screen {
    padding: 24px;
  }
.login-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-card {
    max-width: 420px;
    width: 100%;
    padding: 32px 28px;
    border-radius: 20px;
  }
  .login-logo { font-size: 48px; }
  .login-title { font-size: 22px; }

  /* ── 5k: Image viewer modal ── */
  #image-viewer-modal .modal-box {
    max-width: 90vw;
    max-height: 90vh;
  }

  /* ── 5l: Prevent iOS zoom on input focus ── */
  input, select, textarea {
    font-size: max(16px, 1em);
  }
}

/* ── 5m: Landscape tablet (e.g. iPad landscape 1024×768) ── */
@media (max-width: 1024px) and (orientation: landscape) {
  .pos-layout {
    grid-template-columns: 1fr 340px;
    grid-template-rows: 1fr;
    height: calc(100vh - 56px);
  }
  .product-panel {
    max-height: none;
    overflow: hidden;
  }
  .products-grid {
    max-height: calc(100vh - 56px - 120px);
  }
  .order-panel {
    max-height: calc(100vh - 56px);
  }
  .cart-items {
    max-height: calc(100vh - 56px - 320px);
  }
}
