/* SuperPOS Modern UI - Premium Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Modern Color Palette - Light Mode */
  --primary: #FF6B35;
  --primary-hover: #E85D3F;
  --primary-light: #FF8C42;
  --secondary: #4ECDC4;
  --accent: #FFE66D;

  /* Backgrounds with Subtle Gradients */
  --bg-body: #F7F9FC;
  --bg-sidebar: linear-gradient(180deg, #FF6B35 0%, #FF8C42 100%);
  --bg-card: #FFFFFF;
  --bg-input: #F8FAFB;
  --bg-hover: rgba(78, 205, 196, 0.08);
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* Text Colors */
  --text-primary: #1A202C;
  --text-secondary: #718096;
  --text-muted: #A0AEC0;
  --text-light: #FFFFFF;
  --text-on-primary: #FFFFFF;

  /* Borders & Shadows */
  --border-color: #E2E8F0;
  --border-radius: 12px;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.2);

  /* Status Colors */
  --success: #48BB78;
  --success-light: #C6F6D5;
  --danger: #F56565;
  --danger-light: #FED7D7;
  --warning: #ECC94B;
  --warning-light: #FEFCBF;
  --info: #4299E1;
  --info-light: #BEE3F8;

  /* Dimensions */
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --primary: #FF8C42;
  --primary-hover: #FFA366;
  --primary-light: #FFB088;
  --secondary: #5DD7CF;
  --accent: #FFD700;

  --bg-body: #0F172A;
  --bg-sidebar: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  --bg-card: #1E293B;
  --bg-input: #334155;
  --bg-hover: rgba(78, 205, 196, 0.1);

  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-light: #F8FAFC;
  --text-on-primary: #0F172A;

  --border-color: #334155;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.6);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

/* Layout */
.main-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: var(--spacing-xl);
  transition: margin-left var(--transition-base);
  min-height: 100vh;
}

/* Enhanced Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  color: var(--text-light);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  transition: transform var(--transition-base), background var(--transition-slow);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Sidebar Header */
.sidebar-header {
  padding: var(--spacing-lg) var(--spacing-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-header h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-header .subtitle {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* User Profile Section */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--spacing-md);
  margin: var(--spacing-md);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.user-profile:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-light);
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info .user-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .user-email {
  font-size: 12px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Menu Styles */
.sidebar-menu {
  padding: var(--spacing-sm) 0;
}

.menu-group {
  margin-bottom: 4px;
  transition: all var(--transition-base);
}

.menu-header {
  padding: 10px var(--spacing-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  transition: all var(--transition-fast);
  user-select: none;
}

.menu-header:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.menu-header .arrow {
  font-size: 10px;
  transition: transform var(--transition-base);
}

.menu-group.active .arrow {
  transform: rotate(90deg);
}

.menu-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.1);
}

.menu-group.active .menu-items {
  max-height: 800px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--spacing-md) 12px 32px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(255, 255, 255, 0.1);
  transition: width var(--transition-base);
}

.menu-item:hover::before {
  width: 100%;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  padding-left: 36px;
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: var(--text-light);
  font-weight: 600;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.1);
}

.menu-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  z-index: 1;
}

.menu-item span {
  z-index: 1;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Enhanced Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  border: none;
  color: var(--text-light);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.stat-card-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 56px;
  opacity: 0.15;
  color: var(--text-light);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.stat-card-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-light);
  margin: 8px 0;
  letter-spacing: -1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Enhanced Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0.3px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-on-primary);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #38A169 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #E53E3E 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #D69E2E 100%);
  color: #2D3748;
  box-shadow: 0 4px 12px rgba(236, 201, 75, 0.3);
}

.btn-secondary {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

/* Enhanced Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label,
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition-base);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* Enhanced Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
}

.table th {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-light);
  padding: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: none;
}

.table th:first-child {
  border-top-left-radius: var(--radius-md);
}

.table th:last-child {
  border-top-right-radius: var(--radius-md);
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
}

.table tbody tr {
  transition: all var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-hover);
  transform: scale(1.01);
  box-shadow: var(--shadow-sm);
}

.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-md);
}

.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-md);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: #975A16;
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-info {
  background: var(--info-light);
  color: var(--info);
}

/* Theme Toggle */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: var(--transition-base);
  border-radius: 32px;
  backdrop-filter: blur(10px);
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: var(--transition-base);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

input:checked+.slider:before {
  transform: translateX(28px);
}

/* Alerts */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

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

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

.alert-info {
  background: var(--info-light);
  border-color: var(--info);
  color: #2C5282;
}

.alert-warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: #975A16;
}

.alert-danger {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #9B2C2C;
}

.alert-success {
  background: var(--success-light);
  border-color: var(--success);
  color: #22543D;
}

/* POS / Etalase Styles */
.pos-layout {
  display: flex;
  gap: var(--spacing-lg);
  height: calc(100vh - 120px);
  overflow: hidden;
}

.products-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: var(--spacing-md);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 4px;
  padding-bottom: var(--spacing-md);
}

.product-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.product-card-img {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, #F7FAFC 0%, #EDF2F7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-bottom: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.product-card-img::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(255, 140, 66, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.product-card:hover .product-card-img::before {
  opacity: 1;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform var(--transition-base);
}

.product-card:hover .product-card-img img {
  transform: scale(1.05);
}

.product-card-name {
  padding: 10px 10px 4px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.product-card-price {
  padding: 0 10px 6px;
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}

.product-card-stock {
  padding: 0 10px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Cart Panel */
.cart-panel {
  width: 380px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--spacing-md);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px dashed var(--border-color);
}

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

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.qty-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.qty-input {
  width: 45px;
  text-align: center;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  height: 28px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
}

/* Utility Classes */
.d-flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

/* Loading State */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  .main-content {
    margin-left: 0;
    padding: var(--spacing-md);
    padding-bottom: 80px;
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 2000;
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .page-header h1 {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .pos-layout {
    flex-direction: column;
    height: auto;
  }

  .cart-panel {
    width: 100%;
    margin-top: var(--spacing-md);
  }

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

  .product-card-img {
    height: 100px;
    padding: 6px;
  }

  /* Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-card);
    border-top: 2px solid var(--border-color);
    justify-content: space-around;
    align-items: center;
    z-index: 1500;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
  }

  .mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    gap: 4px;
    flex: 1;
    height: 100%;
    transition: all var(--transition-fast);
    font-weight: 600;
  }

  .mobile-bottom-nav .nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .mobile-bottom-nav .nav-item.active,
  .mobile-bottom-nav .nav-item:hover {
    color: var(--primary);
    background: var(--bg-hover);
  }

  .mobile-bottom-nav .nav-item.active i {
    transform: scale(1.1);
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 20px;
  }

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

  .cart-panel {
    padding: var(--spacing-md);
  }
}

/* Print Styles */
@media print {

  .sidebar,
  .mobile-bottom-nav,
  .btn,
  .theme-switch-wrapper {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}