/* =========================================
   كاشير برو - ملف التنسيق الرئيسي
   POS System - style.css
   ========================================= */

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

/* =========================================
   1. CSS VARIABLES (Design Tokens)
   ========================================= */
:root {
  /* Colors - Light Mode */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --secondary: #7C3AED;
  --secondary-light: #EDE9FE;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --info: #0891B2;
  --info-light: #CFFAFE;

  /* Backgrounds */
  --bg: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1E293B;
  --bg-navbar: #FFFFFF;
  --bg-hover: #F8FAFC;
  --bg-input: #FFFFFF;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Borders */
  --border: #E2E8F0;
  --border-focus: #2563EB;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.2);

  /* Layout */
  --sidebar-width: 240px;
  --navbar-height: 60px;
  --bottom-nav-height: 64px;

  /* Typography */
  --font-ar: 'Cairo', 'Segoe UI', Tahoma, -apple-system, BlinkMacSystemFont, Arial, 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
  --font-en: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
  --font-emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI Symbol', 'Android Emoji', sans-serif;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-sidebar: #0F172A;
  --bg-navbar: #1E293B;
  --bg-hover: #334155;
  --bg-input: #334155;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --border: #334155;
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.5);
  --primary-light: #1E3A5F;
  --success-light: #14532D;
  --danger-light: #7F1D1D;
  --warning-light: #713F12;
}

/* =========================================
   2. BASE STYLES
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-ar);
  background: var(--bg);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
}

/* LTR language mode */
[lang="en"] body {
  font-family: var(--font-en);
  direction: ltr;
}
[lang="en"] .sidebar { right: unset; left: 0; }
[lang="en"] .main-content { margin-right: 0; margin-left: var(--sidebar-width); }
[lang="en"] .navbar-right { order: 1; }
[lang="en"] .navbar-left { order: 3; }

h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.3; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.w-full { width: 100%; }
.span-2 { grid-column: span 2; }

/* =========================================
   3. BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(37,99,235,0.4); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803D; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #B45309; }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #6D28D9; }

.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-hover); }

.btn-outline-primary { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }

.btn-outline-secondary { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--bg-hover); }

.btn-outline-success { background: transparent; border: 1.5px solid var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: white; }

.btn-outline-warning { background: transparent; border: 1.5px solid var(--warning); color: var(--warning); }
.btn-outline-warning:hover { background: var(--warning); color: white; }

.btn-outline-danger { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: white; }

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

.btn-lg { padding: 12px 24px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }

/* =========================================
   4. FORMS
   ========================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control, input[type="text"], input[type="number"],
input[type="password"], input[type="email"], input[type="date"],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, input[type="text"]:focus, input[type="number"]:focus,
input[type="password"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 0.82rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
}
.form-control-sm:focus { outline: none; border-color: var(--primary); }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Toggle Switch */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  right: 3px;
  transition: right var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle-label input:checked ~ .toggle-slider { background: var(--success); }
.toggle-label input:checked ~ .toggle-slider::after { right: calc(100% - 21px); }

/* =========================================
   5. LOGIN SCREEN
   ========================================= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, #0f172a, #1e3a5f, #2563eb, #7c3aed);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Animated Orbs */
.login-screen::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.4) 0%, rgba(37, 99, 235, 0) 70%);
  top: -200px;
  right: -200px;
  animation: floatOrb 8s ease-in-out infinite alternate;
  filter: blur(40px);
}
.login-screen::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.4) 0%, rgba(15, 23, 42, 0) 70%);
  bottom: -150px;
  left: -150px;
  animation: floatOrb 12s ease-in-out infinite alternate-reverse;
  filter: blur(40px);
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(50px) scale(1.1); }
}

.login-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xl);
  padding: 50px 45px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
  transform: translateY(20px);
  opacity: 0;
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Adjust forms for glassmorphism */
.login-card label {
  color: #f1f5f9;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.login-card input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.login-card input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.login-card input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.login-logo { text-align: center; margin-bottom: 35px; }
.logo-icon { font-size: 4rem; display: inline-block; margin-bottom: 12px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2)); animation: bounce 3s ease-in-out infinite; }
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.login-title { font-size: 2rem; font-weight: 800; color: #ffffff; text-shadow: 0 2px 10px rgba(0,0,0,0.2); margin-bottom: 4px; }
.login-subtitle { color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; font-weight: 500; }
.login-error { background: rgba(220, 38, 38, 0.2); backdrop-filter: blur(10px); color: #fca5a5; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px; border: 1px solid rgba(220, 38, 38, 0.3); }

.password-wrap { position: relative; }
.password-wrap input { padding-left: 45px; }
.toggle-pass { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1.2rem; color: rgba(255,255,255,0.7); transition: color var(--transition); }
.toggle-pass:hover { color: #ffffff; }

/* Login Button Glow */
.login-card .btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border: none;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.login-card .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6);
}
.login-card .btn-secondary {
  background: rgba(16, 185, 129, 0.2) !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  color: #34d399 !important;
  backdrop-filter: blur(10px);
}
.login-card .btn-secondary:hover {
  background: rgba(16, 185, 129, 0.3) !important;
}

/* =========================================
   6. TOP NAVBAR
   ========================================= */
.top-navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--navbar-height);
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-slow);
}

.navbar-right, .navbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
  padding: 0 8px;
}

.screen-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
}

.db-connection-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 3px 10px;
  letter-spacing: 0.3px;
  direction: ltr;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}
.brand-icon { font-size: 1.3rem; }

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-primary);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: none;
}

