/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ui-scale: 0.9;
    --font-size-base: calc(13px * var(--ui-scale));
    --font-size-menu: calc(12px * var(--ui-scale));
    --font-size-menu-icon: calc(16px * var(--ui-scale));
    --font-size-title: calc(22px * var(--ui-scale));
    --font-size-card-title: calc(18px * var(--ui-scale));
    --font-size-button: calc(12px * var(--ui-scale));
    --control-height: calc(36px * var(--ui-scale));
    --control-padding-x: calc(16px * var(--ui-scale));
    --control-padding-y: calc(8px * var(--ui-scale));
    --radius-base: 10px;
}

html {
    font-size: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #FFFFFF;
    color: #03111B;
    font-size: var(--font-size-base);
    line-height: 1.6;
    overflow-x: hidden;
}

.mobile-topbar {
    display: none;
}

.mobile-overlay {
    display: none;
}

@media (min-width: 1025px) {
    .mobile-topbar,
    .mobile-overlay {
        display: none !important;
    }
}

/* Контейнер */
.container {
    display: flex;
    min-height: 100vh;
}

/* Боковая панель */
.sidebar {
    width: 250px;
    background-color: #EBF1F6;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow: visible;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.menu {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    overflow-x: visible;
}

.logo {
    text-align: center;
    padding: calc(20px * var(--ui-scale));
    margin-bottom: calc(30px * var(--ui-scale));
    border-bottom: 1px solid rgba(0, 122, 211, 0.2);
}

.logo h1 {
    color: #007AD3;
    font-weight: 700;
    font-size: calc(20px * var(--ui-scale));
    margin-bottom: calc(5px * var(--ui-scale));
}

.logo-image {
    width: 90%;
    max-width: 90%;
    max-height: 70px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 6px;
    display: block;
}

.logo p {
    color: #666;
    font-size: calc(12px * var(--ui-scale));
}

/* Меню */
.menu {
    list-style: none;
    padding: 0 15px;
}

.menu-item {
    margin-bottom: calc(5px * var(--ui-scale));
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
    font-size: var(--font-size-menu);
    color: #03111B;
    text-decoration: none;
    transition: all 0.3s;
    border-radius: var(--radius-base);
}

.menu-item a:hover {
    background-color: rgba(0, 122, 211, 0.1);
}

.menu-item.active a {
    color: #007AD3;
    font-weight: 600;
    background-color: rgba(0, 122, 211, 0.1);
}

.menu-icon {
    margin-right: calc(10px * var(--ui-scale));
    font-size: var(--font-size-menu-icon);
}

.menu-title {
    font-size: var(--font-size-menu);
}

.chat-unread-badge {
    margin-left: auto;
    min-width: calc(18px * var(--ui-scale));
    height: calc(18px * var(--ui-scale));
    padding: 0 5px;
    font-size: calc(11px * var(--ui-scale));
    font-weight: 600;
    line-height: calc(18px * var(--ui-scale));
    text-align: center;
    color: #fff;
    background: #e74c3c;
    border-radius: 9px;
    flex-shrink: 0;
}

.chat-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    pointer-events: none;
}

.chat-toast-container .chat-toast {
    pointer-events: auto;
    padding: 12px 14px;
    background: #fff;
    border-radius: var(--radius-base);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-left: 4px solid #007AD3;
    cursor: pointer;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}

.chat-toast-container .chat-toast.chat-toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.chat-toast .chat-toast-title {
    display: block;
    font-size: calc(12px * var(--ui-scale));
    font-weight: 600;
    color: #03111B;
    margin-bottom: 2px;
}

.chat-toast .chat-toast-from {
    font-size: calc(11px * var(--ui-scale));
    color: #007AD3;
}

