.table-container {
  background: #fff;
}

.table-container a {
    text-decoration: none;
}

.table-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-container thead th,
.table-container tbody td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  height: 32px;
  min-width: 36px;
  background: #fff;
}

.table-container thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f7fa;
  border-bottom: 1px solid #cccccc;
  font-weight: 600;
}

/* .table-container thead tr:nth-child(2) th {
  top: 36px;
  z-index: 2;
} */

.table-container tbody tr:hover td {
  background-color: #f5f8ff;
}

/* Column sizing/behavior */
.table-container .id-column { width: 56px; font-weight: 600; color: #6c757d; z-index: 4; }
.table-container .image-column { width: 60px; text-align: center; z-index: 4;}
.table-container .name-column { min-width: 160px; max-width: 360px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 4;}
.table-container .barcode-column { width: 140px; z-index: 4;}
.table-container .fillru-stock { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; z-index: 4;}
.table-container .total-column { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; z-index: 4;}

.table-container .market-header { text-align: center; background: #eef4ff; z-index: 4;}
.table-container .subheader { text-align: center; font-size: 12.5px; color: #495057; z-index: 4;}

/* Sorting link appearance */
.table-container th a { color: inherit; text-decoration: none; }
.table-container th a:hover { color: #007bff; }

/* Stock badges */
.table-container .stock-width { display: inline-block; min-width: 28px; text-align: center; }
.table-container .stock-red { color: #c62828; font-weight: 600; }
.table-container .stock-yellow { color: #b8860b; font-weight: 600; }
.table-container .stock-green { color: #2e7d32; font-weight: 600; }

/* FBS/FBO cells: center content and fill cell evenly */
.table-container td.col-ozon-fbs,
.table-container td.col-ozon-fbo,
.table-container td.col-wb-fbs,
.table-container td.col-wb-fbo,
.table-container td.col-yandex-fbs,
.table-container td.col-yandex-fbo {
  padding: 6px 4px;
}

.table-container .fbs-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.table-container .fbs-container > * {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
}

/* Optional badge styles inside FBS/FBO */
.table-container .stock-green,
.table-container .stock-yellow,
.table-container .stock-red,
.table-container .stock-gray {
  width: 100%;
  height: 28px;
  line-height: 28px;
  border-radius: 8px;
}

@media (max-width: 576px) {
  .table-container thead th,
  .table-container tbody td { padding: 6px; font-size: 13px; }
  .table-container .name-column { min-width: 140px; }
}

/* Fullscreen image modal */
.modal-img-bg {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}
.modal-img-bg.active { display: flex; }
.modal-img-bg img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
  background: #fff;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    box-shadow: none;
}

thead {
    background: #f7f7fa;
    z-index: 2;
}

th, td {
    padding: 3px 4px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 15px;
    font-weight: 500;
    height: 28px;
    min-width: 35px;
    background: #fff;
    transition: background 0.2s, color 0.2s;
    font-family: 'Segoe UI', Arial, sans-serif;
}

thead th {
    border: 1px solid #cccccc;
    background: #f7f7fa;
    position: sticky;
    top: 0;
    z-index: 3;
}
thead tr:nth-child(2) th {
    top: 50px;
    z-index: 3;
}

tr {
    position: static;
    border-radius: 0;
    transition: background 0.2s;
}

tbody tr:hover td {
    background-color: #f0f4ff;
}

#thead-bg-stretch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 40px;
    background: #f7f7fa;
    z-index: 3;
    pointer-events: none;
    opacity: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.35s cubic-bezier(.4,2,.6,1), height 0.2s;
}
#thead-bg-stretch.active {
    transform: scaleY(1);
}

.demo-img {
    width: 44px;
    height: 44px;
    object-fit:scale-down;
    border-radius: 5px;
    box-shadow: none;
    border: 1.5px solid #e0e0e0;
}

.id-column {
    width: 50px;
    font-weight: 600;
}

.image-column {
    width: 60px;
}

.name-column {
    min-width: 120px;
    max-width: 350px;
    width: auto;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.name-column a {
    color: #000;
    text-decoration: none;
    transition: color 0.2s;
}

.name-column a:hover {
    color: #b8860b;
    text-decoration: underline;
}

.fillru-stock{
    min-width: 40px;
    font-weight: 500;
}

.stock-width {
    min-width: 30px;
    max-width: 55px;
    width: 50px;
    display: inline-block;
    text-align: center;
    padding: 7px 0;
    font-size: 15px;
}

.stock-green {
    background: #6EDE6E;
    color: #1B5E20;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(27, 94, 32, 0.1); /* Тень в тон тексту */
}
.stock-yellow {
    background: #FFD166;
    color: #8B6914; 
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(139, 105, 20, 0.15); /* Тень в тон тексту */
}
.stock-red {
    background: #FF6B6B;
    color: #8E0000;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(142, 0, 0, 0.1); /* Тень в тон тексту */
}
.stock-gray {
    background: #f2f3f5;
    color: #7b7b7b;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(123, 123, 123, 0.07);
}

.right-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 10%;
}

.tableContent a,
.tableContent .stock-green a,
.tableContent .stock-red a,
.tableContent .stock-yellow a,
.tableContent .stock-gray a {
    text-decoration: none !important;
}

.green-text{
    color: #2E7D32;
}

.yellow-text{
    color: #b8860b;
}

.red-text{
    color: #c62828;
}

.gray-text{
    color: #7b7b7b;
}

.col-hover {
    background: #f0f4ff;
    transition: background 0.2s, box-shadow 0.2s;
}

.sorted-column {
    border-top: 1px solid #BBB;
    background: #e0eaff;
    transition: background 0.2s, color 0.2s;
}

.filter-block {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(147,113,83, 0.07);
    padding: 14px 18px 8px 18px;
    
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.filter-toggle-btn {
    background: #f7f7fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.2s, border 0.2s;
}
.filter-toggle-btn:hover {
    background: #e0eaff;
    border-color: #b3c6ff;
}
.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}
.filter-checkboxes label {
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}
.filter-checkboxes input[type="checkbox"] {
    margin-right: 6px;
}

td.col-ozon-fbs, td.col-wb-fbs, td.col-yandex-fbs{
    position: relative;
    /* vertical-align: top; */
    padding: 8px 4px;
    min-width: 35px;
    text-align: center;
}

.marketplace-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: #f7f7fa;
    overflow: hidden;
}

.marketplace-icon-img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* КОНТЕЙНЕР ДЛЯ ОТНОСИТЕЛЬНОГО ПОЗИЦИОНИРОВАНИЯ */
.fbs-container {
    position: relative;
    display: inline-block;
    /* min-height: 28px; */
    width: 100%;
}

.order-link{
    position: absolute;
    z-index: 2;
    top: -1px;
    text-decoration: none;
}
.admin-order-badge-link {
    position: absolute;
    top: 0;
    right: -3px; 
    z-index: 2;
    text-decoration: none;
}
.admin-order-badge-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background: #ff3b30;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(142, 0, 0, 0.15);
    padding: 2px;
    z-index: 2;
    border: 0;
    transition: padding 0.2s ease;
}
.admin-order-badge-num:hover{
    padding: 4px;
}
/* ССЫЛКА С БЕЙДЖЕМ */
.order-badge-link {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 2;
    text-decoration: none;
}
.order-badge-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background: #ff3b30;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(142, 0, 0, 0.15);
    padding: 2px;
    z-index: 2;
    border: 0;
    transition: transform 0.2s ease;
}

.badge-text{
    position: relative;
    margin-right: 8px;
    top: -3px;
    left: -5px;
}

td .stock-green,
td .stock-yellow,
td .stock-red,
td .stock-gray {
    display: inline-block;
    width: 100%;
    height: 28px;
    line-height: 28px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.order-icon {
    width: 38px;
    height: 38px;
    display: inline-block;
    vertical-align: middle;
}

/* --- Модальное окно для увеличенного фото --- */
.modal-img-bg {
    display: none;
    position: fixed;
    z-index: 5;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s;
}
.modal-img-bg.active {
    display: flex;
}
.modal-img-bg img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.25);
    background: #fff;
    animation: modal-img-zoom 0.2s;
}
@keyframes modal-img-zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.25rem 0.25rem 0.25rem;
    margin: 0;
    list-style: none;
}
.pagination li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(108, 117, 125, 0.25);
    background-color: #fff;
    color: #343a40;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.pagination li a:hover {
    border-color: #007bff;
    color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}
.pagination li.active a {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}
.pagination li.previous a, .pagination li.next a {
    padding: 0 0.75rem;
}
