/* Apple Design System - Light Theme */
:root {
  --ios-bg: #F2F2F7;
  --ios-card: #FFFFFF;
  --ios-grouped-bg: #F2F2F7;
  --ios-blue: #007AFF;
  --ios-green: #34C759;
  --ios-red: #FF3B30;
  --ios-orange: #FF9500;
  --ios-yellow: #FFCC00;
  --ios-gray: #8E8E93;
  --ios-gray2: #AEAEB2;
  --ios-gray3: #C7C7CC;
  --ios-gray4: #D1D1D6;
  --ios-gray5: #E5E5EA;
  --ios-gray6: #F2F2F7;
  --ios-text: #000000;
  --ios-text-secondary: #3C3C43;
  --ios-text-tertiary: #3C3C4399;
  --ios-border: #C6C6C8;
  --ios-separator: #C6C6C8;
  --ios-shadow: rgba(0, 0, 0, 0.1);
  --ios-radius-sm: 8px;
  --ios-radius: 10px;
  --ios-radius-lg: 12px;
  --ios-radius-xl: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
}

html, body {
  background: var(--ios-bg);
  color: var(--ios-text);
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
}

#app {
  min-height: 100vh;
}

/* iOS-style blur header */
.header {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ios-separator);
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ios-text);
}

.back-btn {
  color: var(--ios-blue);
  font-size: 17px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-left: -8px;
}

.logout-btn {
  color: var(--ios-blue);
  font-size: 17px;
  background: none;
  border: none;
  cursor: pointer;
}

/* iOS Login Screen */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: var(--ios-bg);
}

.login-logo {
  font-size: 48px;
  font-weight: 700;
  color: var(--ios-blue);
  margin-bottom: 8px;
  letter-spacing: -0.021em;
}

.login-subtitle {
  color: var(--ios-gray);
  margin-bottom: 40px;
  font-size: 17px;
}

.login-form {
  width: 100%;
  max-width: 343px;
}

.login-input {
  width: 100%;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--ios-card);
  border: none;
  border-radius: var(--ios-radius);
  color: var(--ios-text);
  font-size: 17px;
  outline: none;
  box-shadow: 0 0 0 0.5px var(--ios-gray4);
  transition: box-shadow 0.2s;
}

.login-input:focus {
  box-shadow: 0 0 0 2px var(--ios-blue);
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: var(--ios-blue);
  border: none;
  border-radius: var(--ios-radius);
  color: white;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.login-btn:active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* iOS Menu Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 20px 16px;
}

.menu-item {
  background: var(--ios-card);
  border-radius: var(--ios-radius-lg);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px var(--ios-shadow);
}

.menu-item:active {
  transform: scale(0.96);
  background: var(--ios-gray6);
}

.menu-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.menu-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-text);
}

/* iOS List Style */
.categories-list,
#assemblyList,
#pcMissingList {
  padding: 20px 16px;
}

.category-item,
.assembly-item {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin-bottom: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0.5px 0 var(--ios-separator);
}

.category-item:first-child,
.assembly-item:first-child {
  border-radius: var(--ios-radius) var(--ios-radius) 0 0;
}

.category-item:last-child,
.assembly-item:last-child {
  border-radius: 0 0 var(--ios-radius) var(--ios-radius);
  margin-bottom: 0;
}

.category-item:only-child,
.assembly-item:only-child {
  border-radius: var(--ios-radius);
}

.category-item.completed {
  background: rgba(52, 199, 89, 0.1);
}

.category-item.completed .category-name {
  color: var(--ios-green);
  font-weight: 600;
}

.category-name {
  font-size: 17px;
  font-weight: 400;
  color: var(--ios-text);
}

.category-arrow {
  color: var(--ios-gray3);
  font-size: 20px;
}

/* Products Grid - ВСЕГДА 4 в ряд */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px;
}

.product-card {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 1px 2px var(--ios-shadow);
  will-change: transform;
  transform: translateZ(0);
}

