* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

:root {
  --animate-duration: 0.3s;
  --primary: #d29224;
  --primary-dark: #6c52a8;
  --bg-dark: #0a0a1a;
  --bg-card: #12122a;
  --bg-sidebar: #0f0f25;
  --bg-input: #1a1a3a;
  --border: #2a2a50;
  --text: #ffffff;
  --text-muted: #7777aa;
  --success: #28ca41;
  --warning: #ffbd2e;
  --danger: #ff5f57;
  --neon-cyan: #00f5ff;
  --neon-purple: #6c52a8;
  --neon-pink: #ff2d95;
  --neon-green: #39ff14;
  --neon-gold: #d29224;
  --orb-color-1: #6c52a8;
  --orb-color-2: #00f5ff;
  --orb-opacity: 0.15;
  --orb-blur: 120px;
  --orb-size-1: 500px;
  --orb-size-2: 400px;
  --glow-sm: 0 0 5px;
  --glow-md: 0 0 15px;
  --glow-lg: 0 0 30px;
  --sidebar-glow-top: #6c52a8;
  --sidebar-glow-bottom: #d29224;
  --sidebar-glow-right: #00f5ff;
  --sidebar-glow-left: #ff2d95;
  --sidebar-glow-intensity: 0.35;
  --sidebar-glow-size: 40px;
  --sidebar-glow-speed: 3s;
}

body {
  background: var(--bg-dark);
  min-height: 100vh;
  color: var(--text);
  direction: rtl;
  overflow-x: hidden;
}

/* Animated background glow orbs */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(var(--orb-blur));
  opacity: var(--orb-opacity);
  z-index: -1;
  animation: floatOrbs 15s ease-in-out infinite alternate;
  pointer-events: none;
}
body::before {
  width: var(--orb-size-1);
  height: var(--orb-size-1);
  background: var(--orb-color-1);
  top: -150px;
  right: -100px;
}
body::after {
  width: var(--orb-size-2);
  height: var(--orb-size-2);
  background: var(--orb-color-2);
  bottom: -100px;
  left: -100px;
  animation-delay: -7s;
}

@keyframes floatOrbs {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
  100% { transform: translate(15px, -20px) scale(1.05); }
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: rgba(18, 18, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(210, 146, 36, 0.15);
  border: 1px solid rgba(210, 146, 36, 0.2);
  position: relative;
  overflow: hidden;
  animation: loginAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-box::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--neon-gold), var(--neon-purple), var(--neon-gold), var(--neon-purple));
  background-size: 400% 400%;
  border-radius: 22px;
  z-index: -1;
  animation: glowBorder 6s ease infinite;
  opacity: 0.5;
}

/* Login Logo */
.login-logo {
  display: block;
  margin: 0 auto 20px;
  width: 120px;
  height: auto;
  border-radius: 16px;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes loginAppear {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glowBorder {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-box h1 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 24px;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.login-box .error {
  background: rgba(255, 95, 87, 0.2);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 15px;
  background: rgba(26, 26, 58, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.2), 0 0 30px rgba(0, 245, 255, 0.1), inset 0 0 10px rgba(0, 245, 255, 0.05);
  background: rgba(26, 26, 58, 0.9);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* Fix date inputs in RTL */
input[type="date"],
.form-group input[type="date"] {
  direction: ltr !important;
  text-align: right;
}

/* Date text input styling */
#payrollContractStart {
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* Checkbox Items */
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 5px 0;
  background: var(--bg-input);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.checkbox-item:hover {
  background: var(--bg-sidebar);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

#featurePermissions,
#userPermissions {
  max-height: 200px;
  overflow-y: auto;
  padding: 5px;
  background: var(--bg-dark);
  border-radius: 10px;
}

/* Buttons */
.btn {
  padding: 15px 30px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), rgba(108, 82, 168, 0.15));
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(210, 146, 36, 0.3);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text);
  width: 100%;
  box-shadow: 0 4px 15px rgba(210, 146, 36, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 15px rgba(210, 146, 36, 0.5), 0 0 30px rgba(210, 146, 36, 0.2);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
}

.btn-success {
  background: var(--success);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: var(--text);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* App Container - Hidden by default */
.app-container {
  display: none;
  min-height: 100vh;
}

.app-container.active {
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: rgba(15, 15, 37, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px 15px;
  border-left: 1px solid rgba(210, 146, 36, 0.15);
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* Sidebar Logo */
.sidebar-logo {
  width: 42px;
  height: auto;
  border-radius: 10px;
}

.sidebar-header h2 {
  font-size: 16px;
  margin-bottom: 5px;
}

.sidebar-header p {
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  margin-bottom: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  font-size: 14px;
  position: relative;
}

.sidebar-item:hover {
  background: rgba(210, 146, 36, 0.1);
  color: var(--text);
  box-shadow: 0 0 15px rgba(210, 146, 36, 0.1);
}

.sidebar-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text);
  animation: activeGlow var(--sidebar-glow-speed) ease-in-out infinite alternate;
}

@keyframes activeGlow {
  0% {
    box-shadow:
      0 calc(var(--sidebar-glow-size) * -0.5) var(--sidebar-glow-size) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-top) calc(var(--sidebar-glow-intensity) * 100%), transparent),
      0 calc(var(--sidebar-glow-size) * 0.5) var(--sidebar-glow-size) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-bottom) calc(var(--sidebar-glow-intensity) * 100%), transparent),
      calc(var(--sidebar-glow-size) * 0.5) 0 var(--sidebar-glow-size) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-right) calc(var(--sidebar-glow-intensity) * 100%), transparent),
      calc(var(--sidebar-glow-size) * -0.5) 0 var(--sidebar-glow-size) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-left) calc(var(--sidebar-glow-intensity) * 100%), transparent);
  }
  50% {
    box-shadow:
      0 calc(var(--sidebar-glow-size) * -0.5) calc(var(--sidebar-glow-size) * 1.5) calc(var(--sidebar-glow-size) * -0.2) color-mix(in srgb, var(--sidebar-glow-right) calc(var(--sidebar-glow-intensity) * 130%), transparent),
      0 calc(var(--sidebar-glow-size) * 0.5) calc(var(--sidebar-glow-size) * 1.5) calc(var(--sidebar-glow-size) * -0.2) color-mix(in srgb, var(--sidebar-glow-left) calc(var(--sidebar-glow-intensity) * 130%), transparent),
      calc(var(--sidebar-glow-size) * 0.5) 0 calc(var(--sidebar-glow-size) * 1.5) calc(var(--sidebar-glow-size) * -0.2) color-mix(in srgb, var(--sidebar-glow-top) calc(var(--sidebar-glow-intensity) * 130%), transparent),
      calc(var(--sidebar-glow-size) * -0.5) 0 calc(var(--sidebar-glow-size) * 1.5) calc(var(--sidebar-glow-size) * -0.2) color-mix(in srgb, var(--sidebar-glow-bottom) calc(var(--sidebar-glow-intensity) * 130%), transparent);
  }
  100% {
    box-shadow:
      0 calc(var(--sidebar-glow-size) * -0.5) calc(var(--sidebar-glow-size) * 1.2) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-left) calc(var(--sidebar-glow-intensity) * 110%), transparent),
      0 calc(var(--sidebar-glow-size) * 0.5) calc(var(--sidebar-glow-size) * 1.2) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-top) calc(var(--sidebar-glow-intensity) * 110%), transparent),
      calc(var(--sidebar-glow-size) * 0.5) 0 calc(var(--sidebar-glow-size) * 1.2) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-bottom) calc(var(--sidebar-glow-intensity) * 110%), transparent),
      calc(var(--sidebar-glow-size) * -0.5) 0 calc(var(--sidebar-glow-size) * 1.2) calc(var(--sidebar-glow-size) * -0.25) color-mix(in srgb, var(--sidebar-glow-right) calc(var(--sidebar-glow-intensity) * 110%), transparent);
  }
}

.sidebar-item .icon {
  font-size: 20px;
}

.sidebar-item .badge {
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: auto;
}

.sidebar-logout {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-right: 220px;
  padding: 25px;
  min-height: 100vh;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 101;
  background: transparent;
  padding: 15px 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, box-shadow 0.35s ease;
}

.page-header.sticky-pinned {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(210, 146, 36, 0.08);
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 0 0 14px 14px;
  padding: 12px 15px;
  margin-left: -15px;
  margin-right: -15px;
}

.page-header.sticky-hidden {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}

.page-title {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 20px rgba(210, 146, 36, 0.3);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: rgba(18, 18, 42, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(42, 42, 80, 0.5);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    var(--neon-green) 0%, 
    var(--neon-cyan) 25%, 
    var(--neon-purple) 50%, 
    var(--neon-pink) 75%, 
    var(--neon-cyan) 100%);
  background-size: 200% 100%;
  animation: neonSlide 3s linear infinite;
  opacity: 0;
  transition: opacity 0.4s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 20px rgba(210, 146, 36, 0.15);
  border-color: rgba(210, 146, 36, 0.3);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.blue { border-right: 4px solid var(--primary); }
.stat-card.green { border-right: 4px solid var(--success); }
.stat-card.yellow { border-right: 4px solid var(--warning); }
.stat-card.red { border-right: 4px solid var(--danger); }
.stat-card.purple { border-right: 4px solid #9b59b6; }

.stat-card h3 {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: bold;
}

/* Section Box */
.section-box {
  background: rgba(15, 15, 37, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(42, 42, 80, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.section-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    var(--neon-green) 0%, 
    var(--neon-cyan) 25%, 
    var(--neon-purple) 50%, 
    var(--neon-pink) 75%, 
    var(--neon-cyan) 100%);
  background-size: 200% 100%;
  animation: neonSlide 4s linear infinite;
  opacity: 0.5;
  transition: opacity 0.4s;
  border-radius: 0 0 16px 16px;
}

.section-box:hover::after {
  opacity: 1;
}

.section-box:hover {
  border-color: rgba(210, 146, 36, 0.25);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(210, 146, 36, 0.06);
}

.section-box h2 {
  font-size: 16px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.product-card {
  background: rgba(18, 18, 42, 0.6);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(42, 42, 80, 0.5);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  border-color: rgba(0, 245, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.1), 0 8px 25px rgba(0, 0, 0, 0.3);
  transform: translateY(-3px);
}

.product-card .product-image {
  width: 100%;
  height: 100px;
  background: var(--bg-input);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
}

.product-card .product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-card .product-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
}

.product-card .product-article {
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.product-card .product-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.product-card input[type="number"] {
  width: 60px;
  padding: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-align: center;
  font-size: 14px;
}

.product-card input[type="checkbox"] {
  width: 22px;
  height: 22px;
  cursor: pointer;
}

/* Order Items */
.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 8px;
}

.order-item .order-image {
  width: 50px;
  height: 50px;
  background: var(--bg-input);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-item .order-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.order-item .order-info {
  flex: 1;
}

.order-item .order-name {
  font-weight: bold;
  font-size: 14px;
}

.order-item .order-qty {
  color: var(--primary);
  font-size: 13px;
}

.order-done {
  opacity: 0.5;
}

/* Image Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: transform 0.2s;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: rgba(18, 18, 42, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 18px;
  padding: 25px;
  width: 100%;
  max-width: 450px;
  max-height: 85vh;
  overflow: hidden;
  border: 1px solid rgba(210, 146, 36, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(210, 146, 36, 0.1);
  animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal > form,
.modal > div:not(.modal-header) {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal > .modal-header {
  flex-shrink: 0;
}

/* خط نيون متعدد الألوان تحت الـ Modal */
.modal::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--neon-green) 0%, 
    var(--neon-cyan) 25%, 
    var(--neon-purple) 50%, 
    var(--neon-pink) 75%, 
    var(--neon-cyan) 100%);
  background-size: 200% 100%;
  animation: neonSlide 3s linear infinite;
  border-radius: 0 0 18px 18px;
  pointer-events: none;
  z-index: 1;
}

@keyframes neonSlide {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Image Upload */
.image-upload {
  width: 100%;
  height: 120px;
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
}

.image-upload:hover {
  border-color: var(--primary);
}

.image-upload img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-upload .upload-text {
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  padding: 12px 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, box-shadow 0.35s ease;
}

.tabs.tabs-pinned {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(210, 146, 36, 0.08);
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 0 0 14px 14px;
  padding: 10px 15px;
  margin-left: -15px;
  margin-right: -15px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.08);
  /* top is set dynamically via JS to position below header */
}

.tabs.tabs-hidden {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}

.tab {
  padding: 8px 16px;
  background: rgba(26, 26, 58, 0.6);
  border: 1px solid rgba(42, 42, 80, 0.5);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

.tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.1), rgba(108, 82, 168, 0.1));
  opacity: 0;
  transition: opacity 0.3s;
}