.nav-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: all var(--transition);
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: background var(--transition);
}
.user-info:hover { background: var(--bg-hover); }

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-details { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 0.85rem; font-weight: 700; }
.user-role { font-size: 0.72rem; color: var(--text-muted); }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
}
.user-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: background var(--transition);
}
.user-menu button:hover { background: var(--bg-hover); }

/* =========================================
   7. SIDEBAR
   ========================================= */
.sidebar {
  position: fixed;
  top: var(--navbar-height);
  right: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background: var(--bg-sidebar);
  overflow-y: auto;
  z-index: 90;
  transition: transform var(--transition-slow);
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.sidebar-nav { padding: 12px 0; }

.nav-section { margin-bottom: 8px; }
.nav-section-title {
  padding: 8px 20px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 20px;
  background: none;
  border: none;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94A3B8;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #E2E8F0;
}
.nav-item.active {
  background: rgba(37,99,235,0.15);
  color: #60A5FA;
  border-left: 3px solid var(--primary);
}
[dir="rtl"] .nav-item.active { border-left: none; border-right: 3px solid var(--primary); }
.nav-icon { 
  font-size: 1.2rem; 
  flex-shrink: 0; 
  font-family: var(--font-emoji); 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  line-height: 1;
}

.logo-icon, .brand-icon, .stat-icon, .cat-icon, .btn-icon, .nav-btn, .toggle-pass, .user-avatar, [data-icon] {
  font-family: var(--font-emoji);
  font-style: normal;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 89;
  backdrop-filter: blur(2px);
}

/* =========================================
   8. MAIN CONTENT
   ========================================= */
.main-app { display: flex; flex-direction: column; min-height: 100vh; }

.main-content {
  margin-top: var(--navbar-height);
  margin-right: var(--sidebar-width);
  min-height: calc(100vh - var(--navbar-height));
  transition: margin var(--transition-slow);
}

.screen { display: none; height: calc(100vh - var(--navbar-height)); overflow: hidden; }
.screen.active { display: flex !important; flex-direction: column; }

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
}
.screen-header h2 { font-size: 1.2rem; }

.screen-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* =========================================
   9. POS SCREEN (Redesigned Professional UI)
   ========================================= */
.pos-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
  gap: 14px;
  padding: 12px;
  background: var(--bg);
  box-sizing: border-box;
}

/* Product Side Panel */
.pos-products {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

/* Shift Banner inside POS */
.pos-shift-banner {
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(37, 99, 235, 0.08));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  gap: 10px;
}
.pos-shift-banner .shift-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pos-shift-banner .shift-badge-active {
  background: #10b981;
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
}

/* Search Bar */
.pos-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  right: 14px;
  color: var(--primary);
  font-size: 1.1rem;
  pointer-events: none;
}
#pos-search {
  width: 100%;
  padding: 11px 44px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition);
}
#pos-search:focus {
  border-color: var(--primary);
  background: var(--bg-input);
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.btn-clear-search {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}
.btn-quick-sale {
  flex-shrink: 0;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--primary) !important;
  border: 1.5px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-quick-sale:hover {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white !important;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Category Tabs */
.pos-cats-wrap {
  flex-shrink: 0;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.015);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.pos-categories {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  width: max-content;
  min-width: 100%;
}
.cat-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  user-select: none;
}
.cat-tab:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.cat-tab.active {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.cat-count-badge {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 800;
}
.cat-tab.active .cat-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Products Grid */
.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
  align-content: start;
}

.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  user-select: none;
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
  transform: translateY(-3px);
  background: var(--bg-hover);
}
.product-card:active {
  transform: scale(0.96);
}
.product-card.out-of-stock {
  opacity: 0.55;
  filter: grayscale(0.8);
  pointer-events: none;
}

.product-card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 2px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.product-card:hover .product-card-icon-wrap {
  transform: scale(1.1);
}

.product-card-name {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
  word-break: break-word;
}
.product-card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-top: auto;
  width: 100%;
  padding-top: 4px;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}
.product-card-price {
  font-size: 1rem;
  font-weight: 900;
  color: var(--primary);
}
.product-card-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.product-card-qty {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.product-card-qty.low {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  animation: pulse-low-stock 2s infinite ease-in-out;
}
@keyframes pulse-low-stock {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Combo card styling */
.product-card.combo-card {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #ffffff);
}
.product-card.combo-card:hover {
  border-color: #d97706;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.22);
}
.combo-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 0 12px 0 10px;
}

/* =========================================
   10. CART (POS Invoice Panel)
   ========================================= */
.pos-cart {
  width: 390px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

@media (max-width: 1200px) {
  .pos-cart {
    width: 350px;
  }
}

.cart-header {
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--border);
  background: rgba(0, 0, 0, 0.015);
  flex-shrink: 0;
}
.cart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cart-title-row h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.cart-items-count-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 800;
}
.cart-actions {
  display: flex;
  gap: 6px;
}

.customer-select-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}
.customer-select {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
}
.customer-select:focus {
  border-color: var(--primary);
  background: var(--bg-input);
}

.customer-info-bar {
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--primary-light);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Held Invoices Bar */
.held-invoices-bar {
  padding: 8px 12px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
}
.held-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f59e0b;
  color: white;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.held-badge:hover {
  opacity: 0.85;
}

/* Cart Items List */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
}
.empty-icon {
  font-size: 3.5rem;
  opacity: 0.4;
}
.empty-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cart-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.cart-item:hover {
  background: var(--bg-hover);
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cart-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.cart-item-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  flex: 1;
  word-break: break-word;
}
.cart-item-total-price {
  font-size: 1.05rem;
  font-weight: 900;
  color: #059669;
  white-space: nowrap;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}
