/* =============================================================================
   naveschik.css - Стили страницы навесчика
   Mobile-first design for touch screens
============================================================================= */

.naveschik-page {
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* Scales bar (below header) */
.naveschik-scales-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid #dee2e6;
    gap: 12px;
}

.naveschik-scales-bar .scale-select {
    width: auto;
    min-width: 150px;
    flex: 1;
    max-width: 200px;
}

/* Connection status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background-color: #28a745;
    box-shadow: 0 0 4px #28a745;
}

.status-dot.disconnected {
    background-color: #dc3545;
}

/* Content */
.naveschik-content {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Orders screen */
.orders-screen .search-bar {
    margin-bottom: 1rem;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
}

.order-card {
    cursor: pointer;
    transition: background-color 0.15s;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #dee2e6;
}

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

.order-card:hover,
.order-card:active {
    background-color: #f8f9fa;
    transform: none;
    box-shadow: none;
}

/* Order card article and quantity highlighting */
.order-card .order-meta {
    color: #495057;
}

.order-card .order-article {
    color: #0d6efd;
}

.order-card .order-quantity {
    color: #198754;
}

.order-card .order-equipment {
    color: #6610f2;
}

.order-card .order-product-name,
.order-product-name {
    word-break: break-word;
}

/* Materials screen */
.materials-screen .order-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.materials-screen .order-info .card-title {
    color: #212529;
}

.materials-screen .order-info .card-text {
    color: #6c757d;
}

/* Materials list - unified style */
.materials-list {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
}

.material-card {
    transition: background-color 0.15s, border-color 0.2s;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
}

.material-card:last-child {
    border-bottom: none;
}

.material-card:not(.complete):hover {
    background-color: #f8f9fa;
}

.material-card.complete {
    cursor: default;
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

.material-card .progress {
    background-color: #e9ecef;
}

.material-card .progress-bar {
    transition: width 0.3s;
}

/* Progress bar colors by status */
.material-card .progress-bar.progress-under {
    background-color: #0d6efd;
}

.material-card .progress-bar.progress-ok {
    background-color: #28a745;
}

.material-card .progress-bar.progress-over {
    background-color: #dc3545;
}

.materials-screen .actions {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.materials-screen .actions .btn {
    flex: 1;
}

/* Weighing screen */
.weighing-screen .material-info {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.weighing-screen .material-info h5,
.weighing-screen .material-info p {
    color: white;
}

/* Weight display */
.weight-section .weight-display {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 1rem;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.weight-section .weight-display.stable {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    box-shadow: 0 0 20px rgba(150, 230, 161, 0.5);
}

.weight-section .weight-value {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
}

.weight-section .weight-unit {
    font-size: 1.5rem;
    color: #6c757d;
    margin-left: 0.25rem;
}

/* Weighing actions */
.weighing-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.weighing-actions .btn {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
}

.weighing-actions .btn-primary {
    flex: 2;
}

/* Weighing history */
.weighing-history {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
}

.weighing-history h6 {
    margin-bottom: 0.75rem;
    color: #495057;
}

.history-item {
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.history-item:last-child {
    margin-bottom: 0;
}

/* Scanner section */
.scanner-section .scanned-info {
    font-size: 0.875rem;
}

/* Touch-friendly buttons */
.btn-delete-weighing {
    min-height: 44px;
    min-width: 44px;
}

/* Complete material button */
#btnCompleteMaterial {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .naveschik-scales-bar .scale-select {
        min-width: 120px;
    }

    .weight-section .weight-value {
        font-size: 2.5rem;
    }

    .weighing-actions {
        flex-direction: column;
    }

    .weighing-actions .btn-primary {
        flex: 1;
        order: -1;
    }
}

/* Loading states */
.naveschik-page .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Alerts and notifications */
.naveschik-page .alert {
    margin-bottom: 0;
}

/* Badge styling */
.naveschik-page .badge {
    font-weight: 500;
}

/* =============================================================================
   Weighing screen - compact layout
   ============================================================================= */

.weighing-order-info {
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.weighing-material-info {
    padding: 8px 12px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-radius: 8px;
}

.weighing-barcode {
    font-size: 18px;
    padding: 12px 16px;
}

.weighing-batch-info {
    padding: 8px 12px;
    background: #e7f3ff;
    border-radius: 6px;
    font-size: 14px;
    color: #0d6efd;
}

.weighing-weight-display {
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    border: 3px solid #ffc107;
    background: #fffbeb;
    transition: border-color 0.3s, background-color 0.3s;
}

.weighing-weight-display.stable {
    border-color: #28a745;
    background: #d4edda;
}

.weighing-weight-display .weight-value {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.weighing-weight-display .weight-unit {
    font-size: 1.5rem;
    color: #6c757d;
    margin-left: 4px;
}

.weighing-actions {
    display: flex;
    gap: 8px;
}

.weighing-actions .btn-primary {
    flex: 2;
}

.weighing-actions .btn-outline-secondary {
    flex: 1;
}

.weighing-history {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
}

@media (max-width: 576px) {
    .weighing-weight-display .weight-value {
        font-size: 2.5rem;
    }
}