.tab:hover {
  border-color: rgba(0, 245, 255, 0.4);
  color: var(--text);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.12);
  transform: translateY(-1px);
}

.tab:hover::before {
  opacity: 1;
}

.tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(210, 146, 36, 0.35), 0 0 10px rgba(210, 146, 36, 0.15);
}

.tab.active::before {
  opacity: 0;
}

/* Password Input with Toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-left: 45px;
}

.password-toggle {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.password-toggle:hover {
  opacity: 1;
}

/* Table */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th,
table td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

table th {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 13px;
}

table tr:hover {
  background: var(--bg-input);
}

/* Badge */
.badge {
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 11px;
  display: inline-block;
}

.badge-success { background: rgba(40, 202, 65, 0.2); color: var(--success); }
.badge-warning { background: rgba(255, 189, 46, 0.2); color: var(--warning); }
.badge-danger { background: rgba(255, 95, 87, 0.2); color: var(--danger); }
.badge-info { background: rgba(210, 146, 36, 0.2); color: var(--primary); }

/* Toast (legacy container hidden — now using Toastify) */
.toast-container {
  display: none;
}

/* Toastify dark theme overrides */
.toastify {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  border-radius: 10px !important;
  padding: 12px 18px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}
@media print {
  .toastify { display: none !important; }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: fixed;
    bottom: 0;
    top: auto;
    right: 0;
    left: 0;
    height: auto;
    padding: 6px 4px;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    border-top: 1px solid rgba(42, 42, 80, 0.5);
    border-left: none;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5), 0 -1px 0 rgba(210, 146, 36, 0.1);
  }

  .sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-purple), transparent);
    opacity: 0.5;
  }

  .sidebar-header,
  .sidebar-logout,
  .sidebar-item span:not(.icon) {
    display: none;
  }

  .sidebar-item {
    padding: 8px 6px;
    margin: 0;
    flex-direction: column;
    font-size: 10px;
    border-radius: 12px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: transparent;
    min-width: 42px;
  }

  .sidebar-item .icon {
    font-size: 22px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: grayscale(0.3) brightness(0.85);
    position: relative;
    z-index: 1;
  }

  /* --- لكل أيقونة لون نيون مختلف --- */

  /* 🏠 الرئيسية - بنفسجي */
  .sidebar-item[data-page="dashboard"] .icon { filter: drop-shadow(0 0 0px transparent); }
  .sidebar-item[data-page="dashboard"].active .icon {
    filter: drop-shadow(0 0 8px rgba(108, 82, 168, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="dashboard"].active::after {
    background: var(--neon-purple);
    box-shadow: 0 0 10px var(--neon-purple), 0 0 20px rgba(108, 82, 168, 0.3);
  }

  /* 🛒 الطلبيات - سيان */
  .sidebar-item[data-page="orders"].active .icon {
    filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="orders"].active::after {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px rgba(0, 245, 255, 0.3);
  }

  /* 🧺 السلة - أخضر */
  .sidebar-item[data-page="cart"].active .icon {
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="cart"].active::after {
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green), 0 0 20px rgba(57, 255, 20, 0.3);
  }

  /* 📋 طلبياتي - وردي */
  .sidebar-item[data-page="myorders"].active .icon {
    filter: drop-shadow(0 0 8px rgba(255, 45, 149, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="myorders"].active::after {
    background: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink), 0 0 20px rgba(255, 45, 149, 0.3);
  }

  /* 📦 الجرد - برتقالي */
  .sidebar-item[data-page="inventory"].active .icon {
    filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="inventory"].active::after {
    background: #ffa500;
    box-shadow: 0 0 10px #ffa500, 0 0 20px rgba(255, 165, 0, 0.3);
  }

  /* 📝 منتجات مطلوبة - أصفر */
  .sidebar-item[data-page="requested"].active .icon {
    filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="requested"].active::after {
    background: #f1c40f;
    box-shadow: 0 0 10px #f1c40f, 0 0 20px rgba(241, 196, 15, 0.3);
  }

  /* 📂 قوائمي - أزرق */
  .sidebar-item[data-page="mylists"].active .icon {
    filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="mylists"].active::after {
    background: #3498db;
    box-shadow: 0 0 10px #3498db, 0 0 20px rgba(52, 152, 219, 0.3);
  }

  /* 📦 المنتجات - سيان */
  .sidebar-item[data-page="products"].active .icon {
    filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="products"].active::after {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px rgba(0, 245, 255, 0.3);
  }

  /* 👥 المستخدمين - بنفسجي */
  .sidebar-item[data-page="users"].active .icon {
    filter: drop-shadow(0 0 8px rgba(108, 82, 168, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="users"].active::after {
    background: var(--neon-purple);
    box-shadow: 0 0 10px var(--neon-purple), 0 0 20px rgba(108, 82, 168, 0.3);
  }

  /* ⏰ الدوام - أخضر */
  .sidebar-item[data-page="attendance"].active .icon {
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="attendance"].active::after {
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green), 0 0 20px rgba(57, 255, 20, 0.3);
  }

  /* ⚙️ الإعدادات - وردي */
  .sidebar-item[data-page="settings"].active .icon {
    filter: drop-shadow(0 0 8px rgba(255, 45, 149, 0.8)) brightness(1.2);
  }
  .sidebar-item[data-page="settings"].active::after {
    background: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink), 0 0 20px rgba(255, 45, 149, 0.3);
  }

  /* --- نقطة مضيئة تحت الأيقونة النشطة --- */
  .sidebar-item::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 3px;
    border-radius: 3px;
    background: var(--neon-cyan);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
  }

  .sidebar-item.active::after {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }

  /* --- Hover: الأيقونة تكبر + توهج خفيف --- */
  .sidebar-item:hover .icon {
    filter: grayscale(0) brightness(1.1);
    transform: scale(1.15);
  }

  /* --- Active: bounce animation --- */
  .sidebar-item.active {
    background: transparent;
    box-shadow: none;
  }

  .sidebar-item.active .icon {
    animation: iconBounce 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1.2);
  }

  @keyframes iconBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.35) translateY(-4px); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1.2); }
  }

  /* --- Ripple عند الضغط --- */
  .sidebar-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s, opacity 0.5s;
    opacity: 0;
  }

  .sidebar-item:active::before {
    width: 60px;
    height: 60px;
    opacity: 1;
    transition: 0s;
  }

  .main-content {
    margin-right: 0;
    margin-bottom: 70px;
    padding: 15px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* Category Sections - تنسيق الأقسام */
.categories-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.category-section {
  background: rgba(18, 18, 42, 0.5);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(42, 42, 80, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-section:hover {
  border-color: rgba(210, 146, 36, 0.25);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(210, 146, 36, 0.06);
}

.category-header {
  background: linear-gradient(135deg, rgba(210, 146, 36, 0.3) 0%, rgba(108, 82, 168, 0.2) 100%);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(210, 146, 36, 0.15);
  position: relative;
  overflow: hidden;
}

.category-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-purple), transparent);
  opacity: 0.4;
}

.category-header .product-count {
  font-size: 13px;
  opacity: 0.8;
  font-weight: normal;
}

.products-list {
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* Product Row - صف المنتج */
.product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(18, 18, 42, 0.5);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(42, 42, 80, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-row:last-child {
  margin-bottom: 0;
}

.product-row:hover {
  border-color: rgba(0, 245, 255, 0.2);
  background: rgba(18, 18, 42, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 245, 255, 0.05);
  transform: translateX(-3px);
}

.product-row.in-order {
  border-color: rgba(40, 202, 65, 0.4);
  background: rgba(40, 202, 65, 0.08);
  box-shadow: 0 0 15px rgba(40, 202, 65, 0.08);
}

.product-image-small {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 10, 30, 0.6);
  border: 1px solid rgba(108, 82, 168, 0.15);
  box-shadow: 0 0 8px rgba(108, 82, 168, 0.06), inset 0 0 15px rgba(108, 82, 168, 0.03);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.product-image-small::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(108, 82, 168, 0.08), transparent 60%);
  pointer-events: none;
  transition: opacity 0.4s;
  opacity: 0;
}

.product-row:hover .product-image-small {
  border-color: rgba(108, 82, 168, 0.35);
  box-shadow: 0 0 20px rgba(108, 82, 168, 0.18), 0 4px 15px rgba(108, 82, 168, 0.08);
  transform: scale(1.03);
}

.product-row:hover .product-image-small::after {
  opacity: 1;
}

.product-image-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-row:hover .product-image-small img {
  transform: scale(1.08);
}

.product-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 8px 12px;
  background: rgba(10, 10, 30, 0.5);
  border: 1px solid rgba(0, 245, 255, 0.08);
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(0, 245, 255, 0.02);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-row:hover .product-details {
  border-color: rgba(0, 245, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.06), inset 0 0 25px rgba(0, 245, 255, 0.03);
  background: rgba(10, 10, 30, 0.7);
}

.product-details .product-name {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  transition: text-shadow 0.3s;
}

