/* Core Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0a0a0f;
  --color-bg-secondary: rgba(18, 18, 27, 0.8);
  --color-bg-featured: rgba(30, 30, 45, 0.6);
  --color-primary: #d4af37;
  --color-primary-hover: #f0c952;
  --color-primary-dark: #a97c37;
  --color-text: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: rgba(255, 255, 255, 0.4);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #6366f1;
  --color-purple: #8b5cf6;

  /* Sidebar */
  --sidebar-bg: rgba(25, 25, 35, 0.95);
  --sidebar-width: 280px;
  --sidebar-width-collapsed: 80px;
  --content-bg: rgba(15, 15, 20, 0.95);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #d4af37 0%, #f0c952 100%);
  --gradient-secondary: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(240, 201, 82, 0.1) 100%);
  --gradient-dark: linear-gradient(180deg, rgba(18, 18, 27, 0.95) 0%, rgba(10, 10, 15, 0.95) 100%);
  --gradient-sidebar: linear-gradient(180deg, rgba(8, 8, 15, 0.98) 0%, rgba(5, 5, 10, 0.98) 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  color: var(--color-text);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 2px);
  pointer-events: none;
  z-index: 1;
}

/* Layout */
.admin-container {
  display: none;
  /* Скрыт по умолчанию, показывается только после успешной авторизации */
  min-height: 100vh;
  position: relative;
  z-index: 2;
  background: var(--content-bg);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width-collapsed);
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: none;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  margin: 20px 0 20px 20px;
  border-radius: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.sidebar.expanded {
  width: var(--sidebar-width);
  padding: 24px 0;
}

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

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  margin: 0 16px 32px 16px;
  padding: 12px;
  position: relative;
  white-space: nowrap;
  transition: all 0.4s ease;
}

.sidebar.expanded .logo {
  justify-content: flex-start;
  margin: 0 20px 32px 20px;
}

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
  flex-shrink: 0;
}

.logo-text {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.4s ease;
}

.sidebar.expanded .logo-text {
  opacity: 1;
  transform: translateX(0);
}

.logo-version {
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.sidebar.expanded .logo-version {
  opacity: 1;
}



.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-bottom: 24px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin: 0 0 0 16px;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  position: relative;
  overflow: visible;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar.expanded .nav-item {
  padding: 14px 18px;
  margin: 0 0 0 20px;
}

/* Active state */
.sidebar .nav-item.active {
  color: var(--color-primary);
  font-weight: 600;
  background: linear-gradient(to right, rgba(15, 15, 20, 0.95) 50%, transparent 50%);
  background-size: 200% 100%;
  background-position: -100% 0;
  animation: slideInBg 0.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  margin-right: 0;
  border-radius: 30px 0 0 30px;
  z-index: 10;
}



/* Curves for active state */
.sidebar .nav-item.active::before,
.sidebar .nav-item.active::after {
  content: '';
  position: absolute;
  right: 0;
  width: 50px;
  height: 50px;
  background: transparent;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
}

.sidebar .nav-item.active::before {
  top: -50px;
  box-shadow: 25px 25px 0 0 rgba(15, 15, 20, 0.95);
}

.sidebar .nav-item.active::after {
  bottom: -50px;
  box-shadow: 25px -25px 0 0 rgba(15, 15, 20, 0.95);
}

.nav-icon {
  font-size: 24px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.nav-item:hover .nav-icon {
  transform: scale(1.05);
  color: var(--color-text);
}

.nav-item.active .nav-icon {
  color: var(--color-primary);
}

.nav-text {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.4s ease;
  position: relative;
  z-index: 1;
}

.sidebar.expanded .nav-text {
  opacity: 1;
  transform: translateX(0);
}

.role-badge {
  margin: auto 16px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  width: 48px;
  height: 48px;
  background: rgba(212, 175, 55, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar.expanded .role-badge {
  margin: auto 20px 0 20px;
  padding: 12px;
  gap: 10px;
  width: auto;
  height: auto;
}

.role-badge:hover {
  background: rgba(212, 175, 55, 0.15);
  box-shadow: var(--shadow-md);
}

.logout-btn {
  margin: 12px 16px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  width: 48px;
  height: 48px;
  background: rgba(239, 68, 68, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-danger);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.sidebar.expanded .logout-btn {
  margin: 12px 20px 20px 20px;
  width: auto;
  padding: 12px 16px;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.logout-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

.logout-btn .btn-text {
  display: none;
  white-space: nowrap;
}

.sidebar.expanded .logout-btn .btn-text {
  display: inline;
}

.role-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #0a0a0f;
  flex-shrink: 0;
}

.role-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transform: translateX(-10px);
  transition: all 0.4s ease;
  white-space: nowrap;
}

.sidebar.expanded .role-info {
  opacity: 1;
  width: auto;
  transform: translateX(0);
}

.role-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.role-title {
  font-size: 11px;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px;
  background: var(--content-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  min-height: 100vh;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page {
  display: none;
}

.page.active {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Исправление смещения страницы заказов - применяется только когда страница активна */
#orders-page.active {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  flex-direction: unset !important;
}

#orders-page.active .page-header {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  row-gap: 14px;
  column-gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#orders-page.active .table-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Заказы: не даём резать шапку фильтров/переключателей */
#orders-page .table-header-actions {
  flex-wrap: wrap;
  row-gap: 10px;
}

#orders-page .table-header-actions-left,
#orders-page .table-header-actions-right {
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

#orders-page .table-header-actions-right {
  margin-left: 0;
  justify-content: flex-end;
}

#orders-page .status-filters {
  flex-wrap: wrap;
}

#orders-page .coffee-shop-filters {
  margin-left: 0 !important;
  flex-wrap: wrap;
}

@media (max-width: 1200px) {
  #orders-page .table-header-actions-right {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.page-title {
  font-size: 36px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Analytics Blocks Animation */
.analytics-block {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.analytics-block.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Analytics Carousel */
.analytics-carousel {
  position: relative;
  overflow: visible !important;
  z-index: 50;
}

.carousel-container {
  position: relative;
  width: 100%;
}

.carousel-slide {
  width: 100%;
  display: none;
}

.carousel-slide.active {
  display: block;
}

.carousel-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--color-primary);
}

.carousel-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
}

.carousel-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-primary);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 1s ease-out;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  filter: blur(8px);
  animation: unblurText 1.5s ease-out forwards;
  animation-delay: 0.5s;
}