.product-card:active {
  opacity: 0.9;
}

/* Предотвращаем мигание при обновлении */
.products-grid {
  contain: layout style paint;
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--ios-gray6);
  padding: 4px;
  /* ИСПРАВЛЕНИЕ: отключаем анимации для предотвращения мигания */
  transition: none !important;
  animation: none !important;
}

.product-info {
  padding: 8px;
}

/* НАЗВАНИЕ ТОВАРА - 3 СТРОКИ */
.product-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  height: 45px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  color: var(--ios-text);
}

/* УВЕЛИЧЕННЫЙ КРУГ КОЛИЧЕСТВА */
.product-qty-left {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 36px;
  height: 36px;
  background: var(--ios-blue);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
  cursor: pointer;
  z-index: 10;
}

/* STOCK BADGE - Остаток на складе */
.stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.stock-badge.stock-normal {
  background: var(--ios-green);
}

.stock-badge.stock-last {
  background: var(--ios-red);
  font-size: 10px;
  padding: 4px 6px;
  animation: pulse-last 1.5s ease-in-out infinite;
}

/* Карточка товара с последним остатком */
.product-card.stock-last {
  box-shadow: 0 0 0 2px var(--ios-red), 0 2px 8px rgba(255, 59, 48, 0.3);
}

@keyframes pulse-last {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* iOS Buttons */
.bottom-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 0.5px solid var(--ios-separator);
  display: flex;
  gap: 12px;
  z-index: 100;
}

.btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: var(--ios-radius);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:active {
  transform: scale(0.96);
  opacity: 0.8;
}

.btn-primary {
  background: var(--ios-blue);
  color: white;
}

.btn-secondary {
  background: var(--ios-gray5);
  color: var(--ios-blue);
}

.btn-danger {
  background: var(--ios-red);
  color: white;
}

.btn-success {
  background: var(--ios-green);
  color: white;
}

.btn-warning {
  background: var(--ios-orange);
  color: white;
}

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

/* Pages Grid */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
}

.page-item {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px var(--ios-shadow);
}

.page-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-item.active {
  box-shadow: 0 0 0 2px var(--ios-blue);
}

.page-number {
  font-size: 17px;
  font-weight: 600;
  color: var(--ios-text);
}

.page-status {
  font-size: 12px;
  color: var(--ios-gray);
  margin-top: 4px;
}

/* Price Check Products */
.pc-product {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  box-shadow: 0 1px 2px var(--ios-shadow);
}

.pc-product-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--ios-radius-sm);
  background: var(--ios-gray6);
  /* ИСПРАВЛЕНИЕ: отключаем анимации для предотвращения мигания */
  transition: none !important;
  animation: none !important;
}

.pc-product-info {
  flex: 1;
}

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

.pc-product-code {
  font-size: 14px;
  color: var(--ios-gray);
  font-weight: 500;
}

.pc-product-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.pc-btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--ios-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pc-btn.problem {
  background: var(--ios-red);
  color: white;
}

.pc-btn.price {
  background: var(--ios-orange);
  color: white;
}

.pc-btn.active {
  box-shadow: 0 0 0 2px var(--ios-blue);
}

/* Assembly */
.assembly-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--ios-gray4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.assembly-checkbox.checked {
  background: var(--ios-blue);
  border-color: var(--ios-blue);
}

.assembly-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.assembly-content {
  flex: 1;
}

.assembly-content div:first-child {
  font-size: 16px;
  font-weight: 600;
}

.assembly-qty {
  font-size: 18px;
  font-weight: 700;
  color: var(--ios-blue);
}

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 16px;
}

.calendar-day {
  aspect-ratio: 1;
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px var(--ios-shadow);
}

.calendar-day.active {
  background: var(--ios-blue);
}

.calendar-day.active .calendar-day-name,
.calendar-day.active .calendar-day-number {
  color: white;
}

