*{ box-sizing:border-box }
html,body{ 
  height:100%; 
  width: 100%;
  max-width: none;
  overflow-x: hidden;
}
body{ 
  margin:0; 
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Helvetica Neue",Arial; 
  color:#1d1d1f; 
  background:#faf9f5;
  width: 100%;
  max-width: none;
}

/* Кнопки */
.btn-primary{ background:#dc5f00; color:#fff; border:0; border-radius:999px; padding:8px 14px; cursor:pointer }
.btn-primary:hover{ background:#b84e00 }
.btn-secondary{ background:#fff; color:#1d1d1f; border:1px solid #e2d5c6; border-radius:999px; padding:8px 12px; cursor:pointer }
.btn-secondary:hover{ border-color:#dc5f00 }
.btn-danger{ background:#9a2a2a; color:#fff; border:0; border-radius:999px; padding:8px 12px; cursor:pointer }
.btn-danger:hover{ background:#7c2222 }

.hidden{ display:none!important }
.wrap{ max-width:1200px; margin:0 auto; padding:12px 16px }

.header{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:2px solid #dc5f00;background:#fff}
.header .brand{display:flex;gap:10px;align-items:center}
.header .brand img{height:22px}
.header .user-actions{display:flex;gap:8px;align-items:center}
.header #userEmail{opacity:.8}

/* Таблицы */
.table{ width:100%; border-collapse:collapse; background:#fff; border:1px solid #e8dccd; border-radius:12px; overflow:hidden }
.table th{ text-align:left; padding:10px; background:#dc5f00; color:#fff; font-weight:600 }
.table td{ padding:8px 10px; border-top:1px solid #f1e6d9; position:relative }

:root{
  --st-nowa:#ffffff;
  --st-wyslana:#fff6cf;
  --st-zamowiona:#ffe2c2;
  --st-rozliczona:#e6f4ec;
}
#dashboard table tr[data-status="nowa"]       > td { background:var(--st-nowa)!important }
#dashboard table tr[data-status="wysłana"]    > td,
#dashboard table tr[data-status="wyslana"]    > td { background:var(--st-wyslana)!important }
#dashboard table tr[data-status="zamówiona"]  > td,
#dashboard table tr[data-status="zamowiona"]  > td { background:var(--st-zamowiona)!important }
#dashboard table tr[data-status="rozliczona"] > td { background:var(--st-rozliczona)!important }
#dashboard table tr[data-status] > td:first-child{ position:relative }
#dashboard table tr[data-status] > td:first-child::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:#dc5f00; opacity:.6 }

.statusSel{ appearance:none; border:1px solid #e2d5c6; border-radius:999px; padding:8px 14px; font-weight:600; background:#fff }

/* Оферта — шапка/формы */
.oferta-header{ display:flex; gap:16px; flex-wrap:wrap; margin-top:8px }
.oferta-customer{ flex:1 1 420px; background:#fff; border:1px solid #e8dccd; border-radius:12px; padding:12px }
.oferta-row{ display:grid; grid-template-columns:160px 1fr; align-items:center; gap:8px; margin:6px 0 }
.oferta-label{ color:#5b5b5f; font-size:13px }
.oferta-input{ width:100%; padding:8px 10px; border:1px solid #e2d5c6; border-radius:10px; background:#fffdf7 }
.oferta-logo-block{ flex:1 1 320px; display:flex; gap:12px; align-items:flex-start }
.oferta-logo{ height:72px }
.oferta-firm{ font-size:14px }

.search-block{ display:flex; align-items:center; gap:8px; margin:10px 0 }
.search-block input{ flex:1; padding:10px 12px; border:1px solid #e2d5c6; border-radius:10px; background:#fff }
.search-block #searchClear{ cursor:pointer; user-select:none; padding:0 6px; border:1px solid #e2d5c6; border-radius:8px; line-height:28px; height:30px; display:inline-flex; align-items:center; }

.table-block{ background:#fff; border:1px solid #e8dccd; border-radius:12px; overflow:auto }
.table-block table{ width:100%; border-collapse:collapse }
.table-block th{ position:sticky; top:0; background:#dc5f00; color:#fff; text-align:left; padding:8px 10px }
.table-block td{ padding:8px 10px; border-top:1px solid #f1e6d9 }

.totals{ display:flex; gap:24px; font-weight:600; color:#003366; margin:10px 2px }

/* карточка авторизации — центр, красиво */
.auth-card{
  width:min(480px, 92vw);
  margin:10vh auto;
  background:#fff;
  border:1px solid #eee0d1;
  border-radius:14px;
  box-shadow:0 14px 40px rgba(0,0,0,.08);
  padding:20px;
}
.auth-logo{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.auth-logo img{height:28px}
.icon.pdf   { background: url('icons/pdf.svg') center/contain no-repeat; }

/* --- login card --- */
.login-card{max-width:520px;margin:64px auto;padding:22px;border:1px solid #eee0d1;border-radius:16px;background:#fff;box-shadow:0 20px 50px rgba(0,0,0,.06)}
.login-logo{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.login-logo img{height:30px}
.login-title{margin:6px 0 10px;font-size:18px}
.login-input{width:100%;padding:12px 14px;border:1px solid #e6d6c5;border-radius:10px;background:#fffdf7;margin:6px 0}
.login-actions{display:flex;gap:8px;margin-top:8px}

/* --- topbar / toolbar --- */
.topbar{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;align-items:center;padding:10px 14px;background:#fff;border-bottom:2px solid #dc5f00}
.topbar .brand{display:flex;gap:10px;align-items:center}
.toolbar{display:flex;gap:8px;margin:12px 0}

/* --- buttons --- */
.btn-primary{background:#dc5f00;color:#fff;border:0;border-radius:10px;padding:10px 14px;cursor:pointer}
.btn-primary:hover{background:#b84e00}
.btn-secondary{background:#fff;border:1px solid #e4d5c4;border-radius:10px;padding:10px 14px;cursor:pointer}
.btn-danger{background:#9a2c2c;color:#fff;border:0;border-radius:10px;padding:10px 14px}

/* --- tables --- */
.table-block{overflow:auto}
table{width:100%;border-collapse:separate;border-spacing:0 10px}
table thead th{background:#dc5f00;color:#fff;padding:10px;border-radius:0}
table thead th:first-child{border-radius:8px 0 0 8px}
table thead th:last-child{border-radius:0 8px 8px 0}
table tbody td{background:#fff;padding:12px;border-top:1px solid #eee;border-bottom:1px solid #eee}
.offers tbody tr{position:relative;transition:background .15s}
/* Цвета фона для строк в зависимости от статуса */
.offers-table tbody tr[data-status="nowa"] td{background:#ffffff !important}
.offers-table tbody tr[data-status="wysłana"] td, .offers-table tbody tr[data-status="wyslana"] td{background:#dbeafe !important}
.offers-table tbody tr[data-status="zamówiona"] td, .offers-table tbody tr[data-status="zamowiona"] td{background:#fef3c7 !important}
.offers-table tbody tr[data-status="rozliczona"] td{background:#dcfce7 !important}


/* Дополнительные стили для строк с классом offer-row */
.offer-row[data-status="nowa"] td{background:#ffffff !important}
.offer-row[data-status="wysłana"] td, .offer-row[data-status="wyslana"] td{background:#dbeafe !important}
.offer-row[data-status="zamówiona"] td, .offer-row[data-status="zamowiona"] td{background:#fef3c7 !important}
.offer-row[data-status="rozliczona"] td{background:#dcfce7 !important}


/* Улучшенные стили для таблицы - УДАЛЕНО ДУБЛИРОВАНИЕ */

/* Улучшенные стили для селектов статусов */
.status-select {
  border: 1px solid #e2d5c6;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-select:hover {
  border-color: #dc5f00;
  box-shadow: 0 1px 4px rgba(220, 95, 0, 0.1);
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-width: 80px;
}

/* --- row actions (ikonki) --- */
.row-actions{display:flex;gap:8px;justify-content:flex-end}
.icon-btn{width:36px;height:36px;display:grid;place-items:center;border:1px solid #e3d3c2;border-radius:10px;background:#fff;cursor:pointer}
.icon-btn:hover{border-color:#dc5f00;box-shadow:0 1px 6px rgba(0,0,0,.08)}
.icon-btn img{width:18px;height:18px;display:block}


/* === OFFERS TOOLBAR === */

.offers-toolbar{
  display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;
  margin:12px 20px;
  width: calc(100% - 40px);
  box-sizing: border-box;
  margin-left: 20px;
  margin-right: 20px;
}
.offers-toolbar .ctrl{
  height:36px;border:1px solid #e3d3c2;border-radius:10px;padding:6px 10px;background:#fff
}
.tools-left{display:flex;gap:8px;flex-wrap:wrap}
.tools-right{display:flex;gap:8px;align-items:center}
.sort-btn{
  background:#fff;border:1px solid #e3d3c2;border-radius:10px;padding:6px 10px;cursor:pointer
}
.sort-btn.active{border-color:#dc5f00;box-shadow:0 1px 6px rgba(0,0,0,.06)}

.only-mine{display:inline-flex;gap:6px;align-items:center;user-select:none}

/* === EDITOR LAYOUT FIX (если ещё не добавлял) === */
#editor{padding:12px 16px}
.oferta-header{
  display:grid;
  grid-template-columns: repeat(3, minmax(220px,1fr));
  gap:12px;
  background:#fff;
  border:1px solid #eee;
  border-radius:12px;
  padding:12px;
  margin:10px 0 14px;
}
.oferta-row{display:flex;align-items:center;gap:8px}
.oferta-label{min-width:120px;opacity:.8;font-size:13px}
.oferta-input{width:100%;height:36px;border:1px solid #e3d3c2;border-radius:10px;padding:6px 10px;background:#fff}

.products{
  background:#fff;border:1px solid #eee;border-radius:12px;overflow:hidden
}
.products table{width:100%;border-collapse:collapse}
.products thead th{background:#dc5f00;color:#fff;padding:10px;border-radius:0}
.products tbody td{padding:10px;border-top:1px solid #f0e7dc}

.totals{
  display:flex;gap:16px;justify-content:flex-end;margin-top:10px;
  background:#fff;border:1px solid #eee;border-radius:12px;padding:10px 14px
}

/* DnD + выбор позиции вставки */
#selectedBody tr{cursor:default}
#selectedBody tr.dragging{opacity:.6}
#selectedBody tr.drop-over{outline:2px dashed #dc5f00}
#selectedBody tr.selected{box-shadow:inset 0 0 0 2px #dc5f00;background:#fff9f3}

/* Szerokości i ikonki w kolumnie Akcje */
.offers td.col-actions, .offers th:last-child { white-space: nowrap; text-align: left; }
.icon-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;border:1px solid #e3d3c2;border-radius:8px;
  background:#fff; cursor:pointer; margin-right:6px;
}
.icon-btn.danger{ border-color:#e9b1b1 }
.icon-btn svg{ width:16px;height:16px; }

/* czytelność klienta */
.offers td.col-client{ max-width:520px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* (опционально) выровнять шрифты заголовков/компактность */
.offers thead th{ font-weight:700; }


.icon-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;border:1px solid #e3d3c2;border-radius:8px;
  background:#fff; cursor:pointer; margin-right:6px;
}
.icon-btn.danger{ border-color:#e9b1b1 }
.offers td.col-client{ max-width:520px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Сообщения об ошибках и пустых результатах */
.error-message, .empty-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.error-message .error-icon, .empty-message .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.error-message {
  color: #9a2a2a;
}

.empty-message {
  color: #666;
}

.error-message small, .empty-message small {
  display: block;
  margin-top: 8px;
  opacity: 0.7;
  font-size: 12px;
}

/* LOGIN — центрируем и увеличиваем логотип */
.login-card{
  max-width: 460px;
  margin: 64px auto;
  padding: 28px 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
}

.login-logo.only-logo{
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.login-logo.only-logo img{
  width: 220px;          /* увеличенный размер логотипа */
  max-width: 80%;
  height: auto;
  display: block;
}

/* прячем тексты WZORCOWNIA и Logowanie, если где-то остались */
.login-logo b,
.login-title{ display: none !important; }

/* мелкие улучшения полей */
.login-input{
  width: 100%;
  height: 44px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #e9e1d6;
  border-radius: 10px;
  background: #fffaf5;
  outline: none;
}
.login-input:focus{ border-color:#d76e1d; box-shadow: 0 0 0 3px rgba(215,110,29,.12); }

.login-actions{
  display:flex; gap:10px; margin-top: 8px; justify-content: center;
}


/* ——— Login: большой логотип по центру, над полями ——— */
.login-card{
  max-width: 520px;
  margin: 72px auto;
  padding: 28px 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
}

#authBox .login-logo{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;   /* центрируем по горизонтали */
  margin: 6px 0 22px;        /* отступ над полями */
}

#authBox .login-logo img{
  width: 260px;              /* крупный логотип */
  max-width: 86%;
  height: auto;
  display: block;
}

@media (min-width: 768px){
  #authBox .login-logo img{ width: 400px; }
}

/* убираем тексты "WZORCOWNIA" и "Logowanie", если где-то остались */
.login-logo b,
.login-title{ display: none !important; }


/* ====== PANEL (menu page) ====== */
.panel-body{ 
  background: #fbf7f2; 
  width: 100%;
  max-width: none;
  overflow-x: hidden;
}

.panel-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

.menu-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.menu-card{
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  border-top: 6px solid #d76e1d;
  text-decoration: none;
  color: #1c1a19;
  transition: transform .15s ease, box-shadow .15s ease;
}
.menu-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0,0,0,.09);
}

.menu-ico{
  font-size: 28px;
  line-height: 1;
  margin-bottom: 10px;
}
.menu-title{
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}
.menu-desc{
  font-size: 13px;
  color: #6b625a;
}


/* Auth extras */
.pw-wrap{ position: relative; }
.pw-toggle{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  border:0; background:transparent; cursor:pointer; font-size:16px; line-height:1;
  opacity:.6;
}
.pw-toggle:hover{ opacity:1; }

.login-row{
  display:flex; justify-content:space-between; align-items:center;
  margin: 4px 0 10px;
}
.remember{ font-size: 13px; color:#51463f; }
.linklike{
  background:none; border:0; color:#d76e1d; cursor:pointer; font-size:13px; text-decoration:underline;
}

.auth-error{
  background:#fff1f0; color:#a32626; border:1px solid #ffc9c4;
  padding:8px 10px; border-radius:10px; font-size:13px; margin-bottom:10px;
}
.login-input:invalid{ border-color:#e07a7a; }


/* ===== Oferta header layout ===== */
.ofr-head{
  display:grid; grid-template-columns: 1fr 1fr; gap:16px;
  margin: 0;
}

/* ===== Специальные стили для формы оферты ===== */

/* Унифицированная ширина для всех элементов формы оферты */
.offers-container .offers-toolbar {
  margin: 0;
  padding: 16px 20px;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .ofr-head {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .ofr-form {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .filters-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5d7c7;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .filters-card .search-input-wrapper {
  flex: 1;
  margin: 0;
}

.offers-container .filters-card .btn {
  margin: 0;
  white-space: nowrap;
}

.offers-container .table-container {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .section-title {
  margin: 0 0 10px 0;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .offer-sticky {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Стили для группировки товаров по производителю */
.producer-group-header {
  background: linear-gradient(135deg, #d76e1d 0%, #c76519 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  margin: 0;
  border-radius: 8px 8px 0 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(215, 110, 29, 0.2);
}

.producer-group {
  margin-bottom: 20px;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.producer-group:last-child {
  margin-bottom: 0;
}

.producer-group .table-container {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.producer-group .offers-table {
  border-radius: 0;
  margin: 0;
}

.producer-group .offers-table thead {
  display: none;
}

.producer-group .offers-table tbody tr:first-child td {
  border-top: none;
}

.producer-group .offers-table tbody tr:last-child td {
  border-bottom: none;
}

/* Стили для сепараторов */
.separator-row {
  background: #fef3e2;
  border: 2px solid #d76e1d;
  border-radius: 8px;
  margin: 16px 0;
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  color: #d76e1d;
  font-size: 14px;
}

/* Кнопка переключения группировки - УДАЛЕНА */

/* Адаптивность для формы оферты */
@media (max-width: 768px) {
  .offers-container .filters-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .offers-container .filters-card .search-input-wrapper {
    flex: none;
  }
  
  .offers-container .filters-card .btn {
    width: 100%;
  }
  
  /* Адаптивность для формы */
  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-group {
    gap: 6px;
  }
  
  .form-input {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 16px !important;
  }
  
  /* Адаптивность для группировки */
  .producer-group-header {
    font-size: 13px;
    padding: 10px 12px;
  }
  
  .separator-row {
    font-size: 13px;
    padding: 10px 12px;
    margin: 12px 0;
  }
}
.ofr-form{
  background:#fff; border-radius:16px; padding:16px; box-shadow:0 10px 26px rgba(0,0,0,.06);
}
.ofr-row{ display:grid; grid-template-columns: 160px 1fr; align-items:center; gap:10px; margin:8px 0; }
.ofr-row span{ font-size:12px; font-weight:700; color:#6b625a; }
.firm-card{
  background:#fff; border-radius:16px; padding:18px; box-shadow:0 10px 26px rgba(0,0,0,.06);
  display:flex; flex-direction:column; align-items:flex-start;
}

/* ===== Search bar ===== */
.search-bar{ display:flex; gap:8px; align-items:center; margin: 0; }
.search-bar .ctrl{ flex:1; }

/* ===== Pretty selected table ===== */
table.pretty thead th{
  background:#d86f1f; color:#fff; border-radius:10px; padding:10px 8px;
  font-weight:700;
}
table.pretty tbody td{ padding:6px 8px; }
table.pretty tbody tr.selected{ outline:2px dashed #d86f1f; }
table.pretty tbody tr.dragging{ opacity:.6; }
table.pretty tbody tr.drop-over{ box-shadow: inset 0 0 0 2px #d86f1f; }


/* THEME */
:root{
  --brand:#d86f1f;
  --brand-d:#c76519;
  --bg:#f6f2ed;
  --card:#ffffff;
  --text:#2b221c;
  --muted:#6b625a;
}

/* Global header polish */
.topbar{ background:#fff; }
.topbar .brand img{ height:65px; width:auto; margin-right:10px; } /* Крупнее лого */
.topbar .user .btn{ margin-left:8px; }

/* Cards / layout */
.card{ background:var(--card); border-radius:16px; box-shadow:0 10px 26px rgba(0,0,0,.06); }
.toolbar.gap{ padding:12px 16px; display:flex; gap:8px; }

/* Firm card right aligned */
.firm-card{ text-align:right; align-items:flex-end; padding:22px; }
.firm-logo{ width:150px; height:auto; margin:6px 0 12px; filter:contrast(1.1); }
.firm-name{ font-weight:800; letter-spacing:.3px; margin-bottom:6px; }
.firm-lines{ color:#51463f; font-size:18px; line-height:1.8; }

/* Oferta form layout */
.ofr-head{ 
  display: block !important; 
  margin: 20px !important; 
  width: calc(100% - 40px) !important;
  box-sizing: border-box !important;
}

.ofr-form{ 
  background: linear-gradient(135deg, #fff 0%, #faf9f5 100%);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(215, 110, 29, 0.15);
  position: relative;
  overflow: hidden;
  width: 100% !important;
  box-sizing: border-box !important;
}

.ofr-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d76e1d 0%, #f59e0b 100%);
}

/* Стильные поля ввода для формы оферты */
.ofr-form input[type="text"],
.ofr-form input[type="email"],
.ofr-form input[type="tel"],
.ofr-form input[type="date"],
.ofr-form textarea,
.ofr-form select {
  height: 36px !important;
  padding: 8px 12px !important;
  border: 2px solid #e8e4dd !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  background: #fff !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}

/* Унифицированная ширина для всех полей формы */
.ofr-form input[id="orderNr"],
.ofr-form input[type="date"],
.ofr-form input[id="fvPhone"],
.ofr-form input[type="text"],
.ofr-form input[type="email"],
.ofr-form input[type="tel"] {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Дополнительная специфичность для поля orderNr */
input[id="orderNr"],
.form-input[id="orderNr"],
.ofr-form input[id="orderNr"] {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.ofr-form input[type="text"]:focus,
.ofr-form input[type="email"]:focus,
.ofr-form input[type="tel"]:focus,
.ofr-form input[type="date"]:focus,
.ofr-form textarea:focus,
.ofr-form select:focus {
  outline: none !important;
  border-color: #d76e1d !important;
  box-shadow: 0 0 0 3px rgba(215, 110, 29, 0.1) !important;
}

.ofr-form textarea {
  height: auto !important;
  min-height: 80px !important;
  resize: vertical !important;
  line-height: 1.4 !important;
}

/* Стили для новой структуры формы */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
  position: relative;
  width: 100%;
}

/* Минималистичная группировка */
.form-group:has(input[id="orderNr"]),
.form-group:has(input[id="offerDate"]),
.form-group:has(input[id="offerValid"]) {
  margin-bottom: 6px;
}

.form-group:has(input[id="fvData"]),
.form-group:has(input[id="fvEmail"]),
.form-group:has(input[id="fvPhone"]) {
  margin-bottom: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  line-height: 1.1;
}

.form-input {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 6px 10px !important;
  border: 1px solid #e2d5c6 !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  background: #fff !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease !important;
  font-family: inherit !important;
  line-height: 1.2 !important;
}

.form-input:focus {
  outline: none;
  border-color: #dc5f00;
}

/* Простая валидация */
.form-input:invalid {
  border-color: #b33a38;
}

/* Стили для сообщений валидации */
.validation-message {
  font-size: 11px;
  margin-top: 2px;
  min-height: 14px;
  color: #666;
}

/* Простые стили для полей */
.form-input[type="date"] {
  position: relative;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  line-height: 1.2 !important;
}

/* Унифицированная ширина для всех полей */
.form-group .form-input {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Дополнительная специфичность для всех полей формы */
.form-group input,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"] {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.form-group:has(input[id="deliveryAddress"]) .form-input {
  width: 350px;
}

.form-group:has(input[id="designerName"]) .form-input {
  width: 280px;
}

/* Стили для рядов */
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
  margin-bottom: 0;
}

/* Ряд 1: Номер заказа, Дата, Важна до */
.form-row:has(input[id="orderNr"]) {
  gap: 20px;
}

/* Ряд 2: Данные для ФВ, Email, Телефон */
.form-row:has(input[id="fvData"]) {
  gap: 20px;
}

/* Ряд 3: Адрес доставки, Проектант */
.form-row:has(input[id="deliveryAddress"]) {
  gap: 20px;
}

.ofr-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d76e1d 0%, #f59e0b 100%);
}

.ofr-row{ 
  display: grid; 
  grid-template-columns: 160px 1fr; 
  align-items: center; 
  gap: 8px; 
  margin: 1px 0; 
}
.ofr-row span{ 
  font-size: 13px; 
  font-weight: 600; 
  color: #666; 
  line-height: 1.2;
}
.oferta-input{ 
  height: 32px !important; 
  min-height: 32px !important;
  max-height: 32px !important;
  border: 1px solid #e2d5c6 !important; 
  border-radius: 6px !important; 
  padding: 0 10px !important; 
  background: #fff !important; 
  font-size: 13px !important;
  transition: border-color 0.2s ease !important;
  line-height: 1.2 !important;
}

/* Buttons — единый стиль (обновлено) */
.btn{ 
  appearance:none; 
  border:0; 
  border-radius:12px; 
  padding:12px 20px; 
  font-weight:600; 
  cursor:pointer; 
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary{ 
  background: linear-gradient(135deg, #d76e1d 0%, #c76519 100%);
  color:#fff; 
  box-shadow:0 4px 12px rgba(215,110,29,.25); 
  /* Убираем лишние отступы */
  margin: 0;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover{ 
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(215,110,29,.35);
}
.btn-secondary{ 
  background:#fff; 
  color:#374151; 
  border:1px solid #e5d7c7; 
}
.btn-secondary:hover:not(:disabled){ 
  border-color: #d76e1d;
  color: #d76e1d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.btn-danger{ 
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color:#fff; 
  box-shadow: 0 4px 12px rgba(239,68,68,.25);
}
.btn-danger:hover{ 
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239,68,68,.35);
}
.btn:disabled{ 
  opacity:0.5; 
  cursor:not-allowed; 
  transform: none !important;
  box-shadow: none !important;
}

/* Search bar — фирменный */
.search-wrap{ margin: 4px 16px 10px; padding:10px; display:flex; gap:10px; align-items:center; }
.search-icon{ font-size:18px; margin:0 6px 0 4px; }
.search-input{ flex:1; height:36px; border-radius:999px; border:1px solid #efd6c5; background:#fff; padding:0; font-size: 13px; }
.search-input:focus{ outline:2px solid #ffd7bf; }

/* Tables — «WOW» */
.tbl{ width:100%; border-collapse:separate; border-spacing:0 8px; }
.tbl thead th{
  position:sticky; top:0; z-index:1;
  background:linear-gradient(180deg, var(--brand) 0%, var(--brand-d) 100%);
  color:#fff; padding:10px 10px; text-align:left; font-weight:800; letter-spacing:.2px;
  border-radius:12px;
}
.tbl tbody td{ background:#fff; padding:10px 10px; border-top:1px solid #f1e6df; border-bottom:1px solid #f1e6df; }
.tbl tbody tr td:first-child{ border-left:1px solid #f1e6df; border-top-left-radius:12px; border-bottom-left-radius:12px; }
.tbl tbody tr td:last-child{ border-right:1px solid #f1e6df; border-top-right-radius:12px; border-bottom-right-radius:12px; }
.tbl tbody tr:hover td{ background:#fff9f4; }
.tbl tbody tr.selected td{ outline:2px dashed var(--brand); }

/* Totals badge */
.totals{ margin:10px 16px 24px; padding:10px 14px; display:flex; gap:18px; font-weight:800; }
.totals span{ color:var(--brand-d); }

/* Small polish */
.section-title{ 
  margin: 0 0 6px 0; 
  width: 100%;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}


/* ===== Offer tables: compact headers & OPIS widest ===== */
.tbl--compact thead th{
  padding: 8px 8px;
  font-size: 13px;
  line-height: 1.2;
}
.tbl--compact tbody td{
  padding: 6px 8px;
  font-size: 13px;
}

/* Selected items: OPIS (4-я колонка) — авто/шире остальных */
#selectedBody td:nth-child(4){ white-space: normal; }
#selectedBody td:nth-child(4) .oferta-input{ width: 100%; }

/* Search results: фоллбэк-ширины, если colgroup не вставился */
#productBody td:nth-child(2), .products thead th:nth-child(2){ width: 7rem; }   /* Kod */
#productBody td:nth-child(3), .products thead th:nth-child(3){ width: auto; }   /* Nazwa (аналог OPIS) */
#productBody td:nth-child(4), .products thead th:nth-child(4){ width: 10rem; }  /* Producent */
#productBody td:nth-child(5), .products thead th:nth-child(5){ width: 7.5rem; } /* Cena netto */
#productBody td:nth-child(6), .products thead th:nth-child(6){ width: 6rem; }   /* Rabat */
#productBody td:nth-child(7), .products thead th:nth-child(7){ width: 6rem; text-align:left; } /* Akcja */

/* Чуть скруглим углы у липкой шапки для красоты */
.tbl thead th:first-child{ border-top-left-radius:12px; }
.tbl thead th:last-child { border-top-right-radius:12px; }


/* Убрать «пилюли» на заголовках выбранных таблиц */
.tbl--flat thead th{
  border-radius: 0 !important;
}
.tbl--flat thead th:first-child,
.tbl--flat thead th:last-child{
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

/* 1) Спрятать «пунктиры» при клике по фону таблицы, оставить аккуратный фокус у инпутов */
.tbl *:focus { outline: none !important; }
.oferta-input:focus {
  outline: none;
  border-color: #dc5f00;
}



/* убить пунктиры, которые рисуются на tr/td при :focus / :focus-within */
.tbl tr:focus,
.tbl tr:focus-within,
.tbl td:focus,
.tbl td:focus-within,
.tbl th:focus,
.tbl th:focus-within { outline: none !important; box-shadow: none !important; }

/* если где-то задаётся dashed на границах при фокусе — принудительно solid */
.tbl tbody tr:focus-within > td {
  border-top-style:    solid !important;
  border-right-style:  solid !important;
  border-bottom-style: solid !important;
  border-left-style:   solid !important;
  border-image: none !important;
}



/* убираем dashed/outline/псевдо-рамки у строки таблицы при фокусе */
table.tbl.tbl--compact tbody tr:focus,
table.tbl.tbl--compact tbody tr:focus-within,
table.tbl tbody tr:focus,
table.tbl tbody tr:focus-within{
  outline: none !important;
  box-shadow: none !important;
}
table.tbl.tbl--compact tbody tr:focus-within td,
table.tbl tbody tr:focus-within td,
#selectedBody tr:focus-within td{
  border-style: solid !important;
  border-image: none !important;
  box-shadow: none !important;
}
table.tbl tbody tr:focus-within::before,
table.tbl tbody tr:focus::before{
  content: none !important;
}


/* === HOTFIX: убрать пунктиры и выровнять липкие суммы === */

/* анти-пунктиры на строках таблиц */
.tbl *:focus{ outline: none !important; }
.tbl tr:focus, .tbl tr:focus-within,
.tbl td:focus, .tbl td:focus-within,
.tbl th:focus, .tbl th:focus-within{
  outline: none !important;
  box-shadow: none !important;
}
.tbl tbody tr:focus-within > td{
  border-style: solid !important;
  border-image: none !important;
  box-shadow: none !important;
}

/* не показываем dashed у выбранной строки и drop-over */
.tbl tbody tr.selected,
.tbl tbody tr.selected td{
  outline: none !important;
  box-shadow: inset 0 0 0 2px rgba(216,111,31,.18) !important;
}
#selectedBody tr.drop-over{
  outline: 0 !important;
  box-shadow: inset 0 0 0 2px rgba(216,111,31,.35) !important;
}

/* шапка таблицы без «пилюль», как просил */
.tbl--flat thead th{
  border-radius: 0 !important;
}




/* Sticky totals: один общий контейнер без фона у внутренних обёрток */
.offer-sticky{
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
  padding: 12px 20px;
  white-space: nowrap;
  line-height: 1;
  background:
    linear-gradient(180deg, rgba(250,247,242,0) 0%, rgba(250,247,242,1) 40%),
    #FAF7F2;
  border-top: 1px solid rgba(0,0,0,.06);
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.offer-sticky .totals,
.offer-sticky > div,
.offer-sticky > section{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.offer-sticky b{ font-weight: 800; margin-left: 6px; line-height: 1; }
.offer-sticky-pad{ padding-bottom: 0; }


/* Row scroll offset so last row isn't hidden under sticky totals */
#selectedBody tr{ scroll-margin-bottom: 0; }

/* При выборе строки — без «разделителей» */
.tbl tbody tr.selected td{
  background:#fff8f1;
  outline:none !important;
  box-shadow:none !important;  /* ← убрали некрасивые бордюры */
}

/* Перетаскивание — мягкая подсветка без пунктиров */
#selectedBody tr.drop-over{
  outline:0 !important;
  box-shadow: inset 0 0 0 2px rgba(216,111,31,.25) !important;
}

/* Drag handle */
.row-actions-cell{
  white-space: nowrap;
}
.row-grip{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; margin-left:8px; margin-right:4px;
  border:1px solid #e3d3c2; border-radius:8px; background:#fff;
  cursor: grab;
}
.row-grip:active{ cursor: grabbing; }
.row-grip:hover{ border-color: var(--brand); box-shadow:0 1px 6px rgba(0,0,0,.08); }


/* --- kill black separators on focus in selected table --- */
#selectedBody tr:focus,
#selectedBody tr:focus-within{
  outline: none !important;
  box-shadow: none !important;
}

#selectedBody tr:focus-within > td,
#selectedBody tr:focus > td{
  outline: none !important;
  box-shadow: none !important;
  border-style: solid !important;
  border-image: initial !important;
  border-top-color:    #f1e6df !important;
  border-bottom-color: #f1e6df !important;
  border-left: 0 !important;
  border-right: 0 !important;
}

/* вернуть нормальные края только первому/последнему столбцу */
#selectedBody tr:focus-within > td:first-child{ border-left: 1px solid #f1e6df !important; }
#selectedBody tr:focus-within > td:last-child { border-right:1px solid #f1e6df !important; }

/* на всякий — если где-то остался selected */
table.tbl tbody tr.selected td{
  outline:none !important;
  box-shadow:none !important;
  border-color:#f1e6df !important;
}

/* Убираем чёрные разделители при фокусе в таблице результатов */
#productBody tr:focus,
#productBody tr:focus-within{
  outline:none !important;
  box-shadow:none !important;
}
#productBody tr:focus-within > td,
#productBody tr:focus > td{
  outline:none !important;
  box-shadow:none !important;
  border-style: solid !important;
  border-image: initial !important;
  border-top-color:#f1e6df !important;
  border-bottom-color:#f1e6df !important;
  border-left:0 !important;
  border-right:0 !important;
}
#productBody tr:focus-within > td:first-child{ border-left:1px solid #f1e6df !important; }
#productBody tr:focus-within > td:last-child { border-right:1px solid #f1e6df !important; }


/* Designers: убрать чёрные бордеры/аутлайны у строк при фокусе */
#designersBody tr:focus,
#designersBody tr:focus-within,
#designersBody td:focus,
#designersBody td:focus-within {
  outline: none !important;
  box-shadow: none !important;
}
#designersBody tr:focus-within > td {
  border-style: inherit !important;  /* отмена принудительного solid */
  border-image: none !important;
}
#designersBody tr:focus::before,
#designersBody tr:focus-within::before {
  content: none !important;
}


/* Autocomplete dropdown for designers */
.suggest{position:absolute;left:0;right:0;top:calc(100% + 6px);background:#fff;border:1px solid #eee;border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.08); max-height:240px; overflow:auto; z-index:10}
.suggest.hidden{display:none}
.suggest-item{padding:8px 10px; cursor:pointer}
.suggest-item:hover{background:#fff7ef}


/* Сетка строки формы: метка + поле */
.oferta-row{
  display:grid;
  grid-template-columns: 170px 1fr;  /* фиксированная ширина колонки слева */
  align-items:center;
  gap:10px;
}
.oferta-label{ min-width:170px; font-size:12px; font-weight:700; color:#6b625a; }
.oferta-field{ position:relative; width:100%; }
.oferta-field .oferta-input{ width:100%; box-sizing:border-box; }

/* автокомплит проектанта */
.suggest{position:absolute; left:0; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #eee1d8; border-radius:10px;
  box-shadow:0 10px 26px rgba(0,0,0,.08); max-height:240px; overflow:auto; z-index:10}
.suggest.hidden{display:none}
.suggest-item{padding:8px 10px; cursor:pointer}
.suggest-item:hover{background:#fff7ef}


/* ===== Oferta: выравнивание строки проектанта ===== */
.ofr-row{
  display:grid;
  grid-template-columns:170px 1fr;
  align-items:center;
  gap:10px;
}
.oferta-field{ position:relative; width:100%; }
.oferta-field .oferta-input{ width:100%; box-sizing:border-box; }

/* Autocomplete dropdown */
.suggest{position:absolute; left:0; right:0; top:calc(100% + 6px); background:#fff;
  border:1px solid #eee1d8; border-radius:10px; box-shadow:0 10px 26px rgba(0,0,0,.08);
  max-height:240px; overflow:auto; z-index:10}
.suggest.hidden{display:none}
.suggest-item{padding:8px 10px; cursor:pointer}
.suggest-item:hover{background:#fff7ef}

/* ===== Footer: Uwagi + Totals ===== */
.offer-sticky{
  position: relative; bottom: auto; z-index: 1;
  display: flex; align-items: flex-start; gap: 24px;
  padding: 12px 16px;
  background:
    linear-gradient(180deg, rgba(250,247,242,0) 0%, rgba(250,247,242,1) 40%),
    #FAF7F2;
  border-top: 1px solid rgba(0,0,0,.06);
}
.offer-sticky-pad{ height: 88px; }   /* отступ, чтобы футер не перекрывал строки */

.offer-notes{ flex: 1 1 auto; }
#offerNotes{
  width:70%; min-height:36px; max-height:160px; resize:none;
  border:1px solid #eee1d8; border-radius:10px; padding:8px 10px; background:#fff;
  font:inherit; box-sizing:border-box;
}

.offer-totals{ display:flex; gap:24px; align-items:center; white-space:nowrap; line-height:1; }
.offer-totals b{ margin-left:6px; }

/* ===== Подсветка опций по строкам ===== */
#selectedBody tr[data-opt="1"] td { background:#eaf5ff; }
#selectedBody tr[data-opt="2"] td { background:#eafaf1; }
#selectedBody tr[data-opt="3"] td { background:#fff3e6; }
#selectedBody tr[data-opt="4"] td { background:#f3eaff; }

.badge-opt{
  display:inline-block; padding:4px 8px; border-radius:999px;
  font-weight:700; font-size:12px; color:#5b534b; background:#f1e6d9; opacity:.9; margin-left:8px;
}

/* Separator row (pomieszczenie) */
tr.sep td { padding: 0 !important; border: 0 !important; background: transparent !important; }
.sep-wrap {
  display:flex; align-items:center; gap:8px;
  padding: 6px 8px; margin: 6px 0;
  background: #fff; border:1px dashed #e3d3c2; border-radius: 10px;
}

/* Кнопки действий в сепараторах */
.sep-wrap .action-btn {
  margin-right: 4px !important;
  min-width: 32px !important;
  flex-shrink: 0 !important;
  width: 32px !important;
  height: 32px !important;
}
.sep-input{
  flex:1; height: 34px; padding: 0 10px;
  border:1px solid #e7dbcc; border-radius: 8px; background:#fffdf8;
  font-weight:700; text-align:center;
}
.sep-input:focus{ outline:none; box-shadow:0 0 0 3px rgba(215,110,29,.12); border-color:#d76e1d; }

/* Flash highlight of newly added rows */
#selectedBody tr.flash td {
  animation: flashRow 1.2s ease-in-out;
}
@keyframes flashRow {
  0%   { background-color:#fff6e9; }
  100% { background-color:transparent; }
}

/* Grip look consistent */
.row-grip { cursor:grab; user-select:none; padding:2px 6px; border:1px solid #e3d3c2; border-radius:6px; background:#fff; }
.row-grip:active { cursor:grabbing; }


/* Примеры — подстройте цвета под себя */
tr.row--status-nowa      { background: #fff7e6; }
tr.row--status-wyslana   { background: #eaf4ff; }
tr.row--status-zaakceptowana { background: #eaffea; }
tr.row--status-odrzucona { background: #ffeaea; }

/* ===== НОВАЯ СТРАНИЦА OFFERS ===== */

/* Основной контейнер */
.offers-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Панель инструментов */
.offers-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 16px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  border: 1px solid #f0e7dc;
  width: 100%;
  box-sizing: border-box;
  /* Убираем лишние отступы */
  margin-left: 0;
  margin-right: 0;
}

.tools-left {
  display: flex;
  gap: 12px;
  align-items: center;
  /* Убираем лишние отступы */
  margin: 0;
  padding: 0;
}

.tools-right {
  display: flex;
  align-items: center;
  /* Убираем лишние отступы */
  margin: 0;
  padding: 0;
}

.results-info {
  font-size: 14px;
  color: #6b625a;
  font-weight: 500;
  /* Убираем лишние отступы */
  margin: 0;
  padding: 0;
}

/* Карточка фильтров */
.filters-card {
  background: linear-gradient(135deg, #fff 0%, #faf9f5 100%);
  border-radius: 20px;
  padding: 32px;
  margin: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(215, 110, 29, 0.15);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.filters-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d76e1d 0%, #f59e0b 100%);
}

.filters-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr auto auto auto auto;
  gap: 16px;
  align-items: start;
}

/* Адаптивность для фильтров */
@media (max-width: 1400px) {
  .filters-grid {
    grid-template-columns: 1fr 1.5fr 1.5fr auto auto auto auto;
  }
}

@media (max-width: 1200px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr auto auto auto auto;
  }
  
  .filter-group:has(.quick-filters-inline) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1000px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr auto auto auto;
  }
}

@media (max-width: 800px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr auto auto;
  }
}

@media (max-width: 600px) {
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .filter-group:has(.quick-filters-inline) {
    grid-column: 1;
  }
  
  .quick-filters-inline {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .quick-filters-inline .quick-filter-btn {
    flex: 1 1 calc(50% - 3px);
    min-width: 80px;
    font-size: 10px;
    padding: 4px 6px;
  }
}

@media (max-width: 400px) {
  .quick-filters-inline .quick-filter-btn {
    flex: 1 1 100%;
    min-width: 60px;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-label {
  font-size: 11px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* Поле поиска */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s ease;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 12px 16px !important;
  border: 1px solid #e2d5c6;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.4;
  text-indent: 24px !important;
  min-height: 48px;
}

.search-input:focus {
  outline: none;
  border-color: #dc5f00;
}

.search-input:focus + .search-icon {
  color: #d76e1d;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s ease;
  z-index: 10;
}

.search-clear:hover {
  background: #d76e1d;
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

/* Селекты и инпуты */
.filter-select,
.filter-input {
  height: 32px;
  padding: 6px 10px;
  border: 1px solid #e2d5c6;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  width: 100%;
}

.filter-select:hover,
.filter-input:hover {
  border-color: #dc5f00;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: #dc5f00;
  box-shadow: 0 0 0 2px rgba(220, 95, 0, 0.1);
}

/* Специфичные ширины для полей фильтров */
.filter-group:has(input[id="fltFrom"]) .filter-input,
.filter-group:has(input[id="fltTo"]) .filter-input {
  width: 120px;
}

/* Размеры для селектов */
#fltDesigner,
#fltStatus {
  min-width: 140px;
}

/* Размер для чекбокса */
.filter-group:has(.only-mine-checkbox) {
  min-width: 160px;
}

/* Поиск */
.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  padding: 12px 16px !important;
  width: 100%;
  min-height: 48px;
  height: 48px;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 8px;
}

/* Контейнер таблицы */
.table-container {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.1);
  border: 1px solid rgba(215, 110, 29, 0.1);
  margin: 0 20px 20px;
  position: relative;
  width: calc(100% - 40px);
  box-sizing: border-box;
}

.table-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d76e1d, #e85d04, #f48c06, #faa307);
  z-index: 1;
}

/* Таблица оферт */
.offers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  background: white;
  table-layout: fixed;
  /* Предотвращение переполнения */
  min-width: 800px;
  max-width: none;
}

/* Скругления для последней строки таблицы */
.offers-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px !important;
}

.offers-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px !important;
}

/* Принудительные стили для кнопок действий */
#selectedTable tbody tr .action-buttons {
  min-width: 120px !important;
  gap: 6px !important;
  padding: 8px !important;
  justify-content: center !important;
  align-items: center !important;
}

#selectedTable tbody tr .action-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  margin-right: 4px !important;
}

/* Ширина колонок для таблицы выбранных продуктов */
#selectedTable th:nth-child(1) { width: 4%; }   /* LP. */
#selectedTable th:nth-child(2) { width: 7%; }   /* KOD */
#selectedTable th:nth-child(3) { width: 7%; }   /* PRODUCENT */
#selectedTable th:nth-child(4) { width: 25%; }  /* OPIS - самая широкая */
#selectedTable th:nth-child(5) { width: 5%; }   /* ILOŚĆ */
#selectedTable th:nth-child(6) { width: 4%; }   /* JM */
#selectedTable th:nth-child(7) { width: 5%; }   /* CENA NETTO */
#selectedTable th:nth-child(8) { width: 5%; }   /* RABAT */
#selectedTable th:nth-child(9) { width: 9%; }   /* CENA PO RABACIE */
#selectedTable th:nth-child(10) { width: 9%; }  /* WARTOŚĆ NETTO */
#selectedTable th:nth-child(11) { width: 7%; }  /* BRUTTO ZA S */
#selectedTable th:nth-child(12) { width: 12%; }  /* Действия - увеличена ширина */

/* Ширина ячеек для таблицы выбранных продуктов */
#selectedTable td:nth-child(1) { width: 4%; }   /* LP. */
#selectedTable td:nth-child(2) { width: 7%; }   /* KOD */
#selectedTable td:nth-child(3) { width: 7%; }   /* PRODUCENT */
#selectedTable td:nth-child(4) { width: 25%; }  /* OPIS - самая широкая */
#selectedTable td:nth-child(5) { width: 5%; }   /* ILOŚĆ */
#selectedTable td:nth-child(6) { width: 4%; }   /* JM */
#selectedTable td:nth-child(7) { width: 5%; }   /* CENA NETTO */
#selectedTable td:nth-child(8) { width: 5%; }   /* RABAT */
#selectedTable td:nth-child(9) { width: 9%; }   /* CENA PO RABACIE */
#selectedTable td:nth-child(10) { width: 9%; }  /* WARTOŚĆ NETTO */
#selectedTable td:nth-child(11) { width: 7%; }  /* BRUTTO ZA S */
#selectedTable td:nth-child(12) { width: 12%; }  /* Действия - увеличена ширина */

.offers-table thead th {
  background: #dc5f00;
  color: #fff;
  padding: 6px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 0;
}

.offers-table thead th:first-child {
  border-radius: 8px 0 0 8px;
}

.offers-table thead th:last-child {
  border-radius: 0 8px 8px 0;
  /* Гарантируем видимость колонки действий */
  min-width: 140px;
  position: sticky;
  right: 0;
  background: #dc5f00;
  z-index: 20;
}

.offers-table tbody td:last-child {
  /* Гарантируем видимость ячейки действий */
  min-width: 140px;
  position: sticky;
  right: 0;
  background: white;
  z-index: 15;
  border-left: none;
}





.offers-table tbody td {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(215, 110, 29, 0.1);
  vertical-align: middle;
  transition: all 0.2s ease;
  position: relative;
}

.offers-table tbody td:first-child {
  border-left: 3px solid transparent;
}

.offers-table tbody tr:hover td:first-child {
  border-left-color: #d76e1d;
}

.offers-table tbody tr {
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}



.offers-table tbody tr:nth-child(even)[data-status="nowa"] {
  background: rgba(249, 250, 251, 0.8);
}



.offers-table tbody tr:hover {
  background: #f8f9fa !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Колонки таблицы */
.offer-date {
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.offer-number {
  font-weight: 700;
  color: #d76e1d;
  font-family: 'Courier New', monospace;
}

.offer-buyer {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-designer {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
}

.offer-net,
.offer-gross {
  text-align: right;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #059669;
}

.offer-gross {
  color: #d76e1d;
}

/* Бейджи статусов */
.status-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.status-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.status-badge:hover::before {
  left: 100%;
}

.status-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Кнопки действий */
.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-btn {
  width: 40px !important;
  height: 40px !important;
  border: 2px solid #e5d7c7 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #fff 0%, #faf9f5 100%) !important;
  color: #6b7280 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  position: relative !important;
  overflow: hidden !important;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:hover {
  border-color: #d76e1d;
  color: #d76e1d;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(215,110,29,.2);
  background: linear-gradient(135deg, #fff 0%, #fef3c7 100%);
}

.action-btn.action-view:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.action-btn.action-pdf:hover {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-color: #ef4444;
  color: #ef4444;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.2);
}

.action-btn.action-excel:hover {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #16a34a;
  color: #16a34a;
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.2);
}

.action-btn.action-excel-subject:hover {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #16a34a;
  color: #16a34a;
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.2);
}

.action-btn.action-excel-order:hover {
  background: linear-gradient(135deg, #fef3e2 0%, #fed7aa 100%);
  border-color: #d76e1d;
  color: #d76e1d;
  box-shadow: 0 8px 25px rgba(215, 110, 29, 0.2);
}

.action-btn.action-edit:hover {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #0ea5e9;
  color: #0ea5e9;
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.2);
}

.action-btn.action-delete:hover {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-color: #dc2626;
  color: #dc2626;
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.2);
}

/* Улучшенные стили для touch устройств */
@media (hover: none) and (pointer: coarse) {
  .offers-table tbody tr .action-btn:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  .offers-table tbody tr .action-btn:active {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
    border-color: #9ca3af !important;
    color: #1f2937 !important;
    transform: scale(0.95) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }
  
  .action-btn.action-view:active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
  }
  
  .action-btn.action-pdf:active {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%) !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
  }
  
  .action-btn.action-excel:active {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    border-color: #15803d !important;
    color: #15803d !important;
  }
  
  .action-btn.action-excel-subject:active {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    border-color: #15803d !important;
    color: #15803d !important;
  }
  
  .action-btn.action-excel-order:active {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%) !important;
    border-color: #c65d21 !important;
    color: #c65d21 !important;
  }
  
  .action-btn.action-edit:active {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
  }
  
  .action-btn.action-delete:active {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%) !important;
    border-color: #b91c1c !important;
    color: #b91c1c !important;
  }
}

/* Состояние загрузки для кнопок */
.action-btn.btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.action-btn.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Кликабельные строки таблицы */
.offers-table tbody tr {
  cursor: default;
  transition: all 0.2s ease;
}

/* Заголовки с сортировкой */
.offers-table thead th {
  cursor: default;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.offers-table thead th:hover {
  background: #dc5f00;
}

.offers-table thead th.sortable::after {
  content: '↕';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.offers-table thead th.sortable:hover::after {
  opacity: 1;
}

.offers-table thead th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: #d76e1d;
}

.offers-table thead th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: #d76e1d;
}



.offers-table tbody tr:hover {
  background: #f8f9fa !important;
}

.offers-table tbody tr:active {
  background: #f1f3f4 !important;
}

/* Исключаем кнопки действий из кликабельности строки */
.offers-table tbody tr .action-buttons {
  cursor: default;
  display: flex !important;
  gap: 3px !important; /* Уменьшаем gap */
  padding: 6px 8px !important; /* Уменьшаем правый отступ */
  min-width: 100px !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
  justify-content: flex-start !important; /* Выравниваем по левому краю с отступом */
  align-items: center !important;
  position: relative !important;
  z-index: 100 !important;
  /* Улучшенная поддержка touch */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Предотвращение переполнения */
  overflow: hidden;
}

.offers-table tbody tr .action-btn {
  cursor: pointer !important;
  position: relative;
  z-index: 10;
  width: 32px !important;
  height: 32px !important;
  border: 1px solid #e5d7c7 !important;
  border-radius: 6px !important;
  background: linear-gradient(135deg, #fff 0%, #faf9f5 100%) !important;
  color: #6b7280 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  position: relative !important;
  overflow: hidden !important;
  margin-right: 2px !important; /* Уменьшаем отступ между кнопками */
  min-width: 32px !important;
  max-width: 32px !important;
  flex-shrink: 0 !important;
  /* Улучшенная поддержка touch */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Улучшенная доступность */
  user-select: none;
  -webkit-user-select: none;
  /* Предотвращение переполнения */
  box-sizing: border-box;
}

/* Сообщения загрузки и ошибок */
.loading-message,
.empty-message,
.error-message {
  text-align: center;
  padding: 80px 20px;
  color: #6b7280;
  background: linear-gradient(135deg, #faf9f5 0%, #fef3c7 100%);
  border-radius: 12px;
  margin: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(215, 110, 29, 0.1);
}

.empty-message {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: rgba(14, 165, 233, 0.1);
}

.error-message {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(215, 110, 29, 0.1);
  border-top: 4px solid #d76e1d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(215, 110, 29, 0.2);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-message span,
.empty-message span,
.error-message span {
  display: block;
  font-size: 16px;
  font-weight: 500;
}

.empty-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
  display: block;
}

.error-icon {
  animation: pulse 2s infinite;
}

.empty-icon {
  animation: bounce 2s infinite;
}

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Пагинация */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #fff 0%, #faf9f5 100%);
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,.08);
  border: 1px solid rgba(215, 110, 29, 0.1);
  position: relative;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.pagination::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d76e1d, #e85d04, #f48c06);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.pagination-info {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  gap: 12px;
}

.pagination-controls .btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}

.pagination-controls .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Модальное окно удаления */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #374151;
}

.modal-body {
  padding: 20px 24px;
}

.modal-body p {
  margin: 0 0 8px;
  color: #374151;
  font-size: 16px;
}

.modal-details {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 0 24px 20px;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  border: 1px solid #e5e7eb;
  z-index: 1001;
  animation: notificationSlideIn 0.3s ease;
}

@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  min-width: 300px;
}

.notification-success {
  border-left: 4px solid #10b981;
}

.notification-error {
  border-left: 4px solid #ef4444;
}

.notification-info {
  border-left: 4px solid #3b82f6;
}

.notification-close {
  width: 24px;
  height: 24px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
}

.notification-close:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Чекбокс "Tylko moje" */
.only-mine-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 16px;
  border: 1px solid #e2d5c6;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s ease;
  min-height: 48px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.4;
  user-select: none;
  width: 100%;
  justify-content: flex-start;
  min-width: 160px;
}

.only-mine-checkbox:hover {
  border-color: #dc5f00;
}

.only-mine-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #dc5f00;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.only-mine-checkbox span {
  font-weight: 500;
  line-height: 1.2;
  font-size: 13px;
  white-space: nowrap;
}

/* Селект статуса */
.status-select {
  background: inherit;
  color: inherit;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 140px;
  min-height: 44px;
}

.status-select:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.status-select:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.status-select option {
  background: white;
  color: #333;
  font-weight: 500;
  padding: 8px;
}

.status-select:focus {
  box-shadow: 0 0 0 2px rgba(215,110,29,.2);
}

/* Кнопка редактирования */
.action-btn.action-edit:hover {
  background: #f0f9ff;
  border-color: #0ea5e9;
  color: #0ea5e9;
}

.action-btn.action-excel:hover {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #16a34a;
}

/* Форма проектировщиков */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  position: relative;
  z-index: 1;
}

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

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

.form-group:nth-child(3) {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 11px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.form-input {
  height: 52px;
  padding: 0 20px;
  border: 2px solid #e5d7c7;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-input:hover {
  border-color: #d76e1d;
  box-shadow: 0 4px 16px rgba(215, 110, 29, 0.1);
}

.form-input:focus {
  outline: none;
  border-color: #d76e1d;
  box-shadow: 0 0 0 4px rgba(215, 110, 29, 0.15), 0 4px 16px rgba(215, 110, 29, 0.1);
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.form-input.success {
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.validation-message {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  min-height: 16px;
  transition: all 0.3s ease;
}

.validation-message.error {
  color: #ef4444;
}

.validation-message.success {
  color: #16a34a;
}

.validation-message.info {
  color: #6b7280;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5d7c7;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f3f4f6;
}

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

.autocomplete-item:hover {
  background: #f9fafb;
}

.autocomplete-item:active {
  background: #f3f4f6;
}

/* Стили для таблицы проектировщиков */
.designer-number {
  font-weight: 600;
  color: #6b7280;
  text-align: center;
}

.designer-lastname {
  font-weight: 700;
  color: #1f2937;
}

.designer-firstname {
  font-weight: 600;
  color: #374151;
}

.designer-bureau {
  color: #6b7280;
  font-style: italic;
}

.designer-phone {
  font-family: 'Courier New', monospace;
  color: #059669;
}

.designer-email {
  color: #3b82f6;
  text-decoration: none;
}

.designer-email:hover {
  text-decoration: underline;
}

/* ===== СТИЛИ ДЛЯ ВЫБОРА ПРОЕКТИРОВЩИКА ===== */
.designer-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.designer-select {
  width: 100%;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.designer-select:focus {
  outline: none;
  border-color: #dc5f00;
  box-shadow: 0 0 0 3px rgba(220, 95, 0, 0.1);
}

.designer-select:hover {
  border-color: #dc5f00;
}

.designer-divider {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  position: relative;
  margin: 4px 0;
}

.designer-divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e5e7eb;
  z-index: 1;
}

.designer-divider span {
  background: #fff;
  padding: 0 8px;
  position: relative;
  z-index: 2;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ OFFER ===== */

/* Заголовок секции */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 24px 0 16px;
  padding: 0 16px;
}

/* Стили для формы оферты */
.ofr-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 0 16px 20px;
}

.ofr-form {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  border: 1px solid #f0e7dc;
}

.firm-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  border: 1px solid #f0e7dc;
  text-align: right;
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}

.firm-logo {
  width: 150px;
  height: auto;
  margin: 0 0 16px 0;
  filter: contrast(1.1);
}

.firm-lines {
  color: #51463f;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
}

/* Стили для поиска продуктов */
.filters-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin: 0 16px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  border: 1px solid #f0e7dc;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.filters-card .search-input-wrapper {
  flex: 1;
  min-width: 300px;
}

.filters-card .btn {
  white-space: nowrap;
}

/* Стили для таблиц продуктов */
.table-container {
  margin: 0 16px 20px;
}

/* Стили для footer */
.offer-sticky {
  position: relative;
  bottom: auto;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(250,247,242,0) 0%, rgba(250,247,242,1) 40%),
    #FAF7F2;
  border-top: 1px solid rgba(0,0,0,.06);
  margin: 0 16px;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
}

.offer-notes {
  flex: 1 1 auto;
}

#offerNotes {
  width: 100%;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  resize: none;
  border: 1px solid #e5d7c7;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  font: inherit;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1.2;
}

#offerNotes:focus {
  outline: none;
  border-color: #d76e1d;
  box-shadow: 0 0 0 3px rgba(215,110,29,.12);
}

.offer-totals {
  display: flex;
  gap: 24px;
  align-items: center;
  white-space: nowrap;
  line-height: 1;
  font-weight: 600;
  color: #1f2937;
}

.offer-totals b {
  color: #d76e1d;
  font-weight: 700;
  font-size: 16px;
}

.offer-sticky-pad {
  height: 0;
}

/* Адаптивность для offer */
@media (max-width: 768px) {
  .ofr-head {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .filters-card {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filters-card .search-input-wrapper {
    min-width: auto;
  }
  
  .offer-sticky {
    flex-direction: column;
    gap: 16px;
  }
  
  .offer-totals {
    justify-content: space-between;
    width: 100%;
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .offers-container {
    padding: 0 12px 24px;
  }
  
  .offers-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .tools-left {
    justify-content: center;
  }
  
  .filters-card {
    padding: 20px;
    margin: 10px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .filter-select,
  .filter-input,
  .only-mine-checkbox {
    height: 52px;
    min-height: 52px;
  }
  
  .pagination {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 4px;
  }
  

  

  
  .offer-buyer,
  .offer-designer {
    max-width: 150px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group:nth-child(3) {
    grid-column: 1;
  }
  
  .ofr-head {
    margin: 10px;
    width: calc(100% - 20px);
  }
  
  .ofr-form {
    padding: 20px;
  }
}

/* Анимации для строк таблицы */
.offer-row {
  animation: rowFadeIn 0.3s ease;
}

@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ИНДИКАТОРЫ ЗАГРУЗКИ И УВЕДОМЛЕНИЯ ===== */

/* Глобальный индикатор загрузки */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #d76e1d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Индикатор загрузки для кнопок */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Улучшенные уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #d76e1d;
  z-index: 10000;
  animation: slideInRight 0.3s ease;
}

.notification-success {
  border-left-color: #10b981;
}

.notification-error {
  border-left-color: #ef4444;
}

.notification-warning {
  border-left-color: #f59e0b;
}

.notification-content {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Анимации */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin: 0 20px 16px;
  font-size: 14px;
}

.breadcrumb-item {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item:hover {
  color: #d76e1d;
}

.breadcrumb-separator {
  color: #d1d5db;
}

.breadcrumb-current {
  color: #374151;
  font-weight: 600;
}

/* ===== МАССОВЫЕ ОПЕРАЦИИ ===== */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  margin: 0 20px 16px;
  animation: slideInUp 0.3s ease;
}

.bulk-actions.hidden {
  display: none;
}

.bulk-selection-info {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
}

.bulk-action-btn {
  padding: 6px 12px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: #fff;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bulk-action-btn:hover {
  background: #f59e0b;
  color: #fff;
}

/* ===== БЫСТРЫЕ ФИЛЬТРЫ ===== */
.quick-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 20px;
}

.quick-filter-btn {
  padding: 6px 12px;
  border: 1px solid #e5d7c7;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-filter-btn:hover {
  border-color: #d76e1d;
  color: #d76e1d;
}

.quick-filter-btn.active {
  background: #d76e1d;
  border-color: #d76e1d;
  color: #fff;
}

/* Быстрые фильтры в основной панели */
.quick-filters-inline {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  width: 100%;
  min-height: 32px;
}

.quick-filters-inline .quick-filter-btn {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 6px;
  min-width: auto;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Кнопка очистки фильтров */
.filter-clear-btn {
  padding: 12px 16px;
  border: 1px solid #e2d5c6;
  border-radius: 8px;
  background: #ffffff;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-clear-btn:hover {
  background: #f9fafb;
  border-color: #dc5f00;
  color: #dc5f00;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-clear-btn:active {
  background: #f3f4f6;
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===== БЫСТРЫЕ ДЕЙСТВИЯ ===== */
.quick-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.offer-row:hover .quick-actions {
  opacity: 1;
}

.quick-action-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e5d7c7;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  border-color: #d76e1d;
  color: #d76e1d;
  transform: scale(1.1);
}

/* ===== ТЕМНАЯ ТЕМА ===== */
[data-theme="dark"] {
  --bg-primary: #1f2937;
  --bg-secondary: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --border-color: #4b5563;
  --accent-color: #f59e0b;
}

[data-theme="dark"] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme="dark"] .offers-toolbar,
[data-theme="dark"] .filters-card,
[data-theme="dark"] .table-container,
[data-theme="dark"] .pagination {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .filter-input,
[data-theme="dark"] .filter-select,
[data-theme="dark"] .search-input {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* ===== УЛУЧШЕННАЯ МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
  .offers-table {
    font-size: 12px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 8px 4px;
  }
  
  .offer-number,
  .offer-date {
    font-size: 11px;
  }
  
  .action-buttons {
    flex-direction: row !important;
    gap: 4px !important;
    min-width: 100px !important;
    padding-right: 12px !important;
  }
  
  .action-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
    margin-right: 8px !important;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .quick-filters {
    flex-wrap: wrap;
  }
  
  .bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== УЛУЧШЕННАЯ ДОСТУПНОСТЬ ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Фокус для клавиатурной навигации */
.btn:focus,
.filter-input:focus,
.filter-select:focus,
.search-input:focus {
  outline: 2px solid #d76e1d;
  outline-offset: 2px;
}

/* ===== АВТОДОПОЛНЕНИЕ ===== */
.autocomplete-dropdown {
  position: fixed;
  top: auto;
  left: auto;
  right: auto;
  background: #fff;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  width: 100%;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
  background: #f3f4f6;
}

.autocomplete-item.selected {
  background: #d76e1d;
  color: #fff;
}

/* ===== ВАЛИДАЦИЯ В РЕАЛЬНОМ ВРЕМЕНИ ===== */
.form-input.valid {
  border-color: #10b981;
}

.form-input.invalid {
  border-color: #ef4444;
}

.validation-message {
  font-size: 11px;
  margin-top: 4px;
  min-height: 16px;
}

.validation-message.error {
  color: #ef4444;
}

.validation-message.success {
  color: #10b981;
}

/* ===== АВТОСОХРАНЕНИЕ ===== */
.auto-save-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 8px 16px;
  background: #10b981;
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1000;
  animation: slideInUp 0.3s ease;
}

.auto-save-indicator.saving {
  background: #f59e0b;
}

.auto-save-indicator.error {
  background: #ef4444;
}

/* ===== УЛУЧШЕННЫЕ АНИМАЦИИ ===== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.scale-in {
  animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== УЛУЧШЕННАЯ ОБРАБОТКА ОШИБОК ===== */
.error-boundary {
  padding: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin: 20px;
}

.error-boundary h3 {
  color: #dc2626;
  margin: 0 0 12px 0;
}

.error-boundary p {
  color: #7f1d1d;
  margin: 0;
}

.retry-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.retry-btn:hover {
  background: #b91c1c;
}

/* ===== ГЛОБАЛЬНАЯ АДАПТИВНОСТЬ ХЕДЕРА ===== */
/* Унифицированный хедер для всех страниц */
.topbar, .header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 2px solid #dc5f00;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topbar .brand, .header .brand {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.topbar .brand img, .header .brand img {
  height: 32px;
  width: auto;
  max-width: 120px;
}

.topbar .brand strong, .header .brand strong {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}

.topbar .user, .header .user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar .user span, .header .user-actions span {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
  .topbar, .header {
    padding: 10px 16px;
  }
  
  .topbar .brand img, .header .brand img {
    height: 28px;
  }
  
  .topbar .brand strong, .header .brand strong {
    font-size: 16px;
  }
  
  .topbar .user, .header .user-actions {
    gap: 8px;
  }
  
  .topbar .user .btn, .header .user-actions .btn {
    padding: 8px 12px;
    font-size: 14px;
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .topbar, .header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .topbar .brand, .header .brand {
    flex: 1;
    min-width: 0;
  }
  
  .topbar .brand img, .header .brand img {
    height: 24px;
  }
  
  .topbar .brand strong, .header .brand strong {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .topbar .user, .header .user-actions {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }
  
  .topbar .user .btn, .header .user-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
  }
  
  .topbar .user span, .header .user-actions span {
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .topbar, .header {
    padding: 6px 8px;
  }
  
  .topbar .brand, .header .brand {
    gap: 8px;
  }
  
  .topbar .brand img, .header .brand img {
    height: 20px;
  }
  
  .topbar .brand strong, .header .brand strong {
    font-size: 13px;
  }
  
  .topbar .user, .header .user-actions {
    gap: 4px;
  }
  
  .topbar .user .btn, .header .user-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  
  .topbar .user span, .header .user-actions span {
    display: none; /* Скрываем email на очень маленьких экранах */
  }
}

/* ===== АДАПТИВНОСТЬ ОСНОВНОГО КОНТЕНТА ===== */
.offers-container {
  padding: 20px;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .offers-container {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .offers-container {
    padding: 12px;
  }
  
  .offers-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 12px 0;
  }
  
  .tools-left, .tools-right {
    justify-content: center;
  }
  
  .filters-card {
    margin: 12px 0;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .offers-container {
    padding: 8px;
  }
  
  .offers-toolbar {
    margin: 8px 0;
  }
  
  .tools-left, .tools-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
}

/* ===== АДАПТИВНОСТЬ ТАБЛИЦ ===== */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.offers-table {
  min-width: 600px; /* Минимальная ширина для горизонтального скролла */
}

@media (max-width: 768px) {
  .offers-table {
    font-size: 12px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 8px 6px;
  }
  
  .row-actions {
    flex-direction: column;
    gap: 4px;
  }
  
  .icon-btn {
    width: 28px;
    height: 28px;
  }
  
  .icon-btn img {
    width: 14px;
    height: 14px;
  }
}

/* ===== АДАПТИВНОСТЬ ФОРМ ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

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

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  padding: 10px 12px;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #fff;
}

.form-input:focus {
  outline: none;
  border-color: #dc5f00;
  box-shadow: 0 0 0 3px rgba(220, 95, 0, 0.1);
}

.form-input::placeholder {
  color: #999;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: fixed;
  top: auto;
  left: auto;
  right: auto;
  background: #fff;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  width: 100%;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
  background: #f8f9fa;
}

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

@media (max-width: 1024px) {
  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
  }
  
  .form-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .form-input, .form-select {
    font-size: 16px; /* Предотвращает зум на iOS */
    padding: 12px 14px;
  }
  
  .form-label {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .form-grid {
    gap: 10px;
  }
  
  .form-row {
    gap: 6px;
  }
  
  .form-input, .form-select {
    padding: 10px 12px;
    font-size: 16px;
  }
  
  .form-label {
    font-size: 10px;
  }
}

/* ===== АДАПТИВНОСТЬ КАРТОЧЕК ===== */
.card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
  overflow: hidden;
}

@media (max-width: 768px) {
  .card {
    border-radius: 8px;
    margin: 8px 0;
  }
}

/* ===== УЛУЧШЕННАЯ НАВИГАЦИЯ ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #666;
  /* Убираем лишние отступы */
  padding: 2px;
  width: 100%;
  box-sizing: border-box;
}

.breadcrumb-item {
  color: #dc5f00;
  text-decoration: none;
}

.breadcrumb-item:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #ccc;
}

.breadcrumb-current {
  color: #333;
  font-weight: 600;
}

@media (max-width: 768px) {
  .breadcrumbs {
    font-size: 12px;
    margin-bottom: 12px;
    padding: 3px;
  }
}

/* ===== АДАПТИВНОСТЬ ПАНЕЛИ ===== */
.panel-wrap {
  padding: 20px;
  max-width: 100%;
  box-sizing: border-box;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: #fff;
  border: 1px solid #e5d7c7;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  text-align: center;
}

.menu-card:hover {
  border-color: #dc5f00;
  box-shadow: 0 4px 16px rgba(220, 95, 0, 0.15);
  transform: translateY(-2px);
}

.menu-ico {
  font-size: 48px;
  margin-bottom: 16px;
}

.menu-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.menu-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

@media (max-width: 1024px) {
  .panel-wrap {
    padding: 16px;
  }
  
  .menu-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }
  
  .menu-card {
    padding: 20px;
  }
  
  .menu-ico {
    font-size: 40px;
  }
  
  .menu-title {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .panel-wrap {
    padding: 12px;
  }
  
  .menu-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .menu-card {
    padding: 16px;
  }
  
  .menu-ico {
    font-size: 32px;
    margin-bottom: 12px;
  }
  
  .menu-title {
    font-size: 14px;
  }
  
  .menu-desc {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .panel-wrap {
    padding: 8px;
  }
  
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .menu-card {
    padding: 12px;
    flex-direction: row;
    text-align: left;
    gap: 12px;
  }
  
  .menu-ico {
    font-size: 24px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  .menu-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  
  .menu-desc {
    font-size: 11px;
  }
}

/* ===== АДАПТИВНОСТЬ ПОИСКА И ФИЛЬТРОВ ===== */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  min-height: 48px;
}

.search-input-wrapper:focus-within {
  border-color: #dc5f00;
  box-shadow: 0 0 0 3px rgba(220, 95, 0, 0.1);
}

.search-icon {
  padding: 0 12px;
  color: #999;
  font-size: 16px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0;
  font-size: 14px;
  background: transparent;
  outline: none;
  min-height: 48px;
  line-height: 1.4;
}

.search-input::placeholder {
  color: #999;
}

/* Удален дублирующий блок стилей для .search-clear */

/* ===== СТРАНИЦА ПРОДУКТОВ ===== */
.filter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.pagination {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin: 20px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5d7c7;
}

.pagination-info {
  font-size: 14px;
  color: #666;
  min-width: 120px;
  text-align: center;
}

.pagination .btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination .btn:hover:not(:disabled) {
  background: #f8f6f3;
  border-color: #dc5f00;
}

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

.product-row {
  transition: background-color 0.2s ease;
}

.product-row:hover {
  background-color: #f8f6f3;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: #d32f2f;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

/* ===== ИСПРАВЛЕНИЕ ФИЛЬТРОВ - ВОЗВРАТ К ГОРИЗОНТАЛЬНОМУ РАСПОЛОЖЕНИЮ ===== */
.filters-card {
  background: #fff;
  border: 1px solid #e5d7c7;
  border-radius: 12px;
  padding: 20px;
  margin: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  width: calc(100% - 40px);
  box-sizing: border-box;
}

.filters-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr auto auto auto auto;
  gap: 16px;
  align-items: start;
}

/* Адаптивность для фильтров */
@media (max-width: 1400px) {
  .filters-grid {
    grid-template-columns: 1fr 1.5fr 1.5fr auto auto auto auto;
  }
}

@media (max-width: 1200px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr auto auto auto auto;
  }
  
  .filter-group:has(.quick-filters-inline) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1000px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr auto auto auto;
  }
}

@media (max-width: 800px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr auto auto;
  }
}

@media (max-width: 600px) {
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .filter-group:has(.quick-filters-inline) {
    grid-column: 1;
  }
  
  .quick-filters-inline {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .quick-filters-inline .quick-filter-btn {
    flex: 1 1 calc(50% - 3px);
    min-width: 80px;
    font-size: 10px;
    padding: 4px 6px;
  }
}

@media (max-width: 400px) {
  .quick-filters-inline .quick-filter-btn {
    flex: 1 1 100%;
    min-width: 60px;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-label {
  font-size: 11px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.filter-select {
  padding: 12px 16px;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: all 0.2s ease;
  min-height: 48px;
  line-height: 1.4;
}

.filter-select:focus {
  outline: none;
  border-color: #dc5f00;
  box-shadow: 0 0 0 3px rgba(220, 95, 0, 0.1);
}

.filter-input {
  padding: 12px 16px;
  border: 1px solid #e5d7c7;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: all 0.2s ease;
  min-height: 48px;
  line-height: 1.4;
}

.filter-input:focus {
  outline: none;
  border-color: #dc5f00;
  box-shadow: 0 0 0 3px rgba(220, 95, 0, 0.1);
}

/* Улучшение отображения плейсхолдеров в селектах */
.filter-select option {
  font-size: 14px;
  padding: 8px;
}

.filter-select option:first-child {
  color: #6b7280;
  font-style: italic;
}

@media (max-width: 1024px) {
  .filters-card {
    padding: 16px;
    margin: 16px 0;
  }
}

@media (max-width: 768px) {
  .filters-card {
    padding: 12px;
    margin: 12px 0;
  }
  
  .search-input-wrapper {
    margin-bottom: 12px;
  }
  
  .search-input {
    font-size: 16px;
    padding: 12px 16px !important;
    min-height: 48px;
  }
  
  .filter-select {
    font-size: 16px;
    padding: 12px 14px;
  }
  
  .filter-label {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .filters-card {
    padding: 10px;
    margin: 10px 0;
  }
  
  .filters-grid {
    gap: 10px;
  }
  
  .search-input {
    padding: 12px 16px !important;
    min-height: 48px;
  }
  
  .filter-select {
    padding: 10px 12px;
  }
  
  .filter-label {
    font-size: 10px;
  }
}

/* Дополнительные стили для кнопок действий на очень маленьких экранах */
@media (max-width: 400px) {
  .action-buttons {
    min-width: 70px !important;
    padding-right: 4px !important;
  }
  
  .action-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 10px !important;
    margin-right: 2px !important;
  }
}

/* Стили для очень узких экранов (консоль разработчика) */
@media (max-width: 1200px) {
  .offers-table tbody tr .action-buttons {
    min-width: 70px !important;
    gap: 2px !important;
    padding: 6px 8px !important; /* Добавляем левый отступ */
  }
  
  .offers-table tbody tr .action-btn {
    width: 28px !important;
    height: 28px !important;
    margin-right: 2px !important;
    min-width: 28px !important;
  }
  
  .sep-wrap .action-btn {
    width: 28px !important;
    height: 28px !important;
    margin-right: 2px !important;
    min-width: 28px !important;
  }
}

/* Стили для экстремально узких экранов */
@media (max-width: 800px) {
  .offers-table tbody tr .action-buttons {
    min-width: 60px !important;
    gap: 1px !important;
    padding: 4px 6px !important; /* Добавляем левый отступ */
  }
  
  .offers-table tbody tr .action-btn {
    width: 24px !important;
    height: 24px !important;
    margin-right: 1px !important;
    min-width: 24px !important;
    font-size: 10px !important;
  }
  
  .sep-wrap .action-btn {
    width: 24px !important;
    height: 24px !important;
    margin-right: 1px !important;
    min-width: 24px !important;
    font-size: 10px !important;
  }
}

/* ===== УЛУЧШЕННАЯ АДАПТИВНОСТЬ ДЛЯ ВСЕГО ПРОЕКТА ===== */

/* Общие адаптивные стили для всех страниц */
@media (max-width: 1024px) {
  .panel-body {
    padding: 10px;
  }
  
  .card {
    margin: 8px 0;
    padding: 16px;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .form-input,
  .search-input,
  .filter-input {
    padding: 10px 12px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .panel-body {
    padding: 8px;
  }
  
  .card {
    margin: 6px 0;
    padding: 12px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
  }
  
  .form-input,
  .search-input,
  .filter-input {
    padding: 12px 16px;
    font-size: 16px;
    min-height: 44px;
  }
  
  /* Улучшенная навигация */
  .topbar {
    padding: 8px 12px;
  }
  
  .breadcrumbs {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  /* Адаптивные сетки */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Адаптивные таблицы */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive table {
    min-width: 600px;
  }
}

/* ===== СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ ГЛАВНОЙ ПАНЕЛИ ===== */
@media (max-width: 1024px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .menu-card {
    padding: 20px;
  }
  
  .menu-ico {
    font-size: 32px;
    margin-bottom: 12px;
  }
  
  .menu-title {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .menu-desc {
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .menu-card {
    padding: 16px;
  }
  
  .menu-ico {
    font-size: 28px;
    margin-bottom: 10px;
  }
  
  .menu-title {
    font-size: 15px;
    margin-bottom: 6px;
  }
  
  .menu-desc {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .panel-body {
    padding: 4px;
  }
  
  .card {
    margin: 4px 0;
    padding: 8px;
  }
  
  .btn {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 40px;
  }
  
  .form-input,
  .search-input,
  .filter-input {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 40px;
  }
  
  .topbar {
    padding: 6px 8px;
  }
  
  .breadcrumbs {
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* ===== УЛУЧШЕННАЯ АДАПТИВНОСТЬ ДЛЯ ФОРМЫ ОФЕРТЫ ===== */

/* Планшеты и маленькие ноутбуки */
@media (max-width: 1024px) {
  .offers-container {
    padding: 15px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .offers-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin: 0;
  }
  
  .tools-left,
  .tools-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .btn {
    flex: 1;
    min-width: 120px;
  }
  
  /* Улучшенная таблица для планшетов */
  .table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .offers-table {
    min-width: 800px;
    font-size: 13px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 12px 8px;
  }
  
  /* Улучшенные кнопки действий */
  .offers-table tbody tr .action-buttons {
    min-width: 90px !important;
    gap: 3px !important;
    padding: 5px !important;
    justify-content: center !important;
  }
  
  .offers-table tbody tr .action-btn {
    width: 28px !important;
    height: 28px !important;
    margin-right: 3px !important;
    min-width: 28px !important;
    max-width: 28px !important;
  }
}

/* Мобильные устройства */
@media (max-width: 768px) {
  .offers-container {
    padding: 10px;
  }
  
  .topbar {
    padding: 8px 12px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .brand {
    justify-content: center;
  }
  
  .user {
    justify-content: center;
    gap: 8px;
  }
  
  .breadcrumbs {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .offers-toolbar {
    padding: 12px;
    gap: 8px;
    margin: 0;
  }
  
  .tools-left,
  .tools-right {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn {
    width: 100%;
    min-width: auto;
    justify-content: center;
  }
  
  /* Мобильная таблица */
  .table-container {
    margin: 8px 0;
  }
  
  .offers-table {
    min-width: 600px;
    font-size: 12px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 8px 4px;
  }
  
  /* Скрываем менее важные колонки на мобильных */
  .offers-table th:nth-child(6), /* JM */
  .offers-table td:nth-child(6),
  .offers-table th:nth-child(11), /* Brutto za szt */
  .offers-table td:nth-child(11) {
    display: none;
  }
  
  /* Улучшенные кнопки действий для мобильных */
  .offers-table tbody tr .action-buttons {
    min-width: 80px !important;
    gap: 2px !important;
    padding: 4px !important;
    justify-content: center !important;
  }
  
  .offers-table tbody tr .action-btn {
    width: 26px !important;
    height: 26px !important;
    margin-right: 2px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    font-size: 10px !important;
  }
  
  /* Мобильная форма */
  .ofr-form {
    margin: 8px 0;
    padding: 16px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-label {
    font-size: 12px;
    margin-bottom: 4px;
  }
  
  .form-input {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  /* Мобильный поиск */
  .filters-card {
    padding: 12px;
    margin: 0;
  }
  
  .search-input-wrapper {
    margin-bottom: 12px;
  }
  
  .search-input {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  /* Мобильные заметки и итоги */
  .offer-sticky {
    padding: 12px;
    margin: 8px 0;
  }
  
  .offer-notes textarea {
    padding: 12px;
    font-size: 14px;
    min-height: 80px;
  }
  
  .offer-totals {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Очень маленькие экраны */
/* ===== СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ ЛИСТИНГА ОФЕРТ ===== */

/* Унифицированное выравнивание для страницы листинга */
.offers-container .offers-toolbar {
  margin: 0;
  padding: 16px 20px;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .breadcrumbs {
  margin: 0 0 16px 0;
  padding: 2px;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .filters-card {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .table-container {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.offers-container .pagination {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 1024px) {
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .offers-table {
    min-width: 800px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 10px 6px;
  }
  
  /* Скрываем менее важные колонки на планшетах */
  .offers-table th:nth-child(4), /* Email */
  .offers-table td:nth-child(4),
  .offers-table th:nth-child(5), /* Phone */
  .offers-table td:nth-child(5) {
    display: none;
  }
}

@media (max-width: 768px) {
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .offers-table {
    min-width: 600px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 8px 4px;
  }
  
  /* Скрываем еще больше колонок на мобильных */
  .offers-table th:nth-child(3), /* Designer */
  .offers-table td:nth-child(3),
  .offers-table th:nth-child(6), /* Created */
  .offers-table td:nth-child(6) {
    display: none;
  }
  
  /* Улучшенные кнопки действий */
  .offers-table tbody tr .action-buttons {
    min-width: 80px !important;
    gap: 2px !important;
    padding-right: 6px !important;
  }
  
  .offers-table tbody tr .action-btn {
    width: 28px !important;
    height: 28px !important;
    margin-right: 2px !important;
    min-width: 28px !important;
  }
  
  /* Адаптивность для страницы листинга */
  .offers-container .offers-toolbar {
    padding: 12px 16px;
  }
  
  .offers-container .filters-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .offers-container {
    padding: 8px;
  }
  
  .topbar {
    padding: 6px 8px;
  }
  
  .breadcrumbs {
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .offers-toolbar {
    padding: 8px;
  }
  
  .ofr-form {
    padding: 12px;
  }
  
  .filters-card {
    padding: 8px;
    margin: 0;
  }
  
  /* Еще более компактная таблица */
  .offers-table {
    min-width: 500px;
    font-size: 11px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 6px 2px;
  }
  
  /* Скрываем еще больше колонок */
  .offers-table th:nth-child(3), /* Producent */
  .offers-table td:nth-child(3),
  .offers-table th:nth-child(7), /* Cena netto */
  .offers-table td:nth-child(7),
  .offers-table th:nth-child(8), /* Rabat */
  .offers-table td:nth-child(8) {
    display: none;
  }
  
  /* Минимальные кнопки действий */
  .offers-table tbody tr .action-buttons {
    min-width: 50px !important;
    gap: 0 !important;
    padding: 2px !important;
  }
  
  .offers-table tbody tr .action-btn {
    width: 20px !important;
    height: 20px !important;
    margin-right: 0 !important;
    min-width: 20px !important;
    max-width: 20px !important;
    font-size: 8px !important;
  }
  
  /* Компактные формы */
  .form-input {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .search-input {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Экстремально узкие экраны (консоль разработчика) */
@media (max-width: 400px) {
  .offers-table {
    min-width: 400px;
    font-size: 10px;
  }
  
  .offers-table th,
  .offers-table td {
    padding: 4px 1px;
  }
  
  /* Скрываем все кроме самых важных колонок */
  .offers-table th:nth-child(4), /* Opis */
  .offers-table td:nth-child(4),
  .offers-table th:nth-child(9), /* Cena po rabacie */
  .offers-table td:nth-child(9),
  .offers-table th:nth-child(10), /* Wartość netto */
  .offers-table td:nth-child(10) {
    display: none;
  }
  
  /* Минимальные кнопки */
  .offers-table tbody tr .action-buttons {
    min-width: 40px !important;
    gap: 0 !important;
    padding: 1px !important;
  }
  
  .offers-table tbody tr .action-btn {
    width: 18px !important;
    height: 18px !important;
    margin-right: 0 !important;
    min-width: 18px !important;
    max-width: 18px !important;
    font-size: 7px !important;
  }
}

/* ===== ROLE BADGES ===== */
.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background-color: #dc3545;
    color: white;
}

.role-seller {
    background-color: #007bff;
    color: white;
}

.role-warehouse {
    background-color: #28a745;
    color: white;
}

.role-logistyka {
    background-color: #17a2b8;
    color: white;
}

.role-reklamacja {
    background-color: #6f42c1;
    color: white;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== PREVIEW TABLE ===== */
.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.preview-table th,
.preview-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.preview-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.preview-table tr:hover {
    background-color: #f8f9fa;
}

/* ===== ALERT STYLES ===== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

/* ===== CHECKBOX STYLES ===== */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Горизонтальная прокрутка для таблиц */
.table-container {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #d76e1d #f3f4f6;
  /* Улучшенная прокрутка */
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  /* Предотвращение переполнения */
  max-width: 100%;
  margin: 8px 0;
}

.table-container::-webkit-scrollbar {
  height: 6px;
}

.table-container::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #d76e1d;
  border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #b45309;
}

/* Улучшенные стили для drag & drop */
.offers-table tbody tr {
  cursor: pointer;
}

.offers-table tbody tr:active {
  cursor: pointer;
}

.offers-table tbody tr.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Улучшенные стили для сепараторов */
.sep-wrap {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  margin: 8px 0;
  padding: 12px;
  position: relative;
}

.sep-wrap .action-buttons {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 60px !important;
  gap: 2px !important;
  padding: 4px !important; /* Добавляем отступы */
}

.sep-wrap .action-btn {
  width: 24px !important;
  height: 24px !important;
  margin-right: 2px !important;
  min-width: 24px !important;
  font-size: 10px !important;
}

@media (max-width: 768px) {
  .sep-wrap {
    padding: 16px 12px 12px 12px;
  }
  
  .sep-wrap .action-buttons {
    top: 6px;
    right: 6px;
    min-width: 50px !important;
  }
  
  .sep-wrap .action-btn {
    width: 20px !important;
    height: 20px !important;
    font-size: 8px !important;
  }
}

/* ===== СТАТУСНЫЕ ЦВЕТА ДЛЯ СТРОК ОФЕРТ ===== */
.status-nowa {
    background-color: #ffffff !important;
    color: #374151 !important;
}

.status-wyslana {
    background-color: #dbeafe !important;
    color: #2563eb !important;
}

.status-zamowiona {
    background-color: #fef3c7 !important;
    color: #d97706 !important;
}

.status-rozliczona {
    background-color: #dcfce7 !important;
    color: #16a34a !important;
}

/* ===== ACCESS DENIED ===== */
.access-denied {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.access-denied-content {
    text-align: center;
    max-width: 500px;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

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

.access-denied h2 {
    color: #dc2626;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.access-denied p {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.access-denied p strong {
    color: #374151;
}

.access-denied-actions {
    margin-top: 24px;
}