.loading-logo {
  font-size: 72px;
  margin-bottom: 30px;
  animation: floatLogo 3s ease-in-out infinite;
}



.loading-title {
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, #d4af37 0%, #f0c952 50%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.loading-subtitle {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 50px;
}

.loading-animation {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

/* Rotating rings */
.loading-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--color-primary);
  border-right-color: var(--color-primary);
  border-radius: 50%;
  top: 0;
  left: 0;
  animation: rotateRing 1.5s linear infinite;
}

.loading-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: var(--color-primary);
  border-left-color: var(--color-primary);
  animation: rotateRingReverse 2s linear infinite;
}

.loading-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-top-color: rgba(212, 175, 55, 0.4);
  border-right-color: rgba(212, 175, 55, 0.4);
  animation: rotateRing 2.5s linear infinite;
}





/* Center pulsing dot */
.loading-center-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 30px var(--color-primary), 0 0 60px rgba(212, 175, 55, 0.5);
  animation: pulseDot 1.5s ease-in-out infinite;
}



/* Orbiting particles */
.loading-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--color-primary);
}

.loading-particle:nth-child(4) {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: orbitParticle 3s linear infinite;
}

.loading-particle:nth-child(5) {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  animation: orbitParticle 3s linear infinite 0.75s;
}

.loading-particle:nth-child(6) {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: orbitParticle 3s linear infinite 1.5s;
}

.loading-particle:nth-child(7) {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  animation: orbitParticle 3s linear infinite 2.25s;
}



/* Background glow effect */
.loading-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
}



.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

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

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

.btn span {
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #0a0a0f;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
}

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

.btn-secondary {
  background: var(--color-bg-secondary);
  backdrop-filter: blur(10px);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--color-bg-featured);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Container for online status badges */
.online-status-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Online Users Badge */
.online-users {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-success);
  box-shadow: var(--shadow-sm);
  cursor: default;
  position: relative;
  user-select: none;
  transition: none;
}

/* Желтая карточка для админов */
.online-users-admins {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* Зеленая карточка для клиентов */
.online-users-clients {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.online-users-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  max-width: 350px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 0;
}

.online-users-dropdown.show {
  display: block;
}

.online-users-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  border-radius: 12px 12px 0 0;
}

.online-users-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.online-users-list-item {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  transition: background-color 0.2s;
  cursor: pointer;
}

.online-users-list-item:first-of-type {
  border-radius: 0;
}

.online-users-list-item:last-of-type {
  border-radius: 0 0 12px 12px;
}

.online-users-list-item:hover {
  background: var(--color-bg-hover);
}

.online-users-list-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.online-users-list-item-name {
  flex: 1;
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}

.online-users-list-empty {
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2s infinite;
}



/* Date Picker Dropdown */
.date-picker-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--gradient-dark);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-xl);
  z-index: 9999 !important;
  min-width: 320px;
  display: none;
}

.date-picker-dropdown.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.date-option {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.date-option:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--color-primary);
}

.date-option.active {
  background: rgba(212, 175, 55, 0.2);
  color: var(--color-primary);
  font-weight: 600;
}

.date-divider {
  height: 1px;
  background: var(--color-border);
  margin: 12px 0;
}

/* Custom Date Range Calendar */
.custom-date-calendar {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.custom-date-calendar.show {
  display: block;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 8px;
}

.calendar-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.1);
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: scale(1.1);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 4px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
}

.calendar-day:hover:not(.calendar-day-disabled):not(.calendar-day-other-month) {
  background: rgba(212, 175, 55, 0.1);
  color: var(--color-primary);
}

.calendar-day.calendar-day-selected {
  background: var(--color-primary);
  color: #0a0a0f;
  font-weight: 700;
}

.calendar-day.calendar-day-range {
  background: rgba(212, 175, 55, 0.2);
  color: var(--color-primary);
}

.calendar-day.calendar-day-disabled {
  color: var(--color-text-muted);
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-day.calendar-day-other-month {
  color: var(--color-text-muted);
  opacity: 0.4;
}

.calendar-day.calendar-day-today {
  border: 1px solid var(--color-primary);
}

.calendar-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.calendar-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-btn-apply {
  background: var(--gradient-primary);
  color: #0a0a0f;
}

.calendar-btn-apply:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.calendar-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
}

.calendar-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

.date-range-display {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 8px;
  padding: 6px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 6px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

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

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .stat-card {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .stat-header {
    margin-bottom: 12px !important;
  }

  .stat-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }

  .stat-title {
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
  }

  .stat-value {
    font-size: 24px !important;
    margin-bottom: 4px !important;
  }

  .stat-change {
    font-size: 11px !important;
  }
}

/* Mobile Nav Styles */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: rgba(18, 18, 27, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--color-border);
  z-index: 10000;
  padding: 0 5px;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
}

.mobile-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
  flex: 1;
  height: 100%;
  margin: 0 !important;
  padding: 5px 0 !important;
  border-radius: 0 !important;
  background: none !important;
  position: relative;
}

.mobile-nav .nav-item.active {
  color: var(--color-primary);
}

.mobile-nav .nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
}

.mobile-nav .nav-icon {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
}

.mobile-nav .nav-text {
  font-size: 9px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

.stat-card {
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
  background: var(--color-bg-featured);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.stat-title {
  font-size: 13px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 24px;
  transition: all 0.4s ease;
  box-shadow: var(--shadow-sm);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(5deg);
}

.stat-icon.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
  color: var(--color-success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-icon.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
  color: var(--color-warning);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.stat-icon.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
  color: var(--color-danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.stat-icon.info {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
  color: var(--color-info);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.stat-value {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.stat-change {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.stat-change.positive {
  color: var(--color-success);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.stat-change.negative {
  color: var(--color-danger);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.calendar-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.calendar-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-btn-apply {
  background: var(--gradient-primary);
  color: #0a0a0f;
}

.calendar-btn-apply:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.calendar-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
}

.calendar-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Table */
.table-container {
  background: var(--color-bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

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

.table-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--sidebar-bg);
}

.table-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.search-box {
  position: relative;
}

.search-input {
  padding: 10px 14px 10px 42px;
  background: rgba(10, 10, 15, 0.5);
  border: none;
  border-radius: 12px;
  color: var(--color-text);
  width: 280px;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1), var(--shadow-md);
  background: rgba(10, 10, 15, 0.8);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(10, 10, 15, 0.5);
  white-space: nowrap;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  font-size: 13px;
  color: var(--color-text-secondary);
}

@media (max-width: 1024px) {
  th {
    padding: 12px 16px;
    font-size: 10px;
  }

  td {
    padding: 14px 16px;
    font-size: 12px;
  }

  .action-btn {
    padding: 6px 12px;
    font-size: 11px;
    margin-right: 4px;
  }
}

tr {
  transition: all 0.3s ease;
}

tr:hover td {
  background: rgba(212, 175, 55, 0.08);
  color: var(--color-text);
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}

.status-badge.paid {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.status-badge.preparing {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-info);
}

.status-badge.ready {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.status-badge.delivered {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.status-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(10, 10, 15, 0.6);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  width: 100%;
  max-width: 180px;
}

.status-select:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(10, 10, 15, 0.8);
}

.status-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.status-select option {
  background: #1a1a1f;
  color: var(--color-text);
  padding: 8px;
}

.order-items-cell {
  font-size: 12px;
  line-height: 1.3;
  max-width: 250px;
}

.order-items-detailed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-item-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 6px;
  font-size: 11px;
  transition: all 0.3s ease;
}

.order-item-mini:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
}

.order-item-mini .item-icon {
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}

.order-item-mini .item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item-mini .item-name {
  flex: 1;
  color: var(--color-text);
  font-weight: 500;
}

.order-item-mini .item-quantity {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 10px;
}

.order-item-mini.detailed {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.order-item-mini.detailed .item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.order-item-mini.detailed .item-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 22px;
}

.order-item-mini.detailed .item-option {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-primary);
  border-radius: 4px;
  font-weight: 500;
}

.order-items-compact {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Таймер заказа */
.order-timer {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* .order-timer.completed - завершённые заказы, время зафиксировано, не обновляется */

/* Specific styling for orders page table */
#orders-page table td {
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.4;
}

#orders-page table th {
  padding: 12px 16px;
  font-size: 11px;
}

/* View toggle buttons */
.table-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.table-header-actions-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.table-header-actions-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex: 0 0 auto;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 4px;
}

.view-btn {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  line-height: 1;
}

.view-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--color-primary);
}

.view-btn.active {
  background: var(--color-primary);
  color: #0a0a0f;
}

/* Grid columns toggle */
.grid-columns-toggle {
  display: flex;
  gap: 4px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 4px;
}

/* Orders animated expandable controls (columns + status) */
.expand-pill {
  --collapsed-w: 54px;
  --expanded-w: 260px;
  display: inline-flex;
  align-items: center;
  width: var(--collapsed-w);
  max-width: 100%;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  overflow: hidden;
  transition: width 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background 160ms ease, border-color 160ms ease;
}

.expand-pill.open {
  width: min(var(--expanded-w), 100%);
  background: rgba(10, 10, 15, 0.75);
  border-color: rgba(212, 175, 55, 0.35);
}

.expand-pill-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  min-width: var(--collapsed-w);
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.expand-pill-main:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
}

.expand-pill-main .chev {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 800;
  line-height: 1;
  margin-top: 1px;
  transition: transform 200ms ease;
}

.expand-pill.open .expand-pill-main .chev {
  transform: rotate(180deg);
}

.expand-pill-options {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 0;
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  transition-delay: 0ms;
}

.expand-pill.open .expand-pill-options {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 110ms;
  /* показываем кнопки после начала расширения */
}

.expand-pill-option {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  min-width: 36px;
}

.expand-pill-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
}

.expand-pill-option.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* Status pill uses wider label + horizontal scrolling if needed */
.orders-status-pill {
  --collapsed-w: 110px;
  /* ширина раскрытия выставляется динамически JS-ом */
  --expanded-w: 520px;
}

.orders-status-pill .expand-pill-main {
  justify-content: flex-start;
  font-size: 13px;
  font-weight: 800;
}

.orders-status-pill .expand-pill-options {
  overflow: visible;
  max-width: none;
}

.orders-status-pill .expand-pill-option {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  min-width: unset;
  white-space: nowrap;
}

/* Orders: compact coffee shop + search */
#orders-page #coffeeShopFilter {
  min-width: 150px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
}

#orders-page #ordersSearchInput.search-input {
  width: 220px;
  padding: 9px 12px 9px 38px;
  font-size: 13px;
}

/* Orders header: remove "gold" outline for expand controls (cols + status) */
#orders-page .table-header-actions .expand-pill {
  border-color: transparent;
  background: rgba(10, 10, 15, 0.55);
}