.product-row:hover .product-details .product-name {
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.3);
}

/* عرض الاسم المزدوج (عربي + ألماني) */
.dual-name {
  display: flex !important;
  flex-direction: column !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  -webkit-box-orient: vertical !important;
  overflow: visible !important;
  gap: 3px;
}

.product-name-primary {
  display: block;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  color: #f0d0a0;
  text-shadow: 0 0 10px rgba(240, 208, 160, 0.15);
  transition: all 0.3s;
}

.product-row:hover .product-name-primary {
  color: #ffd98a;
  text-shadow: 0 0 12px rgba(255, 217, 138, 0.3);
}

.product-name-secondary {
  display: block;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  color: #90b0c8;
  text-shadow: 0 0 10px rgba(144, 176, 200, 0.1);
  transition: all 0.3s;
}

.product-row:hover .product-name-secondary {
  color: #a8d0f0;
  text-shadow: 0 0 12px rgba(168, 208, 240, 0.25);
}



/* الكاردات (الجرد) */
.product-card .dual-name {
  align-items: center;
  text-align: center;
}

.product-card .product-name-secondary {
  text-align: center;
}

.product-details .product-article {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  transition: all 0.3s;
}

.product-row:hover .product-details .product-article {
  opacity: 0.9;
  color: rgba(0, 245, 255, 0.5);
}

.product-link-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(26, 26, 58, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s;
}

.product-link-btn:hover {
  background: var(--primary);
}

/* Add to Cart Button */
.add-to-cart-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--success), #2a9d8f);
  border: none;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  position: relative;
}

.add-to-cart-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(40, 202, 65, 0.5), 0 0 40px rgba(40, 202, 65, 0.15);
}

.add-to-cart-btn:active {
  transform: scale(0.9);
}

/* Quantity Control — مربع الكمية */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 10, 30, 0.7);
  border-radius: 14px;
  padding: 6px;
  border: 1px solid rgba(57, 255, 20, 0.15);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.06), inset 0 0 15px rgba(57, 255, 20, 0.03);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.quantity-control:hover {
  border-color: rgba(57, 255, 20, 0.3);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.12), inset 0 0 20px rgba(57, 255, 20, 0.04);
}

.qty-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(57, 255, 20, 0.12);
  color: var(--neon-green);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.5);
}

.qty-btn:hover {
  background: rgba(57, 255, 20, 0.25);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.35);
  transform: scale(1.12);
  border-color: rgba(57, 255, 20, 0.3);
}

.qty-btn:active {
  transform: scale(0.92);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.2);
}

.qty-btn.minus {
  background: rgba(255, 95, 87, 0.1);
  color: var(--danger);
  text-shadow: 0 0 6px rgba(255, 95, 87, 0.4);
  border-color: rgba(255, 95, 87, 0.1);
}

.qty-btn.minus:hover {
  background: rgba(255, 95, 87, 0.25);
  box-shadow: 0 0 15px rgba(255, 95, 87, 0.4);
  border-color: rgba(255, 95, 87, 0.3);
}

.qty-btn.plus {
  background: rgba(57, 255, 20, 0.12);
  border-color: rgba(57, 255, 20, 0.1);
}

.qty-btn.plus:hover {
  background: rgba(57, 255, 20, 0.3);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.45);
  border-color: rgba(57, 255, 20, 0.35);
}

.qty-input {
  width: 50px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--neon-green);
  text-align: center;
  font-size: 17px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
  transition: all 0.3s;
}

.qty-input:focus {
  outline: none;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.6);
}

.empty-message {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

/* Responsive for product rows */
@media (max-width: 600px) {
  .product-row {
    gap: 10px;
    padding: 12px;
  }
  
  .product-image-small {
    width: 65px;
    height: 65px;
    min-width: 65px;
  }
  
  .product-details .product-name {
    font-size: 12px;
  }
  
  .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  
  .qty-input {
    width: 40px;
    height: 32px;
    font-size: 14px;
  }
  
  .product-link-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
  }
  
  .category-header {
    padding: 12px 15px;
    font-size: 14px;
  }
  
  .products-list {
    padding: 8px;
  }
}

/* Product Row for Settings Page - صف المنتج في الإعدادات */
.product-row-settings {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 10px;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.product-row-settings:last-child {
  margin-bottom: 0;
}

.product-row-settings:hover {
  border-color: var(--primary);
  background: var(--bg-sidebar);
}

/* Drag Handle - مقبض السحب */
.drag-handle {
  cursor: grab;
  font-size: 24px;
  color: var(--text-muted);
  padding: 10px 6px;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  transition: color 0.2s, transform 0.2s;
  min-width: 30px;
  justify-content: center;
  border-radius: 8px;
}

.drag-handle:hover {
  color: var(--primary);
  background: rgba(210, 146, 36, 0.1);
  transform: scale(1.15);
}

.drag-handle:active {
  cursor: grabbing;
  color: var(--warning);
  background: rgba(255, 189, 46, 0.15);
}

/* Drag Clone - النسخة المتحركة */
.drag-clone {
  border-radius: 12px !important;
  background: var(--bg-card) !important;
  cursor: grabbing !important;
}

/* Drop Animation */
@keyframes dropIn {
  0% { transform: scale(1.03); box-shadow: 0 8px 30px rgba(210, 146, 36, 0.4); }
  50% { transform: scale(0.98); }
  100% { transform: scale(1); box-shadow: none; }
}

.product-image-large {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.product-image-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-link-small {
  color: var(--primary);
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}

.product-link-small:hover {
  text-decoration: underline;
}

.product-actions-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-icon.edit {
  background: var(--bg-input);
  color: var(--text);
}

.btn-icon.edit:hover {
  background: var(--primary);
}

.btn-icon.delete {
  background: rgba(255, 95, 87, 0.2);
  color: var(--danger);
}

.btn-icon.delete:hover {
  background: var(--danger);
  color: white;
}

/* Responsive for settings products */
@media (max-width: 600px) {
  .product-row-settings {
    gap: 10px;
    padding: 12px;
  }
  
  .drag-handle {
    font-size: 18px;
    padding: 6px 2px;
    min-width: 24px;
  }
  
  .product-image-large {
    width: 60px;
    height: 60px;
    min-width: 60px;
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* Sources Card - كارت المصدر */
.source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.source-card:hover {
  background: var(--bg-sidebar);
}

.source-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.source-icon {
  font-size: 32px;
}

.source-details h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.source-whatsapp {
  font-size: 13px;
  color: var(--text-muted);
}

.source-actions {
  display: flex;
  gap: 8px;
}

/* Cart System - نظام السلة */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 10px;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.cart-item.in-order {
  border-color: var(--success);
  background: rgba(40, 202, 65, 0.1);
}

.cart-item.status-later {
  border-color: var(--warning);
  background: rgba(255, 189, 46, 0.1);
}

.cart-item.status-unavailable {
  border-color: var(--danger);
  background: rgba(255, 95, 87, 0.1);
  opacity: 0.7;
}

.cart-note {
  font-size: 12px;
  color: var(--warning);
  margin-top: 5px;
  padding: 4px 8px;
  background: rgba(255, 189, 46, 0.1);
  border-radius: 6px;
  display: inline-block;
}

.cart-added-by {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.8;
}

.cart-status-badge {
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
  padding: 3px 10px;
  border-radius: 8px;
  display: inline-block;
}

.status-badge-ordered {
  color: var(--success);
  background: rgba(40, 202, 65, 0.15);
}

.status-badge-later {
  color: var(--warning);
  background: rgba(255, 189, 46, 0.15);
}

.status-badge-unavailable {
  color: var(--danger);
  background: rgba(255, 95, 87, 0.15);
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 5px 10px;
  border-radius: 10px;
}

.cart-qty .qty-value {
  font-size: 16px;
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

.cart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cart-status {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.cart-status:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-icon.ordered {
  background: var(--success);
  color: white;
}

.source-footer {
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
}

.source-footer .btn {
  width: 100%;
  max-width: 300px;
}

/* Branch Stats for Admin */
.branch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-card);
  border-radius: 12px;
}

.branch-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: var(--bg-input);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  border-right: 4px solid var(--branch-color, #667eea);
}

.branch-stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.branch-stat-item.active {
  background: linear-gradient(135deg, var(--branch-color, #667eea) 0%, var(--bg-input) 100%);
  box-shadow: 0 0 20px rgba(210, 146, 36, 0.3);
}

.branch-stat-item .branch-name {
  font-weight: 500;
}

.branch-stat-item .branch-count {
  background: var(--branch-color, #667eea);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

/* Product Row in Cart Style */
.product-row.in-cart {
  background: linear-gradient(135deg, rgba(40, 202, 65, 0.1) 0%, rgba(40, 202, 65, 0.05) 100%);
  border-right: 4px solid var(--success);
}

.cart-qty-control {
  background: linear-gradient(135deg, var(--success) 0%, #2a9d8f 100%) !important;
}

/* Order Card Styles */
.order-card {
  background: rgba(18, 18, 42, 0.5);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border: 1px solid rgba(42, 42, 80, 0.3);
  transition: all 0.3s ease;
}

.order-card:hover {
  border-color: rgba(210, 146, 36, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(42, 42, 80, 0.4);
}

.order-info {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.order-source {
  font-weight: bold;
  font-size: 16px;
}

.order-branch, .order-date {
  color: var(--text-muted);
  font-size: 14px;
}

/* Order Items Grid - New Design */
.order-items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.order-item-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  transition: all 0.2s;
  max-width: 280px;
}

.order-item-card:hover {
  background: rgba(210, 146, 36, 0.15);
}

.order-item-image {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.order-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.order-item-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.order-item-qty {
  font-size: 12px;
  font-weight: bold;
  color: var(--success);
  flex-shrink: 0;
}

.order-item-addedby {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  flex-shrink: 0;
}

.order-source {
  padding: 5px 12px;
  border-radius: 20px;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.order-time {
  color: var(--text-muted);
  font-size: 13px;
}

/* Old order items - keep for compatibility */
.order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.order-item {
  display: flex;
  gap: 8px;
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.item-qty {
  color: var(--success);
  font-weight: bold;
}

.order-total {
  color: var(--text-muted);
  font-size: 14px;
}

/* Color Input */
.color-input {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* Header Controls */
.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-controls .form-select {
  min-width: 200px;
}

/* Responsive for cart */
@media (max-width: 768px) {
  .cart-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .cart-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  
  .cart-status {
    flex: 1;
  }
  
  .branch-stats {
    gap: 5px;
  }
  
  .branch-stat-item {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .order-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* Quick Stats */
#quickStats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.quick-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  background: var(--bg-input);
  border-radius: 12px;
  flex: 1;
  min-width: 250px;
}

.quick-stat-item .stat-label {
  color: var(--text-muted);
  font-size: 14px;
}

.quick-stat-item .stat-value {
  font-weight: bold;
  color: var(--primary);
}

/* ==================== MY ORDERS - NEW DESIGN ==================== */
.day-section {
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 15px;
  overflow: hidden;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid transparent;
}

.day-header:hover {
  background: rgba(210, 146, 36, 0.1);
}

.day-section.expanded .day-header {
  border-bottom: 1px solid var(--border);
}

.day-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.day-date {
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
}

.today-badge {
  background: var(--success);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-right: 8px;
}

.day-stats {
  color: var(--text-muted);
  font-size: 13px;
}

.day-toggle {
  color: var(--text-muted);
  transition: transform 0.3s;
}

.day-section.expanded .day-toggle {
  transform: rotate(180deg);
}

.day-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.day-section.expanded .day-content {
  max-height: 5000px;
  padding: 15px;
}

.sources-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* My Orders source cards - override settings source-card */
.day-content .source-card {
  display: block;
  padding: 0;
  border: none;
  margin-bottom: 10px;
}

.day-content .source-card:hover {
  background: var(--bg-dark);
}

.source-card {
  background: var(--bg-dark);
  border-radius: 10px;
  overflow: hidden;
}

.source-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.source-header:hover {
  filter: brightness(1.1);
}

.source-icon {
  font-size: 20px;
}

.source-name {
  font-weight: bold;
  color: var(--text);
  flex: 1;
}

.source-count {
  color: var(--text-muted);
  font-size: 13px;
}

.source-toggle {
  color: var(--text-muted);
  transition: transform 0.3s;
  font-size: 12px;
}

.source-card.expanded .source-toggle {
  transform: rotate(90deg);
}

.source-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: rgba(0,0,0,0.2);
}

.source-card.expanded .source-items {
  max-height: 5000px;
  padding: 10px;
}

.order-mini {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 6px;
}

.order-mini:last-child {
  margin-bottom: 0;
}

.order-mini-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.order-mini-header .order-time {
  flex: 1;
}

.order-mini-header .order-updated {
  font-size: 11px;
  color: #64b5f6;
  background: rgba(100, 181, 246, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.btn-icon-small {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-icon-small:hover {
  background: rgba(255,255,255,0.1);
}

.btn-icon-small.delete:hover {
  background: rgba(255, 95, 87, 0.2);
}

/* ==================== Language Switch Button ==================== */
.lang-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 15px;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.lang-switch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(210, 146, 36, 0.4);
}

.lang-switch-btn:active {
  transform: translateY(0);
}

/* ==================== LTR Support ==================== */
body.ltr {
  direction: ltr;
}

body.ltr .sidebar {
  right: auto;
  left: 0;
  border-right: 1px solid var(--border);
  border-left: none;
}

body.ltr .main-content {
  margin-right: 0;
  margin-left: 220px;
}

body.ltr .sidebar-item .badge {
  margin-right: 0;
  margin-left: auto;
}

body.ltr .product-card .product-actions {
  text-align: left;
}

body.ltr .modal-close {
  right: auto;
  left: 15px;
}

body.ltr .page-header {
  flex-direction: row;
}

body.ltr .password-toggle {
  right: auto;
  left: 10px;
}

/* LTR responsive */
@media (max-width: 768px) {
  body.ltr .main-content {
    margin-left: 0;
  }
  body.ltr .sidebar {
    right: auto;
    left: -100%;
  }
  body.ltr .sidebar.open {
    left: 0;
    right: auto;
  }
}

/* ==================== SMART SEARCH ==================== */
.smart-search-box {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0;
  margin-bottom: 12px;
  background: transparent;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 14px;
  cursor: text;
  gap: 8px;
  background: linear-gradient(270deg, 
    rgba(108, 82, 168, 0.3),
    rgba(0, 245, 255, 0.2),
    rgba(255, 107, 107, 0.2),
    rgba(150, 206, 180, 0.25),
    rgba(108, 82, 168, 0.3)
  );
  background-size: 400% 400%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.4s ease;
  z-index: 1;
  animation: bgShift 10s ease-in-out infinite, ambientGlow 8s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ambientGlow {
  0% {
    box-shadow: 
      -25px 0 30px -10px rgba(108, 82, 168, 0.45),
      25px 0 25px -10px rgba(0, 245, 255, 0.2),
      0 5px 20px -5px rgba(255, 107, 107, 0.1);
  }
  33% {
    box-shadow: 
      -20px 0 25px -10px rgba(0, 245, 255, 0.35),
      25px 0 30px -10px rgba(255, 159, 243, 0.4),
      0 5px 20px -5px rgba(150, 206, 180, 0.15);
  }
  66% {
    box-shadow: 
      -25px 0 30px -10px rgba(254, 202, 87, 0.35),
      20px 0 25px -10px rgba(108, 82, 168, 0.4),
      0 5px 20px -5px rgba(0, 245, 255, 0.15);
  }
  100% {
    box-shadow: 
      -20px 0 25px -10px rgba(255, 159, 243, 0.4),
      25px 0 30px -10px rgba(150, 206, 180, 0.35),
      0 5px 20px -5px rgba(254, 202, 87, 0.15);
  }
}

.search-input-wrapper:hover {
  transform: scale(1.01);
  box-shadow: 
    -30px 0 35px -10px rgba(108, 82, 168, 0.5),
    30px 0 35px -10px rgba(0, 245, 255, 0.45),
    0 8px 25px -5px rgba(255, 107, 107, 0.2);
}

.search-input-wrapper:focus-within {
  transform: scale(1.01);
  box-shadow: 
    -30px 0 40px -8px rgba(108, 82, 168, 0.55),
    30px 0 40px -8px rgba(0, 245, 255, 0.5),
    0 8px 30px -5px rgba(255, 159, 243, 0.25);
}

.search-icon {
  font-size: 18px;
  opacity: 0.5;
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 12px 4px;
  min-width: 0;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.search-clear-btn:hover {
  background: var(--danger);
  transform: scale(1.1);
}

.search-results-count {
  display: none;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 6px 14px;
  background: rgba(210, 146, 36, 0.15);
  border-radius: 10px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.search-results-count.no-results {
  background: rgba(255, 95, 87, 0.15);
  color: var(--danger);
}

/* ==================== MY LISTS / PLAYLISTS ==================== */

/* Lists Grid - عرض البطاقات */
.my-lists-container {
  padding: 0;
}

.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.list-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.list-card:hover {
  border-color: var(--list-color, var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.list-card-preview {
  height: 80px;
  background: linear-gradient(135deg, var(--list-color, #667eea) 0%, rgba(0,0,0,0.3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  overflow: hidden;
}

.list-card-preview img {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}

.list-card-preview .no-preview {
  font-size: 36px;
  opacity: 0.6;
}

.list-card-info {
  padding: 14px 16px 8px;
}

.list-card-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.list-card-count {
  font-size: 13px;
  color: #888;
}

.list-card-actions {
  padding: 8px 16px 14px;
  display: flex;
  gap: 8px;
}

/* Empty lists message */
.empty-lists-message {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-lists-message .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-lists-message h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #ccc;
}

.empty-lists-message p {
  margin-bottom: 20px;
  font-size: 14px;
}

/* List Detail View */
.list-detail-view {
  padding: 0;
}

.list-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.list-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.list-detail-title h2 {
  margin: 0;
  font-size: 20px;
}

#listDetailIcon {
  font-size: 28px;
}

.list-detail-actions {
  display: flex;
  gap: 8px;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-remove-btn {
  color: var(--danger) !important;
  font-size: 16px !important;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.list-remove-btn:hover {
  opacity: 1;
}

/* Save to List button on product rows */
.save-to-list-btn {
  font-size: 18px !important;
  padding: 4px 8px !important;
  opacity: 0.5;
  transition: all 0.2s;
  background: none !important;
  border: none !important;
  cursor: pointer;
  flex-shrink: 0;
}

.save-to-list-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Save to List Modal */
.save-to-list-body {
  padding: 16px;
}

.save-to-list-product {
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.save-to-list-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.save-to-list-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.save-to-list-option:hover {
  background: rgba(255,255,255,0.1);
}

.save-to-list-option.checked {
  border-color: var(--primary);
  background: rgba(210, 146, 36, 0.15);
}

.list-check {
  font-size: 18px;
}

.list-option-icon {
  font-size: 20px;
}

.list-option-name {
  flex: 1;
  font-weight: 600;
}

.list-option-count {
  color: #888;
  font-size: 13px;
}

/* Emoji Picker Grid */
.emoji-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.emoji-option {
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: rgba(255,255,255,0.05);
}

.emoji-option:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.1);
}

.emoji-option.selected {
  border-color: var(--primary);
  background: rgba(210, 146, 36, 0.2);
}

/* Responsive for lists */
@media (max-width: 600px) {
  .lists-grid {
    grid-template-columns: 1fr;
  }
  
  .list-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .list-detail-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .list-item-actions {
    flex-direction: column;
    gap: 4px;
  }
}

/* ==================== OFFLINE BANNER ==================== */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: slideDown 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Sync Status Indicator */
.sync-indicator {
  position: relative;
  z-index: 10;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
}

.sync-indicator:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.sync-icon {
  font-size: 20px;
  transition: all 0.3s;
}

.sync-indicator.syncing .sync-icon {
  animation: syncSpin 1s linear infinite;
}

@keyframes syncSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sync-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--warning);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Sync status color ring */
.sync-indicator.sync-status-ok {
  border-color: #2ecc71;
  box-shadow: 0 2px 12px rgba(46,204,113,0.3);
}
.sync-indicator.sync-status-pending {
  border-color: var(--warning);
  box-shadow: 0 2px 12px rgba(241,196,15,0.3);
}
.sync-indicator.sync-status-error {
  border-color: var(--danger, #e74c3c);
  box-shadow: 0 2px 12px rgba(231,76,60,0.4);
  animation: syncPulseError 1.5s ease-in-out infinite;
}
.sync-indicator.sync-status-offline {
  border-color: #95a5a6;
  opacity: 0.7;
}

@keyframes syncPulseError {
  0%, 100% { box-shadow: 0 2px 12px rgba(231,76,60,0.3); }
  50% { box-shadow: 0 2px 20px rgba(231,76,60,0.7); }
}

/* Sync tooltip */
.sync-tooltip {
  display: none;
  position: absolute;
  bottom: auto;
  top: 48px;
  background: var(--bg-card, #1e1e2e);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--text, #ccc);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 10000;
  pointer-events: none;
}
.sync-indicator:hover .sync-tooltip {
  display: block;
}

/* ==================== ATTENDANCE SYSTEM ==================== */

/* Attendance Header Actions */
.attendance-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.att-month-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 4px 8px;
  border: 1px solid var(--border);
}

.att-month-label {
  font-size: 15px;
  font-weight: 600;
  min-width: 120px;
  text-align: center;
  color: var(--text-light);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.btn-icon:hover { background: var(--bg-card); }

/* Attendance Tabs */
.att-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 15px;
  margin-bottom: 5px;
  scrollbar-width: thin;
}

.att-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.25s;
}

.att-tab:hover {
  background: var(--bg-card);
  color: var(--text-light);
  border-color: var(--primary);
}

.att-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(210, 146, 36, 0.4);
}

.att-tab-icon { font-size: 16px; }

.att-tab-content {
  display: none;
}
.att-tab-content.active {
  display: block;
  animation: attFadeIn 0.3s ease;
}

@keyframes attFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Alerts Banner */
.att-alerts-banner {
  border-radius: 12px;
  margin-bottom: 15px;
  overflow: hidden;
}

.att-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
}

.att-alert.danger {
  background: rgba(255, 95, 87, 0.15);
  border-left: 4px solid var(--danger);
  color: #ff8a80;
}

.att-alert.warning {
  background: rgba(255, 189, 46, 0.15);
  border-left: 4px solid var(--warning);
  color: #ffe082;
}

.att-alert-icon { font-size: 20px; }

.att-alert-action {
  margin-inline-start: auto;
  background: rgba(255,255,255,0.15);
  border: none;
  color: inherit;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: background 0.2s;
}
.att-alert-action:hover { background: rgba(255,255,255,0.25); }

/* Live Stats Card */
.att-stat-live {
  position: relative;
  overflow: hidden;
}
.att-stat-live::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(40, 202, 65, 0.7); }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(40, 202, 65, 0); }
}

/* Live List */
.att-live-section {
  border: 1px solid rgba(40, 202, 65, 0.2);
  background: linear-gradient(135deg, rgba(40, 202, 65, 0.05) 0%, var(--bg-sidebar) 100%);
}

.att-live-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.att-live-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  transition: all 0.25s;
  cursor: pointer;
}
.att-live-card:hover {
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.att-live-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #1da340);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
}

.att-live-info {
  flex: 1;
  min-width: 0;
}

.att-live-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-live-since {
  font-size: 12px;
  color: var(--success);
  margin-top: 2px;
}

.att-live-duration {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Empty State */
.att-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 30px;
  font-size: 14px;
}

/* Timeline */
.att-timeline {
  max-height: 400px;
  overflow-y: auto;
}

.att-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
}
.att-timeline-item:last-child { border-bottom: none; }

.att-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.att-timeline-dot.in { background: var(--success); box-shadow: 0 0 8px rgba(40, 202, 65, 0.5); }
.att-timeline-dot.out { background: var(--danger); box-shadow: 0 0 8px rgba(255, 95, 87, 0.5); }

.att-timeline-body {
  flex: 1;
}

.att-timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.att-timeline-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-light);
}

.att-timeline-action {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.att-timeline-action.in { background: rgba(40, 202, 65, 0.15); color: var(--success); }
.att-timeline-action.out { background: rgba(255, 95, 87, 0.15); color: var(--danger); }

.att-timeline-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.att-timeline-duration {
  font-size: 12px;
  color: var(--primary);
  margin-top: 2px;
}

/* Employee Cards Grid */
.att-employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.att-emp-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.att-emp-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

.att-emp-card.live {
  border-color: var(--success);
}
.att-emp-card.live::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--success), #1da340);
}

.att-emp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.att-emp-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
}

.att-emp-info { flex: 1; min-width: 0; }

.att-emp-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-emp-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.att-emp-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.att-emp-badge.live { background: rgba(40, 202, 65, 0.15); color: var(--success); }
.att-emp-badge.offline { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.att-emp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.att-emp-stat {
  background: var(--bg-input);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.att-emp-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.att-emp-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.att-emp-stat-value.green { color: var(--success); }
.att-emp-stat-value.red { color: var(--danger); }
.att-emp-stat-value.blue { color: var(--primary); }

/* Progress Bar */
.att-progress {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
}

.att-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.att-progress-bar.green { background: linear-gradient(90deg, var(--success), #1da340); }
.att-progress-bar.yellow { background: linear-gradient(90deg, var(--warning), #ff9800); }
.att-progress-bar.red { background: linear-gradient(90deg, var(--danger), #d43f3a); }
.att-progress-bar.gray { background: var(--bg-tertiary); width: 100% !important; opacity: 0.3; }

/* Detail View */
.att-detail-header {
  background: var(--bg-sidebar);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.att-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
}

.att-detail-info { flex: 1; }

.att-detail-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
}

.att-detail-meta {
  display: flex;
  gap: 15px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.att-detail-meta span {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.att-detail-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.att-detail-stat {
  text-align: center;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 20px;
  border: 1px solid var(--border);
}

.att-detail-stat-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.att-detail-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Calendar / Heatmap */
.att-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.att-cal-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 2px;
}

.att-cal-day {
  min-height: 52px;
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  font-size: 13px;
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: default;
}

.att-cal-day .day-num {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 3px;
}

.att-cal-day .day-hours {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.att-cal-day.empty { background: transparent; }
.att-cal-day.future { background: var(--bg-input); opacity: 0.4; }
.att-cal-day.weekend { background: rgba(155, 89, 182, 0.08); border-color: rgba(155, 89, 182, 0.15); }
.att-cal-day.absent { background: rgba(255, 95, 87, 0.08); border-color: rgba(255, 95, 87, 0.15); }
.att-cal-day.complete { background: rgba(40, 202, 65, 0.10); border-color: rgba(40, 202, 65, 0.2); }
.att-cal-day.high-hours { background: rgba(40, 202, 65, 0.20); border-color: rgba(40, 202, 65, 0.35); }
.att-cal-day.open { background: rgba(255, 189, 46, 0.10); border-color: rgba(255, 189, 46, 0.2); }
.att-cal-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(210, 146, 36, 0.3); }

/* Detail Table */
.att-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.att-detail-table th,
.att-detail-table td {
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.att-detail-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
}

.att-detail-table tr:hover td {
  background: rgba(255,255,255,0.03);
}

.att-status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.att-status-badge.complete { background: rgba(40,202,65,0.15); color: var(--success); }
.att-status-badge.absent { background: rgba(255,95,87,0.15); color: var(--danger); }
.att-status-badge.weekend { background: rgba(155,89,182,0.15); color: #c39bd3; }
.att-status-badge.open { background: rgba(255,189,46,0.15); color: var(--warning); }
.att-status-badge.future { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* Manual Form */
.att-manual-form {
  margin-bottom: 0;
}

.att-manual-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.att-manual-row .form-group {
  flex: 1;
  min-width: 160px;
}

.att-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.att-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

/* Stale List */
.att-stale-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-stale-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 189, 46, 0.08);
  border: 1px solid rgba(255, 189, 46, 0.2);
  border-radius: 10px;
  padding: 12px;
}

.att-stale-info { flex: 1; }
.att-stale-name { font-weight: 600; font-size: 14px; color: var(--text-light); }
.att-stale-since { font-size: 12px; color: var(--warning); margin-top: 2px; }

/* Audit Log */
.att-audit-log {
  max-height: 300px;
  overflow-y: auto;
}

.att-audit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}

.att-audit-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.att-audit-text { flex: 1; color: var(--text-muted); }
.att-audit-time { font-size: 11px; color: var(--text-muted); }

/* ==================== PAYROLL SYSTEM ==================== */

.payroll-lock {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-sidebar);
  border-radius: 14px;
  border: 2px dashed var(--border);
}

.payroll-lock-icon {
  font-size: 64px;
  margin-bottom: 15px;
}

.payroll-lock h3 {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.payroll-lock p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 15px;
}

.payroll-pin-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.payroll-pin-input input {
  width: 160px;
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-light);
  padding: 12px;
}

.payroll-pin-input input:focus {
  border-color: var(--primary);
  outline: none;
}

#payrollSetupPin {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

#payrollSetupPin input {
  width: 160px;
  text-align: center;
  font-size: 18px;
  letter-spacing: 6px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-light);
  padding: 10px;
  margin: 5px;
}

.payroll-salary-section {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 15px;
  margin: 10px 0;
  border: 1px solid var(--border);
}

.payroll-salary-section h3 {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 12px;
}

/* Payroll Contract Card (in employee grid) */
.payroll-contract-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  transition: all 0.25s;
}
.payroll-contract-card:hover {
  border-color: #f1c40f;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.payroll-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.payroll-type-badge.Vollzeit { background: rgba(40,202,65,0.15); color: var(--success); }
.payroll-type-badge.Teilzeit { background: rgba(102,126,234,0.15); color: var(--primary); }
.payroll-type-badge.Minijob { background: rgba(255,189,46,0.15); color: var(--warning); }
.payroll-type-badge.unconfigured { background: rgba(255,152,0,0.12); color: #e67e22; font-size: 0.75rem; }

.payroll-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.payroll-row:last-child { border-bottom: none; }
.payroll-row-label { color: var(--text-muted); }
.payroll-row-value { color: var(--text-light); font-weight: 600; font-variant-numeric: tabular-nums; }

.payroll-row-value.positive { color: var(--success); }
.payroll-row-value.negative { color: var(--danger); }

/* Payroll Monthly Table */
.payroll-table {
  width: 100%;
  border-collapse: collapse;
}

.payroll-table th,
.payroll-table td {
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.payroll-table th {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-input);
}

.payroll-table tr:hover td {
  background: rgba(255,255,255,0.03);
}

.payroll-total-row {
  font-weight: 700;
  background: rgba(102,126,234,0.08) !important;
}
.payroll-total-row td { color: var(--text-light); }

/* Payroll Share */
.payroll-share-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: var(--bg-input);
  border-radius: 10px;
  margin-bottom: 8px;
}

.payroll-share-item .share-user {
  font-weight: 600;
  color: var(--text-light);
}

.payroll-share-item .share-perm {
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive Attendance */
@media (max-width: 768px) {
  .att-tabs {
    gap: 6px;
  }
  
  .att-tab {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .att-tab-icon { display: none; }
  
  .att-live-list {
    grid-template-columns: 1fr;
  }
  
  .att-employees-grid {
    grid-template-columns: 1fr;
  }
  
  .att-detail-header {
    flex-direction: column;
    text-align: center;
  }
  
  .att-detail-summary {
    justify-content: center;
  }
  
  .att-manual-row {
    flex-direction: column;
  }
  
  .att-calendar {
    gap: 3px;
  }
  
  .att-cal-day {
    min-height: 40px;
    font-size: 11px;
    padding: 4px 2px;
  }

  .attendance-header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==================== CHART STYLES ==================== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.chart-box {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}

.chart-box h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.chart-box canvas {
  max-height: 280px;
}

@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-box canvas {
    max-height: 220px;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  /* Hide non-content elements */
  .sidebar,
  .sidebar-overlay,
  .menu-toggle,
  .sync-indicator,
  .offline-banner,
  .toast-container,
  .login-container,
  .page-header button,
  .page-header .btn,
  .quick-actions,
  .smart-search-box,
  .tabs,
  .lightbox-overlay,
  .modal-overlay,
  .form-group.admin-only,
  .branch-stats,
  .charts-grid,
  #chartsSection,
  .qty-btn,
  .cart-qty-control,
  .save-to-list-btn,
  .product-link-btn,
  .btn-icon,
  .cart-status,
  .source-toggle,
  .day-toggle,
  .source-footer,
  #syncIndicator,
  #offlineBanner,
  #toastContainer,
  #currentOrderSection,
  .att-month-selector button,
  .attendance-header-actions button,
  .search-clear-btn,
  [onclick*="export"],
  [onclick*="print"] {
    display: none !important;
  }
  
  /* Layout */
  body {
    background: white !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .app-container {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .main-content {
    margin: 0 !important;
    padding: 10px !important;
  }
  
  .page {
    display: none !important;
  }
  
  .page.active {
    display: block !important;
  }
  
  /* Cards/Sections */
  .section-box,
  .stat-card,
  .category-section,
  .product-row,
  .product-row-settings,
  .cart-item {
    background: white !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  
  .category-header {
    background: #667eea !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .page-title {
    color: #000 !important;
    font-size: 20px;
    text-align: center;
    margin-bottom: 10px;
  }
  
  /* Table styles */
  table {
    border-collapse: collapse;
    width: 100%;
  }
  
  th, td {
    border: 1px solid #ccc !important;
    padding: 6px 10px !important;
    color: #000 !important;
    background: white !important;
    font-size: 12px;
  }
  
  th {
    background: #f0f0f0 !important;
    font-weight: bold;
  }
  
  /* Text colors */
  .stat-label,
  .stat-value,
  .product-name,
  .product-info,
  .cart-added-by,
  h1, h2, h3, p, span, label, div {
    color: #000 !important;
  }
  
  /* Expand collapsed sections for print */
  .source-items,
  .day-content,
  .products-list {
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }
  
  /* Images */
  img {
    max-width: 40px;
    max-height: 40px;
  }
  
  /* Page breaks */
  .category-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 10px;
  }
  
  /* Header info for print */
  .page-header {
    text-align: center;
    border-bottom: 2px solid #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
  }
}

/* ==================== NEON GLOW ENHANCEMENTS ==================== */

/* Page transition — removed (caused re-animation on page switch) */

/* Neon accent line on top of floating header */
.page-header.sticky-pinned::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-purple), transparent);
}

/* Product row staggered entry animation — removed (caused re-animation on page switch) */

/* Category section scale-in — removed (caused re-animation on page switch) */

/* Neon pulse on active tab */
@keyframes tabPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(210, 146, 36, 0.35), 0 0 10px rgba(210, 146, 36, 0.15); }
  50% { box-shadow: 0 4px 20px rgba(210, 146, 36, 0.5), 0 0 20px rgba(210, 146, 36, 0.25); }
}

.tab.active {
  animation: tabPulse 3s ease-in-out infinite;
}

/* Qty input glow on focus */
.qty-input:focus {
  border-color: rgba(0, 245, 255, 0.3) !important;
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.15);
}

/* Glowing scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-purple), var(--primary));
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--neon-pink), var(--neon-purple));
}

/* Neon stat card border accents */
.stat-card.blue { border-right: 3px solid var(--neon-cyan); }
.stat-card.blue:hover { box-shadow: 0 0 20px rgba(0, 245, 255, 0.15), 0 10px 40px rgba(0,0,0,0.4); }
.stat-card.green:hover { box-shadow: 0 0 20px rgba(57, 255, 20, 0.15), 0 10px 40px rgba(0,0,0,0.4); }
.stat-card.purple:hover { box-shadow: 0 0 20px rgba(108, 82, 168, 0.15), 0 10px 40px rgba(0,0,0,0.4); }
.stat-card.red:hover { box-shadow: 0 0 20px rgba(255, 95, 87, 0.15), 0 10px 40px rgba(0,0,0,0.4); }
.stat-card.yellow:hover { box-shadow: 0 0 20px rgba(255, 189, 46, 0.15), 0 10px 40px rgba(0,0,0,0.4); }

/* Glassmorphism on order items */
.order-item {
  background: rgba(18, 18, 42, 0.5);
  border: 1px solid rgba(42, 42, 80, 0.3);
  transition: all 0.3s;
}
.order-item:hover {
  background: rgba(18, 18, 42, 0.8);
  border-color: rgba(210, 146, 36, 0.2);
}

/* Badge glow */
.sidebar-item .badge {
  box-shadow: 0 0 8px rgba(255, 95, 87, 0.4);
}

/* Focus ring glow for all interactive elements */
*:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}

/* Checkbox glow */
input[type="checkbox"]:checked {
  box-shadow: 0 0 8px rgba(210, 146, 36, 0.3);
}

/* Search results count glow */
.search-results-count {
  background: rgba(210, 146, 36, 0.1);
  border: 1px solid rgba(210, 146, 36, 0.2);
}

/* Lightbox enhanced */
.lightbox-overlay {
  backdrop-filter: blur(10px);
}
.lightbox-overlay img {
  box-shadow: 0 0 60px rgba(0, 245, 255, 0.15), 0 0 100px rgba(0,0,0,0.8);
}

/* Subtle shimmer on login title */
.login-box h1 {
  background: linear-gradient(135deg, #fff 0%, var(--neon-gold) 50%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 4s ease-in-out infinite;
}

@keyframes shimmerText {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

/* Toast notifications glow */
.toastify {
  border-radius: 12px !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 15px rgba(210, 146, 36, 0.2) !important;
}

/* Smooth transitions for everything */
*, *::before, *::after {
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════════════════════════════
   🎨 Theme Editor Styles
   ═══════════════════════════════════════ */

.theme-presets-section { margin-bottom: 24px; }

.theme-section-title {
  font-size: 15px; font-weight: 700; color: var(--neon-gold);
  margin-bottom: 8px;
}
.theme-section-desc {
  font-size: 12px; color: var(--text-muted); margin-bottom: 14px;
}

/* Preset grid */
.theme-presets-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.theme-preset-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; cursor: pointer;
  transition: all 0.25s; position: relative; text-align: center;
}
.theme-preset-card:hover {
  border-color: var(--neon-gold);
  box-shadow: 0 0 12px rgba(210, 146, 36, 0.15);
  transform: translateY(-2px);
}
.theme-preset-card.active {
  border-color: var(--neon-gold);
  box-shadow: 0 0 18px rgba(210, 146, 36, 0.3);
  background: rgba(210, 146, 36, 0.08);
}
.preset-colors-preview {
  display: flex; gap: 4px; justify-content: center; margin-bottom: 8px;
}
.preset-colors-preview span {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
}
.preset-name { font-size: 12px; color: var(--text); font-weight: 600; }
.preset-delete-btn {
  position: absolute; top: 4px; left: 4px; background: rgba(255,95,87,0.15);
  color: var(--danger); border: none; border-radius: 50%; width: 22px; height: 22px;
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.theme-preset-card:hover .preset-delete-btn { opacity: 1; }

/* Save as preset */
.theme-save-section {
  display: flex; gap: 10px; align-items: center; margin-bottom: 24px;
  padding: 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px;
}
.theme-save-section input { flex: 1; }

/* Color groups */
.theme-color-group {
  margin-bottom: 24px; padding: 18px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; position: relative; overflow: hidden;
}
.theme-color-group::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--neon-gold), var(--neon-cyan), var(--neon-green), var(--neon-pink), var(--neon-purple));
  background-size: 200%; animation: neonSlide 4s linear infinite;
}

.theme-color-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.theme-color-item {
  display: flex; flex-direction: column; gap: 6px;
}
.theme-color-item label {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
}

.color-picker-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 10px;
  transition: border-color 0.3s;
}
.color-picker-wrap:focus-within {
  border-color: var(--neon-gold);
  box-shadow: 0 0 10px rgba(210, 146, 36, 0.15);
}

.theme-color-input {
  width: 34px; height: 34px; border: none; border-radius: 8px;
  cursor: pointer; background: transparent; padding: 0;
}
.theme-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.theme-color-input::-webkit-color-swatch { border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); }

.color-hex-input {
  flex: 1; background: transparent; border: none; color: var(--text);
  font-family: 'Courier New', monospace; font-size: 13px; font-weight: 600;
  outline: none; min-width: 80px;
}

.color-preview-dot {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  transition: all 0.3s;
}

/* Slider controls */
.theme-sliders-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.theme-slider-item {
  display: flex; flex-direction: column; gap: 6px;
}
.slider-header {
  display: flex; justify-content: space-between; align-items: center;
}
.slider-header label {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
}
.slider-value {
  font-size: 12px; color: var(--neon-cyan); font-family: 'Courier New', monospace;
  font-weight: 700; min-width: 50px; text-align: left;
}
.theme-range-input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--bg-input); border: 1px solid var(--border);
  outline: none; cursor: pointer;
}
.theme-range-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--neon-gold); border: 2px solid var(--bg-dark);
  box-shadow: 0 0 8px rgba(210, 146, 36, 0.5);
  cursor: pointer; transition: box-shadow 0.2s;
}
.theme-range-input::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(210, 146, 36, 0.8);
}
.theme-range-input::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--neon-gold); border: 2px solid var(--bg-dark);
  box-shadow: 0 0 8px rgba(210, 146, 36, 0.5);
  cursor: pointer;
}
.theme-range-input::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: var(--bg-input); border: 1px solid var(--border);
}

/* Live preview bar */
.theme-preview-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0;
  padding: 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px;
}
.preview-element {
  padding: 8px 14px; border-radius: 8px; font-size: 12px;
  font-weight: 600; text-align: center;
}
.neon-preview {
  background: var(--bg-dark); border: 1px solid var(--border);
  font-weight: 700;
}

/* Actions */
.theme-actions {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .theme-presets-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  .theme-color-grid {
    grid-template-columns: 1fr;
  }
  .theme-save-section {
    flex-direction: column;
  }
  .theme-actions {
    flex-direction: column;
  }
  .theme-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ==================== LOADING SCREEN ==================== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&display=swap');

.loading-screen {
    --ls-progress: 0;
    --ls-fill: 8%;
    --ls-needle: -65deg;
    --ls-stream-opacity: 0;
    --ls-stream-scale: 0.35;
    --ls-steam-opacity: 0.15;
    --ls-crema-opacity: 0.2;
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 14%, rgba(210,146,36,0.18), transparent 22%),
        radial-gradient(circle at 18% 18%, rgba(108,82,168,0.16), transparent 26%),
        radial-gradient(circle at 82% 22%, rgba(0,245,255,0.12), transparent 22%),
        linear-gradient(155deg, #050816 0%, #0a0a1a 28%, #12122a 62%, #050611 100%);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-screen.hidden {
    display: none;
}

/* Ambience */
.loading-ambience {
    position: fixed; inset: 0; pointer-events: none; overflow: hidden;
}
.loading-orb {
    position: absolute; border-radius: 50%; filter: blur(28px); mix-blend-mode: screen;
    animation: ls-drift 12s ease-in-out infinite;
}
.loading-orb-a {
    width: 360px; height: 360px; top: 8%; left: 10%;
    background: radial-gradient(circle, rgba(108,82,168,0.22), transparent 68%);
}
.loading-orb-b {
    width: 420px; height: 420px; bottom: -8%; right: 8%;
    background: radial-gradient(circle, rgba(0,245,255,0.18), transparent 70%);
    animation-delay: -4s;
}
.loading-orb-c {
    width: 260px; height: 260px; top: 14%; right: 20%;
    background: radial-gradient(circle, rgba(210,146,36,0.14), transparent 72%);
    animation-delay: -7s;
}
.loading-beam {
    position: absolute; top: -30%; width: 22vw; height: 160vh;
    background: linear-gradient(180deg, rgba(210,146,36,0.16), transparent 58%);
    filter: blur(8px); opacity: 0.18;
}
.loading-beam-a { left: 26%; transform: rotate(18deg); animation: ls-pulseBeam 9s ease-in-out infinite; }
.loading-beam-b { right: 24%; transform: rotate(-16deg); animation: ls-pulseBeam 11s ease-in-out infinite reverse; }

/* Content wrapper */
.loading-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center;
    gap: 18px; width: 100%; max-width: 680px; padding: 0 20px;
}

/* Crown beans */
.loading-crown {
    position: relative; width: min(100%,560px); height: 120px; pointer-events: none;
}
.loading-bean {
    position: absolute; left: var(--x); bottom: var(--start);
    width: var(--size); height: calc(var(--size)*1.42);
    border-radius: 58% 42% 54% 46% / 46% 56% 44% 54%;
    background: linear-gradient(140deg, #7a4120 0%, #49200d 42%, #1c0b08 100%);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.08), inset -8px -10px 16px rgba(0,0,0,0.26), 0 12px 22px rgba(0,0,0,0.24);
    opacity: 0; transform: translate3d(0,18px,0) rotate(var(--rotate));
    animation: ls-beanRise var(--duration) linear infinite;
    animation-delay: var(--delay);
}
.loading-bean::before {
    content: ""; position: absolute; top: 10%; bottom: 10%; left: 50%; width: 2px;
    transform: translateX(-50%) rotate(6deg); border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,231,202,0.24), rgba(21,10,8,0.88));
}
.loading-bean::after {
    content: ""; position: absolute; top: 12%; right: 18%; width: 26%; height: 18%;
    border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.34), transparent 70%); filter: blur(1px);
}
.loading-sparkle {
    position: absolute; left: var(--x); bottom: var(--start);
    width: var(--size); height: var(--size); border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.96) 0%, rgba(0,245,255,0.34) 42%, transparent 78%);
    box-shadow: 0 0 12px rgba(0,245,255,0.22);
    opacity: 0; animation: ls-sparkleRise var(--duration) ease-in-out infinite;
    animation-delay: var(--delay); mix-blend-mode: screen;
}
.loading-sparkle::before, .loading-sparkle::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 150%; height: 1px;
    transform: translate(-50%,-50%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
}
.loading-sparkle::after { transform: translate(-50%,-50%) rotate(90deg); }