.chat-toast .chat-toast-preview {
    font-size: var(--font-size-menu);
    color: #555;
    margin: 6px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-group-title {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    column-gap: 10px;
    padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
    color: #03111B;
    text-decoration: none;
    border-radius: var(--radius-base);
    cursor: pointer;
    font-size: var(--font-size-menu);
}

.menu-group-title:hover {
    background-color: rgba(0, 122, 211, 0.1);
}

.menu-group .menu-submenu {
    display: none;
    padding-left: 10px;
    list-style: none;
    margin: 0;
}

.menu-group.open .menu-submenu {
    display: block;
}

.user-info-sidebar {
    padding: calc(20px * var(--ui-scale));
    margin-top: calc(30px * var(--ui-scale));
    border-top: 1px solid rgba(0, 122, 211, 0.2);
    text-align: center;
}

.user-info-sidebar p {
    margin-bottom: 10px;
    font-weight: 500;
}

.logout-btn {
    display: inline-block;
    padding: var(--control-padding-y) var(--control-padding-x);
    background-color: #007AD3;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-base);
    font-size: var(--font-size-button);
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #005fa3;
    text-decoration: none;
    color: white;
}

/* Chat */
.chat-layout {
    display: flex;
    gap: 20px;
}

.chat-list {
    width: 300px;
    min-width: 260px;
    min-height: 400px;
}

.chat-list-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-list-heading h2 {
    margin: 0;
}

.chat-list-section-title {
    font-size: calc(11px * var(--ui-scale));
    font-weight: 600;
    color: #5a6b7b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 8px 4px 4px;
}

.chat-list-item-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 6px;
}

.chat-list-item-row .chat-list-item {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.chat-group-assign-form {
    flex-shrink: 0;
    align-self: center;
}

.chat-group-select {
    max-width: 110px;
    padding: 4px 6px;
    font-size: calc(11px * var(--ui-scale));
}

.chat-list-items {
    max-height: 70vh;
    overflow-y: auto;
}

.chat-list-item {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-base);
    color: #03111B;
    text-decoration: none;
    margin-bottom: 6px;
    background: #f6f8fb;
}

.chat-list-item.active {
    background: rgba(0, 122, 211, 0.12);
}

.chat-list-title {
    font-weight: 600;
}

.chat-list-preview {
    font-size: calc(11px * var(--ui-scale));
    color: #5a6b7b;
    margin-top: 4px;
}

.chat-messages {
    flex: 1;
    min-height: 400px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.chat-header-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 220px;
}

.chat-search-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    max-width: 320px;
}

.chat-search-input {
    font-size: calc(12px * var(--ui-scale));
    padding: 6px 10px;
}

.chat-search-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.chat-search-count {
    font-size: calc(11px * var(--ui-scale));
    color: #5a6b7b;
    margin-right: 4px;
}

.chat-message.chat-search-active {
    outline: 2px solid rgba(0, 122, 211, 0.45);
    outline-offset: 2px;
    border-radius: 8px;
}

.chat-search-mark {
    background: #ffe066;
    color: inherit;
    padding: 0 1px;
}

.chat-header-main {
    flex: 1;
    min-width: 0;
}

.chat-admin-members {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-title {
    font-weight: 600;
}

.chat-members {
    font-size: calc(11px * var(--ui-scale));
    color: #5a6b7b;
}

.chat-messages-list {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}

.chat-message {
    margin-bottom: 12px;
}

.chat-message.mine .chat-bubble {
    background: rgba(0, 122, 211, 0.12);
}

.chat-message-meta {
    font-size: calc(11px * var(--ui-scale));
    color: #5a6b7b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-message-delete {
    margin-left: auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #8a97a3;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.chat-message:hover .chat-message-delete {
    opacity: 1;
}

.chat-message-delete:hover {
    background: rgba(192, 57, 43, 0.12);
    color: #c0392b;
}

.chat-message-deleted {
    opacity: 0.75;
}

.chat-bubble-deleted {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 10px;
    background: #eef1f4;
    color: #8a97a3;
    font-style: italic;
    max-width: 80%;
}

.chat-bubble {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f0f2f5;
    max-width: 80%;
    white-space: pre-wrap;
}

.chat-file {
    margin-top: 6px;
}

.chat-file-size {
    margin-left: 8px;
    font-size: calc(11px * var(--ui-scale));
    color: #5a6b7b;
}

.chat-file-image {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.chat-image-link {
    display: inline-block;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
}

.chat-image-thumb {
    display: block;
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: #e8ecf0;
}

.chat-image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.chat-image-lightbox.chat-image-lightbox-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.chat-image-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(95vw, 1200px);
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-image-lightbox-img {
    max-width: min(95vw, 1200px);
    max-height: calc(95vh - 48px);
    object-fit: contain;
    border-radius: 6px;
    background: #111;
}

.chat-image-lightbox-close {
    position: absolute;
    top: -36px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.chat-image-lightbox-caption {
    margin-top: 8px;
    color: #fff;
    font-size: calc(12px * var(--ui-scale));
    text-align: center;
    max-width: 100%;
    word-break: break-word;
}

.chat-message[data-unread="1"] .chat-bubble {
    box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.35);
}

.chat-input {
    margin-top: 10px;
}

.chat-input-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.chat-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.chat-file-label {
    margin: 0;
    cursor: pointer;
}

.chat-attachment-area[hidden] {
    display: none !important;
}

.chat-attachment-area {
    margin-top: 8px;
}

.chat-attachment-preview[hidden],
.chat-upload-progress[hidden] {
    display: none !important;
}

.chat-attachment-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: #f6f8fb;
    border: 1px solid rgba(0, 122, 211, 0.2);
    border-radius: var(--radius-base);
}

.chat-attachment-preview-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.chat-attachment-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #e8ecf0;
}