#orders-page .table-header-actions .expand-pill.open {
  border-color: transparent;
  background: rgba(10, 10, 15, 0.78);
}

#orders-page .table-header-actions .expand-pill-main:focus {
  outline: none;
  box-shadow: none;
}

/* Orders header: active option without gray highlight */
#orders-page .table-header-actions .expand-pill-option.active {
  background: transparent;
  color: var(--color-text);
  box-shadow: none;
}

@media (max-width: 1200px) {
  #orders-page #ordersSearchInput.search-input {
    width: 200px;
  }
}

@media (max-width: 768px) {
  #orders-page #ordersSearchInput.search-input {
    width: 180px;
  }

  /* На узких экранах колонки удобнее разворачивать вниз/в ширину */
  .expand-pill.open {
    width: 100%;
  }
}

.grid-col-btn {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  min-width: 36px;
}

.grid-col-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--color-primary);
}

.grid-col-btn.active {
  background: var(--color-primary);
  color: #0a0a0f;
}

/* Status filters */
.status-filters {
  display: flex;
  gap: 4px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 4px;
}

.status-filter-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.status-filter-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--color-primary);
}

.status-filter-btn.active {
  background: var(--color-primary);
  color: #0a0a0f;
}

/* Orders grid view */
#ordersTableWrapper {
  background: var(--sidebar-bg);
  border-radius: 12px;
  padding: 20px;
  overflow: hidden;
}

.orders-grid {
  display: grid;
  /* По умолчанию — 2 колонки (дальше управляем классами cols-*) */
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 20px;
  padding: 20px 24px;
  transition: all 0.3s ease;
}

/* Виртуализация списков */
#ordersVirtualContainer {
  display: contents;
  /* Используем grid родителя */
  width: 100%;
}

#ordersVirtualContainer>div[style*="grid-column"] {
  /* Spacer элементы для виртуализации */
  grid-column: 1 / -1;
  width: 100%;
}

.orders-grid.cols-1 {
  grid-template-columns: 1fr !important;
}

.orders-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(320px, 1fr)) !important;
}

.orders-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.orders-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.orders-grid.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

@media (max-width: 1600px) {
  .orders-grid.cols-4 {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .orders-grid.cols-5 {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 1400px) {

  .orders-grid.cols-3,
  .orders-grid.cols-4,
  .orders-grid.cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 1024px) {

  .orders-grid,
  .orders-grid.cols-2,
  .orders-grid.cols-3,
  .orders-grid.cols-4,
  .orders-grid.cols-5 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .orders-grid {
    padding: 14px 14px;
    gap: 14px;
  }
}

@media (max-width: 1400px) {
  /* Removed column hiding logic as 5th column is now globally removed */
}

.order-card {
  background: var(--sidebar-bg);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.order-card:hover {
  background: rgba(212, 175, 55, 0.05);
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.1);
}

/* Пагинация заказов */
#ordersPagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

#ordersPaginationPages {
  display: flex;
  gap: 4px;
  align-items: center;
}

#ordersPaginationPages button.btn {
  min-width: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

#ordersPaginationPages button.btn.active {
  background: var(--color-primary);
  color: #0a0a0f;
  font-weight: 600;
  border-color: var(--color-primary);
}

#ordersPaginationPages button.btn:hover:not(.active):not(:disabled) {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
}

#ordersPaginationPrev:disabled,
#ordersPaginationNext:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.order-card-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.order-card-customer {
  font-size: 13px;
  color: var(--color-text);
  margin-bottom: 12px;
}

.order-card-customer-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.order-card-info-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.order-card-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.order-card-info-item .info-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.order-card-info-item .info-text {
  flex: 1;
  color: var(--color-text);
}

.order-card-items {
  margin-bottom: 16px;
}

.order-card-payment .payment-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
}

.order-card-payment .payment-method-badge.terminal {
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-primary);
}

/* Small payment badge for table view */
.payment-method-badge.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 6px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 6px;
  font-size: 16px;
}

.payment-method-badge.small.terminal {
  background: rgba(212, 175, 55, 0.15);
}

.status-select.compact {
  max-width: 150px;
  font-size: 12px;
  padding: 6px 10px;
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

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

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

.action-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: rgba(10, 10, 15, 0.5);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 600;
  margin-right: 8px;
  box-shadow: var(--shadow-sm);
}

.action-btn:last-child {
  margin-right: 0;
}

.action-btn:hover {
  background: var(--gradient-primary);
  color: #0a0a0f;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

/* Time History Modal */
.time-history-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.time-history-content {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.time-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.time-history-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--color-text);
}

.time-history-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.time-history-close:hover {
  color: var(--color-primary);
}

.time-history-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

.time-history-table {
  width: 100%;
  border-collapse: collapse;
}

.time-history-table th,
.time-history-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.time-history-table th {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.time-history-table td {
  font-size: 14px;
  color: var(--color-text);
}

.time-history-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  text-align: right;
  font-size: 15px;
  color: var(--color-primary);
}

/* Time Button */
.time-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.1);
  color: var(--color-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.time-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-primary);
}

.time-btn .time-icon {
  font-size: 14px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}



.modal.show {
  display: flex;
}

.modal-content {
  background: var(--gradient-dark);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content.large {
  max-width: 900px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.modal-content.large #modalBody {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.modal-content.large #modalBody::-webkit-scrollbar {
  width: 6px;
}

.modal-content.large #modalBody::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content.large #modalBody::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 10px;
}



.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 10px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.close-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: rgba(10, 10, 15, 0.5);
  color: var(--color-text);
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.close-btn:hover {
  background: var(--color-danger);
  color: white;
  transform: scale(1.1) rotate(90deg);
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-text);
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(10, 10, 15, 0.6);
  border: none;
  border-radius: 12px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15), var(--shadow-md);
  background: rgba(10, 10, 15, 0.9);
}