.cart-item-unit-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-card);
  padding: 2px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.qty-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.qty-btn:hover {
  background: var(--primary);
  color: white;
}
.qty-input {
  width: 40px;
  text-align: center;
  padding: 2px 0;
  border: none;
  font-size: 0.9rem;
  font-weight: 800;
  background: transparent;
  color: var(--text-primary);
  outline: none;
}

.cart-item-del {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.cart-item-del:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Coupon & Discount Rows */
.coupon-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.01);
  flex-shrink: 0;
}
.coupon-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.coupon-msg {
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  flex-shrink: 0;
}
.coupon-msg.success {
  background: #dcfce7;
  color: #166534;
}
.coupon-msg.error {
  background: #fee2e2;
  color: #991b1b;
}

.discount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  flex-shrink: 0;
}
.discount-display {
  font-size: 0.82rem;
  color: var(--danger);
  font-weight: 700;
}

/* Financial Totals Card */
.cart-totals {
  padding: 10px 14px;
  border-top: 1.5px solid var(--border);
  background: rgba(0, 0, 0, 0.015);
  flex-shrink: 0;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.total-row.grand-total {
  border-top: 1.5px dashed var(--border);
  margin-top: 8px;
  padding-top: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}
.grand-total-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 1px 2px rgba(37, 99, 235, 0.1);
}
.loyalty-preview {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #d97706;
  padding: 5px;
  background: #fef3c7;
  border-radius: 8px;
  margin-top: 6px;
}

/* Delivery Section */
.delivery-toggle-row {
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.delivery-fields {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  background: var(--bg);
}
.delivery-fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Payment Section */
.payment-section {
  border-top: 2px solid var(--border);
  padding: 12px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
}
.payment-methods {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.pay-method {
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}
.pay-method:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.pay-method.active {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.pay-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Quick Cash Tender Row */
.quick-cash-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.quick-cash-btn {
  flex: 1;
  padding: 5px 6px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-align: center;
}
.quick-cash-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}
.quick-cash-btn.exact {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.cash-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cash-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.cash-field input {
  width: 130px;
  padding: 8px 10px;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  background: var(--bg-input);
}
.cash-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.change-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
}
.change-row span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.change-amount {
  font-size: 1.15rem;
  font-weight: 900;
  color: #059669;
}

.btn-checkout {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 900;
  border-radius: 12px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, #059669, #047857);
}
.btn-checkout:active {
  transform: scale(0.98);
}

/* =========================================
   11. TABLES
   ========================================= */
.table-responsive { width: 100%; overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 0.875rem;
}
thead th {
  background: var(--bg);
  padding: 12px 14px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-hover); }
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }

.actions-cell { display: flex; gap: 4px; flex-wrap: wrap; }

/* =========================================
   12. BADGES & STATUS
   ========================================= */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-paid { background: var(--success-light); color: var(--success); }