.calendar-day-name {
  font-size: 10px;
  color: var(--ios-gray);
  text-transform: uppercase;
  font-weight: 600;
}

.calendar-day-number {
  font-size: 20px;
  font-weight: 600;
  color: var(--ios-text);
  margin-top: 2px;
}

.calendar-events {
  padding: 16px;
}

.event-item {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--ios-blue);
  box-shadow: 0 1px 2px var(--ios-shadow);
}

.event-title {
  font-weight: 600;
  color: var(--ios-text);
  margin-bottom: 4px;
}

.event-text {
  font-size: 15px;
  color: var(--ios-gray);
}

/* Admin */
.admin-sections {
  padding: 16px;
}

.admin-card {
  background: var(--ios-card);
  border-radius: var(--ios-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px var(--ios-shadow);
}

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

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--ios-separator);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--ios-gray);
  font-size: 15px;
}

.stat-value {
  font-weight: 600;
  color: var(--ios-text);
}

/* User List */
.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--ios-card);
  border-bottom: 0.5px solid var(--ios-separator);
}

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

.user-login {
  font-weight: 600;
  color: var(--ios-text);
}

.user-role {
  font-size: 13px;
  color: var(--ios-gray);
}

.icon-btn {
  width: 32px;
  height: 32px;
  background: var(--ios-gray6);
  border: none;
  border-radius: var(--ios-radius-sm);
  color: var(--ios-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CHAT ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.chat-message {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
}

.chat-message.sent {
  background: var(--ios-blue);
  color: white;
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-message.received {
  background: var(--ios-card);
  color: var(--ios-text);
  align-self: flex-start;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--ios-border);
}

.chat-message .chat-sender {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ios-blue);
}

.chat-message.sent .chat-sender {
  color: rgba(255, 255, 255, 0.7);
}

.chat-message .chat-time {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
  align-self: flex-end;
}

.chat-message.sent .chat-time {
  color: rgba(255, 255, 255, 0.8);
}

.chat-message.received .chat-time {
  color: var(--ios-gray);
}

/* ===== SPECIAL TASKS ===== */
.special-task-item {
  padding: 16px;
  border-bottom: 1px solid var(--ios-border);
  background: var(--ios-card);
  margin: 8px;
  border-radius: 12px;
}

/* ===== TODAY TASKS (main screen) ===== */
.today-task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--ios-card);
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--ios-border);
  cursor: pointer;
  transition: all 0.2s;
}

.today-task-item:hover {
  background: rgba(0, 122, 255, 0.05);
}

.today-task-item:active {
  transform: scale(0.98);
}

.today-task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ios-blue);
  flex-shrink: 0;
  margin-top: 2px;
}

.today-task-content {
  flex: 1;
  min-width: 0;
}

/* ===== SCOREBOARD TABLE ===== */
.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.score-table thead tr {
  border-bottom: 2px solid var(--ios-border);
}

.score-table th {
  padding: 8px 6px;
  text-align: left;
  font-weight: 600;
  color: var(--ios-gray);
  font-size: 11px;
  text-transform: uppercase;
}

.score-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--ios-border2);
  vertical-align: middle;
}

.score-table tbody tr:hover {
  background: rgba(0, 122, 255, 0.04);
}

/* ===== EXPIRY CHECK ===== */
.expiry-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ios-border);
  background: var(--ios-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.expiry-item.confirmed {
  opacity: 0.6;
  background: rgba(52, 199, 89, 0.05);
}

.expiry-info {
  flex: 1;
}

/* ===== CALENDAR SUNDAY & PENDING ===== */
.calendar-day.sunday {
  background: rgba(255, 59, 48, 0.08);
}

.calendar-day.has-pending {
  position: relative;
}

.calendar-pending-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: var(--ios-red);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== PRICE CHECK OPTIONS ===== */
.price-check-option {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: var(--ios-bg);
  cursor: pointer;
  transition: all 0.2s;
  gap: 10px;
}

.price-check-option:hover {
  background: rgba(0, 122, 255, 0.1);
}

.price-check-option.selected {
  background: rgba(0, 122, 255, 0.15);
  border: 2px solid var(--ios-blue);
}

.price-check-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--ios-blue);
}

/* ===== MENU BADGE ===== */
.menu-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 20px;
  height: 20px;
  background: var(--ios-red);
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.menu-item {
  position: relative;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--ios-border);
  border-radius: 3px;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: var(--ios-green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.modal-content {
  background: var(--ios-card);
  border-radius: var(--ios-radius-xl);
  padding: 20px;
  width: 100%;
  max-width: 340px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--ios-gray6);
  border: none;
  border-radius: var(--ios-radius);
  color: var(--ios-text);
  font-size: 17px;
  outline: none;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Install Button */
.install-btn {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--ios-blue);
  color: white;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--ios-gray);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ios-gray);
}

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

/* Sync Status */
.sync-status {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin: 16px;
  box-shadow: 0 1px 2px var(--ios-shadow);
}

.sync-progress {
  height: 4px;
  background: var(--ios-gray5);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.sync-progress-bar {
  height: 100%;
  background: var(--ios-blue);
  transition: width 0.3s;
}

/* Print Styles */
@media print {
  .header, .bottom-actions, .back-btn, .install-btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--ios-gray4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ios-gray3);
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  background: var(--ios-card);
  border-bottom: 0.5px solid var(--ios-separator);
  padding: 0 16px;
  gap: 20px;
}

.admin-tab {
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.admin-tab.active {
  color: var(--ios-blue);
  border-bottom-color: var(--ios-blue);
}

/* Users List */
.users-list {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  overflow: hidden;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 0.5px solid var(--ios-separator);
}

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

.user-info {
  flex: 1;
}

.user-login {
  font-size: 17px;
  font-weight: 600;
  color: var(--ios-text);
  margin-bottom: 4px;
}

.user-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.user-role {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.user-role.admin {
  background: rgba(0, 122, 255, 0.1);
  color: var(--ios-blue);
}

.user-role.staff {
  background: var(--ios-gray6);
  color: var(--ios-gray);
}

.user-status {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.user-status.active {
  background: rgba(52, 199, 89, 0.1);
  color: var(--ios-green);
}

.user-status.inactive {
  background: rgba(255, 59, 48, 0.1);
  color: var(--ios-red);
}

.user-dates {
  font-size: 12px;
  color: var(--ios-gray);
}

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

/* User Form */
.user-form {
  background: var(--ios-gray6);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin: 12px 0;
}

.user-form h4 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--ios-card);
  border: none;
  border-radius: var(--ios-radius);
  color: var(--ios-text);
  font-size: 17px;
  outline: none;
  box-shadow: 0 0 0 0.5px var(--ios-gray4);
}

.form-input:focus {
  box-shadow: 0 0 0 2px var(--ios-blue);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.form-actions .btn {
  flex: 1;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 15px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--ios-blue);
}

/* Locks List */
.locks-list {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  overflow: hidden;
}

.lock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 0.5px solid var(--ios-separator);
}

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

.lock-info {
  flex: 1;
}

.lock-category {
  font-size: 16px;
  font-weight: 600;
  color: var(--ios-text);
  margin-bottom: 4px;
}

.lock-meta {
  font-size: 14px;
  color: var(--ios-gray);
  margin-bottom: 2px;
}

.lock-time {
  font-size: 12px;
  color: var(--ios-gray2);
}

/* ===== СТИЛИ ДЛЯ СОВМЕСТНОЙ РАБОТЫ ===== */

/* Статус категории в списке */
.category-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.category-status {
  font-size: 13px;
  color: var(--ios-gray);
  margin-top: 2px;
}

.category-item.has-items {
  background: rgba(0, 122, 255, 0.05);
}

.category-item.completed {
  background: rgba(52, 199, 89, 0.1);
}

.category-item.completed .category-name {
  color: var(--ios-green);
  font-weight: 600;
}

/* Статистика категории */
.category-stats-bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--ios-card);
  font-size: 13px;
  color: var(--ios-gray);
  border-bottom: 0.5px solid var(--ios-separator);
}

.category-users {
  padding: 8px 16px;
  background: var(--ios-card);
  font-size: 12px;
  color: var(--ios-gray);
  border-bottom: 0.5px solid var(--ios-separator);
}

/* Статистика сборки */
.assembly-stats {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: var(--ios-card);
  margin: 0 16px 8px;
  border-radius: var(--ios-radius);
  gap: 8px;
}

.assembly-stats span {
  font-size: 14px;
  color: var(--ios-text);
  font-weight: 500;
}

.progress-bar {
  height: 6px;
  background: var(--ios-gray5);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--ios-green);
  transition: width 0.3s ease;
}

/* Собранный товар */
.assembly-item.collected {
  opacity: 0.7;
  background: rgba(52, 199, 89, 0.05);
}

.assembly-item.collected .assembly-content div:first-child {
  text-decoration: line-through;
  color: var(--ios-gray);
}

/* Вкладчики в сборке */
.contributors {
  font-size: 12px;
  color: var(--ios-gray);
  margin-top: 4px;
}

/* Код товара */
.product-code {
  font-size: 13px;
  color: var(--ios-gray);
  margin-top: 2px;
}

/* ===== ИСПРАВЛЕНИЕ БАГА С МИГАНИЕМ ===== */

/* Отключаем все анимации и переходы для изображений */
.product-image,
.pc-product-image {
  transition: none !important;
  animation: none !important;
  will-change: auto;
}

/* Предотвращаем перерисовку при наведении */
.product-card:hover .product-image,
.product-card:active .product-image {
  transform: none !important;
}

/* Оптимизация производительности сетки */
.products-grid {
  contain: layout style paint;
  content-visibility: auto;
}

/* Предотвращаем сдвиги контента */
.product-card {
  contain: layout style;
}

/* ===== ЦВЕТНОЙ ИНДИКАТОР КЛИКА ===== */
.product-click-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 10;
}

/* ===== СБОРКА - КРУЖОК СПРАВА ===== */
.assembly-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assembly-content {
  flex: 1;
}

.assembly-qty {
  font-size: 18px;
  font-weight: 700;
  color: var(--ios-blue);
  margin-right: 8px;
}

.assembly-checkbox {
  flex-shrink: 0;
}

/* ===== НОВАЯ ПРОВЕРКА ЦЕННИКОВ ===== */

/* Сетка 4 в ряд */
.price-check-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}

/* Карточка товара */
.price-check-card {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px var(--ios-shadow);
  transition: transform 0.2s;
  min-width: 0; /* Для мобильной версии */
}

.price-check-card:active {
  transform: scale(0.98);
}

/* Обёртка для изображения */
.price-check-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 aspect ratio */
  background: var(--ios-gray6);
  overflow: hidden;
}

.price-check-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

/* Значок ! на товаре */
.price-check-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: var(--ios-red);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Срок годности на карточке */
.price-check-expiry {
  font-size: 10px;
  font-weight: 600;
  color: var(--ios-gray);
  line-height: 1.3;
  margin-top: 2px;
}

/* Информация о товаре */
.price-check-info {
  padding: 12px;
}

.price-check-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--ios-text);
  line-height: 1.2;
  height: 33px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-bottom: 2px;
}

.price-check-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--ios-text);
  line-height: 1.4;
  margin-top: 4px;
}

.price-check-expiry {
  font-size: 11px;
  color: var(--ios-gray);
  line-height: 1.4;
  margin-top: 2px;
}