/* Order Details Styles */
.order-detail-section {
  margin-bottom: 20px;
}

.order-detail-section:last-child {
  margin-bottom: 0;
}

.order-detail-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.order-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .order-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.order-info-item {
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 12px;
  padding: 16px;
}

.order-info-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-info-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.order-info-value.large {
  font-size: 24px;
  color: var(--color-primary);
}

.order-items-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .order-items-list {
    grid-template-columns: 1fr;
  }
}

.order-item-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.3s ease;
}

.order-item-card:hover {
  background: rgba(10, 10, 15, 0.7);
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateX(4px);
}

.order-item-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #c99b2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}

.order-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.order-item-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.order-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.order-item-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  max-height: 60px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.order-item-options::-webkit-scrollbar {
  width: 3px;
}

.order-item-options::-webkit-scrollbar-track {
  background: transparent;
}

.order-item-options::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}

.order-item-option {
  font-size: 10px;
  padding: 3px 6px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-primary);
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.order-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.order-item-quantity {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.order-item-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

.payment-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}

.payment-method-badge.terminal {
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-primary);
}

.order-summary {
  background: rgba(212, 175, 55, 0.08);
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-top: 24px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.order-summary-row.total {
  border-top: 2px solid rgba(212, 175, 55, 0.2);
  margin-top: 8px;
  padding-top: 16px;
}

.order-summary-label {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.order-summary-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.order-summary-value.total {
  font-size: 24px;
  color: var(--color-primary);
  font-weight: 700;
}

@media (max-width: 768px) {
  .order-info-grid {
    grid-template-columns: 1fr !important;
  }

  .order-item-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-item-price {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  cursor: pointer;
}

/* Chart */
.chart-container {
  background: var(--color-bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

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

.chart-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.chart-bar:hover {
  transform: translateX(8px);
}

.chart-label {
  width: 120px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.chart-bar-bg {
  flex: 1;
  height: 40px;
  background: rgba(10, 10, 15, 0.5);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chart-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 12px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.chart-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

.chart-value {
  width: 70px;
  text-align: right;
  font-weight: 800;
  font-size: 18px;
  color: var(--color-primary);
}

/* Toast */
.toast {
  position: fixed;
  top: 32px;
  right: 32px;
  padding: 18px 28px;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-glow);
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.toast.show {
  display: flex;
}



.toast span:first-child {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Burger Menu */
.burger-btn {
  display: flex;
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.3s ease;
  margin: 0 auto 24px auto;
  flex-shrink: 0;
}

.burger-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-radius: 12px;
}

.sidebar.expanded .burger-btn {
  margin: 0 0 24px 20px;
}

.burger-line {
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger-btn.active .burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger-btn.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-btn.active .burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 68px;
  }

  .sidebar {
    margin: 16px 0 16px 16px;
    top: 16px;
    height: calc(100vh - 32px);
    padding: 20px 0;
    border-radius: 18px;
  }

  .sidebar.expanded {
    padding: 20px 0;
  }

  .logo {
    margin: 0 14px 24px 14px;
    padding: 10px;
  }

  .sidebar.expanded .logo {
    margin: 0 16px 24px 16px;
  }

  .logo-icon {
    font-size: 28px;
  }

  .nav-item {
    padding: 12px;
    margin: 0 0 0 14px;
    gap: 12px;
    font-size: 14px;
  }

  .sidebar.expanded .nav-item {
    padding: 12px 16px;
    margin: 0 0 0 16px;
  }

  .nav-icon {
    font-size: 22px;
  }

  .burger-btn {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px auto;
  }

  .sidebar.expanded .burger-btn {
    margin: 0 0 18px 16px;
  }

  .role-badge {
    width: 44px;
    height: 44px;
    margin: auto 14px 0 14px;
  }

  .sidebar.expanded .role-badge {
    margin: auto 16px 0 16px;
    padding: 10px;
  }

  .role-avatar {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .logout-btn {
    margin: 12px 12px 16px 12px;
  }

  .sidebar.expanded .logout-btn {
    margin: 12px 16px 20px 16px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: var(--sidebar-width);
    padding: 24px 20px;
    background: var(--gradient-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.expanded {
    transform: translateX(0);
  }

  .sidebar.expanded .logo {
    justify-content: flex-start;
  }

  .sidebar.expanded .nav-item {
    justify-content: flex-start;
  }

  .sidebar.expanded .nav-text,
  .sidebar.expanded .logo-text,
  .sidebar.expanded .role-info {
    opacity: 1;
    transform: translateX(0);
  }

  .main-content {
    padding: 24px;
  }

  .page-title {
    font-size: 28px;
  }

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

  .table-container {
    border-radius: 16px;
    overflow-x: auto;
    /* Allow horizontal scroll on tablets */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 14px 16px;
  }

  .modal-content {
    padding: 28px;
    border-radius: 20px;
  }

  .toast {
    right: 16px;
    top: 16px;
    left: 16px;
  }

  .logout-btn {
    margin: 12px 10px 16px 10px;
  }

  .sidebar.expanded .logout-btn {
    margin: 12px 12px 20px 12px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  /* Для страницы заказов хедер всегда должен быть строкой */
  #orders-page .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .btn {
    flex: 1;
  }
}

/* ============================================
       CATALOG MODULE STYLES
       ============================================ */

/* Catalog Layout */
.catalog-container {
  padding: 0;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}

.catalog-header>div:first-child {
  flex: 1;
  text-align: left;
  min-width: 250px;
}

.catalog-header .header-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.catalog-header:empty,
.catalog-header:not(:has(h3)) {
  justify-content: flex-end;
}

.section-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Catalog Tabs */
.catalog-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.catalog-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  position: relative;
}

.catalog-tab:hover {
  color: var(--color-text);
  background: var(--color-bg-featured);
}

.catalog-tab.active {
  color: var(--color-primary);
  background: rgba(212, 175, 55, 0.1);
}

/* Catalog Views */
.catalog-view {
  display: none;
}

.catalog-view.active {
  display: block;
  background: var(--sidebar-bg);
  border-radius: 12px;
  padding: 20px;
}

/* Filters */
.catalog-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.catalog-search-input,
.catalog-filter-select {
  padding: 12px 16px;
  background: var(--sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.catalog-search-input {
  flex: 0 1 auto;
  min-width: 200px;
  max-width: 300px;
}

.catalog-search-input:focus,
.catalog-filter-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Item Cards */
/* Catalog Table */
.catalog-table-container {
  background: var(--sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
}

.catalog-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.catalog-table th {
  padding: 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.catalog-table tbody tr {
  transition: background 0.2s ease, transform 0.2s ease;
}

.catalog-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: scale(1.005);
}

.catalog-table td {
  padding: 16px;
  vertical-align: middle;
}

.catalog-table-image {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-bg-featured);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.catalog-table-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.catalog-table-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.catalog-table-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-table-category {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.catalog-table-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.catalog-table-sizes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.size-badge {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.catalog-table-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 16px;
}

.btn-icon:hover {
  background: var(--color-primary);
  color: #000;
  transform: scale(1.1);
}

.btn-icon.delete:hover {
  background: #ef4444;
  color: #fff;
}

.empty-state-td {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.empty-state-td .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-gold {
  background: var(--gradient-primary);
  color: #000;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
}

.badge-info {
  background: rgba(99, 102, 241, 0.2);
  color: var(--color-info);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

.catalog-modal-large {
  width: 90%;
  max-width: 900px;
}

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

.modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-featured);
}

.tab-btn {
  background: none;
  border: none;
  padding: 16px 24px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
  top: 1px;
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

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

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

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  background: var(--color-bg-featured);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group textarea {
  resize: vertical;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-transform: none;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.empty-state p {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* Info Box */
.info-box {
  background: var(--sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.info-box-content {
  flex: 1;
  min-width: 250px;
}

.info-box h4 {
  margin: 0 0 12px 0;
  color: var(--color-info);
  font-size: 16px;
}

.info-box p {
  margin: 8px 0 0 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Categories Tree */
.categories-tree {
  background: var(--sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
}

.category-node {
  background: var(--sidebar-bg);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.category-node:hover {
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
  transform: translateY(-2px);
}

.category-node-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
}

.category-node-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  /* Важно для overflow */
  overflow: hidden;
}

.category-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  /* Не сжимать иконку */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-featured);
  border-radius: 10px;
}

.category-info {
  flex: 1;
  min-width: 0;
  /* Важно для overflow */
  overflow: hidden;
}

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

.category-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.category-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-count::before {
  content: '📦';
  font-size: 12px;
}

.category-view-items {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-primary);
  cursor: pointer;
  transition: opacity 0.2s;
}

.category-view-items:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.category-actions {
  display: flex;
  gap: 6px;
  margin-left: 12px;
}

.category-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.category-btn:hover {
  background: var(--color-primary);
  color: #000;
  transform: scale(1.1);
}

.category-btn.delete:hover {
  background: #ef4444;
  color: #fff;
}

.category-items-preview {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.2);
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.category-items-preview.show {
  max-height: 500px;
  padding: 16px;
  overflow-y: auto;
}

.category-items-preview::-webkit-scrollbar {
  width: 6px;
}

.category-items-preview::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.category-items-preview::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}

.category-items-preview::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-hover);
}

.category-items-preview strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.category-items-list li {
  background: var(--sidebar-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.category-items-list li:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.category-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-item-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

/* Attributes Grid */
.attributes-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.attribute-group {
  background: var(--sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.attribute-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.2s;
}

.attribute-group-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.attribute-group-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.attribute-group-chevron {
  font-size: 18px;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
}

.attribute-group.collapsed .attribute-group-chevron {
  transform: rotate(-90deg);
}

.attribute-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 16px;
  color: var(--color-text);
}

.attribute-group-icon {
  font-size: 24px;
}

.attribute-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--color-primary);
  color: #000;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
}

.attribute-group-items {
  padding: 8px;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.attribute-group.collapsed .attribute-group-items {
  max-height: 0;
  padding: 0 8px;
}

.attribute-group.collapsed .attribute-group-header {
  border-bottom: none;
}

.attribute-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s;
}

.attribute-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.attribute-item:last-child {
  margin-bottom: 0;
}

.attribute-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.attribute-item-icon {
  font-size: 20px;
}

.attribute-item-name {
  font-size: 14px;
  color: var(--color-text);
}

.attribute-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.attribute-item-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  min-width: 50px;
  text-align: right;
}

.attribute-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-bg-featured);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.attribute-checkbox:hover {
  border-color: var(--color-primary);
}

.attribute-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* YTimes Sections */
.ytimes-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ytimes-stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.ytimes-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 8px 0;
}

.ytimes-stat-label {
  font-size: 14px;
  color: var(--color-text-muted);
}

.ytimes-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.ytimes-section {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
}

.ytimes-section h4 {
  margin: 0 0 16px 0;
  color: var(--color-text);
  font-size: 16px;
}

.ytimes-list {
  max-height: 400px;
  overflow-y: auto;
}

.ytimes-list-item {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

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

.ytimes-item-name {
  color: var(--color-text);
  font-weight: 500;
}

.ytimes-item-price {
  color: var(--color-primary);
  font-weight: 600;
  margin-left: 8px;
}

/* Pricing Tab */
.pricing-tab {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.price-size,
.price-value {
  padding: 12px 16px;
  background: var(--color-bg-featured);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
}

/* Catalog Modal Styles */
.catalog-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.catalog-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.catalog-modal-content {
  position: relative;
  background: var(--gradient-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  width: 90%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  z-index: 1;
}

.catalog-modal-small {
  max-width: 600px;
}

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

.catalog-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.catalog-modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  transition: color 0.2s;
}

.catalog-modal-close:hover {
  color: var(--color-text);
}

.catalog-modal-tabs {
  display: flex;
  gap: 8px;
  padding: 20px 24px 0 24px;
  background: var(--color-bg-featured);
}

.catalog-modal-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 14px 20px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 12px 12px 0 0;
  margin-bottom: -1px;
}

.catalog-modal-tab .nav-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.catalog-modal-tab:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
}

.catalog-modal-tab.active {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--content-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid var(--content-bg);
}

.catalog-modal-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.catalog-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: var(--content-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 20px 20px;
}

.catalog-modal-tab-content {
  display: none;
}

.catalog-modal-tab-content.active {
  display: block;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 8px;
  padding: 0 0 20px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
  position: relative;
}

.settings-tab .nav-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.settings-tab:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
}

.settings-tab.active {
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(212, 175, 55, 0.1);
  border-bottom: 2px solid var(--color-primary);
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
}

.analytics-tabs {
  display: flex;
  gap: 8px;
  padding: 0 0 20px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.analytics-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
  position: relative;
}

.analytics-tab:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-tab.active {
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(212, 175, 55, 0.1);
  border-bottom: 2px solid var(--color-primary);
}

.analytics-tab-content {
  display: none;
}

.analytics-tab-content.active {
  display: block;
}

.catalog-modal-footer {
  padding: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Item modal (basic tab) layout */
.item-basic-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 8px;
}

.item-basic-right .form-group {
  margin-bottom: 16px;
}

.coffee-shops-dropdown {
  position: relative;
  width: 100%;
}

.coffee-shops-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--color-bg-featured);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}

.coffee-shops-dropdown-toggle:hover {
  border-color: rgba(212, 175, 55, 0.5);
}

.coffee-shops-dropdown-toggle:focus {
  outline: none;
  border-color: var(--color-primary);
}

.coffee-shops-selected-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coffee-shops-selected-text.is-placeholder {
  color: var(--color-text-muted);
}

.coffee-shops-dropdown-chevron {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1;
}

.coffee-shops-dropdown-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  display: none;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

/* Важно: поле выбора не должно быть "как multi-select" по высоте */
.coffee-shops-dropdown.open .coffee-shops-dropdown-panel {
  display: block;
}

.coffee-shops-dropdown-list {
  max-height: 200px;
  overflow-y: auto;
}

.coffee-shop-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 13px;
}

.coffee-shop-option:last-child {
  border-bottom: none;
}

.coffee-shop-option:hover {
  background: rgba(212, 175, 55, 0.08);
}

.coffee-shop-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

@media (max-width: 768px) {
  .item-basic-columns {
    grid-template-columns: 1fr;
  }
}

.tab-description {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.sizes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.size-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.size-row input {
  padding: 12px 16px;
  background: var(--color-bg-featured);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
}

.size-row input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.size-row button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

.size-row button:hover {
  background: #ef4444;
  color: #fff;
}

.attribute-section {
  margin-bottom: 24px;
}

.collapsible-section {
  background: var(--sidebar-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.section-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-chevron {
  font-size: 14px;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
}

.collapsible-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.section-content {
  padding: 0 20px 20px 20px;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.collapsible-section.collapsed .section-content {
  max-height: 0;
  padding: 0 20px;
}

.attribute-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}

.attribute-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group small {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Animations */




/* Responsive */
@media (max-width: 768px) {
  .catalog-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    flex-direction: column;
  }

  .catalog-items-grid {
    grid-template-columns: 1fr;
  }

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

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

  .catalog-modal-content {
    width: 95%;
    max-height: 95vh;
  }
}

/* Заглушка технических работ для админ-панели */
.admin-maintenance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.admin-maintenance-icon {
  font-size: 100px;
  margin-bottom: 32px;
  animation: maintenance-pulse 2s infinite;
}



.admin-maintenance-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}

.admin-maintenance-text {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.admin-maintenance-timer {
  background: var(--color-bg-secondary);
  border-radius: 16px;
  padding: 24px 40px;
  margin-top: 16px;
}

.admin-maintenance-timer-label {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.admin-maintenance-timer-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.admin-maintenance-logout {
  margin-top: 32px;
  padding: 12px 32px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-maintenance-logout:hover {
  background: var(--color-border);
}

/* --- MOBILE ADAPTATION (v1.1.3) --- */
@media (max-width: 768px) {

  .sidebar,
  .burger-btn {
    display: none !important;
  }

  .admin-container {
    display: block !important;
  }

  .main-content {
    padding: 20px 15px 85px 15px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
  }

  .mobile-nav {
    display: flex;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .page-title {
    font-size: 26px !important;
  }

  /* Horizontal scroll for tables */
  .table-container,
  .catalog-table-container,
  #ordersTableWrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  .table-container table,
  .catalog-table-container table,
  #ordersTableWrapper table {
    min-width: 1000px !important;
  }

  /* Global table header adaptation */
  .table-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  .table-title {
    font-size: 18px !important;
    text-align: center;
  }

  /* Fix for orders grid view */
  #ordersGridView {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    padding: 10px !important;
  }

  /* Orders table header adaptations */
  #orders-page .table-header {
    padding: 16px !important;
  }

  #orders-page .table-header-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #orders-page .table-header-actions-left,
  #orders-page .table-header-actions-right {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  #orders-page .view-toggle {
    justify-content: center !important;
  }

  #orders-page .expand-pill {
    width: 100% !important;
    margin-left: 0 !important;
  }

  #orders-page .expand-pill-main {
    width: 100% !important;
    justify-content: center !important;
  }

  .header-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: flex-start !important;
  }

  .online-status-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .online-users {
    padding: 10px 12px !important;
    font-size: 11px !important;
    flex: 1 !important;
    justify-content: center !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    border-radius: 10px !important;
  }

  /* Date picker button full width */
  .header-actions>div:has(#dashboardDatePickerBtn),
  .header-actions>div:has(#ordersDatePickerBtn) {
    width: 100% !important;
  }

  #dashboardDatePickerBtn,
  #ordersDatePickerBtn {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 2px !important;
    font-size: 14px !important;
    padding: 12px !important;
    border-radius: 10px !important;
  }

  /* Tabs scroll */
  .catalog-tabs,
  .settings-tabs,
  .analytics-tabs {
    overflow-x: auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 8px !important;
    margin-bottom: 16px !important;
    border-bottom: 1px solid var(--color-border);
    gap: 8px !important;
    scrollbar-width: none;
  }

  .catalog-tabs::-webkit-scrollbar,
  .settings-tabs::-webkit-scrollbar,
  .analytics-tabs::-webkit-scrollbar {
    display: none;
  }

  .catalog-tab,
  .settings-tab,
  .analytics-tab {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 10px 18px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  /* Catalog filters fix */
  .catalog-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .catalog-search-input {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  /* Search box optimization */
  .search-box {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 8px !important;
  }

  .search-input {
    width: 100% !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
  }

  /* Tables in modals */
  .modal-content .table-container table {
    min-width: 800px !important;
  }

  /* Orders Filters Mobile Optimization */
  #orders-page .expand-pill {
    width: 100% !important;
    margin-left: 0 !important;
  }

  #orders-page .expand-pill-main {
    width: 100% !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
  }

  #orders-page .coffee-shop-filters {
    margin-left: 0 !important;
    width: 100% !important;
  }

  #orders-page #coffeeShopFilter {
    width: 100% !important;
  }

  #orders-page .table-header-actions-right {
    gap: 12px !important;
  }

  /* Product Modal Tabs Horizontal Scroll */
  .catalog-modal-tabs,
  .catalog-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none;
    padding-bottom: 4px;
    /* Немного места для скроллбара, если он есть */
  }

  .catalog-modal-tab,
  .catalog-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  /* Stable Modal Layout */
  .catalog-modal-content {
    height: 85vh !important;
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .catalog-modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 20px !important;
  }

  .catalog-modal-header,
  .catalog-modal-tabs {
    flex-shrink: 0 !important;
  }

  /* Analytics Optimization */
  /* Stack Revenue & Chart vertically */
  .analytics-revenue-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 24px !important;
  }

  /* Make Payment Card full width */
  .analytics-payment-card {
    max-width: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Analytics Mobile Optimization (v1.2.0) */
  /* Payment stats column fix */
  #analytics-page .carousel-slide>div[style*="align-items: stretch"] {
    flex-direction: column !important;
  }

  #analytics-page #revenue-chart {
    min-height: 250px !important;
  }

  /* Seasonality Heatmap: 2 columns grid */
  /* Seasonality Heatmap: 2 columns grid */
  .heatmap-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .heatmap-legend {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  /* Order Statistics: Vertical Stack */
  .order-stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Main Analytics Grid: Vertical Stack */
  .analytics-main-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 24px !important;
  }

  /* Time Metrics: Responsive width */
  #analytics-page .analytics-main-grid>div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

}