.status-partial { background: var(--warning-light); color: var(--warning); }
.status-unpaid { background: var(--danger-light); color: var(--danger); }
.status-preparing { background: var(--warning-light); color: var(--warning); }
.status-delivering { background: var(--info-light); color: var(--info); }
.status-delivered { background: var(--success-light); color: var(--success); }
.status-cancelled { background: var(--danger-light); color: var(--danger); }
.status-draft { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.status-sent { background: var(--primary-light); color: var(--primary); }
.status-converted { background: var(--success-light); color: var(--success); }

.tag-vip {
  background: linear-gradient(135deg, #FCD34D, #F59E0B);
  color: #78350F;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* =========================================
   13. MODALS
   ========================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
  overflow: hidden;
}
@keyframes modalIn {
  from { transform: scale(0.92) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-box.modal-sm { max-width: 380px; }
.modal-box.modal-lg { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* =========================================
   14. CARDS & GRIDS
   ========================================= */
.categories-grid, .combos-grid, .zones-grid, .staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.cat-card, .zone-card, .staff-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition);
}
.cat-card:hover, .zone-card:hover, .staff-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.combo-card-item {
  background: var(--bg-card);
  border: 1.5px solid var(--warning);
  border-radius: var(--radius);
  padding: 16px;
}

.card-actions { display: flex; gap: 6px; }

/* =========================================
   15. DELIVERY KANBAN
   ========================================= */
.kanban-board {
  display: flex;
  gap: 16px;
  padding: 4px;
  overflow-x: auto;
  min-height: 400px;
}

.kanban-col {
  flex-shrink: 0;
  width: 280px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-col-title {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.kanban-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kanban-card-num { font-size: 0.78rem; font-weight: 700; color: var(--primary); }
.kanban-card-body { font-size: 0.82rem; }
.kanban-card-footer { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }

/* Zone View */
.zone-group { background: var(--bg-card); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; border: 1px solid var(--border); }
.zone-group-title { background: var(--primary-light); color: var(--primary); padding: 10px 16px; font-weight: 700; font-size: 0.9rem; }
.zone-group-orders { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

/* =========================================
   16. REPORTS
   ========================================= */
.report-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 12px;
  flex-wrap: wrap;
}
.report-tab {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.report-tab:hover { border-color: var(--primary); color: var(--primary); }
.report-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.report-content { display: flex; flex-direction: column; gap: 16px; }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon { font-size: 1.5rem; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.stat-sub { font-size: 0.72rem; color: var(--text-muted); }

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.chart-container h4 { margin-bottom: 12px; font-size: 0.9rem; }

/* =========================================
   17. SETTINGS
   ========================================= */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.settings-card h3 { font-size: 0.95rem; margin-bottom: 16px; color: var(--text-primary); }
.settings-actions { display: flex; flex-direction: column; gap: 8px; }

/* =========================================
   18. FILTER TABS & MISC
   ========================================= */
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-tab:hover { background: var(--primary-light); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.view-toggle { display: flex; gap: 4px; }

.search-input-sm {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--transition);
}
.search-input-sm:focus { outline: none; border-color: var(--primary); }

/* Barcode Wrap */
.barcode-input-wrap { display: flex; gap: 6px; align-items: center; }
.barcode-input-wrap input { flex: 1; }

/* Discount Preview */
.discount-preview { padding: 8px; background: var(--warning-light); border-radius: var(--radius-sm); font-size: 0.85rem; margin-top: 8px; }

/* =========================================
   19. TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  max-width: 320px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: all;
}
@keyframes toastIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(-20px); opacity: 0; } }

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-warning { background: var(--warning); color: white; }
.toast-info { background: var(--primary); color: white; }

/* =========================================
   20. BARCODE NOT FOUND BANNER
   ========================================= */
.barcode-banner {
  position: fixed;
  bottom: 80px;
  right: 340px;
  background: var(--danger);
  color: white;
  border-radius: var(--radius);
  padding: 12px 16px;
  z-index: 400;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.barcode-banner-content { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* =========================================
   21. BOTTOM NAVIGATION (Mobile)
   ========================================= */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px;
  transition: all var(--transition);
  font-family: inherit;
}
.bottom-nav-item span:first-child { font-size: 1.3rem; }
.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--primary); }

/* =========================================
   22. PURCHASE FORMS
   ========================================= */
.po-item-row, .pi-item-row, .combo-item-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.po-item-row select, .po-item-row input,
.pi-item-row select, .pi-item-row input,
.combo-item-row select, .combo-item-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  font-size: 0.82rem;
}
.po-total-row, .pi-total-row, .combo-price-calc {
  padding: 10px 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.pi-total-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* =========================================
   23. STAR RATING
   ========================================= */
.star-rating { display: flex; gap: 4px; }
.star {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform var(--transition);
  filter: grayscale(1);
  opacity: 0.4;
}
.star.active { filter: none; opacity: 1; transform: scale(1.1); }

/* =========================================
   24. PRINT STYLES & BARCODE LABELS
   ========================================= */
.print-area { display: none; }

/* KBD Badge for Shortcuts */
.kbd-badge {
  display: inline-block;
  padding: 3px 8px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-bottom: 2px solid #94a3b8;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Barcode Label Modal & Preview */
.barcode-preview-box {
  background: #f8fafc;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  max-height: 380px;
  overflow-y: auto;
}

.barcode-sticker {
  background: #ffffff;
  color: #000000;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.barcode-sticker.size-38x25 {
  width: 38mm;
  height: 25mm;
  font-size: 9px;
}
.barcode-sticker.size-50x25 {
  width: 50mm;
  height: 25mm;
  font-size: 10px;
}
.barcode-sticker.size-50x30 {
  width: 50mm;
  height: 30mm;
  font-size: 11px;
}

.barcode-sticker .sticker-store {
  font-size: 8px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.barcode-sticker .sticker-name {
  font-size: 10px;
  font-weight: 800;
  color: #000;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.barcode-sticker .sticker-price {
  font-size: 11px;
  font-weight: 900;
  color: #000;
}
.barcode-sticker svg.barcode-svg {
  max-width: 95%;
  height: 32px;
  margin: 2px 0;
}
.barcode-sticker .sticker-code {
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Receipt Enhancements */
.receipt-logo {
  max-width: 65px;
  max-height: 65px;
  object-fit: contain;
  margin: 0 auto 6px auto;
  display: block;
}
.receipt-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}
.receipt-qr-wrap canvas, .receipt-qr-wrap img {
  width: 95px;
  height: 95px;
}
.receipt-barcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}
.receipt-barcode-wrap svg {
  max-width: 100%;
  height: 36px;
}

@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area {
    display: block !important;
    width: 100%;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    direction: rtl;
    color: #000 !important;
    background: #fff !important;
  }

  /* Thermal 80mm format */
  .receipt.paper-80mm {
    max-width: 78mm;
    margin: 0 auto;
    padding: 3mm;
  }

  /* Thermal 58mm format */
  .receipt.paper-58mm {
    max-width: 56mm;
    margin: 0 auto;
    padding: 2mm;
    font-size: 10px;
  }
  .receipt.paper-58mm .receipt-header h2 { font-size: 12px; }
  .receipt.paper-58mm .receipt-items td { font-size: 9px; padding: 2px 1px; }
  .receipt.paper-58mm .receipt-totals .r-row { font-size: 9px; }
  .receipt.paper-58mm .receipt-totals .r-total { font-size: 12px; }
  .receipt.paper-58mm .receipt-qr-wrap canvas, .receipt.paper-58mm .receipt-qr-wrap img { width: 75px; height: 75px; }

  /* A4 Page format */
  .receipt.paper-a4 {
    max-width: 190mm;
    margin: 10mm auto;
    padding: 10mm;
    border: 1px solid #ccc;
    font-size: 14px;
  }
  .receipt.paper-a4 .receipt-header h2 { font-size: 22px; }
  .receipt.paper-a4 .receipt-items td { font-size: 13px; padding: 6px 4px; }
  .receipt.paper-a4 .receipt-totals .r-row { font-size: 13px; }
  .receipt.paper-a4 .receipt-totals .r-total { font-size: 18px; }

  .receipt-header { text-align: center; margin-bottom: 8px; }
  .receipt-header h2 { font-size: 15px; font-weight: 900; margin-bottom: 2px; }
  .receipt-header p { font-size: 11px; margin: 1px 0; }
  .receipt-divider { border: none; border-top: 1px dashed #000; margin: 6px 0; }
  .receipt-items table { width: 100%; border-collapse: collapse; }
  .receipt-items th { font-size: 11px; border-bottom: 1px solid #000; padding: 3px 2px; text-align: right; }
  .receipt-items td { padding: 3px 2px; font-size: 11px; }
  .receipt-totals { margin-top: 6px; }
  .receipt-totals .r-row { display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0; }
  .receipt-totals .r-total { font-size: 14px; font-weight: 900; border-top: 1px solid #000; padding-top: 4px; }
  .receipt-footer { text-align: center; margin-top: 8px; font-size: 10px; }

  /* Sticker Sheet Printing */
  .barcode-sticker-sheet {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
  }
  .barcode-sticker-sheet .barcode-sticker {
    box-shadow: none;
    border: none;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  @page {
    margin: 0;
  }
}

/* =========================================
   25. MISC UTILITY
   ========================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.radio-group { display: flex; gap: 16px; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.875rem; }

.expiry-near { background: var(--warning-light) !important; }
.expiry-very-near { background: var(--danger-light) !important; }
.stock-low { color: var(--danger); font-weight: 700; }

.pi-total-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 4px 0; }

/* Shift Close Report */
.shift-report-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.shift-report-total { font-size: 1.2rem; font-weight: 800; color: var(--success); }

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

/* =========================================
   27. FULL RESPONSIVE DESIGN (ALL SCREENS)
   ========================================= */

/* --- 1. Extra Large & 4K/2K Screens (min-width: 1800px) --- */
@media (min-width: 1800px) {
  :root {
    --navbar-height: 64px;
    --sidebar-width: 260px;
  }
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 14px;
    padding: 16px;
  }
  .product-card {
    min-height: 135px;
    padding: 14px 10px;
  }
  .product-card-icon {
    font-size: 2.4rem;
  }
  .product-card-name {
    font-size: 0.95rem;
  }
  .product-card-price {
    font-size: 1.05rem;
  }
  .pos-cart {
    width: 430px;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

/* --- 2. Compact Desktops & Standard POS Terminals (max-width: 1280px or max-height: 800px) --- */
@media (max-width: 1280px), (max-height: 820px) and (min-width: 769px) {
  :root {
    --navbar-height: 48px;
  }
  .top-navbar {
    padding: 0 10px;
  }
  .brand-name {
    font-size: 0.95rem;
  }
  .nav-btn {
    padding: 4px 8px;
    font-size: 0.85rem;
  }
  .pos-layout {
    padding: 6px;
    gap: 6px;
    height: 100%;
  }
  .pos-products {
    flex: 1;
  }
  .pos-shift-banner {
    padding: 4px 10px;
    font-size: 0.78rem;
  }
  .pos-search-bar {
    padding: 6px 10px;
    gap: 6px;
  }
  #pos-search {
    padding: 6px 30px 6px 28px;
    font-size: 0.82rem;
    height: 32px;
  }
  .btn-quick-sale {
    padding: 4px 10px;
    font-size: 0.75rem;
    height: 32px;
  }
  .pos-categories {
    padding: 4px 10px;
    gap: 4px;
  }
  .cat-tab {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: 8px;
  }
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
    padding: 8px;
  }
  .product-card {
    min-height: 85px;
    padding: 6px 4px;
    gap: 2px;
  }
  .product-card-icon-wrap {
    font-size: 1.4rem;
  }
  .product-card-name {
    font-size: 0.75rem;
    line-height: 1.2;
  }
  .product-card-price {
    font-size: 0.82rem;
  }

  /* Compact Cart for 768px height terminals */
  .pos-cart {
    width: 330px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .cart-header {
    padding: 6px 10px;
    border-bottom-width: 1px;
  }
  .cart-title-row {
    margin-bottom: 4px;
  }
  .cart-title-row h3 {
    font-size: 0.88rem;
  }
  .customer-select {
    padding: 3px 6px;
    font-size: 0.78rem;
    height: 28px;
  }
  .cart-items {
    flex: 1 1 auto;
    min-height: 50px;
    max-height: 150px;
    overflow-y: auto;
    padding: 6px 8px;
    gap: 4px;
  }
  .cart-item {
    padding: 4px 8px;
    gap: 4px;
    border-radius: 8px;
  }
  .cart-item-name {
    font-size: 0.8rem;
  }
  .cart-item-total-price {
    font-size: 0.85rem;
  }
  .cart-item-unit-info {
    font-size: 0.72rem;
  }
  .qty-btn {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .qty-input {
    width: 32px;
    height: 22px;
    font-size: 11px;
  }
  .coupon-row,
  .discount-row {
    padding: 2px 10px;
    margin: 1px 0;
  }
  .coupon-input {
    height: 26px;
    font-size: 0.75rem;
    padding: 2px 6px;
  }
  .discount-row button {
    padding: 2px 6px;
    font-size: 0.72rem;
  }
  .cart-totals {
    padding: 4px 10px;
    border-top-width: 1px;
  }
  .total-row {
    font-size: 0.78rem;
    padding: 1px 0;
  }
  .total-row.grand-total {
    margin-top: 3px;
    padding-top: 3px;
    font-size: 0.88rem;
  }
  .grand-total-val {
    font-size: 1.15rem;
  }
  .delivery-toggle-row {
    padding: 2px 10px;
    font-size: 0.75rem;
  }
  .payment-section {
    padding: 5px 10px;
    border-top-width: 1px;
  }
  .payment-methods {
    gap: 4px;
    margin-bottom: 4px;
  }
  .pay-method {
    padding: 4px 6px;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  .quick-cash-row {
    gap: 3px;
    margin-bottom: 4px;
  }
  .quick-cash-btn {
    padding: 3px 5px;
    font-size: 0.72rem;
    border-radius: 6px;
  }
  .cash-field {
    gap: 4px;
    margin-bottom: 3px;
  }
  .cash-field label {
    font-size: 0.72rem;
  }
  .cash-field input {
    height: 28px;
    font-size: 0.82rem;
    padding: 2px 6px;
  }
  .change-row {
    padding: 1px 0;
    font-size: 0.75rem;
  }
  .btn-checkout {
    padding: 7px 10px;
    font-size: 0.92rem;
    margin-top: 4px;
    border-radius: 8px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* --- 3. Tablets in Landscape (max-width: 1024px) --- */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 200px;
  }
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 6px;
  }
  .pos-cart {
    width: 310px;
  }
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 4. Tablets in Portrait & Mobile Devices (max-width: 768px) --- */
@media (max-width: 768px) {
  :root {
    --navbar-height: 52px;
    --bottom-nav-height: 58px;
  }
  
  /* Menu Toggle & Off-canvas Sidebar */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar {
    position: fixed;
    top: var(--navbar-height);
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    z-index: 150;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  [lang="en"] .sidebar {
    transform: translateX(-100%);
  }
  [lang="en"] .sidebar.open {
    transform: translateX(0);
  }

  /* Clean Navbar for Mobile/Tablet */
  .navbar-left > button:not(#alerts-btn):not(#theme-toggle):not(#lang-toggle),
  .navbar-center,
  .user-details {
    display: none !important;
  }

  .main-content {
    margin-right: 0 !important;
    margin-left: 0 !important;
    margin-bottom: var(--bottom-nav-height);
    min-height: calc(100vh - var(--navbar-height) - var(--bottom-nav-height));
  }

  .screen {
    height: calc(100vh - var(--navbar-height) - var(--bottom-nav-height));
    overflow: hidden;
  }

  /* Bottom Navigation Bar */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  }

  /* POS Mobile Layout & Tab Switching */
  .pos-layout {
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 6px;
    position: relative;
    height: 100%;
    overflow: hidden;
  }

  /* Mobile POS Tab Switcher */
  .pos-mobile-nav {
    display: flex !important;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 4px;
    flex-shrink: 0;
  }
  .pos-mobile-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
  }
  .pos-mobile-tab.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  }

  .pos-products {
    flex: 1;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
  }
  .pos-cart {
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: none;
    border-radius: 12px;
  }

  /* When cart tab is active on mobile */
  .pos-layout.mobile-show-cart .pos-products {
    display: none !important;
  }
  .pos-layout.mobile-show-cart .pos-cart {
    display: flex !important;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile Floating Cart Summary Bar */
  .pos-floating-cart-bar {
    display: flex;
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border-radius: 14px;
    padding: 10px 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 50;
    cursor: pointer;
    animation: slideUpFade 0.25s ease;
  }
  .pos-floating-cart-bar.hidden,
  .pos-layout.mobile-show-cart ~ .pos-floating-cart-bar {
    display: none !important;
  }

  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 6px;
    padding: 8px;
    padding-bottom: 65px; /* Leave space for floating cart bar */
  }

  /* Modals on Mobile & Tablet */
  .modal {
    padding: 8px;
    align-items: flex-end;
  }
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-body {
    max-height: calc(92vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
  }

  /* Tables Scrollable Wrapper */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive table {
    min-width: 580px;
  }

  /* Form & Settings Grids */
  .form-grid-2, .form-grid-3, .form-grid-4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-grid-2 .span-2, .form-grid-3 .span-3, .form-grid-4 .span-4 {
    grid-column: 1;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Screen Header Responsive */
  .screen-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
  }
  .screen-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  /* Toast & Notification adjustments */
  .toast-container {
    bottom: calc(var(--bottom-nav-height) + 10px);
    left: 10px;
    right: 10px;
  }
  .toast {
    max-width: 100%;
  }
  .barcode-banner {
    right: 10px;
    left: 10px;
    bottom: calc(var(--bottom-nav-height) + 65px);
  }

  /* Hide brand text & extra details on mobile */
  .brand-name {
    display: none;
  }
  .user-details {
    display: none;
  }
  .db-connection-badge {
    display: none;
  }
}

/* --- 5. Small Mobile Phones (max-width: 480px) --- */
@media (max-width: 480px) {
  .login-card {
    padding: 30px 20px;
    margin: 10px;
    border-radius: var(--radius-lg);
  }
  .login-title {
    font-size: 1.6rem;
  }
  .pos-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 6px;
    padding-bottom: 65px;
  }
  .product-card {
    padding: 8px 6px;
    min-height: 95px;
  }
  .product-card-icon {
    font-size: 1.5rem;
  }
  .product-card-name {
    font-size: 0.74rem;
  }
  .product-card-price {
    font-size: 0.8rem;
  }
  .pos-search-bar {
    padding: 6px 10px;
  }
  .btn-quick-sale {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  /* Hide extra navbar buttons on small mobile */
  .navbar-left .nav-btn:not(#alerts-btn):not(#theme-toggle):not(#lang-toggle),
  .navbar-center,
  .license-badge {
    display: none !important;
  }
  .payment-methods {
    grid-template-columns: repeat(3, 1fr);
  }
  .btn-pay-method {
    font-size: 0.7rem;
    padding: 6px 2px;
  }
  .cart-items {
    max-height: calc(100vh - var(--navbar-height) - var(--bottom-nav-height) - 310px);
  }
  .pos-layout.mobile-show-cart ~ .pos-floating-cart-bar {
    display: none !important;
  }
}

/* =========================================
   28. ANIMATIONS
   ========================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fade-in { animation: fadeIn 0.3s ease; }
.slide-down { animation: slideDown 0.2s ease; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--bg-hover) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* Shift Management Banner & Badges */
.pos-shift-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.pos-shift-banner.active-shift {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.18));
  border: 1.5px solid #10B981;
  color: #065F46;
}
[data-theme="dark"] .pos-shift-banner.active-shift {
  background: rgba(16, 185, 129, 0.15);
  color: #6EE7B7;
  border-color: #059669;
}
.pos-shift-banner.locked-shift {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.18));
  border: 1.5px solid #EF4444;
  color: #991B1B;
}
[data-theme="dark"] .pos-shift-banner.locked-shift {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border-color: #DC2626;
}
.pos-shift-banner.closed-shift {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.18));
  border: 1.5px solid #F59E0B;
  color: #92400E;
}
[data-theme="dark"] .pos-shift-banner.closed-shift {
  background: rgba(245, 158, 11, 0.15);
  color: #FDE68A;
  border-color: #D97706;
}
.shift-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.shift-banner-info .divider {
  color: rgba(0,0,0,0.2);
  margin: 0 4px;
}
.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #10B981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-dot-anim 1.8s infinite;
}
@keyframes pulse-dot-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* =========================================
   PERMISSIONS MATRIX STYLES
   ========================================= */
.permissions-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 15px;
}
.permissions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.permissions-header h4 {
  margin: 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
}
.permissions-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.perm-count-badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.permissions-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.perm-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: var(--transition);
}
.perm-category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.perm-category-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  color: var(--primary);
}
.perm-category-title span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.perm-category-toggle {
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 4px;
}
.perm-category-toggle:hover {
  color: var(--primary);
  text-decoration: underline;
}
.perm-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.perm-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
  padding: 3px 4px;
  border-radius: 4px;
  transition: var(--transition);
}
.perm-item-label:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.perm-item-label input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}
.perm-badge-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

/* ============================================================
   ENHANCED REPORTING MODULE & PRINT STYLES
   ============================================================ */
.report-tabs {
  margin-bottom: 16px;
}
.report-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.badge-danger-soft {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}
.badge-warning-soft {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}
.badge-success-soft {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}
.badge-info-soft {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Formal Report A4 Print Layout */
.formal-report-a4 {
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: 'Cairo', sans-serif !important;
  direction: rtl !important;
  padding: 15mm 12mm;
  width: 100%;
  box-sizing: border-box;
}
.formal-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.formal-report-title {
  text-align: center;
  flex: 1;
}
.formal-report-title h2 {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 4px 0;
}
.formal-report-title p {
  font-size: 12px;
  color: #475569;
  margin: 0;
}
.formal-report-meta {
  font-size: 11px;
  color: #334155;
  line-height: 1.5;
}
.formal-report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}
.formal-report-table th {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 800;
  text-align: right;
  color: #0f172a !important;
}
.formal-report-table td {
  border: 1px solid #e2e8f0 !important;
  padding: 7px 10px;
  font-size: 12px;
  text-align: right;
}
.formal-report-table tr:nth-child(even) {
  background: #f8fafc !important;
}
.formal-report-footer {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
  font-size: 11.5px;
  color: #64748b;
}

@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
  }
}