/* Опции в модальном окне */
.price-check-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ios-gray6);
  border-radius: var(--ios-radius);
  cursor: pointer;
  transition: all 0.2s;
}

.price-check-option:hover {
  background: var(--ios-gray5);
}

.price-check-option.selected {
  background: rgba(0, 122, 255, 0.1);
  box-shadow: 0 0 0 2px var(--ios-blue);
}

.price-check-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--ios-blue);
}

.price-check-option span {
  font-size: 16px;
  color: var(--ios-text);
}

/* Пагинация */
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--ios-card);
  border: 1px solid var(--ios-gray4);
  border-radius: var(--ios-radius-sm);
  color: var(--ios-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--ios-gray6);
}

.page-btn.active {
  background: var(--ios-blue);
  color: white;
  border-color: var(--ios-blue);
}

/* Календарь - дни с событиями */
.calendar-day.has-events {
  position: relative;
}

.calendar-day.has-events::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--ios-red);
  border-radius: 50%;
}

.calendar-todo-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--ios-blue);
  border-radius: 50%;
}

/* To-do задачи */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  margin-bottom: 8px;
  box-shadow: 0 1px 2px var(--ios-shadow);
}

.todo-item.completed {
  opacity: 0.7;
  background: rgba(52, 199, 89, 0.05);
}

.todo-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ios-gray4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.todo-checkbox.checked {
  background: var(--ios-green);
  border-color: var(--ios-green);
}

.todo-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.todo-content {
  flex: 1;
}

/* Неделя в календаре */
.calendar-week-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (max-width: 400px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
  }
  
  .price-check-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 4px;
  }
  
  .price-check-name {
    font-size: 8px;
    height: 30px;
    line-height: 1.15;
    -webkit-line-clamp: 3;
  }
  
  .price-check-code {
    font-size: 10px;
  }
  
  .price-check-info {
    padding: 4px;
  }
  
  .price-check-card {
    border-radius: 5px;
  }
  
  .price-check-expiry {
    font-size: 9px;
  }
  
  .product-name {
    font-size: 11px;
    height: 42px;
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 16px;
  }
}

/* ===== CLAIMS / ПРЕТЕНЗИИ ===== */

.menu-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 20px;
  height: 20px;
  background: var(--ios-red);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  padding: 0 4px;
}

.claims-list {
  padding: 16px;
}

.claim-item {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px var(--ios-shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.claim-item:active {
  transform: scale(0.98);
}

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

.claim-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 10px;
}

.claim-status.status-pending {
  background: rgba(255, 149, 0, 0.15);
  color: var(--ios-orange);
}

.claim-status.status-progress {
  background: rgba(0, 122, 255, 0.15);
  color: var(--ios-blue);
}

.claim-status.status-approved {
  background: rgba(52, 199, 89, 0.15);
  color: var(--ios-green);
}

.claim-status.status-rejected {
  background: rgba(255, 59, 48, 0.15);
  color: var(--ios-red);
}

.claim-date {
  font-size: 12px;
  color: var(--ios-gray);
}

.claim-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.claim-assignee {
  font-size: 13px;
  color: var(--ios-blue);
  margin-top: 4px;
}

.claim-meta {
  font-size: 12px;
  color: var(--ios-gray);
  margin-top: 2px;
}

/* Claim Detail */
.claim-detail-card {
  background: var(--ios-card);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px var(--ios-shadow);
}

.claim-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.claim-detail-label {
  font-size: 12px;
  color: var(--ios-gray);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.claim-detail-value {
  font-size: 15px;
  color: var(--ios-text);
  line-height: 1.4;
}

.claim-detail-section {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid var(--ios-gray5);
}

.claim-detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.claim-attachment-link {
  display: inline-block;
  color: var(--ios-blue);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 12px;
  background: var(--ios-gray6);
  border-radius: var(--ios-radius-sm);
  margin-top: 4px;
}

.claim-actions {
  padding: 0 16px 16px;
}
