/* ============================================================
   dispatch.css — Отгрузки (Dispatch/Shipments) module styles
   ============================================================ */

.dispatch-module {
    padding: 0;
}

.dispatch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #f3f4f6;
}

.dispatch-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.dispatch-subtitle {
    font-size: 13px;
    color: #6e6e73;
    margin: 4px 0 0;
}

.dispatch-add-btn {
    background: #0071e3;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.dispatch-add-btn:hover {
    background: #0077ed;
}

/* Filters */

.dispatch-filters {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid #f3f4f6;
}

.dispatch-filter-btn {
    border: 1px solid #e5e7eb;
    border-radius: 980px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: #6b7280;
    transition: background 0.15s, color 0.15s;
}

.dispatch-filter-btn.active {
    font-weight: 600;
}

.dispatch-filter-btn:hover {
    border-color: #d1d5db;
}

/* List */

.dispatch-list {
    display: flex;
    flex-direction: column;
}

.dispatch-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 24px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.12s;
}

.dispatch-row:hover {
    background: #f9fafb;
}

.dispatch-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dispatch-row-number {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
}

.dispatch-row-client {
    font-size: 13px;
    color: #6e6e73;
}

.dispatch-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dispatch-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 980px;
}

.dispatch-date {
    font-size: 11px;
    color: #6b7280;
}

.dispatch-items {
    font-size: 11px;
    color: #6b7280;
}

.dispatch-amount {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
}

.dispatch-empty {
    text-align: center;
    padding: 48px;
    color: #9ca3af;
    font-size: 14px;
}

/* Modal overlay */

.dispatch-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dispatch-modal {
    background: white;
    border-radius: 20px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.dispatch-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.dispatch-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
}

.dispatch-modal-sub {
    font-size: 13px;
    color: #6e6e73;
    margin-top: 4px;
}

.dispatch-modal-close {
    font-size: 22px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 0;
    transition: color 0.12s;
}

.dispatch-modal-close:hover {
    color: #6b7280;
}

.dispatch-modal-body {
    padding: 20px 24px 24px;
}

/* Detail grid */

.dispatch-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.dispatch-detail-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
}

.dispatch-detail-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dispatch-detail-value {
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
}

.dispatch-status-select {
    width: 100%;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.dispatch-date-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
}

/* Notes */

.dispatch-notes {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 16px;
}

/* Items section */

.dispatch-items-section {
    margin-top: 16px;
}

.dispatch-items-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.dispatch-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dispatch-items-table th {
    background: #f9fafb;
    padding: 8px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dispatch-items-table td {
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
    color: #1d1d1f;
}

.dispatch-empty-items {
    color: #9ca3af;
    font-size: 13px;
    padding: 12px;
}

/* Create form */

.dispatch-form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dispatch-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.dispatch-form-row label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.dispatch-input {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
    font-family: inherit;
}

.dispatch-input:focus {
    border-color: #0071e3;
    outline: none;
}

/* Responsive */

@media (max-width: 640px) {
    .dispatch-detail-grid {
        grid-template-columns: 1fr;
    }

    .dispatch-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .dispatch-add-btn {
        width: 100%;
        text-align: center;
    }
}