/* --- License & Trial Protection Styles --- */
.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.license-badge.trial {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  animation: pulse-badge 2.5s infinite ease-in-out;
}
.license-badge.active {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.license-badge.expired {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  animation: pulse-badge-danger 1.5s infinite ease-in-out;
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes pulse-badge-danger {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.04); }
}

.modal.locked .modal-overlay {
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.88);
  pointer-events: none;
}
.modal.locked .modal-close {
  display: none !important;
}
.device-id-box {
  background: rgba(37, 99, 235, 0.06);
  border: 1.5px dashed var(--primary);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin: 12px 0;
}
.device-id-code {
  font-size: 19px;
  font-weight: 800;
  font-family: monospace;
  color: var(--primary);
  letter-spacing: 1.5px;
  direction: ltr;
  display: inline-block;
  margin-bottom: 8px;
}
.btn-whatsapp-direct {
  background: #16a34a !important;
  color: white !important;
}
.btn-whatsapp-direct:hover {
  background: #15803d !important;
}

/* =========================================
   LOGO & BRAND STYLING
   ========================================= */
.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  vertical-align: middle;
}
.login-logo-img {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  object-fit: cover;
  margin-bottom: 14px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.login-logo-img:hover {
  transform: scale(1.08) rotate(2deg);
}
.hero-brand-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-logo-img {
  width: 82px;
  height: 82px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  background: #0f172a;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero-logo-img:hover {
  transform: scale(1.06) rotate(2deg);
}

/* =========================================
   DASHBOARD SCREEN STYLES
   ========================================= */
#screen-dashboard {
  overflow-y: auto !important;
  height: calc(100vh - var(--navbar-height)) !important;
  background: var(--bg);
  padding: 0;
}
#dashboard-content {
  width: 100%;
  min-height: 100%;
}

.dashboard-wrapper {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-hero-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  color: white;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.35);
  position: relative;
  overflow: hidden;
}
.dashboard-hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  flex: 1;
  min-width: 280px;
}
.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hero-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}
.hero-pill.shift-active {
  background: rgba(16, 185, 129, 0.3);
  border-color: #10b981;
  color: #a7f3d0;
}
.hero-pill.shift-closed {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fecaca;
}
.hero-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: white;
}
.hero-title span {
  color: #93c5fd;
}
.hero-subtitle {
  font-size: 13.5px;
  color: #cbd5e1;
  margin: 0;
}
.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-hero-pos {
  background: #ffffff;
  color: #1e40af !important;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  transition: all 0.2s;
  text-align: right;
}
.btn-hero-pos:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  background: #f8fafc;
}
.hero-btn-icon {
  font-size: 24px;
}
.btn-hero-pos small {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: normal;
}
.btn-hero-embedded {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-hero-embedded:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* POS Launch Banner */
.pos-launch-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  box-shadow: var(--shadow-sm);
}
.pos-launch-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
.pos-launch-icon {
  font-size: 32px;
  background: rgba(37, 99, 235, 0.1);
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pos-launch-left h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.pos-launch-left p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.pos-launch-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Dashboard Stats Grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.card-sales .stat-icon-wrap { background: #dcfce7; color: #16a34a; }
.card-invoices .stat-icon-wrap { background: #e0f2fe; color: #0284c7; }
.card-inventory .stat-icon-wrap { background: #fef3c7; color: #d97706; }
.card-expenses .stat-icon-wrap { background: #fee2e2; color: #dc2626; }
.card-debts .stat-icon-wrap { background: #ffedd5; color: #ea580c; }
.card-customers .stat-icon-wrap { background: #f3e8ff; color: #9333ea; }

.stat-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  white-space: nowrap;
}
.stat-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Quick Actions Grid */
.dash-section-header {
  margin-top: 5px;
}
.dash-section-header h2 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 2px 0;
  color: var(--text-primary);
}
.dash-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.dash-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: right;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.dash-action-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: var(--bg-hover);
}
.action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.action-text {
  display: flex;
  flex-direction: column;
}
.action-text strong {
  font-size: 13.5px;
  color: var(--text-primary);
}
.action-text small {
  font-size: 11px;
  color: var(--text-muted);
}

/* 2 Columns Grid */
.dash-columns-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .dash-columns-grid {
    grid-template-columns: 1fr;
  }
}
.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.dash-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.015);
}
.dash-panel-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
}
.dash-panel-body {
  padding: 16px;
  flex: 1;
}

