/**
 * Allocation Manager Styles
 */

/* Utility classes */
.hidden {
    display: none;
}

.cutplanner-allocation-manager {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Table Controls */
.cutplanner-allocation-manager .table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.cutplanner-allocation-manager .filter-form {
    display: flex;
    gap: 8px;
}

.cutplanner-allocation-manager .filter-form input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-width: 200px;
}

.cutplanner-allocation-manager .allocation-actions {
    display: flex;
    gap: 8px;
}

.cutplanner-allocation-manager table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.cutplanner-allocation-manager th {
    background: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid #ddd;
}

.cutplanner-allocation-manager td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    vertical-align: middle;
}

.cutplanner-allocation-manager tr:hover {
    background: #fafafa;
}

/* Editable cells */
.cutplanner-allocation-manager .editable {
    cursor: pointer;
    position: relative;
}

.cutplanner-allocation-manager .editable:hover .display-value {
    text-decoration: underline;
    color: #0073aa;
}

.cutplanner-allocation-manager .edit-input {
    width: 100%;
    max-width: 120px;
    padding: 4px 6px;
    border: 1px solid #0073aa;
    border-radius: 3px;
    font-size: 13px;
}

/* Tag number link */
.cutplanner-allocation-manager .edit-allocation-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.cutplanner-allocation-manager .edit-allocation-link:hover {
    text-decoration: underline;
}

/* Farmer badge */
.cutplanner-allocation-manager .farmer-badge {
    display: inline-block;
    padding: 1px 5px;
    background: #e7f3ff;
    color: #0073aa;
    font-size: 10px;
    border-radius: 3px;
    margin-left: 5px;
}

/* Status badges */
.cutplanner-allocation-manager .status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.cutplanner-allocation-manager .status-possible {
    background: #f0f0f0;
    color: #666;
}

.cutplanner-allocation-manager .status-confirmed {
    background: #cce5ff;
    color: #004085;
}

.cutplanner-allocation-manager .status-email_sent {
    background: #fff3cd;
    color: #856404;
}

.cutplanner-allocation-manager .status-order_placed {
    background: #d4edda;
    color: #155724;
}

.cutplanner-allocation-manager .status-completed {
    background: #6c757d;
    color: #fff;
}

/* Actions column */
.cutplanner-allocation-manager .actions-cell {
    white-space: nowrap;
}

.cutplanner-allocation-manager .actions-cell .button {
    margin-right: 3px;
    padding: 2px 8px;
    font-size: 12px;
}

.cutplanner-allocation-manager .delete-allocation {
    color: #a00;
    background: #fff;
    border-color: #a00;
}

.cutplanner-allocation-manager .delete-allocation:hover {
    background: #a00;
    color: #fff;
    border-color: #a00;
}

/* Modal Styles - reuse harvest table modal */
.allocation-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    overflow-y: auto;
    padding: 40px 20px;
}

.allocation-modal-overlay.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.allocation-modal {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.allocation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 6px 6px 0 0;
}

.allocation-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.allocation-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.allocation-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.allocation-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 0 0 6px 6px;
}

/* Modal form */
.allocation-modal .modal-field {
    margin-bottom: 15px;
}

.allocation-modal .modal-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.allocation-modal .modal-field input,
.allocation-modal .modal-field select,
.allocation-modal .modal-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    box-sizing: border-box;
}

.allocation-modal .modal-field input:focus,
.allocation-modal .modal-field select:focus,
.allocation-modal .modal-field textarea:focus {
    border-color: #0073aa;
    outline: none;
}

.allocation-modal .modal-field input[readonly] {
    background: #f5f5f5;
    color: #666;
}

.allocation-modal .modal-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.allocation-modal .modal-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.allocation-modal .modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.allocation-modal .modal-section h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
}