/* Wordmark */
.loading-wordmark {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(28px,5.8vw,64px); line-height: 0.95;
    letter-spacing: 0.18em; text-transform: uppercase; text-align: center;
    color: transparent;
    background: linear-gradient(115deg, rgba(255,255,255,0.96) 6%, rgba(210,146,36,0.98) 28%, rgba(0,245,255,0.92) 50%, rgba(108,82,168,0.96) 72%, rgba(255,255,255,0.98) 94%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    animation: ls-wordmarkFlow 7.8s linear infinite;
    filter: drop-shadow(0 0 18px rgba(210,146,36,0.14));
    white-space: nowrap; margin: 0;
}

/* Machine Stage */
.loading-machine-stage {
    position: relative; width: min(100%,680px); height: 380px;
}
.loading-ring {
    position: absolute; top: 6px; left: 50%; width: 340px; height: 340px;
    border-radius: 50%; transform: translateX(-50%);
    background: radial-gradient(circle, rgba(108,82,168,0.2), transparent 58%);
}
.loading-ring::after {
    content: ""; position: absolute; inset: 16px; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(210,146,36,0.6) 30deg, transparent 88deg, transparent 220deg, rgba(0,245,255,0.28) 270deg, transparent 360deg);
    filter: blur(1px); animation: ls-ringSpin 18s linear infinite;
}
.loading-stage-glow {
    position: absolute; inset: auto 0 18px; margin: auto; width: 440px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(210,146,36,0.28), rgba(108,82,168,0.16) 46%, transparent 72%);
    filter: blur(18px);
}
.loading-machine {
    position: absolute; top: 18px; left: 50%; width: 320px; height: 220px;
    transform: translateX(-50%); z-index: 3;
    animation: ls-machineHover 7.5s ease-in-out infinite;
}
.loading-machine-top {
    position: absolute; top: 0; left: 50%; width: 210px; height: 26px;
    transform: translateX(-50%); border-radius: 20px 20px 10px 10px;
    background: linear-gradient(180deg, #2b2150, #171735);
    border: 1px solid rgba(108,82,168,0.28);
    box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
}
.loading-machine-top::after {
    content: ""; position: absolute; left: 16px; right: 16px; bottom: 7px; height: 3px;
    border-radius: 999px; background: linear-gradient(90deg, transparent, rgba(0,245,255,0.24), transparent);
}
.loading-machine-body {
    position: absolute; inset: 16px 0 0;
    border-radius: 42px 42px 32px 32px;
    background: linear-gradient(180deg, rgba(40,32,78,0.82), rgba(18,18,42,0.96) 24%, rgba(10,10,26,0.98));
    border: 1px solid rgba(210,146,36,0.14);
    box-shadow: 0 35px 70px rgba(0,0,0,0.44), inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -18px 28px rgba(0,0,0,0.4);
    overflow: hidden;
}
.loading-machine-body::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.07) 34%, transparent 48%);
    transform: translateX(-120%); animation: ls-shellSweep 5.8s ease-in-out infinite;
}
.loading-badge {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    padding: 6px 12px; border-radius: 999px;
    background: linear-gradient(180deg, rgba(108,82,168,0.92), rgba(18,18,42,0.94));
    border: 1px solid rgba(210,146,36,0.2);
    font-family: "Cormorant Garamond", serif; font-size: 16px;
    letter-spacing: 0.18em; color: rgba(255,255,255,0.94);
}
.loading-display {
    position: absolute; top: 58px; left: 46px; width: 84px; height: 44px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(0,245,255,0.16), rgba(0,245,255,0.03)), rgba(4,4,4,0.72);
    border: 1px solid rgba(0,245,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 24px rgba(0,245,255,0.14);
    display: grid; place-items: center; color: rgba(0,245,255,0.92);
    font-size: 13px; letter-spacing: 0.08em;
}
.loading-gauge {
    position: absolute; top: 50px; right: 38px; width: 78px; height: 78px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.96), rgba(210,146,36,0.88) 52%, rgba(42,42,80,0.96));
    box-shadow: 0 16px 30px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.4);
}
.loading-gauge::before {
    content: ""; position: absolute; inset: 10px; border-radius: 50%;
    background: conic-gradient(from 210deg, rgba(86,54,28,0.85) 0deg 20deg, transparent 20deg 25deg, rgba(86,54,28,0.85) 25deg 45deg, transparent 45deg 50deg, rgba(86,54,28,0.85) 50deg 70deg, transparent 70deg 75deg, rgba(86,54,28,0.85) 75deg 95deg, transparent 95deg 100deg, rgba(86,54,28,0.85) 100deg 120deg, transparent 120deg 360deg);
    mask: radial-gradient(circle, transparent 0 56%, #000 56% 62%, transparent 62%);
}
.loading-gauge-needle {
    position: absolute; left: 50%; bottom: 50%; width: 3px; height: 24px;
    transform-origin: center calc(100% - 1px);
    transform: translateX(-50%) rotate(var(--ls-needle));
    background: linear-gradient(180deg, #7b3d18, #461c07); border-radius: 999px;
}
.loading-gauge-core {
    position: absolute; inset: 50%; width: 12px; height: 12px;
    transform: translate(-50%,-50%); border-radius: 50%;
    background: radial-gradient(circle, #51260c, #281106);
    box-shadow: 0 0 0 3px rgba(255,235,208,0.3);
}
.loading-glass-window {
    position: absolute; inset: 70px 110px auto; height: 66px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(108,82,168,0.14), rgba(0,245,255,0.03)), rgba(8,8,8,0.66);
    border: 1px solid rgba(0,245,255,0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), inset 0 -18px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}
.loading-glass-window::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -28%; width: 32%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transform: skewX(-18deg); animation: ls-glassSweep 4.8s ease-in-out infinite;
}
.loading-glass-window::after {
    content: ""; position: absolute; inset: 16px 14px auto; height: 16px; border-radius: 999px;
    background: linear-gradient(90deg, rgba(108,82,168,0.12), rgba(0,245,255,0.82), rgba(108,82,168,0.12));
    filter: blur(8px); animation: ls-pulseWindow 3.4s ease-in-out infinite;
}
.loading-controls {
    position: absolute; top: 142px; left: 54px; display: flex; gap: 10px;
}
.loading-ctrl {
    width: 12px; height: 12px; border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}
.loading-ctrl.amber {
    background: #d29224; box-shadow: 0 0 12px rgba(210,146,36,0.55), 0 0 0 3px rgba(255,255,255,0.05);
    animation: ls-ledPulse 1.9s ease-in-out infinite;
}
.loading-ctrl.red { background: #ff2d95; box-shadow: 0 0 12px rgba(255,45,149,0.34), 0 0 0 3px rgba(255,255,255,0.05); }
.loading-ctrl.green {
    background: #00f5ff; box-shadow: 0 0 14px rgba(0,245,255,0.5), 0 0 0 3px rgba(255,255,255,0.05);
    animation: ls-ledPulse 1.5s ease-in-out infinite reverse;
}
.loading-brew-head {
    position: absolute; left: 50%; bottom: 34px; width: 156px; height: 30px;
    transform: translateX(-50%); border-radius: 18px;
    background: linear-gradient(180deg, rgba(210,146,36,0.95), rgba(108,82,168,0.8) 50%, rgba(18,18,42,0.98));
    box-shadow: 0 14px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,244,220,0.4);
}
.loading-brew-head::before {
    content: ""; position: absolute; inset: 7px 28px auto; height: 7px; border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,250,238,0.12), rgba(255,250,238,0.6), rgba(255,250,238,0.12));
}
.loading-spout {
    position: absolute; bottom: -18px; width: 16px; height: 20px;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(180deg, #2b1c15, #100d0a);
}
.loading-spout.left { left: 38px; }
.loading-spout.right { right: 38px; }
.loading-tray {
    position: absolute; left: 50%; bottom: 6px; width: 220px; height: 34px;
    transform: translateX(-50%); border-radius: 18px;
    background: linear-gradient(180deg, rgba(26,26,58,0.92), rgba(10,10,26,0.98));
    border: 1px solid rgba(108,82,168,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 30px rgba(0,0,0,0.34);
    overflow: hidden;
}
.loading-tray::before {
    content: ""; position: absolute; inset: 8px 16px 12px; border-radius: 999px;
    background: repeating-linear-gradient(90deg, rgba(255,236,210,0.08) 0 6px, transparent 6px 18px);
}
.loading-tray-progress {
    position: absolute; left: 18px; right: 18px; bottom: 7px; height: 3px;
    border-radius: 999px; overflow: hidden;
}
.loading-tray-progress span {
    display: block; width: 100%; height: 100%;
    transform: scaleX(var(--ls-progress)); transform-origin: right center; border-radius: inherit;
    background: linear-gradient(90deg, rgba(108,82,168,0.2), rgba(210,146,36,0.96), rgba(0,245,255,0.38));
    box-shadow: 0 0 20px rgba(210,146,36,0.42);
}

/* Pour zone */
.loading-pour-zone {
    position: absolute; top: 190px; left: 50%; width: 320px; height: 200px;
    transform: translateX(-50%); z-index: 2;
}
.loading-stream {
    position: absolute; top: 0; width: 8px; height: 100px;
    opacity: var(--ls-stream-opacity); transform-origin: top center;
    transform: scaleY(var(--ls-stream-scale)); border-radius: 999px;
    background: linear-gradient(180deg, rgba(205,126,69,0.72), rgba(136,68,31,0.96) 48%, rgba(65,28,12,0.98));
    filter: blur(0.5px);
}
.loading-stream::after {
    content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px;
    transform: translateX(-50%); border-radius: 50%;
    background: radial-gradient(circle, rgba(215,146,86,0.95), rgba(95,44,20,0.2));
    animation: ls-dripPulse 1s ease-in-out infinite;
}
.loading-stream.left { left: 114px; }
.loading-stream.right { right: 114px; }
.loading-cup-shadow {
    position: absolute; bottom: 18px; left: 50%; width: 220px; height: 44px;
    transform: translateX(-50%); border-radius: 50%;
    background: radial-gradient(circle, rgba(0,0,0,0.6), transparent 72%); filter: blur(10px);
}
.loading-cup {
    position: absolute; left: 50%; bottom: 34px; width: 156px; height: 114px;
    transform: translateX(-50%);
}
.loading-cup-body {
    position: absolute; inset: 8px 10px 0;
    border-radius: 16px 16px 44px 44px;
    background: linear-gradient(120deg, rgba(255,255,255,0.96), rgba(244,236,224,0.94) 38%, rgba(205,188,171,0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), inset -14px 0 20px rgba(122,105,88,0.12), 0 24px 40px rgba(0,0,0,0.24);
    overflow: hidden;
}
.loading-cup-rim {
    position: absolute; top: 0; left: 5px; right: 5px; height: 9px;
    border-radius: 999px; border: 1px solid rgba(210,146,36,0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72); z-index: 4;
}
.loading-cup-crest {
    position: absolute; top: 38px; left: 50%; transform: translateX(-50%);
    padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(210,146,36,0.28);
    color: rgba(108,82,168,0.74); font-family: "Cormorant Garamond", serif;
    font-size: 14px; letter-spacing: 0.2em; z-index: 3;
}
.loading-coffee-fill {
    position: absolute; left: 8px; right: 8px; bottom: 0;
    height: var(--ls-fill); border-radius: 0 0 34px 34px;
    background: linear-gradient(180deg, rgba(60,23,9,0.98), rgba(108,52,22,0.98) 40%, rgba(191,122,66,0.98));
    box-shadow: inset 0 10px 24px rgba(255,212,161,0.08);
}
.loading-coffee-fill::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px;
    background: linear-gradient(180deg, rgba(255,215,170,0.18), rgba(255,215,170,0));
}
.loading-crema {
    position: absolute; left: 14px; right: 14px; bottom: calc(var(--ls-fill) - 4px);
    height: 10px; border-radius: 999px;
    background: radial-gradient(circle, rgba(228,182,130,0.96), rgba(191,122,66,0.18) 72%);
    filter: blur(1px); opacity: var(--ls-crema-opacity);
}
.loading-cup-handle {
    position: absolute; top: 30px; left: -5px; width: 30px; height: 50px;
    border: 5px solid rgba(231,220,206,0.98); border-right: none;
    border-radius: 22px 0 0 22px;
}
.loading-saucer {
    position: absolute; left: 50%; bottom: 14px; width: 208px; height: 24px;
    transform: translateX(-50%); border-radius: 50%;
    background: linear-gradient(180deg, rgba(241,232,220,0.96), rgba(199,186,170,0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 18px 30px rgba(0,0,0,0.22);
}
.loading-steam {
    position: absolute; bottom: 108px; width: 12px; height: 72px;
    opacity: var(--ls-steam-opacity); filter: blur(8px);
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.16));
    border-radius: 999px; animation: ls-steamRise 3.2s ease-in-out infinite;
}
.loading-steam-1 { left: 112px; }
.loading-steam-2 { left: 136px; height: 82px; animation-delay: 0.7s; }
.loading-steam-3 { right: 112px; animation-delay: 1.1s; }
.loading-steam-4 { right: 136px; height: 76px; animation-delay: 1.7s; }

/* Progress Panel */
.loading-progress-panel {
    position: relative; z-index: 2; width: min(100%,560px);
    padding: 16px 18px 18px; border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02));
    border: 1px solid rgba(108,82,168,0.16);
    backdrop-filter: blur(16px); box-shadow: 0 24px 50px rgba(0,0,0,0.28);
}
.loading-progress-head {
    display: flex; align-items: center; gap: 12px;
}
.loading-status-dot {
    width: 10px; height: 10px; border-radius: 50%; flex: none;
    background: #00f5ff; box-shadow: 0 0 14px rgba(0,245,255,0.62);
    animation: ls-ledPulse 1.8s ease-in-out infinite;
}
.loading-status-text {
    flex: 1; color: rgba(255,255,255,0.74); font-size: 14px; margin: 0;
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}
.loading-status-value {
    font-family: "Cormorant Garamond", serif; font-size: 30px;
    letter-spacing: 0.08em; color: rgba(210,146,36,0.98);
}
.loading-progress-track {
    position: relative; margin-top: 12px; height: 6px;
    border-radius: 999px; overflow: hidden; background: rgba(255,255,255,0.06);
}
.loading-progress-bar {
    position: absolute; inset: 0;
    transform: scaleX(var(--ls-progress)); transform-origin: right center;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(108,82,168,0.18), rgba(210,146,36,0.96), rgba(0,245,255,0.44));
    box-shadow: 0 0 22px rgba(210,146,36,0.46);
}
.loading-steps {
    margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px;
}
.loading-step {
    padding: 7px 11px; border-radius: 999px;
    border: 1px solid rgba(108,82,168,0.14);
    color: rgba(119,119,170,0.78); background: rgba(255,255,255,0.02);
    transition: all 0.35s ease; font-size: 13px;
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}
.loading-step.is-active {
    color: rgba(255,255,255,0.95); border-color: rgba(210,146,36,0.18);
    background: linear-gradient(180deg, rgba(108,82,168,0.18), rgba(210,146,36,0.08));
    box-shadow: 0 0 18px rgba(108,82,168,0.18);
}