/* =========================================
   WAREHOUSES & STOCK TRANSFERS MODULES
   ========================================= */
.warehouse-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.badge-wh-default {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}
.badge-wh-pos {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-wh-secondary {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.transfer-direction-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(37,99,235,0.05) 0%, rgba(16,185,129,0.05) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.transfer-wh-col {
  flex: 1;
}
.transfer-arrow-col {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.transfer-items-container {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}
.transfer-item-header {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1fr 40px;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.03);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.transfer-item-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1fr 40px;
  gap: 8px;
  padding: 8px 12px;
  align-items: center;
  border-bottom: 1px dashed var(--border);
  transition: background 0.15s ease;
}
.transfer-item-row:last-child {
  border-bottom: none;
}
.transfer-item-row:hover {
  background: rgba(37,99,235,0.02);
}

.transfer-voucher-print {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  color: #0f172a;
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  max-width: 680px;
  margin: 0 auto;
  border: 1px solid #cbd5e1;
}
.voucher-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #0f172a;
  margin-bottom: 16px;
}
.voucher-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
}
.voucher-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.voucher-table th, .voucher-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  text-align: right;
  font-size: 12.5px;
}
.voucher-table th {
  background: #f1f5f9;
  font-weight: bold;
}
.voucher-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 30px;
  text-align: center;
}
.voucher-sign-box {
  border-top: 1px dashed #64748b;
  padding-top: 8px;
  font-size: 12px;
  color: #475569;
}

/* =========================================
   28. DATABASE SETUP WIZARD & TEST MODAL
   ========================================= */
.db-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.db-preset-chip {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: var(--primary);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.db-preset-chip:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}
.db-preset-chip:active {
  transform: scale(0.96);
}

.db-auth-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.db-auth-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.db-auth-btn.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.db-test-result-box {
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.6;
  animation: fadeInDown 0.25s ease-out;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.db-test-result-box.success {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
}
[data-theme="dark"] .db-test-result-box.success {
  background: #052e16;
  border-color: #166534;
  color: #bbf7d0;
}
.db-test-result-box.error {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
}
[data-theme="dark"] .db-test-result-box.error {
  background: #450a0a;
  border-color: #991b1b;
  color: #fecaca;
}
.db-test-result-box.loading {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1e40af;
}
[data-theme="dark"] .db-test-result-box.loading {
  background: #172554;
  border-color: #1d4ed8;
  color: #dbeafe;
}

.db-dot-status {
  animation: pulse-dot 2s infinite ease-in-out;
}
@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