.chat-attachment-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chat-attachment-name {
    font-size: calc(12px * var(--ui-scale));
    font-weight: 600;
    color: #03111B;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-attachment-size {
    font-size: calc(11px * var(--ui-scale));
    color: #5a6b7b;
}

.chat-attachment-status {
    font-size: calc(11px * var(--ui-scale));
}

.chat-attachment-status-ready {
    color: #1a8f4c;
}

.chat-attachment-status-error {
    color: #c0392b;
}

.chat-attachment-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #555;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.chat-attachment-remove:hover {
    background: rgba(192, 57, 43, 0.12);
    color: #c0392b;
}

.chat-upload-progress {
    margin-top: 0;
}

.chat-upload-progress-track {
    height: 6px;
    background: #e8ecf0;
    border-radius: 3px;
    overflow: hidden;
}

.chat-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: #007AD3;
    border-radius: 3px;
    transition: width 0.15s ease;
}

.chat-upload-status {
    display: block;
    margin-top: 4px;
    font-size: calc(11px * var(--ui-scale));
    color: #007AD3;
}

.chat-input-actions .btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.chat-hint {
    font-size: calc(11px * var(--ui-scale));
    color: #5a6b7b;
    margin-top: 6px;
}

.chat-empty {
    color: #5a6b7b;
    padding: 10px 0;
}

/* Основной контент */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 0;
    position: relative;
    z-index: 1;
    min-width: 0;
    max-width: 100%;
}

/* Шапка */
.header {
    background-color: white;
    padding: calc(12px * var(--ui-scale)) calc(24px * var(--ui-scale));
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-bar {
    flex: 1;
    max-width: calc(400px * var(--ui-scale));
}

.search-bar input {
    width: 100%;
    padding: var(--control-padding-y) var(--control-padding-x);
    border: 1px solid #c5ccd6;
    border-radius: var(--radius-base);
    font-family: 'Montserrat', sans-serif;
    font-size: var(--font-size-base);
    outline: none;
    transition: border-color 0.3s;
    height: var(--control-height);
}

.search-bar input:focus {
    border-color: #007AD3;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #007AD3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

/* Контент */
.content {
    padding: calc(30px * var(--ui-scale));
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Заголовок страницы с поиском и кнопками */
.page-header-with-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: calc(15px * var(--ui-scale));
}

.page-header-with-search.document-header {
    flex-direction: column;
    align-items: flex-start;
}

.page-header-with-search.document-header .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.page-header-with-search .header-actions {
    display: flex;
    align-items: center;
    gap: calc(10px * var(--ui-scale));
}

.page-title {
    font-size: var(--font-size-title);
    font-weight: 700;
    color: #03111B;
    margin-bottom: 0;
}

/* Карточки */
.card {
    background: white;
    border-radius: 10px;
    border: 1px solid #d0d7e2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: calc(30px * var(--ui-scale));
    margin-bottom: calc(30px * var(--ui-scale));
}

.card h2 {
    color: #007AD3;
    margin-bottom: calc(20px * var(--ui-scale));
    font-size: var(--font-size-card-title);
    border-bottom: 2px solid #EBF1F6;
    padding-bottom: calc(10px * var(--ui-scale));
}

/* Формы */
.form-group {
    margin-bottom: calc(20px * var(--ui-scale));
}

.form-row {
    display: flex;
    gap: calc(20px * var(--ui-scale));
    margin-bottom: calc(20px * var(--ui-scale));
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-col {
    flex: 1;
    min-width: calc(220px * var(--ui-scale));
}

.form-col-id {
    flex: 0 0 120px;
}

.form-col-comment {
    flex: 1.5;
}

.form-group label {
    display: block;
    margin-bottom: calc(8px * var(--ui-scale));
    color: #03111B;
    font-weight: 500;
    font-size: calc(14px * var(--ui-scale));
}

.form-control {
    width: 100%;
    padding: var(--control-padding-y) var(--control-padding-x);
    border: 1px solid #ddd;
    border-radius: var(--radius-base);
    font-family: 'Montserrat', sans-serif;
    font-size: var(--font-size-base);
    outline: none;
    transition: all 0.3s;
}

.form-control:not(textarea) {
    height: var(--control-height);
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row .btn {
    height: var(--control-height);
    min-height: var(--control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.form-row .d-flex {
    align-items: flex-end;
}

.comment-compact {
    height: var(--control-height);
    min-height: var(--control-height);
    resize: vertical;
}

.filter-row {
    gap: calc(12px * var(--ui-scale));
    margin-bottom: 0;
}

.filter-row .form-group {
    margin-bottom: 0;
}

.filter-row .form-group label {
    font-size: calc(12px * var(--ui-scale));
    margin-bottom: calc(6px * var(--ui-scale));
}

.filter-row .form-control:not(textarea) {
    height: calc(32px * var(--ui-scale));
    padding: calc(6px * var(--ui-scale)) calc(12px * var(--ui-scale));
    font-size: calc(12px * var(--ui-scale));
}

.filter-row .btn {
    height: calc(32px * var(--ui-scale));
    min-height: calc(32px * var(--ui-scale));
    padding: calc(6px * var(--ui-scale)) calc(16px * var(--ui-scale));
    font-size: calc(12px * var(--ui-scale));
}

.filter-actions {
    align-self: flex-end;
    display: flex;
    align-items: flex-end;
}

.form-control:focus {
    border-color: #007AD3;
    box-shadow: 0 0 0 3px rgba(0, 122, 211, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 16px;
    padding-right: 50px;
}

/* Чекбоксы и радиокнопки */
.checkbox-group, .radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input, .radio-item input {
    width: auto;
}

.checkbox-item label, .radio-item label {
    margin: 0;
    font-weight: normal;
}

/* Кнопки */
.btn {
    width: auto;
    padding: var(--control-padding-y) var(--control-padding-x);
    border: 1px solid #ddd;
    border-radius: var(--radius-base);
    font-family: 'Montserrat', sans-serif;
    font-size: var(--font-size-button);
    outline: none;
    transition: all 0.3s;
    height: var(--control-height);
    white-space: nowrap;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    background-color: #007AD3;
}

.btn:hover {
    background-color: #005fa3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 122, 211, 0.2);
    text-decoration: none;
    color: white;
}

.btn-sm {
    height: calc(40px * var(--ui-scale));
    padding: 0 calc(12px * var(--ui-scale));
}

.btn-primary {
    background-color: #007AD3;
    color: white;
}

.btn-primary:hover {
    background-color: #005fa3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 122, 211, 0.2);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background-color: #007AD3;
    color: white;
}

.btn-secondary:hover {
    background-color: #005fa3;
    text-decoration: none;
    color: white;
}

.btn-success {
    background-color: #007AD3;
    color: white;
}

.btn-success:hover {
    background-color: #005fa3;
    text-decoration: none;
    color: white;
}

.btn-danger {
    background-color: #007AD3;
    color: white;
}

.btn-danger:hover {
    background-color: #005fa3;
    text-decoration: none;
    color: white;
}

.btn-warning {
    background-color: #007AD3;
    color: white;
}

.btn-warning:hover {
    background-color: #005fa3;
    text-decoration: none;
    color: white;
}

.btn-info {
    background-color: #007AD3;
    color: white;
}

.btn-info:hover {
    background-color: #005fa3;
    text-decoration: none;
    color: white;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: calc(10px * var(--ui-scale));
    margin-top: calc(30px * var(--ui-scale));
}

.fbs-registry-page {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.fbs-registry-document-form {
    min-width: 0;
    max-width: 100%;
}

.fbs-registry-document-form > .card {
    min-width: 0;
    max-width: 100%;
}

.fbs-registry-items-card {
    min-width: 0;
    max-width: 100%;
}

.fbs-registry-items-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #d0d7e2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.fbs-registry-items-scroll:focus {
    outline: 2px solid rgba(0, 122, 211, 0.35);
    outline-offset: 2px;
}

.fbs-registry-items-scroll::-webkit-scrollbar {
    height: 14px;
}

.fbs-registry-items-scroll::-webkit-scrollbar-track {
    background: #EBF1F6;
    border-radius: 0 0 10px 10px;
}

.fbs-registry-items-scroll::-webkit-scrollbar-thumb {
    background: #007AD3;
    border-radius: 7px;
    border: 3px solid #EBF1F6;
}

.fbs-registry-items-scroll {
    scrollbar-width: thin;
    scrollbar-color: #007AD3 #EBF1F6;
}

.fbs-registry-items-table {
    width: max-content;
    min-width: 1480px;
    table-layout: auto;
    margin-bottom: 0;
}

.fbs-registry-items-table th,
.fbs-registry-items-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.fbs-registry-items-table .mp-order {
    min-width: 120px;
}

.fbs-registry-items-table .fbs-client-select {
    min-width: 160px;
}

.fbs-registry-items-table .product-name {
    min-width: 180px;
}

.fbs-registry-items-table .product-barcode,
.fbs-registry-items-table .product-article {
    min-width: 110px;
}

.fbs-registry-items-table .quantity {
    min-width: 72px;
    width: 72px;
}

.fbs-registry-items-table .cell-name {
    min-width: 90px;
}

.fbs-registry-items-table .data-matrix {
    min-width: 320px;
    width: 320px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
}

.fbs-registry-items-table .data-matrix.is-invalid-marking {
    border-color: #c0392b;
    background-color: #fff5f5;
}

.dm-duplicates-table .data-matrix.is-invalid-marking {
    border-color: #c0392b;
    background-color: #fff5f5;
}

.fbs-registry-items-table .sticker-number {
    min-width: 140px;
}

.fbs-registry-items-table .row-no {
    width: 40px;
    text-align: center;
}

/* Таблицы */
.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #d0d7e2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table-responsive-unclipped {
    overflow: visible;
}

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

.table th {
    background-color: #EBF1F6;
    color: #03111B;
    padding: calc(15px * var(--ui-scale));
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #c5ccd6;
}

.table td {
    padding: calc(15px * var(--ui-scale));
    border-bottom: 1px solid #dde3ea;
}

#productsTable {
    position: relative;
    z-index: 1;
}

.input-with-button {
    display: flex;
    gap: calc(8px * var(--ui-scale));
    align-items: center;
}

.input-with-button .btn {
    height: var(--control-height);
    padding: 0 calc(12px * var(--ui-scale));
    flex: 0 0 auto;
}

.autocomplete-list {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--radius-base);
    max-height: 220px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: calc(8px * var(--ui-scale)) calc(12px * var(--ui-scale));
    cursor: pointer;
}

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

.table tbody tr.active-row {
    background: #e7f3ff;
}

.position-relative {
    position: relative;
}

#productModal .modal-content {
    max-width: 1000px;
    width: 90%;
}

.ref-picker-shell {
    position: relative;
}

select.reference-picker-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    pointer-events: none;
}

.reference-picker-modal-content {
    max-width: 920px;
    width: 92%;
}

.document-summary {
    margin-top: calc(20px * var(--ui-scale));
    padding: calc(12px * var(--ui-scale)) calc(16px * var(--ui-scale));
    background: #f5f9fd;
    border: 1px solid #e3ecf5;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: calc(8px * var(--ui-scale));
    align-items: center;
    max-width: calc(520px * var(--ui-scale));
}

.document-summary strong {
    font-weight: 600;
}

.summary-divider {
    color: #8aa3b6;
}

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

.arrival-number-link {
    color: #007AD3;
    text-decoration: none;
    font-weight: 600;
}

.arrival-number-link:hover {
    text-decoration: underline;
    color: #005fa3;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

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

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

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge-secondary {
    background-color: #6c757d;
    color: #fff;
    border: 1px solid #5a6268;
}

.status-new { background-color: #d1ecf1; color: #0c5460; }
.status-in_progress { background-color: #fff3cd; color: #856404; }
.status-completed { background-color: #d4edda; color: #155724; }
.status-cancelled { background-color: #f8d7da; color: #721c24; }

/* Статусы заборов груза */
.status-driver_assigned {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    color: #5d4037;
    border: 1px solid #fff59d;
}

.status-arrived {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: #fff;
    border: 1px solid #45a049;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .mobile-topbar {
        position: fixed;
        top: 12px;
        left: 12px;
        right: auto;
        height: auto;
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 0;
        background: transparent;
        box-shadow: none;
        z-index: 1200;
    }

    .mobile-title {
        display: none;
    }

    .hamburger-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid #007AD3;
        background: #fff;
        color: #007AD3;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hamburger-btn .material-icons {
        font-size: 22px;
        line-height: 1;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        display: block;
    }

    body.sidebar-open .mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        width: 280px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        margin-bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1150;
        visibility: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        visibility: visible;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 0;
        width: 100%;
    }
    
    .container {
        flex-direction: column;
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .header {
        display: none !important;
    }

    .content {
        padding: 12px;
        padding-top: 64px;
    }
    
    .search-bar {
        max-width: 100%;
    }

    /* Адаптация списков/документов/отчётов под мобильные */
    .card {
        padding: 14px;
        margin-bottom: 14px;
    }

    .card h2 {
        margin-bottom: 12px;
        padding-bottom: 8px;
        font-size: 16px;
    }

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

    .page-header-with-search {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .page-header-with-search .header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .page-header-with-search .header-actions form {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-header-with-search .header-actions form .form-control {
        min-width: 0;
        flex: 1 1 180px;
    }

    .filter-row .form-col {
        min-width: 100%;
        width: 100%;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn,
    .btn-group .btn {
        width: 100%;
    }

    .btn-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .summary-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-card {
        padding: 12px;
    }

    .summary-value {
        font-size: 22px;
    }
}

/* Утилиты */
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-30 { margin-top: 30px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.gap-30 { gap: 30px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }

/* Списки документов: заголовок и значения числовых колонок на одной линии */
.table-doc-list th.col-qty,
.table-doc-list td.col-qty {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.table-doc-list th.col-money,
.table-doc-list td.col-money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.table-doc-list th.col-posted,
.table-doc-list td.col-posted {
    text-align: center;
    width: 1%;
    white-space: nowrap;
}

/* Сообщения */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

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

/* Дополнительные стили для модуля Приход */

/* Табы */
.tabs {
    display: flex;
    border-bottom: 2px solid #EBF1F6;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #007AD3;
}

.tab-btn.active {
    color: #007AD3;
    font-weight: 600;
    border-bottom-color: #007AD3;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #EBF1F6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #007AD3, #005fa3);
    border-radius: 10px 10px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: color 0.3s;
}

.close:hover {
    color: #ffdddd;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Статусы для прихода */
.status-in_transit { 
    background: linear-gradient(135deg, #fff3cd, #ffeaa7); 
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-ready_for_receiving,
.status-in_receiving { 
    background: linear-gradient(135deg, #cce5ff, #a3d5ff); 
    color: #004085;
    border: 1px solid #a3d5ff;
}

.status-received_with_errors {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #856404;
    border: 1px solid #ffb300;
}

.status-pending_approval {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    border: 1px solid #f57c00;
}

.status-approved {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: #fff;
    border: 1px solid #45a049;
}

.status-received { 
    background: linear-gradient(135deg, #d4edda, #a8e6a3); 
    color: #155724;
    border: 1px solid #a8e6a3;
}

/* Обработка упаковка */
.status-ready_for_packing,
.status-in_packing,
.status-packed {
    background: linear-gradient(135deg, #e1bee7, #ce93d8);
    color: #4a148c;
    border: 1px solid #ce93d8;
}

/* Обработка ТЕРМО */
.status-ready_for_thermo,
.status-in_thermo,
.status-thermo_processed {
    background: linear-gradient(135deg, #b2ebf2, #80deea);
    color: #004d40;
    border: 1px solid #80deea;
}

/* Размещение */
.status-ready_for_placement,
.status-in_placement {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    color: #5d4037;
    border: 1px solid #fff59d;
}

.status-placed_with_errors {
    background: linear-gradient(135deg, #ffab91, #ff8a65);
    color: #bf360c;
    border: 1px solid #ff8a65;
}

.status-placed {
    background: linear-gradient(135deg, #81c784, #66bb6a);
    color: #1b5e20;
    border: 1px solid #66bb6a;
}

.status-completed {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: #fff;
    border: 1px solid #45a049;
}

.status-cancelled { 
    background: linear-gradient(135deg, #f8d7da, #f5b5ba); 
    color: #721c24;
    border: 1px solid #f5b5ba;
}

/* Статусы заявок клиента */
.status-draft {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #495057;
    border: 1px solid #dee2e6;
}

.status-submitted {
    background: linear-gradient(135deg, #cce5ff, #a3d5ff);
    color: #004085;
    border: 1px solid #a3d5ff;
}

.status-processed {
    background: linear-gradient(135deg, #d4edda, #a8e6a3);
    color: #155724;
    border: 1px solid #a8e6a3;
}

/* Упрощенные статусы приходов для клиента */
.status-client-new {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-client-receiving {
    background: linear-gradient(135deg, #cce5ff, #a3d5ff);
    color: #004085;
    border: 1px solid #a3d5ff;
}

.status-client-error {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #856404;
    border: 1px solid #ffb300;
}

.status-client-processing {
    background: linear-gradient(135deg, #e1bee7, #ce93d8);
    color: #4a148c;
    border: 1px solid #ce93d8;
}

.status-client-processed {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: #fff;
    border: 1px solid #45a049;
}

.status-client-cancelled {
    background: linear-gradient(135deg, #f8d7da, #f5b5ba);
    color: #721c24;
    border: 1px solid #f5b5ba;
}

/* Итоги */
.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #007AD3;
}

.summary-card h4 {
    margin-top: 0;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: #007AD3;
    margin: 10px 0;
}

.summary-subvalue {
    font-size: 14px;
    color: #666;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Таблицы на мобильных: горизонтальный скролл без "ломания" строк */
@media (max-width: 1024px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 680px;
    }

    .table th,
    .table td {
        padding: 10px;
        white-space: nowrap;
    }
}
/* Стили для модального окна Excel */
.modal-lg {
    max-width: 900px !important;
}

.table-danger {
    background-color: #f8d7da;
}

.table-danger:hover {
    background-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

#crptItemsTable .form-control-sm {
    min-width: 90px;
    font-size: 0.85rem;
}

#crptPasteModal.modal {
    display: none;
    align-items: center;
    justify-content: center;
}

#crptStatusAlert.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

#crptStatusAlert.alert-error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.crpt-cert-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.crpt-cert-picker-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 560px;
    width: 100%;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.crpt-cert-picker-modal h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.crpt-cert-picker-hint {
    margin: 0 0 16px;
    color: #666;
    font-size: 0.9rem;
}

.crpt-cert-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.crpt-cert-picker-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
}

.crpt-cert-picker-item:hover {
    background: #f8f9fa;
}

.crpt-cert-picker-item input {
    margin-top: 3px;
}

.crpt-cert-picker-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.material-icons {
    vertical-align: middle;
    font-size: 18px;
}

/* Стили для иконок в кнопках */
.btn .material-icons {
    margin-right: 5px;
    font-size: 18px;
}

/* Стили для таблицы с результатами парсинга */
#parsedDataTable th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
}

/* Улучшаем внешний вид textarea для вставки Excel данных */
#excelData {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
}

#excelData:focus {
    border-color: #007AD3;
    background-color: white;
}

/* Стили для статусов */
.status-ok {
    color: #28a745;
    font-weight: 600;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

/* Стили для Excel таблицы */
.excel-paste-table {
    border: 2px solid #007AD3;
    background: white;
}

.excel-paste-table th {
    background: #007AD3;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    border: none;
    padding: 12px 15px;
    font-weight: 600;
}

.excel-paste-table td {
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    vertical-align: middle;
    min-height: 45px;
}

.excel-paste-table td[contenteditable="true"]:focus {
    background-color: #f8f9fa;
    outline: 2px solid #007AD3;
    outline-offset: -2px;
}

.excel-paste-table tbody tr:hover {
    background-color: #f8f9fa;
}

.diff-positive {
    color: #28a745;
    font-weight: 600;
}

.diff-negative {
    color: #dc3545;
    font-weight: 600;
}

.diff-zero {
    color: #6c757d;
    font-weight: 600;
}

.group-header-row td {
    background: #f8f9fa;
    font-weight: 600;
}

.group-total-row td {
    background: #fff3cd;
    font-weight: 600;
}

/* Пример таблицы */
.example-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.example-table th {
    background: #6c757d;
    color: white;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
}

.example-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
}

/* Вкладки */
.excel-tab {
    display: block;
    animation: fadeIn 0.3s;
}

.excel-tab.hidden {
    display: none;
}

/* Результаты */
.result-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 4px solid;
}

.result-item.success {
    background: #d4edda;
    border-left-color: #28a745;
}

.result-item.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.result-item.error {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.result-stat {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.result-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: #007AD3;
    display: block;
    margin: 5px 0;
}

.result-stat .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Стили для редактируемых ячеек */
.barcode-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.quantity-cell, .price-cell {
    text-align: right;
}

.quantity-cell:focus, .price-cell:focus {
    text-align: left;
}

/* Стили для модуля отгрузки */

/* Статусы отгрузок */
.status-draft { 
    background: linear-gradient(135deg, #e9ecef, #dee2e6); 
    color: #495057;
    border: 1px solid #dee2e6;
}

.status-confirmed { 
    background: linear-gradient(135deg, #cce5ff, #a3d5ff); 
    color: #004085;
    border: 1px solid #a3d5ff;
}

.status-shipped { 
    background: linear-gradient(135deg, #d4edda, #a8e6a3); 
    color: #155724;
    border: 1px solid #a8e6a3;
}

.status-cancelled { 
    background: linear-gradient(135deg, #f8d7da, #f5b5ba); 
    color: #721c24;
    border: 1px solid #f5b5ba;
}

/* Стили для коробов */
.box-badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: #007AD3;
    color: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 5px;
}

/* Стили для документов */
.document-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.document-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.document-icon {
    font-size: 40px;
    color: #007AD3;
    text-align: center;
    margin-bottom: 10px;
}

.document-name {
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-word;
}

.document-info {
    font-size: 12px;
    color: #666;
}

/* Стили для таблицы с коробами */
.box-table {
    border-collapse: separate;
    border-spacing: 0;
}

.box-table th {
    background: #007AD3;
    color: white;
    position: sticky;
    top: 0;
}

.box-table tr.box-header {
    background: #f8f9fa;
    font-weight: 600;
}

/* Стили для штрих-кодов в печати */
@media print {
    .no-print,
    .btn,
    button {
        display: none !important;
    }

    .barcode {
        font-family: 'Libre Barcode 39', cursive;
        font-size: 30px;
    }
    
    .box-label {
        page-break-inside: avoid;
        border: 1px solid #000;
        padding: 10px;
        margin: 5px 0;
    }
}

/* Стили для модальных окон загрузки */
.load-method-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.load-method-btn {
    padding: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.load-method-btn:hover {
    border-color: #007AD3;
    background: #f8f9fa;
}

.load-method-btn.active {
    border-color: #007AD3;
    background: #e7f3ff;
}

.load-method-icon {
    font-size: 40px;
    color: #007AD3;
    margin-bottom: 10px;
}

.load-method-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.load-method-desc {
    font-size: 12px;
    color: #666;
}

/* Анимация загрузки */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Стили для колонки с номером короба */
.box-number-cell {
    position: relative;
}

.box-number-input {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    text-align: center;
}

/* Стили для информации о приходе */
.arrival-link {
    color: #007AD3;
    text-decoration: none;
    font-size: 12px;
}

.arrival-link:hover {
    text-decoration: underline;
}

/* Стили для кнопок экспорта */
.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.export-btn {
    flex: 1;
    min-width: 150px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .load-method-buttons {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .box-number-input {
        font-size: 14px;
        padding: 5px;
    }
}

/* Стили для страницы авторизации */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #EBF1F6 0%, #FFFFFF 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.login-box h2 {
    color: #007AD3;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #03111B;
    font-weight: 500;
    font-size: 14px;
}

.login-box .form-control {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.login-box .form-control:focus {
    border-color: #007AD3;
    box-shadow: 0 0 0 3px rgba(0, 122, 211, 0.1);
}

.login-box .btn {
    width: 100%;
    padding: 12px 30px;
    margin-top: 10px;
}

.login-box .text-center {
    text-align: center;
}

.login-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #EBF1F6;
    font-size: 13px;
    color: #666;
}

.login-info p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .login-box h2 {
        font-size: 20px;
    }
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-block;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    color: #007AD3;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination-link:hover:not(.disabled):not(.active) {
    background-color: #f0f7ff;
    border-color: #007AD3;
    text-decoration: none;
}

.pagination-link.active {
    background-color: #007AD3;
    color: #fff;
    border-color: #007AD3;
    font-weight: 600;
}

.pagination-link.disabled {
    color: #999;
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-ellipsis {
    padding: 8px 5px;
    color: #666;
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 10px;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}
