body {
    background: #2b3e50;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.production-tablet-page {
    touch-action: manipulation;
}

.production-cards-page .container-tablet {
    max-width: 1400px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
}

.header {
    background: #4e5d6c;
    border-bottom: 1px solid #5a6c7d;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header h1 {
    color: #ebebeb;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.header .info {
    color: #bdc3c7;
    text-align: center;
    margin-top: 0.5rem;
}

.line-section {
    margin-bottom: 2rem;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.line-header {
    background: #4e5d6c;
    border: 1px solid #5a6c7d;
    border-radius: 5px 5px 0 0;
    padding: 1rem;
    border-bottom: 2px solid #df691a;
    margin-bottom: 0;
}

.line-header h2 {
    color: #ebebeb;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.cards-container {
    background: #4e5d6c;
    border: 1px solid #5a6c7d;
    border-top: none;
    border-radius: 0 0 5px 5px;
    padding: 1.5rem;
    min-height: 200px;
}

.order-card {
    background: #4e5d6c;
    border: 1px solid #5a6c7d;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    color: #ebebeb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.order-card-locked {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: auto;
}

.order-card-locked:active {
    transform: none;
}

.order-lock-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    z-index: 2;
    max-width: 55%;
    text-align: right;
    line-height: 1.2;
}

.order-lock-badge-other {
    background: #c9302c;
}

.order-lock-badge-mine {
    background: #5cb85c;
    left: 0.5rem;
    right: auto;
    text-align: left;
}

.order-card-mine {
    border: 2px solid #5cb85c;
}

.btn-release-lock {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 3;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #df691a;
    border-radius: 4px;
    background: #2b3e50;
    color: #ebebeb;
    cursor: pointer;
}

.btn-release-lock:active {
    background: #df691a;
}

.batch-order-item.batch-order-locked {
    opacity: 0.55;
}

.batch-order-item.batch-order-locked .batch-order-checkbox {
    pointer-events: none;
}

/* Стили для карточек в работе */
.order-card[data-order-status="в работе"] {
    background: #5a6c7d;
    border: 2px solid #df691a;
}

.order-card .card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: #ebebeb;
}

.order-card .card-body {
    padding: 0;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #5a6c7d;
}

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

.order-info-label {
    font-weight: 600;
    color: #bdc3c7;
    flex-shrink: 0;
}

.order-info-value {
    font-weight: 500;
    color: #ebebeb;
    text-align: right;
    min-width: 0;
    flex: 1 1 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.order-info-value.status-badge {
    flex: 0 0 auto;
    align-self: center;
    text-align: center;
}

/* Стили для элементов, видимых с планшета (md+) */
.order-info-item.d-md-flex {
    display: none !important;
}

@media (min-width: 768px) {
    .order-info-item.d-md-flex {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
    }
}

/* Принудительное скрытие элементов с классом d-none */
.order-info-item.d-none {
    display: none !important;
}

/* Стили для статусов */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-новое {
    background: #2b3e50;
    color: #5bc0de;
    border: 1px solid #5bc0de;
}

.status-в-работе {
    background: #2b3e50;
    color: #f0ad4e;
    border: 1px solid #f0ad4e;
}

.status-завершено {
    background: #2b3e50;
    color: #5cb85c;
    border: 1px solid #5cb85c;
}

.status-малые-веса-готовы {
    background: #2b3e50;
    color: #28a745;
    border: 1px solid #28a745;
}

.status-большие-веса-готовы {
    background: #2b3e50;
    color: #28a745;
    border: 1px solid #28a745;
}

.no-orders {
    text-align: center;
    padding: 3rem 1rem;
    color: #bdc3c7;
}

.no-orders h3 {
    margin-bottom: 0.5rem;
    color: #ebebeb;
}

.no-orders p {
    margin: 0;
    font-size: 1.1rem;
}

.production-nav-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    width: 100%;
}

.production-nav-btn {
    flex: 1 1 140px;
    max-width: 280px;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #5bc0de;
    background: #2b3e50;
    color: #bdc3c7;
    text-align: center;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.production-nav-btn:hover {
    color: #fff;
    background: #34495e;
    border-color: #7dd3fc;
}

.production-nav-btn.is-active {
    color: #fff;
    background: #df691a;
    border-color: #df691a;
    pointer-events: none;
}

.execution-header .production-nav-switch {
    margin-bottom: 0.5rem;
}

.stats-badge-link {
    text-decoration: none;
    display: inline-block;
}

.stats-badge-link:hover {
    color: #5bc0de;
    background: #2b3e50;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.stats-badge {
    background: #2b3e50;
    color: #5bc0de;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid #5bc0de;
    white-space: nowrap;
}

/* Стили для модального окна */
.modal-content {
    border-radius: 5px;
    border: 1px solid #5a6c7d;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    background: #4e5d6c;
}

.modal-header {
    background: #5a6c7d;
    color: #ebebeb;
    border-radius: 5px 5px 0 0;
    border-bottom: 1px solid #5a6c7d;
}

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

.modal-body {
    padding: 2rem;
    color: #ebebeb;
}

.modal-footer {
    border-top: 1px solid #5a6c7d;
    padding: 1rem 2rem 2rem;
    background: #4e5d6c;
}

.modal-footer .btn {
    border-radius: 5px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border: none;
    cursor: pointer;
}

.modal-footer .btn-primary {
    background: #df691a;
    color: #ebebeb;
}

.modal-footer .btn-secondary {
    background: #5a6c7d;
    color: #ebebeb;
}

/* Стили для toast уведомлений */
.toast {
    border-radius: 5px;
    border: 1px solid #5a6c7d;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    background: #4e5d6c;
}

.toast-header {
    background: #5a6c7d;
    color: #ebebeb;
    border-radius: 5px 5px 0 0;
    border-bottom: 1px solid #5a6c7d;
}

.modal-footer .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.85rem 1.5rem;
    border: none;
    cursor: pointer;
    min-height: 48px;
    min-width: 140px;
}

/* Планшеты и компактные экраны */
@media (max-width: 1024px) {
    .header {
        margin-bottom: 1rem;
        padding: 0.85rem 0;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .line-header h2 {
        font-size: 1.25rem;
    }

    .cards-container {
        padding: 1rem;
    }

    .order-card {
        padding: 1.15rem;
        min-height: 160px;
    }

    .order-card .card-title {
        font-size: 1.15rem;
        line-height: 1.35;
    }

    .order-info-item {
        padding: 0.65rem 0;
        font-size: 1rem;
    }

    .status-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.65rem;
    }

    .modal-dialog {
        max-width: min(520px, calc(100vw - 2rem));
        margin: 1rem auto;
    }

    .modal-body {
        padding: 1.25rem;
        font-size: 1.05rem;
    }

    .modal-footer {
        padding: 1rem 1.25rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: stretch;
    }

    .modal-footer .btn {
        flex: 1 1 45%;
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .line-header h2 {
        font-size: 1.2rem;
    }
    
    .order-card {
        padding: 1rem;
    }
    
    .order-card .card-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
    
    /* Принудительное скрытие элементов с d-none на мобильных */
    .order-info-item.d-none {
        display: none !important;
    }

    .order-card .card-title {
        font-size: 1.05rem;
    }
}