/* Keyframes */
@keyframes ls-drift {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(0,-12px,0) scale(1.08); }
}
@keyframes ls-pulseBeam {
    0%,100% { opacity: 0.1; }
    50% { opacity: 0.22; }
}
@keyframes ls-beanRise {
    0% { transform: translate3d(0,18px,0) rotate(var(--rotate)) scale(0.72); opacity: 0; }
    16% { opacity: 0.92; }
    55% { transform: translate3d(var(--drift),-170px,0) rotate(calc(var(--rotate)+18deg)) scale(1); opacity: 0.96; }
    100% { transform: translate3d(0,-340px,0) rotate(calc(var(--rotate)+34deg)) scale(0.76); opacity: 0; }
}
@keyframes ls-sparkleRise {
    0% { transform: translate3d(0,16px,0) scale(0.35); opacity: 0; }
    18% { opacity: 0.9; }
    50% { transform: translate3d(var(--drift),-130px,0) scale(1); opacity: 1; }
    100% { transform: translate3d(0,-280px,0) scale(0.4); opacity: 0; }
}
@keyframes ls-wordmarkFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}
@keyframes ls-ringSpin { to { transform: rotate(360deg); } }
@keyframes ls-machineHover {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}
@keyframes ls-shellSweep {
    0% { transform: translateX(-130%); }
    46%,100% { transform: translateX(160%); }
}
@keyframes ls-glassSweep {
    0% { transform: translateX(-100%) skewX(-18deg); }
    56%,100% { transform: translateX(380%) skewX(-18deg); }
}
@keyframes ls-pulseWindow {
    0%,100% { opacity: 0.5; }
    50% { opacity: 1; }
}
@keyframes ls-ledPulse {
    0%,100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.12); opacity: 1; }
}
@keyframes ls-dripPulse {
    0%,100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 0.78; }
    50% { transform: translateX(-50%) translateY(5px) scale(0.5); opacity: 0.2; }
}
@keyframes ls-steamRise {
    0% { transform: translateY(10px) scaleX(0.7); opacity: 0; }
    20% { opacity: var(--ls-steam-opacity); }
    60% { transform: translateY(-28px) scaleX(1.7); opacity: calc(var(--ls-steam-opacity)*0.68); }
    100% { transform: translateY(-58px) scaleX(2.3); opacity: 0; }
}

/* Mobile */
@media (max-width: 720px) {
    .loading-machine-stage { height: 320px; }
    .loading-ring { width: 280px; height: 280px; top: 20px; }
    .loading-machine { width: 270px; height: 194px; }
    .loading-display { left: 30px; width: 76px; }
    .loading-glass-window { inset: 70px 94px auto; }
    .loading-gauge { right: 28px; width: 68px; height: 68px; }
    .loading-brew-head { width: 134px; }
    .loading-tray { width: 194px; }
    .loading-pour-zone { width: 280px; top: 168px; }
    .loading-stream.left { left: 98px; }
    .loading-stream.right { right: 98px; }
    .loading-cup { width: 138px; height: 104px; }
    .loading-saucer { width: 186px; }
    .loading-wordmark { font-size: clamp(24px,9vw,42px); letter-spacing: 0.12em; }
    .loading-progress-head { flex-wrap: wrap; }
    .loading-status-value { margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .loading-screen *, .loading-screen *::before, .loading-screen *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}