/**
 * Складская система - Стили
 */

:root {
    --primary: #667eea;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.app-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

.app-header .role-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-left: 1rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

tr:hover {
    background: #f7fafc;
}

/* Checkbox */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filters select,
.filters input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9375rem;
}

/* Scanner Input */
.scanner-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    border: 2px solid #667eea;
    border-radius: 8px;
    text-align: center;
    outline: none;
}

.scanner-input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Order Details */
.order-details {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.order-ttn {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.order-section {
    margin-bottom: 1.5rem;
}

.order-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.order-info-item {
    display: flex;
    align-items: baseline;
}

.order-info-label {
    font-weight: 600;
    color: #718096;
    margin-right: 0.5rem;
    min-width: 100px;
}

.order-info-value {
    color: #2d3748;
}

/* Product Image */
.product-image-large {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    margin: 1rem auto;
    display: block;
}

.product-image-small {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* СБОРНЫЙ Badge */
.assembled-badge {
    display: inline-block;
    color: #dc3545;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 1.5rem 0;
    padding: 1rem 2rem;
    border: 3px solid #dc3545;
    border-radius: 8px;
    background: #fff5f5;
}

/* Product List */
.product-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

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

.product-item img {
    margin-right: 1rem;
}

.product-item-info {
    flex: 1;
}

.product-item-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.product-item-code {
    font-size: 0.875rem;
    color: #718096;
}

.product-item-price {
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
}

/* Stats */
.stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }
}