@media (max-width: 768px) {

  /* Analytics Optimization */
  /* Payment stats column fix */
  .analytics-revenue-container {
    flex-direction: column !important;
  }

  .analytics-payment-card {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    margin-top: 16px;
  }

  /* Header KPI mobile */
  #analytics-tab-metrics .carousel-slide>div[style*="justify-content: space-between"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px;
  }

  #analytics-tab-metrics .carousel-slide>div>div[style*="display: flex"] {
    width: 100%;
    justify-content: space-between;
  }

  /* Seasonality Heatmap scroll */
  #seasonality-heatmap {
    overflow-x: auto !important;
    display: flex !important;
    gap: 12px !important;
    padding-bottom: 8px !important;
    justify-content: flex-start !important;
  }

  #seasonality-heatmap>div {
    flex-shrink: 0 !important;
    min-width: 60px !important;
  }

  /* Fix Charts container */
  #revenue-chart,
  #orders-chart {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-height: 250px;
  }

  /* Header Stats Stack */
  #analytics-tab-metrics .analytics-block>div[style*="justify-content: space-between"] {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start !important;
  }

  #analytics-tab-metrics .analytics-block>div>div[style*="gap: 32px"] {
    gap: 16px !important;
    width: 100%;
    justify-content: space-between;
  }
}

/* Tablet/Mobile Table Optimization */
@media (max-width: 1200px) {
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
    width: calc(100% + 40px);
  }

  table {
    min-width: 1000px;
    /* Ensure table keeps width to trigger scroll */
  }

  /* Clients Table Specific Adaptations */
  #customers-page table th,
  #customers-page table td {
    white-space: nowrap;
    padding: 12px 8px;
    /* Slightly reduced padding */
  }

  /* Hide less critical columns on smaller screens */
  /* 3: Telegram ID, 7: First Order */
  #customers-page table th:nth-child(3),
  #customers-page table td:nth-child(3),
  #customers-page table th:nth-child(7),
  #customers-page table td:nth-child(7) {
    display: none;
  }
}