/* ================================================================
   FABZAG ERP — стили (порт с React v23 / Tailwind, чистый CSS)
   ================================================================ */

/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid #E2E8F0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #F0F1F3;
  color: #1A202C;
  font-size: 16px;
  line-height: 1.5;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button { cursor: pointer; font-family: inherit; font-size: inherit; color: inherit; background: none; line-height: inherit; }
input, select, textarea { font-family: inherit; }
table { border-collapse: collapse; }
svg { display: block; }
button svg, span svg { display: inline-block; vertical-align: middle; }

.hidden { display: none !important; }

/* ============ APP LAYOUT ============ */
.app { height: 100vh; width: 100vw; display: flex; flex-direction: column; background: #F0F1F3; overflow: hidden; }
.app-main { flex: 1; overflow: hidden; min-height: 0; }

/* screen container (внутри каждой вкладки) */
.screen { display: flex; flex-direction: column; height: 100%; padding: 12px; gap: 12px; overflow: hidden; }
.screen-title { font-size: 20px; line-height: 28px; font-weight: 700; color: #1A365D; flex-shrink: 0; }
.screen-head { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }

/* ============ NAVIGATION ============ */
.navbar {
  height: 80px;
  background: #1A365D;
  display: flex;
  align-items: stretch;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}
.nav-tab {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  transition: background-color 0.1s;
  user-select: none;
  cursor: pointer;
  padding-top: 4px;
  padding-bottom: 4px;
}
.nav-tab:hover { background-color: rgba(255,255,255,0.08); }
.nav-tab.active { background-color: #2B6CB0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2); }
.nav-main-row { display: flex; align-items: center; gap: 6px; }
.nav-label { font-size: 15px; line-height: 1.25; font-weight: 600; }
.nav-alert { display: flex; align-items: center; justify-content: center; margin-left: 2px; color: #F6AD55; }
.nav-badge {
  margin-left: 2px; min-width: 20px; height: 20px; border-radius: 9999px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  background: #E53E3E; color: #fff;
}
.nav-tab.active .nav-badge { background: #fff; color: #1A365D; }
.nav-sub-row { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.nav-sub-text { font-size: 11px; line-height: 1.25; color: rgba(255,255,255,0.55); }
.nav-tab.active .nav-sub-text { color: rgba(255,255,255,0.8); }
.nav-sub-badge {
  min-width: 18px; height: 18px; border-radius: 9999px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  background: #E53E3E; color: #fff;
}
.nav-tab.active .nav-sub-badge { background: #fff; color: #1A365D; }

/* Burger */
.burger-wrap { margin-left: auto; display: flex; align-items: center; padding-right: 16px; position: relative; }
.burger-btn {
  width: 48px; height: 48px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background-color 0.15s;
}
.burger-btn:hover { background: rgba(255,255,255,0.1); }
.burger-backdrop { position: fixed; inset: 0; z-index: 40; }
.burger-dropdown {
  position: absolute; top: 100%; right: 16px; margin-top: 4px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  border: 1px solid #E2E8F0;
  padding: 8px 0; min-width: 220px; z-index: 50;
}
.burger-profile { padding: 12px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #E2E8F0; margin-bottom: 4px; }
.burger-avatar {
  width: 36px; height: 36px; border-radius: 9999px; background: #1A365D; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.burger-profile-name { font-size: 14px; line-height: 20px; font-weight: 600; color: #1A202C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger-profile-role { font-size: 12px; line-height: 16px; color: #718096; }
.burger-item {
  width: 100%; padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  color: #1A202C; text-align: left; transition: background-color 0.15s;
  font-weight: 500; font-size: 14px; line-height: 20px;
}
.burger-item:hover { background: #F7FAFC; }
.burger-item svg { color: #718096; }
.burger-sep { border-top: 1px solid #E2E8F0; margin-top: 4px; padding-top: 4px; }
.burger-item.logout { color: #E53E3E; }
.burger-item.logout:hover { background: #FFF5F5; }
.burger-item.logout svg { color: #E53E3E; }

/* ============ COMPONENTS (порт index.css) ============ */
/* ВАЖНО: в React font-size:16px !important побеждает утилиты text-xl/text-sm,
   поэтому ВСЕ tablet-input отображаются 16px — воспроизводим это точно */
.tablet-input {
  height: 52px; font-size: 16px !important; padding: 0 16px; background: #fff;
  border: 2px solid #E2E8F0; border-radius: 8px; color: #1A202C; width: 100%;
}
.tablet-input:focus { border-color: #2B6CB0; box-shadow: 0 0 0 4px rgba(43,108,176,0.15); outline: none; }
.tablet-input::placeholder { color: #A0AEC0; font-style: italic; }
textarea.tablet-input { padding: 12px 16px; }

.tablet-select {
  height: 52px; font-size: 16px; padding: 0 40px 0 16px; background: #fff;
  border: 2px solid #E2E8F0; border-radius: 8px; appearance: none; -webkit-appearance: none; width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.tablet-select:focus { border-color: #2B6CB0; box-shadow: 0 0 0 4px rgba(43,108,176,0.15); outline: none; }

.btn-primary {
  height: 56px; padding: 0 32px; background: #1A365D; color: #fff;
  font-size: 18px; font-weight: 600; border-radius: 12px;
  transition: all 75ms; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary:hover { background: #234876; }
.btn-primary:active { background: #0F2744; transform: scale(0.98); }

.btn-success {
  height: 56px; padding: 0 32px; background: #38A169; color: #fff;
  font-size: 18px; font-weight: 600; border-radius: 12px;
  transition: all 75ms; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-success:hover { background: #2F855A; }
.btn-success:active { background: #276749; transform: scale(0.98); }

.btn-secondary {
  height: 52px; padding: 0 24px; background: #fff; border: 2px solid #2B6CB0; color: #2B6CB0;
  font-size: 16px; font-weight: 600; border-radius: 12px;
  transition: all 75ms; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-secondary:hover { background: #EBF8FF; }
.btn-secondary:active { transform: scale(0.98); }

.btn-danger {
  height: 48px; padding: 0 24px; background: #E53E3E; color: #fff;
  font-size: 16px; font-weight: 600; border-radius: 8px;
  transition: all 75ms; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-danger:hover { background: #C53030; }
.btn-danger:active { background: #9B2C2C; transform: scale(0.98); }

.tablet-card {
  background: #fff; border-radius: 12px; border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}

.status-badge {
  display: inline-flex; align-items: center; padding: 6px 14px;
  border-radius: 9999px; font-size: 14px; font-weight: 600;
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #EDF2F7; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #A0AEC0; }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff;
  border: 1px solid #E2E8F0; border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  z-index: 50; max-height: 240px; overflow-y: auto;
}
.autocomplete-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #F7FAFC; }
.autocomplete-item:last-child { border-bottom: 0; }
.autocomplete-item:hover { background: #EDF2F7; }
.autocomplete-item .ac-name { font-weight: 500; font-size: 14px; line-height: 20px; }
.autocomplete-item .ac-phone { font-size: 12px; line-height: 16px; color: #718096; }

/* Flash-red validation */
@keyframes flashRed {
  0%, 100% { border-color: #E2E8F0; }
  50% { border-color: #E53E3E; background-color: #FFF5F5; }
}
.flash-red { animation: flashRed 0.2s ease; }

/* ============ TOAST (по центру экрана) ============ */
.toast-root {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.toast-stack { display: flex; flex-direction: column; gap: 8px; align-items: center; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.toast {
  pointer-events: auto; padding: 16px 24px; border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  color: #fff; font-weight: 500; font-size: 16px; line-height: 24px;
  min-width: 300px; text-align: center;
  animation: toastIn 0.3s ease;
}
.toast.success { background: #38A169; }
.toast.error { background: #E53E3E; }
.toast.info { background: #1A365D; }

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-panel {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%; margin: 0 16px;
}
.modal-panel.w-md { max-width: 448px; }
.modal-panel.w-cells { max-width: 520px; }

/* Инфо-модалка (бургер-меню) */
.info-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.info-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.info-panel {
  position: relative; background: #fff; border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%; max-width: 640px; max-height: 80vh;
  display: flex; flex-direction: column; margin: 0 16px; z-index: 10; overflow: hidden;
}
.info-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #E2E8F0; flex-shrink: 0;
}
.info-title { font-size: 18px; line-height: 28px; font-weight: 700; color: #1A365D; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #718096; transition: background-color 0.15s;
}
.icon-btn:hover { background: #EDF2F7; }
.info-body { flex: 1; overflow-y: auto; padding: 16px; }

/* Фильтры в модалке заказов */
.filter-btn {
  padding: 6px 12px; border-radius: 8px; font-size: 12px; line-height: 16px; font-weight: 500;
  white-space: nowrap; transition: background-color 0.15s, color 0.15s;
  background: #F7FAFC; color: #718096;
}
.filter-btn:hover { background: #EDF2F7; }
.filter-btn.active { background: #1A365D; color: #fff; }
.filter-btn.active:hover { background: #1A365D; }

/* ============ ТАБЛИЦЫ РАЗДЕЛОВ ============ */
.data-table { width: 100%; }
.data-table thead { position: sticky; top: 0; z-index: 10; }
.data-table thead tr { background: #EDF2F7; }
.data-table th {
  text-align: left; font-size: 12px; line-height: 16px; font-weight: 600; color: #718096;
  padding: 6px 8px;
}
.data-table th.tar { text-align: right; }
.data-table th.tac { text-align: center; }
.data-table tbody tr { border-bottom: 1px solid #E2E8F0; }
/* строка с браком; при наведении, как в React, перекрывается hover-фоном */
.data-table tbody tr.defect { background: #FFF5F5; }
.data-table tbody tr:hover { background: #F7FAFC; }
.data-table td { padding: 8px; font-size: 14px; line-height: 20px; }
.data-table td.tar { text-align: right; }
.data-table td.tac { text-align: center; }

/* ============ УТИЛИТЫ (аналоги использованных tailwind-классов) ============ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-1-5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.min-h-0 { min-height: 0; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.relative { position: relative; }
.w-full { width: 100%; }
.uppercase-wide { text-transform: uppercase; letter-spacing: 0.025em; }

/* line-height повторяет шкалу Tailwind: xs 12/16, sm 14/20, base 16/24, lg 18/28, xl 20/28 */
.fs10 { font-size: 10px; }
.fs11 { font-size: 11px; }
.fs12 { font-size: 12px; line-height: 16px; }
.fs14 { font-size: 14px; line-height: 20px; }
.fs16 { font-size: 16px; line-height: 24px; }
.fs18 { font-size: 18px; line-height: 28px; }
.fs20 { font-size: 20px; line-height: 28px; }
.fw5 { font-weight: 500; }
.fw6 { font-weight: 600; }
.fw7 { font-weight: 700; }
.c-navy { color: #1A365D; }
.c-blue { color: #2B6CB0; }
.c-dark { color: #1A202C; }
.c-gray { color: #718096; }
.c-lgray { color: #A0AEC0; }
.c-red { color: #E53E3E; }
.c-green { color: #38A169; }
.c-orange { color: #DD6B20; }

/* Пустое состояние */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #A0AEC0;
}
.empty-state.pad { padding: 48px 0; flex: initial; }

/* Цветная точка (цвет гофры) */
.color-dot { display: inline-block; border-radius: 9999px; border: 1px solid rgba(0,0,0,0.1); flex-shrink: 0; }
.color-dot.d20 { width: 20px; height: 20px; }
.color-dot.d16 { width: 16px; height: 16px; }
.color-dot.d14 { width: 14px; height: 14px; }
.color-dot.d12 { width: 12px; height: 12px; }

/* ============ НОВЫЙ ЗАКАЗ ============ */
.no-layout { display: flex; gap: 12px; flex: 1; min-height: 0; }
.no-client-card { padding: 12px; display: flex; flex-direction: column; gap: 12px; width: 360px; flex-shrink: 0; overflow-y: auto; }
.no-items-card { padding: 12px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.field-label { display: block; font-size: 14px; line-height: 20px; font-weight: 500; color: #718096; margin-bottom: 4px; }
.field-label .req { color: #E53E3E; }
.input-xl { font-weight: 700; }

.add-item-box { background: #F7FAFC; border: 1px solid #E2E8F0; border-radius: 8px; padding: 8px; margin-bottom: 8px; flex-shrink: 0; }
.add-item-box .cable-row { margin-bottom: 6px; }
.input-cable { height: 40px; }
.opt-label { font-size: 10px; color: #718096; font-weight: 500; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.025em; }

.d-btn {
  height: 40px; padding: 0 12px; border-radius: 8px; font-weight: 700; font-size: 16px;
  border: 2px solid #E2E8F0; background: #fff; transition: all 0.15s;
}
.d-btn:hover { border-color: #A0AEC0; }
.d-btn.active { border-color: #1A365D; background: #1A365D; color: #fff; }
.d-btn.active:hover { border-color: #1A365D; }

.c-btn {
  width: 32px; height: 32px; border-radius: 9999px; border: 2px solid rgba(255,255,255,0.5);
  transition: all 0.15s;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}
.c-btn:hover { transform: scale(1.05); }
.c-btn.active {
  border-color: #1A365D;
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px #1A365D;
  transform: scale(1.1);
}

.qty-btn {
  width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 2px solid #E2E8F0;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: #EDF2F7; }
.qty-display {
  height: 40px; min-width: 70px; padding: 0 8px; background: #fff; border: 2px solid #E2E8F0;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.btn-add-item {
  height: 40px; padding: 0 16px; background: #38A169; color: #fff;
  font-size: 14px; font-weight: 600; border-radius: 8px;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 4px;
}
.btn-add-item:hover { background: #2F855A; }
.btn-add-item:active { transform: scale(0.98); }

.row-del-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #E53E3E; transition: background-color 0.15s; margin: 0 auto;
}
.row-del-btn:hover { background: #FFF5F5; }

.no-footer { border-top: 1px solid #E2E8F0; padding-top: 8px; margin-top: 8px; flex-shrink: 0; }
.btn-h12 { height: 48px !important; }

/* ============ ПРИЁМ ============ */
.back-btn {
  width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 2px solid #E2E8F0;
  display: flex; align-items: center; justify-content: center;
  color: #1A365D; transition: background-color 0.15s;
}
.back-btn:hover { background: #EDF2F7; }

.order-card {
  background: #fff; border-radius: 12px; border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  padding: 12px; display: flex; flex-direction: column; align-items: flex-start;
  min-width: 220px; text-align: left; transition: border-color 0.15s; position: relative;
}
.order-card:hover { border-color: #2B6CB0; }
.order-card.defect { border: 2px solid #E53E3E; background: #FFF5F5; }
.order-card.defect:hover { border-color: #C53030; }
.order-card.issued { opacity: 0.7; }
.order-card.issued:hover { border-color: #E2E8F0; }
.order-card.w240 { min-width: 240px; }
.oc-num { font-weight: 700; color: #1A365D; font-size: 16px; line-height: 24px; }
.oc-num.red { color: #E53E3E; }
.oc-num.gray { color: #718096; }
.oc-client { font-size: 14px; line-height: 20px; color: #1A202C; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.oc-phone { font-size: 12px; line-height: 16px; color: #718096; }
.oc-check {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 9999px;
  background: #38A169; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px;
}

.section-label { font-size: 14px; line-height: 20px; font-weight: 600; color: #718096; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.025em; }
.cards-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }

.cell-pick-btn {
  height: 32px; padding: 0 12px; background: #EBF8FF; color: #2B6CB0;
  font-size: 14px; line-height: 20px; font-weight: 600; border-radius: 8px; transition: background-color 0.15s;
}
.cell-pick-btn:hover { background: #BEE3F8; }
.cell-pick-btn.assigned { background: #F0FFF4; color: #38A169; font-weight: 700; }
.cell-pick-btn.assigned:hover { background: #C6F6D5; }

.check-circle {
  width: 28px; height: 28px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; font-size: 12px; font-weight: 700;
  background: #EDF2F7; color: #CBD5E0;
}
.check-circle.on { background: #38A169; color: #fff; }

.accept-btn {
  flex: 1; height: 56px; border-radius: 12px; color: #fff; font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.15s;
  background: #CBD5E0; cursor: not-allowed;
}
.accept-btn.enabled { background: #38A169; cursor: pointer; }
.accept-btn.enabled:hover { background: #2F855A; }
.accept-btn.enabled:active { transform: scale(0.98); }

/* Сетка ячеек в модалке приёма */
.cell-grid-10 { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); gap: 6px; }
.cgm-cell {
  height: 40px; border-radius: 8px; font-size: 14px; font-weight: 700; transition: all 0.15s;
  background: #EDF2F7; border: 2px solid #EDF2F7; color: #CBD5E0; cursor: not-allowed;
}
.cgm-cell.free { background: #fff; border-color: #E2E8F0; color: #1A202C; cursor: pointer; }
.cgm-cell.free:hover { border-color: #38A169; background: #F0FFF4; color: #38A169; }
.cgm-cell.free:active { transform: scale(0.95); }
.cgm-cell.defect { background: #FFF5F5; border-color: #E53E3E; color: #E53E3E; cursor: pointer; }
.cgm-cell.defect:hover { background: #FED7D7; }
/* назначенная ячейка: в React у disabled-кнопки без cursor-утилиты курсор default */
.cgm-cell.assigned { background: #38A169; border-color: #38A169; color: #fff; cursor: default; }

/* ============ НАЧАЛО ЛИНИИ ============ */
.sl-grid { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); gap: 4px; }
.sl-cell {
  height: 36px; border-radius: 8px; font-size: 12px; font-weight: 700; transition: all 0.15s;
  background: #EDF2F7; border: 2px solid #EDF2F7; color: #CBD5E0; cursor: not-allowed;
}
.sl-cell.occupied { background: #fff; border-color: #38A169; color: #38A169; cursor: pointer; }
.sl-cell.occupied:hover { background: #F0FFF4; }
.sl-cell.occupied:active { transform: scale(0.95); }
.sl-cell.defect { background: #FFF5F5; border-color: #E53E3E; color: #E53E3E; cursor: pointer; }
.sl-cell.defect:hover { background: #FED7D7; }
.sl-cell.defect:active { transform: scale(0.95); }
.sl-cell.selected { background: #1A365D; border-color: #1A365D; color: #fff; cursor: pointer; transform: scale(1.05); }

.groove-row {
  display: flex; align-items: center; gap: 12px;
  background: #F7FAFC; border-radius: 8px; padding: 8px 12px;
}
.gc-circle {
  width: 28px; height: 28px; border-radius: 9999px; border: 2px solid rgba(255,255,255,0.5);
  transition: all 0.15s; flex-shrink: 0;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}
.gc-circle:hover { transform: scale(1.1); }
.gc-circle.used { border-color: #D1D5DB; opacity: 0.3; cursor: not-allowed; box-shadow: none; }
.gc-circle.used:hover { transform: none; }
.gc-circle.active { border-color: #1A365D; box-shadow: 0 0 0 1px #1A365D; transform: scale(1.1); }

.x-btn {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #E53E3E; transition: background-color 0.15s; flex-shrink: 0;
}
.x-btn:hover { background: #FFF5F5; }

.line-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; border: 2px solid; }
.groove-num-circle {
  width: 32px; height: 32px; border-radius: 9999px; color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.groove-num-circle.fs12 { font-size: 12px; }

.big-action-btn {
  height: 56px; border-radius: 12px; color: #fff; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.15s; flex-shrink: 0;
  background: #CBD5E0; cursor: not-allowed; width: 100%;
}
.big-action-btn.enabled { background: #38A169; cursor: pointer; }
.big-action-btn.enabled:hover { background: #2F855A; }
.big-action-btn.enabled:active { transform: scale(0.98); }
.big-action-btn.h48 { height: 48px; font-size: 16px; margin-top: 8px; }

/* ============ КОНЕЦ ЛИНИИ ============ */
.cancel-line-btn {
  height: 32px; padding: 0 12px; background: #FFFAF0; color: #DD6B20;
  font-size: 14px; font-weight: 600; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 4px; transition: background-color 0.15s;
}
.cancel-line-btn:hover { background: #FEEBC8; }

.radio-pill {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 4px 8px; border-radius: 8px; font-size: 14px; line-height: 20px; font-weight: 500; transition: all 0.15s;
}
.radio-pill:hover { background: #F7FAFC; }
.radio-pill.packed { background: #F0FFF4; color: #38A169; }
.radio-pill.packed:hover { background: #F0FFF4; }
.radio-pill.defect { background: #FFF5F5; color: #E53E3E; }
.radio-pill.defect:hover { background: #FFF5F5; }
.radio-pill input[type="radio"] { width: 16px; height: 16px; cursor: pointer; }
.radio-pill.p-accent input { accent-color: #38A169; }
.radio-pill.d-accent input { accent-color: #E53E3E; }

.defect-tag {
  font-size: 12px; line-height: 16px; color: #E53E3E; background: #FFF5F5; padding: 2px 8px; border-radius: 4px;
  max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============ ВЫДАЧА ============ */
.issue-cell-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border-radius: 8px; padding: 8px 12px; text-align: left; transition: all 0.15s;
  background: #F7FAFC; border: 1px solid #E2E8F0; opacity: 0.5;
}
.issue-cell-row.selected { background: #F0FFF4; border-color: #38A169; opacity: 1; }
.issue-checkbox {
  width: 24px; height: 24px; border-radius: 6px; border: 2px solid #CBD5E0; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; transition: all 0.15s; flex-shrink: 0; color: #fff;
}
.issue-cell-row.selected .issue-checkbox { background: #38A169; border-color: #38A169; }

.back-link { display: flex; align-items: center; gap: 4px; font-size: 14px; color: #2B6CB0; margin-bottom: 4px; }
.back-link:hover { text-decoration: underline; }

/* ============ ИНФО-МОДАЛКИ: карточки ============ */
.list-card {
  background: #fff; border-radius: 12px; border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); padding: 12px;
}
.stack-2 > * + * { margin-top: 8px; }
.stack-15 > * + * { margin-top: 6px; }
.stack-1 > * + * { margin-top: 4px; }
.space-y-3 > * + * { margin-top: 12px; }

.client-avatar {
  width: 36px; height: 36px; border-radius: 9999px; background: #EDF2F7; color: #1A365D;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}

.status-pill { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; }

.input-h40 { height: 40px !important; }

/* ============ ПЕЧАТЬ ============ */
.print-only { display: none !important; }

/* Бланк заказа (порт OrderPrint.tsx); line-height по шкале Tailwind */
.print-area { background: #fff; padding: 24px; color: #000; font-family: Arial, sans-serif; font-size: 13px; line-height: 1.5; }
.pa-header { border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 12px; }
.pa-header-row { display: flex; justify-content: space-between; align-items: flex-start; }
.pa-title { font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: 0.025em; }
.pa-sub { font-size: 14px; line-height: 20px; }
.pa-sub.mt { margin-top: 4px; }
.pa-order-num { font-size: 20px; line-height: 28px; font-weight: 700; }
.pa-client-box { border: 1px solid #000; padding: 12px; margin-bottom: 12px; }
.pa-service { text-align: center; margin-bottom: 12px; font-size: 16px; line-height: 24px; font-weight: 600; }
.pa-table { width: 100%; border-collapse: collapse; border: 2px solid #000; margin-bottom: 16px; }
.pa-table th { border: 1px solid #000; padding: 8px; font-weight: 700; background: #E5E7EB; }
.pa-table td { border: 1px solid #000; padding: 8px; }
.pa-total { display: flex; justify-content: flex-end; margin-bottom: 20px; font-size: 20px; line-height: 28px; font-weight: 700; }
.pa-sign { border-top: 1px solid #000; padding-top: 16px; margin-top: 16px; }
.pa-sign-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.pa-sign-line { flex: 1; border-bottom: 1px solid #000; min-height: 35px; }
.pa-terms { font-size: 12px; color: #374151; line-height: 1.625; border: 1px solid #9CA3AF; padding: 12px; margin-top: 16px; }

/* @media print идёт ПОСЛЕ экранных правил .print-area:
   при печати побеждает padding 20px — ровно как в React (index.css) */
@media print {
  .print-only { display: block !important; }

  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    position: absolute; left: 0; top: 0; width: 100%;
    padding: 20px; background: #fff !important;
  }
  .no-print { display: none !important; }
}

/* ============ ИНДИКАТОР ЗАГРУЗКИ (AJAX) ============ */
.page-loader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(240,241,243,0.7);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.page-loader svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ============ OFFLINE BANNER ============ */
.offline-banner {
  position: fixed; bottom: 16px; right: 16px; z-index: 300;
  background: #E53E3E; color: #fff;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 10px;
  animation: pulseRed 2s ease-in-out infinite;
}
@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,62,62,0.6); }
  50% { box-shadow: 0 0 0 12px rgba(229,62,62,0); }
}
.offline-banner .dot {
  width: 10px; height: 10px; border-radius: 9999px;
  background: #fff; animation: blink 1s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }